Re: [PATCH v3] slub: fix false-positive lockdep warning infree_partial()
From: Christoph Lameter
Date: Wed Feb 05 2014 - 15:42:41 EST
On Wed, 5 Feb 2014, Steven Rostedt wrote:
> Really? We are adding a spin lock for a case where it is not needed just to
> quiet lockdep?
Well its a very rarely used code path. Doesnt matter performance wise
since a slab cache should have no objects when its going to be removed.
> Now if it really isn't needed, then why don't we do the following instead of
> adding the overhead of taking a lock?
>
> static inline
> __remove_partial(struct kmem_cache_node *n, struct page *page)
> {
> list_del(&page->lru);
> n->nr_partial--;
> }
>
> static inline remove_partial(struct kmem_cache_node *n,
> struct page *page)
> {
> lockdep_assert_held(&n->list_lock);
> __remove_partial(n, page);
> }
>
> And then just call __remove_partial() where we don't need to check if the
> lock is held or not with a big comment to it.
>
> That, IMNSHO, is a much better solution
Ok with me. It just adds another variant of remove_partial.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/