From: Tejun Heo <tj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Kent Overstreet <koverstreet@google.com>,
linux-kernel@vger.kernel.org, Oleg Nesterov <oleg@redhat.com>,
Christoph Lameter <cl@linux-foundation.org>,
Ingo Molnar <mingo@redhat.com>, Andi Kleen <andi@firstfloor.org>,
Jens Axboe <axboe@kernel.dk>,
"Nicholas A. Bellinger" <nab@linux-iscsi.org>,
Jeff Layton <jlayton@redhat.com>,
"J. Bruce Fields" <bfields@fieldses.org>
Subject: Re: [PATCH] Percpu tag allocator
Date: Thu, 13 Jun 2013 12:35:14 -0700 [thread overview]
Message-ID: <20130613193514.GD13970@mtj.dyndns.org> (raw)
In-Reply-To: <20130613122339.239a721d097a64435817a780@linux-foundation.org>
Hello,
On Thu, Jun 13, 2013 at 12:23:39PM -0700, Andrew Morton wrote:
> > The lowest number guarantee makes them different. Maybe tag
> > allocation can be layered on top as a caching layer, I don't know, but
> > at any rate we need at least two different operation modes.
>
> Why? Tag allocation doesn't care about the values - just that they be
> unique.
Hmmm? Confused. I was talking about other existing idr users which
need lowest-available allocation. Tag allocation doesn't care. ID
allocators do.
> > Maybe we can layer things so that we have percpu layer on top of
> > id[r|a] and, say, mapping id to point is still done by idr, or the
> > percpu tag allocator uses ida for tag chunk allocations, but it's
> > still gonna be something extra on top.
>
> It's not obvious that explicit per-cpu is needed. Get an ID from
> ida_get_new_above(), multiply it by 16 and store that in device-local
> storage, along with a 16-bit bitmap. Blam, 30 lines of code and the
> ida_get_new_above() cost is reduced 16x and it's off the map.
I'm fairly sure it'd have to be per-cpu. The idr allocation is
reduced 16x but now each of those 16 slots needs to be allocated. The
problem hasn't gone away and we do need some sort of utility to help
that as drivers tend to resort to things like linear bitmap scan
combined with test_and_set_bit() making one cacheline extremely hot.
> Or perhaps you can think of something smarter, but first you have to
> start thinking of solutions rather than trying to find problems :(
I don't know. It's pretty clear to me that we at least need two
different operation modes from the two conflicting requirements - one
with strict allocation ordering and the other with very high
scalability. Please note that I'm not saying they both can't be built
into id[r|a], but we *need* two different operation modes.
Thanks.
--
tejun
next prev parent reply other threads:[~2013-06-13 19:35 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-12 4:03 Kent Overstreet
2013-06-12 17:08 ` Oleg Nesterov
2013-06-12 17:59 ` Kent Overstreet
2013-06-12 19:14 ` Oleg Nesterov
2013-06-12 23:38 ` Andrew Morton
2013-06-13 2:05 ` Kent Overstreet
2013-06-13 3:03 ` Andrew Morton
2013-06-13 3:54 ` Kent Overstreet
2013-06-13 5:46 ` Andrew Morton
2013-06-13 18:53 ` Tejun Heo
2013-06-13 19:04 ` Andrew Morton
2013-06-13 19:15 ` Tejun Heo
2013-06-13 19:23 ` Andrew Morton
2013-06-13 19:35 ` Tejun Heo [this message]
2013-06-13 22:10 ` Andrew Morton
2013-06-13 22:30 ` Tejun Heo
2013-06-13 22:35 ` Andrew Morton
2013-06-13 23:13 ` Tejun Heo
2013-06-13 23:23 ` Tejun Heo
2013-06-19 1:32 ` Kent Overstreet
2013-06-13 19:08 ` J. Bruce Fields
2013-06-13 19:09 ` Jeff Layton
2013-06-13 21:53 ` Kent Overstreet
2013-06-13 19:06 ` Tejun Heo
2013-06-13 19:13 ` Andrew Morton
2013-06-13 19:21 ` Tejun Heo
2013-06-13 21:14 ` Kent Overstreet
2013-06-13 21:50 ` Tejun Heo
2013-06-13 21:58 ` Kent Overstreet
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=20130613193514.GD13970@mtj.dyndns.org \
--to=tj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=axboe@kernel.dk \
--cc=bfields@fieldses.org \
--cc=cl@linux-foundation.org \
--cc=jlayton@redhat.com \
--cc=koverstreet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=nab@linux-iscsi.org \
--cc=oleg@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®