[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1101041939030.27551@chino.kir.corp.google.com>
Date: Tue, 4 Jan 2011 19:44:37 -0800 (PST)
From: David Rientjes <rientjes@...gle.com>
To: Pekka Enberg <penberg@...nel.org>
cc: linux-kernel@...r.kernel.org,
Bart Van Assche <bart.vanassche@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Christoph Lameter <cl@...ux.com>
Subject: Re: [PATCH] slub: Fix sysfs circular locking dependency
On Tue, 4 Jan 2011, Pekka Enberg wrote:
> diff --git a/mm/slub.c b/mm/slub.c
> index bec0e35..9831004 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -2516,7 +2516,13 @@ void kmem_cache_destroy(struct kmem_cache *s)
> }
> if (s->flags & SLAB_DESTROY_BY_RCU)
> rcu_barrier();
> + /*
> + * The locking order is (1) sysfs internal locks and (2)
> + * slub_lock so drop the latter to avoid a deadlock.
> + */
> + up_write(&slub_lock);
> sysfs_slab_remove(s);
> + return;
> }
> up_write(&slub_lock);
> }
slub_lock protects slab_state following kmem_cache_init() if caches are
created/destroyed prior to the sysfs slab initcall setting the global
variable, so couldn't this leak the kobject if its initialization and add
was deferred on kmem_cache_create() and added by slab_sysfs_init()?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists