From: Christoph Lameter <clameter@sgi.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org
Subject: Re: [SLUB 3/5] Validation of slabs (metadata and guard zones)
Date: Tue, 10 Apr 2007 16:38:25 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0704101636230.2100@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20070410133137.e366a16b.akpm@linux-foundation.org>
On Tue, 10 Apr 2007, Andrew Morton wrote:
> There are a bunch of functions which need to be called with local irqs
> disabled for locking reasons. Documenting this (perhaps with
> VM_BUG_ON(!irqs_disabled()?) would be good.
SLUB: Add checks for interrupts disabled
This only adds interrupt disabled checks to code paths taken if
debugging is on. I want to avoid constant checks in hot paths (like in
SLAB). VM_BUG_ON may be enabled by distributors who want to play it safe.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Index: linux-2.6.21-rc6/mm/slub.c
===================================================================
--- linux-2.6.21-rc6.orig/mm/slub.c 2007-04-10 16:18:13.000000000 -0700
+++ linux-2.6.21-rc6/mm/slub.c 2007-04-10 16:25:33.000000000 -0700
@@ -531,6 +531,8 @@ static int check_object(struct kmem_cach
static int check_slab(struct kmem_cache *s, struct page *page)
{
+ VM_BUG_ON(!irqs_disabled());
+
if (!PageSlab(page)) {
printk(KERN_ERR "SLUB: %s Not a valid slab page @0x%p "
"flags=%lx mapping=0x%p count=%d \n",
@@ -612,6 +614,8 @@ static void add_full(struct kmem_cache *
{
struct kmem_cache_node *n;
+ VM_BUG_ON(!irqs_disabled());
+
if (!(s->flags & SLAB_STORE_USER))
return;
@@ -625,6 +629,8 @@ static void remove_full(struct kmem_cach
{
struct kmem_cache_node *n;
+ VM_BUG_ON(!irqs_disabled());
+
if (!(s->flags & SLAB_STORE_USER))
return;
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-04-10 23:38 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-10 19:19 [SLUB 1/5] Fix object counting Christoph Lameter
2007-04-10 19:19 ` [SLUB 2/5] Enable tracking of full slabs Christoph Lameter
2007-04-10 19:19 ` [SLUB 3/5] Validation of slabs (metadata and guard zones) Christoph Lameter
2007-04-10 20:31 ` Andrew Morton
2007-04-10 20:47 ` Dave Jones
2007-04-10 21:42 ` Andrew Morton
2007-04-10 21:10 ` Christoph Lameter
2007-04-10 21:13 ` Christoph Lameter
2007-04-10 21:14 ` Christoph Lameter
2007-04-10 21:15 ` Christoph Lameter
2007-04-10 21:21 ` Christoph Lameter
2007-04-10 21:40 ` Christoph Lameter
2007-04-10 22:49 ` Christoph Lameter
2007-04-10 23:43 ` Andrew Morton
2007-04-10 23:17 ` Christoph Lameter
2007-04-10 23:38 ` Christoph Lameter [this message]
2007-04-11 0:00 ` Christoph Lameter
2007-04-11 0:15 ` Christoph Lameter
2007-04-11 6:24 ` question on mmap sameer sameer
2007-04-13 17:59 ` Hugh Dickins
2007-04-11 2:24 ` [SLUB 3/5] Validation of slabs (metadata and guard zones) Christoph Lameter
2007-04-11 3:08 ` Andrew Morton
2007-04-10 19:19 ` [SLUB 4/5] Add ability to list alloc / free callers per slab Christoph Lameter
2007-04-10 19:19 ` [SLUB 5/5] Drop version number Christoph Lameter
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=Pine.LNX.4.64.0704101636230.2100@schroedinger.engr.sgi.com \
--to=clameter@sgi.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.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