Messages in this thread | | | Date | Wed, 5 Feb 2014 14:42:26 -0600 (CST) | From | Christoph Lameter <> | Subject | Re: [PATCH v3] slub: fix false-positive lockdep warning in free_partial() |
| |
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.
| |