From: Roland Dreier <rdreier@cisco.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linux-mm@kvack.org, Christoph Lameter <cl@linux-foundation.org>,
"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: kmem_cache_destroy() badness with SLUB
Date: Mon, 05 Jul 2010 20:58:27 -0700 [thread overview]
Message-ID: <aday6dpmfbw.fsf@roland-alpha.cisco.com> (raw)
In-Reply-To: <1277688701.4200.159.camel@pasglop> (Benjamin Herrenschmidt's message of "Mon, 28 Jun 2010 11:31:41 +1000")
Hi folks !
Internally, I'm hitting a little "nit"...
sysfs_slab_add() has this check:
if (slab_state < SYSFS)
/* Defer until later */
return 0;
But sysfs_slab_remove() doesn't.
So if the slab is created -and- destroyed at, for example, arch_initcall
time, then we hit a WARN in the kobject code, trying to dispose of a
non-existing kobject.
Now, at first sight, just adding the same test to sysfs_slab_remove()
would do the job... but it all seems very racy to me.
I don't understand in fact how this slab_state deals with races at all.
What prevents us from hitting slab_sysfs_init() at the same time as
another CPU deos sysfs_slab_add() ? How do that deal with collisions
trying to register the same kobject twice ? Similar race with remove...
Shouldn't we have a mutex around those guys ?
Cheers,
Ben.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
--
Roland Dreier <rolandd@cisco.com> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
WARNING: multiple messages have this Message-ID (diff)
From: Roland Dreier <rdreier@cisco.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linux-mm@kvack.org, Christoph Lameter <cl@linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: kmem_cache_destroy() badness with SLUB
Date: Mon, 05 Jul 2010 20:58:27 -0700 [thread overview]
Message-ID: <aday6dpmfbw.fsf@roland-alpha.cisco.com> (raw)
In-Reply-To: <1277688701.4200.159.camel@pasglop> (Benjamin Herrenschmidt's message of "Mon, 28 Jun 2010 11:31:41 +1000")
Hi folks !
Internally, I'm hitting a little "nit"...
sysfs_slab_add() has this check:
if (slab_state < SYSFS)
/* Defer until later */
return 0;
But sysfs_slab_remove() doesn't.
So if the slab is created -and- destroyed at, for example, arch_initcall
time, then we hit a WARN in the kobject code, trying to dispose of a
non-existing kobject.
Now, at first sight, just adding the same test to sysfs_slab_remove()
would do the job... but it all seems very racy to me.
I don't understand in fact how this slab_state deals with races at all.
What prevents us from hitting slab_sysfs_init() at the same time as
another CPU deos sysfs_slab_add() ? How do that deal with collisions
trying to register the same kobject twice ? Similar race with remove...
Shouldn't we have a mutex around those guys ?
Cheers,
Ben.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
--
Roland Dreier <rolandd@cisco.com> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
--
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:[~2010-07-06 3:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-28 1:31 kmem_cache_destroy() badness with SLUB Benjamin Herrenschmidt
2010-06-28 1:31 ` Benjamin Herrenschmidt
2010-06-28 9:03 ` David Rientjes
2010-06-28 9:03 ` David Rientjes
2010-06-28 21:44 ` Benjamin Herrenschmidt
2010-06-28 21:44 ` Benjamin Herrenschmidt
2010-06-29 15:47 ` Christoph Lameter
2010-06-29 15:47 ` Christoph Lameter
2010-07-06 3:58 ` Roland Dreier [this message]
2010-07-06 3:58 ` Roland Dreier
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=aday6dpmfbw.fsf@roland-alpha.cisco.com \
--to=rdreier@cisco.com \
--cc=benh@kernel.crashing.org \
--cc=cl@linux-foundation.org \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.