mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Lameter <cl@linux.com>
To: Pekka Enberg <penberg@kernel.org>
Cc: Zhao Jin <cronozhj@gmail.com>,
	mpm@selenic.com, rientjes@google.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2][RESEND] slab: avoid unnecessary touching of a partial slab
Date: Mon, 23 Jan 2012 08:48:53 -0600 (CST)	[thread overview]
Message-ID: <alpine.DEB.2.00.1201230846290.7674@router.home> (raw)
In-Reply-To: <alpine.LFD.2.02.1201231521340.11844@tux.localdomain>

On Mon, 23 Jan 2012, Pekka Enberg wrote:

> > diff --git a/mm/slab.c b/mm/slab.c
> > index 82e0a0e..2d7a0f4 100644
> > --- a/mm/slab.c
> > +++ b/mm/slab.c
> > @@ -3121,11 +3121,10 @@ retry:
> > 		check_slabp(cachep, slabp);
> >
> > 		/* move slabp to correct slabp list: */
> > -		list_del(&slabp->list);
> > 		if (slabp->free == BUFCTL_END)
> > -			list_add(&slabp->list, &l3->slabs_full);
> > -		else
> > -			list_add(&slabp->list, &l3->slabs_partial);
> > +			list_move(entry, &l3->slabs_full);
> > +		else if (entry != l3->slabs_partial.next)

Why is the check for entry necessary? We are holding a lock that
prevents modifications to the list after all.

Just a list_move when the partial slab is drained seems to be sufficient.

      reply	other threads:[~2012-01-23 14:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-26 16:28 Zhao Jin
2012-01-23 13:22 ` Pekka Enberg
2012-01-23 14:48   ` Christoph Lameter [this message]

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.00.1201230846290.7674@router.home \
    --to=cl@linux.com \
    --cc=cronozhj@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.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®