Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH 2/2] dma-debug: Put all hash-chain locks into the same lock class

0 views
Skip to first unread message

Joerg Roedel

unread,
Jul 3, 2009, 4:40:10 AM7/3/09
to
From: Ingo Molnar <mi...@elte.hu>

Alan Cox reported that lockdep runs out of its stack-trace entries
with certain configs:

BUG: MAX_STACK_TRACE_ENTRIES too low

This happens because there are 1024 hash buckets, each with a
separate lock. Lockdep puts each lock into a separate lock class and
tracks them independently.

But in reality we never take more than one of the buckets, so they
really belong into a single lock-class. Annotate the has bucket lock
init accordingly.

[ Impact: reduce the lockdep footprint of dma-debug ]

Reported-by: Alan Cox <al...@linux.intel.com>
Signed-off-by: Ingo Molnar <mi...@elte.hu>
Signed-off-by: Joerg Roedel <joerg....@amd.com>
---
lib/dma-debug.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index a9b6b5c..c9187fe 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -716,7 +716,7 @@ void dma_debug_init(u32 num_entries)

for (i = 0; i < HASH_SIZE; ++i) {
INIT_LIST_HEAD(&dma_entry_hash[i].list);
- dma_entry_hash[i].lock = SPIN_LOCK_UNLOCKED;
+ spin_lock_init(&dma_entry_hash[i].lock);
}

if (dma_debug_fs_init() != 0) {
--
1.6.3.3


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

Joerg Roedel

unread,
Jul 3, 2009, 4:40:12 AM7/3/09
to
This patch fixes a bug in the overlap function which returned true if
one region ends exactly before the second region begins. This is no
overlap but the function returned true in that case.

Cc: sta...@kernel.org
Reported-by: Andrew Randrianasulu <ran...@mail.ru>


Signed-off-by: Joerg Roedel <joerg....@amd.com>
---
lib/dma-debug.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index 3b93129..a9b6b5c 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -862,7 +862,7 @@ static inline bool overlap(void *addr, u64 size, void *start, void *end)

return ((addr >= start && addr < end) ||
(addr2 >= start && addr2 < end) ||
- ((addr < start) && (addr2 >= end)));
+ ((addr < start) && (addr2 > end)));
}

static void check_for_illegal_area(struct device *dev, void *addr, u64 size)

0 new messages