From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f180.google.com (mail-ig0-f180.google.com [209.85.213.180]) by kanga.kvack.org (Postfix) with ESMTP id D81826B008C for ; Thu, 24 Jul 2014 18:18:30 -0400 (EDT) Received: by mail-ig0-f180.google.com with SMTP id l13so40434iga.13 for ; Thu, 24 Jul 2014 15:18:30 -0700 (PDT) Received: from mail-ig0-x234.google.com (mail-ig0-x234.google.com [2607:f8b0:4001:c05::234]) by mx.google.com with ESMTPS id i11si168801igf.37.2014.07.24.15.18.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Jul 2014 15:18:30 -0700 (PDT) Received: by mail-ig0-f180.google.com with SMTP id l13so45385iga.1 for ; Thu, 24 Jul 2014 15:18:29 -0700 (PDT) Date: Thu, 24 Jul 2014 15:18:27 -0700 (PDT) From: David Rientjes Subject: Re: [patch 1/2] mm, slub: fix false-positive lockdep warning in free_partial() In-Reply-To: <20140724122143.GI1725@cmpxchg.org> Message-ID: References: <20140724122143.GI1725@cmpxchg.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Johannes Weiner Cc: Andrew Morton , Vladimir Davydov , Dan Carpenter , Christoph Lameter , Joonsoo Kim , Pekka Enberg , linux-kernel@vger.kernel.org, linux-mm@kvack.org On Thu, 24 Jul 2014, Johannes Weiner wrote: > > diff --git a/mm/slub.c b/mm/slub.c > > --- a/mm/slub.c > > +++ b/mm/slub.c > > @@ -3195,12 +3195,13 @@ static void list_slab_objects(struct kmem_cache *s, struct page *page, > > /* > > * Attempt to free all partial slabs on a node. > > * This is called from kmem_cache_close(). We must be the last thread > > - * using the cache and therefore we do not need to lock anymore. > > + * using the cache, but we still have to lock for lockdep's sake. > > */ > > static void free_partial(struct kmem_cache *s, struct kmem_cache_node *n) > > { > > struct page *page, *h; > > > > + spin_lock_irq(&n->list_lock); > > list_for_each_entry_safe(page, h, &n->partial, lru) { > > if (!page->inuse) { > > __remove_partial(n, page); > > This already uses __remove_partial(), which does not have the lockdep > assertion. You even acked the patch that made this change, why add > the spinlock now? > Yup, thanks. This was sitting in Pekka's slab/next branch but isn't actually needed after commit 1e4dd9461fab ("slub: do not assert not having lock in removing freed partial"). Good catch! -- 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: email@kvack.org