From: Ingo Molnar <mingo@elte.hu>
To: linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
Arjan van de Ven <arjan@infradead.org>
Subject: [patch 02/10] PI-futex: introduce debug_check_no_locks_freed()
Date: Sat, 25 Mar 2006 19:45:52 +0100 [thread overview]
Message-ID: <20060325184552.GC16724@elte.hu> (raw)
add debug_check_no_locks_freed(), as a central inline to add
bad-lock-free-debugging functionality to.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
----
arch/i386/mm/pageattr.c | 4 ++--
include/linux/mm.h | 10 ++++++++--
mm/page_alloc.c | 4 ++--
mm/slab.c | 2 +-
4 files changed, 13 insertions(+), 7 deletions(-)
Index: linux-pi-futex.mm.q/arch/i386/mm/pageattr.c
===================================================================
--- linux-pi-futex.mm.q.orig/arch/i386/mm/pageattr.c
+++ linux-pi-futex.mm.q/arch/i386/mm/pageattr.c
@@ -229,8 +229,8 @@ void kernel_map_pages(struct page *page,
if (PageHighMem(page))
return;
if (!enable)
- mutex_debug_check_no_locks_freed(page_address(page),
- numpages * PAGE_SIZE);
+ debug_check_no_locks_freed(page_address(page),
+ numpages * PAGE_SIZE);
/* the return value is ignored - the calls cannot fail,
* large pages are disabled at boot time.
Index: linux-pi-futex.mm.q/include/linux/mm.h
===================================================================
--- linux-pi-futex.mm.q.orig/include/linux/mm.h
+++ linux-pi-futex.mm.q/include/linux/mm.h
@@ -1066,13 +1066,19 @@ static inline void vm_stat_account(struc
}
#endif /* CONFIG_PROC_FS */
+static inline void
+debug_check_no_locks_freed(const void *from, unsigned long len)
+{
+ mutex_debug_check_no_locks_freed(from, len);
+}
+
#ifndef CONFIG_DEBUG_PAGEALLOC
static inline void
kernel_map_pages(struct page *page, int numpages, int enable)
{
if (!PageHighMem(page) && !enable)
- mutex_debug_check_no_locks_freed(page_address(page),
- numpages * PAGE_SIZE);
+ debug_check_no_locks_freed(page_address(page),
+ numpages * PAGE_SIZE);
}
#endif
Index: linux-pi-futex.mm.q/mm/page_alloc.c
===================================================================
--- linux-pi-futex.mm.q.orig/mm/page_alloc.c
+++ linux-pi-futex.mm.q/mm/page_alloc.c
@@ -447,8 +447,8 @@ static void __free_pages_ok(struct page
arch_free_page(page, order);
if (!PageHighMem(page))
- mutex_debug_check_no_locks_freed(page_address(page),
- PAGE_SIZE<<order);
+ debug_check_no_locks_freed(page_address(page),
+ PAGE_SIZE<<order);
for (i = 0 ; i < (1 << order) ; ++i)
reserved += free_pages_check(page + i);
Index: linux-pi-futex.mm.q/mm/slab.c
===================================================================
--- linux-pi-futex.mm.q.orig/mm/slab.c
+++ linux-pi-futex.mm.q/mm/slab.c
@@ -3390,7 +3390,7 @@ void kfree(const void *objp)
local_irq_save(flags);
kfree_debugcheck(objp);
c = virt_to_cache(objp);
- mutex_debug_check_no_locks_freed(objp, obj_size(c));
+ debug_check_no_locks_freed(objp, obj_size(c));
__cache_free(c, (void *)objp);
local_irq_restore(flags);
}
reply other threads:[~2006-03-25 18:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060325184552.GC16724@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@osdl.org \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome