public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Zhao Jin <cronozhj@gmail.com>
To: Christoph Lameter <cl@linux.com>
Cc: penberg@kernel.org, mpm@selenic.com, trivial@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] slab: avoid unnecessary touching of a partial slab
Date: Fri, 26 Aug 2011 22:46:56 +0800	[thread overview]
Message-ID: <1314370016.8991.38.camel@vm> (raw)
In-Reply-To: <alpine.DEB.2.00.1108260841570.5818@router.home>

On Fri, 2011-08-26 at 09:08 -0500, Christoph Lameter wrote:
> On Fri, 26 Aug 2011, Zhao Jin wrote:
> 
> > In cache_alloc_refill(), after refilling from a partial slab, if the
> > slab remains partial, it would be deleted from and then added again to
> > the partial list. As the slab is the first element in the list before
> > deletion, such behavior has no effect. This patch avoids touching the
> > slab in this case.
> 
> The list_del/list_add action is a list_move.

But in cache_alloc_refill(), it is the first slab (that is: its list
field is pointed by the l3->slabs_partial.next) that is picked from the
partial list for refilling. Assume it remains partial after that. Since
list_add inserts a new element after the head (l3->slabs_partial), the
position of the slab in the partial list won't change after
list_del/list_add: it will be still the first element. Therefore,
list_del/list_add has done nothing actually in this case.

Regards,
zhj



  reply	other threads:[~2011-08-26 14:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-26  5:13 [PATCH] slab: avoid unnecessary touching of a partial slab Zhao Jin
2011-08-26  5:58 ` Zhao Jin
2011-08-26 14:08 ` Christoph Lameter
2011-08-26 14:46   ` Zhao Jin [this message]
2011-08-26 14:50     ` Christoph Lameter
2011-08-26 15:02       ` Zhao Jin
2011-08-26 15:05         ` Christoph Lameter
2011-08-26 15:09           ` Zhao Jin

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=1314370016.8991.38.camel@vm \
    --to=cronozhj@gmail.com \
    --cc=cl@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=penberg@kernel.org \
    --cc=trivial@kernel.org \
    /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