mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
To: Jeremiah Mahler <jmmahler@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: [REGRESSION] [FIXED] [PATCH 1/3] mm/slab: use percpu allocator for cpu cache
Date: Thu, 2 Oct 2014 14:30:50 +0900	[thread overview]
Message-ID: <20141002053050.GA7433@js1304-P5Q-DELUXE> (raw)
In-Reply-To: <20140929170315.GA1365@hudson.localdomain>

On Mon, Sep 29, 2014 at 10:03:15AM -0700, Jeremiah Mahler wrote:
> Joonsoo,
> 
> On Mon, Sep 29, 2014 at 04:44:18PM +0900, Joonsoo Kim wrote:
> > On Sat, Sep 27, 2014 at 11:24:49PM -0700, Jeremiah Mahler wrote:
> > > On Thu, Aug 21, 2014 at 05:11:13PM +0900, Joonsoo Kim wrote:
> > > > Because of chicken and egg problem, initializaion of SLAB is really
> > > > complicated. We need to allocate cpu cache through SLAB to make
> > > > the kmem_cache works, but, before initialization of kmem_cache,
> > > > allocation through SLAB is impossible.
> > > > 
> > > > On the other hand, SLUB does initialization with more simple way. It
> > > > uses percpu allocator to allocate cpu cache so there is no chicken and
> > > > egg problem.
> > > > 
> > > > So, this patch try to use percpu allocator in SLAB. This simplify
> > > > initialization step in SLAB so that we could maintain SLAB code more
> > > > easily.
> > > > 
> > > > From my testing, there is no performance difference.
> > > > 
> > > > Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> > > 
> > > I just encountered a problem on a Lenovo Carbon X1 where it will
> > > suspend but won't resume.  A bisect indicated that this patch
> > > is causing the problem.
> > > 
> > > 997888488ef92da365b870247de773255227ce1f
> > > 
> > > I imagine the patch author, Joonsoo Kim, might have a better idea
> > > why this is happening than I do.  But if I can provide any information
> > > or run any tests that might be of help just let me know.
> > 
> > Hello,
> > 
> > Yeah, there is a bug. Below will fix your issue.
> > Could you test it and report the result?
> > 
> > Thanks for reporting it.
> > 
> > --------->8---------------
> > From e03ed6cc554e038b86d7b3a72b89d94e9ea808ba Mon Sep 17 00:00:00 2001
> > From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> > Date: Mon, 29 Sep 2014 16:30:43 +0900
> > Subject: [PATCH] mm/slab: fix cpu on/off handling
> > 
> > When cpu off, we flush all cpu cached objects to it's own slab.
> > free_block() is used for this purpose and it's role is just to flush
> > objects from array_cache to proper slab. It doesn't adjust array_cache's
> > internal fields so we should manually reset them to proper value.
> > Without this fix, we maintain free objects duplicately, one is in
> > cpu cache, and, the other one is in the slab. So system would be broken.
> > 
> > Reported-by: Jeremiah Mahler <jmmahler@gmail.com>
> > Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> > ---
> >  mm/slab.c |    4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/mm/slab.c b/mm/slab.c
> > index 1162f0e..ce289b4 100644
> > --- a/mm/slab.c
> > +++ b/mm/slab.c
> > @@ -1102,8 +1102,10 @@ static void cpuup_canceled(long cpu)
> >  
> >  		/* cpu is dead; no one can alloc from it. */
> >  		nc = per_cpu_ptr(cachep->cpu_cache, cpu);
> > -		if (nc)
> > +		if (nc) {
> >  			free_block(cachep, nc->entry, nc->avail, node, &list);
> > +			nc->avail = 0;
> > +		}
> >  
> >  		if (!cpumask_empty(mask)) {
> >  			spin_unlock_irq(&n->list_lock);
> > -- 
> > 1.7.9.5
> > 
> 
> That fixed the problem.  Thanks!
> 
> Tested-by: Jeremiah Mahler <jmmahler@gmail.com>

Good!

Thanks.

      reply	other threads:[~2014-10-02  5:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21  8:11 Joonsoo Kim
2014-08-21  8:11 ` [PATCH 2/3] mm/slab_common: commonize slab merge logic Joonsoo Kim
2014-08-21 14:22   ` Christoph Lameter
2014-08-25  8:26     ` Joonsoo Kim
2014-08-25 15:27   ` Christoph Lameter
2014-08-26  2:23     ` Joonsoo Kim
2014-08-26 21:23       ` Christoph Lameter
2014-08-21  8:11 ` [PATCH 3/3] mm/slab: support slab merge Joonsoo Kim
2014-08-25 15:29   ` Christoph Lameter
2014-08-26  2:26     ` Joonsoo Kim
2014-08-21 14:21 ` [PATCH 1/3] mm/slab: use percpu allocator for cpu cache Christoph Lameter
2014-08-25  8:26   ` Joonsoo Kim
2014-08-25 13:13     ` Christoph Lameter
2014-08-26  2:19       ` Joonsoo Kim
2014-08-26 21:22         ` Christoph Lameter
2014-08-27 23:37 ` Christoph Lameter
2014-09-01  0:19   ` Joonsoo Kim
2014-09-28  6:24 ` [REGRESSION] " Jeremiah Mahler
2014-09-28 16:38   ` Christoph Lameter
2014-09-28 17:52     ` Jeremiah Mahler
2014-09-29  7:44   ` Joonsoo Kim
2014-09-29 17:03     ` [REGRESSION] [FIXED] " Jeremiah Mahler
2014-10-02  5:30       ` Joonsoo Kim [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=20141002053050.GA7433@js1304-P5Q-DELUXE \
    --to=iamjoonsoo.kim@lge.com \
    --cc=jmmahler@gmail.com \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®