mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Lameter <cl@linux.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Vladimir Davydov <vdavydov@parallels.com>,
	rientjes@google.com, akpm@linux-foundation.org,
	penberg@kernel.org, linux-kernel@vger.kernel.org,
	a.p.zijlstra@chello.nl
Subject: Re: [PATCH v3] slub: fix false-positive lockdep warning in free_partial()
Date: Wed, 5 Feb 2014 14:42:26 -0600 (CST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1402051439100.23701@nuc> (raw)
In-Reply-To: <20140205195837.GA6857@home.goodmis.org>

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.


  parent reply	other threads:[~2014-02-05 20:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-04 12:36 [PATCH] " Vladimir Davydov
2014-02-04 20:44 ` Christoph Lameter
2014-02-05  0:57   ` David Rientjes
2014-02-05  6:34     ` Vladimir Davydov
2014-02-05  6:44       ` [PATCH v2] " Vladimir Davydov
2014-02-05  8:01         ` David Rientjes
2014-02-05  8:12           ` Vladimir Davydov
2014-02-05  8:15             ` [PATCH v3] " Vladimir Davydov
2014-02-05  8:22               ` David Rientjes
2014-02-05 19:30                 ` Christoph Lameter
2014-02-05 19:58               ` Steven Rostedt
2014-02-05 20:32                 ` David Rientjes
2014-02-05 20:58                   ` Steven Rostedt
2014-02-05 21:07                     ` David Rientjes
2014-02-05 21:19                       ` Steven Rostedt
2014-02-05 21:25                         ` David Rientjes
2014-02-05 21:31                           ` Steven Rostedt
2014-02-05 21:35                             ` David Rientjes
2014-02-05 20:42                 ` Christoph Lameter [this message]
2014-02-05 20:55                   ` Steven Rostedt
2014-02-06  8:38                 ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.10.1402051439100.23701@nuc \
    --to=cl@linux.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=rostedt@goodmis.org \
    --cc=vdavydov@parallels.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®