From: Tejun Heo <tj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: lkml <linux-kernel@vger.kernel.org>, Jens Axboe <axboe@kernel.dk>,
Vivek Goyal <vgoyal@redhat.com>
Subject: Re: [PATCH percpu/for-3.17 1/2] percpu: implement percpu_pool
Date: Thu, 31 Jul 2014 21:23:01 -0400 [thread overview]
Message-ID: <20140801012301.GB1967@htj.dyndns.org> (raw)
In-Reply-To: <20140731181656.cf814c3d.akpm@linux-foundation.org>
Hello, Andrew.
On Thu, Jul 31, 2014 at 06:16:56PM -0700, Andrew Morton wrote:
> Yet nowhere in either the changelog or the code comments is it even
> mentioned that this allocator is unreliable and that callers *must*
> implement (and test!) fallback paths.
Hmmm, yeah, somehow the atomic behavior seemed obvious to me. I'll
try to make it clear that this thing can and does fail.
> > an obvious solution is adding a failure
> > injection for debugging, but really except for being a bit ghetto,
> > this is just the atomic allocation for percpu areas.
>
> If it was a try-GFP_ATOMIC-then-fall-back-to-pool thing then it would
> work fairly well. But it's not even that - a caller could trivially
> chew through that pool in a single timeslice. Especially on !SMP.
> Especially squared with !PREEMPT or SCHED_FIFO.
Yeap, occassional pool depletion would be a normal thing to happen,
which isn't a correctness issue and most likely not even a performance
issue.
> But please make very sure that this is how we position it. I don't
> know how to do this. Maybe prefix the names with "blk_" to signify
> that it is block-private (and won't even be there if !CONFIG_BLOCK).
>
> Or rename percpu_pool_alloc() to percpu_pool_try_alloc() - that should
> wake people up.
Sounds good to me. I'll rename it to percpu_pool_try_alloc() and make
it clear in the comment that the allocation is opportunistic.
Thanks.
--
tejun
prev parent reply other threads:[~2014-08-01 1:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-18 20:08 Tejun Heo
2014-07-18 20:08 ` [PATCH percpu/for-3.17 2/2] blk-throttle: replace custom async percpu alloc mechanism with percpu_pool Tejun Heo
2014-07-21 17:27 ` Vivek Goyal
2014-07-22 0:50 ` Tejun Heo
2014-07-22 0:51 ` Tejun Heo
2014-07-31 19:00 ` [PATCH percpu/for-3.17 1/2] percpu: implement percpu_pool Tejun Heo
2014-07-31 22:03 ` Andrew Morton
2014-08-01 0:44 ` Tejun Heo
2014-08-01 1:16 ` Andrew Morton
2014-08-01 1:23 ` Tejun Heo [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=20140801012301.GB1967@htj.dyndns.org \
--to=tj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=vgoyal@redhat.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®