From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Christoph Lameter <cl@linux.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org, brouer@redhat.com
Subject: Re: [PATCH] slub: Avoid irqoff/on in bulk allocation
Date: Wed, 2 Sep 2015 20:51:01 +0200 [thread overview]
Message-ID: <20150902205101.4dfbb7a9@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1509021300460.14827@east.gentwo.org>
On Wed, 2 Sep 2015 13:04:08 -0500 (CDT)
Christoph Lameter <cl@linux.com> wrote:
> On Wed, 2 Sep 2015, Jesper Dangaard Brouer wrote:
>
> > > +error:
> > > + __kmem_cache_free_bulk(s, i, p);
> >
> > Don't we need to update "tid" here, like:
> >
> > c->tid = next_tid(c->tid);
> >
> > Consider a call to the ordinary kmem_cache_alloc/slab_alloc_node was
> > in-progress, which get PREEMPT'ed just before it's call to
> > this_cpu_cmpxchg_double().
> > Now, this function gets called and we modify c->freelist, but cannot
> > get all objects and then fail (goto error). Although we put-back
> > objects (via __kmem_cache_free_bulk) don't we want to update c->tid
> > in-order to make sure the call to this_cpu_cmpxchg_double() retry?
>
> Hmm... I thought that __kmem_cache_free_bulk is run with interrupts
> disabled and will invoke the __slab_free which will increment tid if any
> objects are freed from the local page.
Ah, yes. Fallback __kmem_cache_free_bulk() will invoke slab_free(),
which will have updated c->tid. The patch is correct.
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Sr. Network Kernel Developer at Red Hat
Author of http://www.iptv-analyzer.org
LinkedIn: http://www.linkedin.com/in/brouer
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-09-02 18:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-28 19:44 [PATCH] slub: Avoid irqoff/on in bulk allocation Christoph Lameter
2015-09-02 9:09 ` Jesper Dangaard Brouer
2015-09-02 18:04 ` Christoph Lameter
2015-09-02 18:51 ` Jesper Dangaard Brouer [this message]
2015-09-16 22:13 ` Andrew Morton
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=20150902205101.4dfbb7a9@redhat.com \
--to=brouer@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).