From: Andrew Morton <akpm@digeo.com>
To: Andreas Dilger <adilger@clusterfs.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [BUG] CONFIG_DEBUG_SLAB broken on SMP
Date: Wed, 09 Oct 2002 12:41:09 -0700 [thread overview]
Message-ID: <3DA48655.82A5E044@digeo.com> (raw)
In-Reply-To: 20021009191335.GB3045@clusterfs.com
Andreas Dilger wrote:
>
> We were tracking down a strange bug in our code that only appeared on
> SMP and not UP, and we thought that CONFIG_DEBUG_SLAB (and the ensuing
> FORCED_DEBUG which enables SLAB_POISON and SLAB_REDZONE) was going to
> catch problems with slab objects, so we were very very confused when a
> test like:
>
> struct foo *obj;
>
> cache = kmem_cache_create("test_cache", sizeof(struct foo))
> obj = kmem_cache_alloc(cache, GFP_KERNEL);
> kmem_cache_free(cache, obj);
> // print out contents of obj
>
> was not poisoning obj, or setting the redzone fields on obj to "free".
>
Linus recently changed the 2.5 slab allocator to stamp that out.
--- mm/slab.c 18 Sep 2002 03:48:34 -0000 1.28
+++ mm/slab.c 20 Sep 2002 16:22:53 -0000 1.29
@@ -1727,8 +1728,13 @@
return 0;
}
+/*
+ * If slab debugging is enabled, don't batch slabs
+ * on the per-cpu lists by defaults.
+ */
static void enable_cpucache (kmem_cache_t *cachep)
{
+#ifndef CONFIG_DEBUG_SLAB
int err;
int limit;
@@ -1746,6 +1752,7 @@
if (err)
printk(KERN_ERR "enable_cpucache failed for %s, error %d.\n",
cachep->name, -err);
+#endif
}
static void enable_all_cpucaches (void)
next prev parent reply other threads:[~2002-10-09 19:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-09 19:13 [BUG] CONFIG_DEBUG_SLAB broken on SMP Andreas Dilger
2002-10-09 19:41 ` Andrew Morton [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-10-09 19:50 Manfred Spraul
2002-10-09 21:33 ` William Lee Irwin III
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=3DA48655.82A5E044@digeo.com \
--to=akpm@digeo.com \
--cc=adilger@clusterfs.com \
--cc=linux-kernel@vger.kernel.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