[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140205200632.021dc613@gandalf.local.home>
Date: Wed, 5 Feb 2014 20:06:32 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: David Rientjes <rientjes@...gle.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Pekka Enberg <penberg@...nel.org>,
Christoph Lameter <cl@...ux.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Vladimir Davydov <vdavydov@...allels.com>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH] slub: Do not assert not having lock in removing freed
partial
On Wed, 5 Feb 2014 16:46:43 -0800 (PST)
David Rientjes <rientjes@...gle.com> wrote:
> > +/*
> > + * The difference between remove_partial and remove_freed_partial
> > + * is that remove_freed_partial happens only on a a freed slab
>
> Duplicate "a" there.
oops.
>
> > + * that should not have anyone accessing it, and thus does not
> > + * require the n->list_lock.
> > + */
> > +static inline void remove_freed_partial(struct kmem_cache_node *n,
> > + struct page *page)
> > +{
> > + __remove_partial(n, page);
> > }
> >
> > /*
> > @@ -3195,7 +3212,7 @@ static void free_partial(struct kmem_cac
> >
> > list_for_each_entry_safe(page, h, &n->partial, lru) {
> > if (!page->inuse) {
> > - remove_partial(n, page);
> > + remove_freed_partial(n, page);
> > discard_slab(s, page);
> > } else {
> > list_slab_objects(s, page,
>
> We'll want to do something similiar for the add_partial() called from
> early_kmem_cache_node_alloc(), right? It had the added n->list_lock for
> the same reason and is done during early init where nobody else can be
> referencing a kmem_cache_node.
>
> It would probably be better to define these in terms of "partial slabs
> that cannot have anyone else accessing it" rather than "freed slabs".
Perhaps then we just use the __remove_partial() and __add_partial()
that does not do the checks. That's common practice to use a "__" to
denote that it's special and usually doesn't require locking.
-- Steve
--
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