[PATCH] dma-debug: serialize locking in unmap path

From: Joerg Roedel
Date: Wed Mar 18 2009 - 08:15:20 EST


Impact: reduce maximum lockdepth to one

This patch reduces the maximum spin lock depth from two to one in the
dma-debug code.

Signed-off-by: Joerg Roedel <joerg.roedel@xxxxxxx>
---
lib/dma-debug.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index 9a350b4..3bd8d1d 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -542,7 +542,8 @@ static void check_unmap(struct dma_debug_entry *ref)
"to free DMA memory it has not allocated "
"[device address=0x%016llx] [size=%llu bytes]\n",
ref->dev_addr, ref->size);
- goto out;
+ put_hash_bucket(bucket, &flags);
+ return;
}

if (ref->size != entry->size) {
@@ -593,10 +594,8 @@ static void check_unmap(struct dma_debug_entry *ref)
}

hash_bucket_del(entry);
- dma_entry_free(entry);
-
-out:
put_hash_bucket(bucket, &flags);
+ dma_entry_free(entry);
}

static void check_for_stack(struct device *dev, void *addr)
--
1.5.6.4


--
| Advanced Micro Devices GmbH
Operating | Karl-Hammerschmidt-Str. 34, 85609 Dornach bei München
System |
Research | Geschäftsführer: Jochen Polster, Thomas M. McCoy, Giuliano Meroni
Center | Sitz: Dornach, Gemeinde Aschheim, Landkreis München
| Registergericht München, HRB Nr. 43632

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/