From: Jens Axboe <axboe@kernel.dk>
To: David Miller <davem@davemloft.net>
Cc: paulmck@linux.vnet.ibm.com, hch@infradead.org, mroos@linux.ee,
linux-scsi@vger.kernel.org, sparclinux@vger.kernel.org
Subject: Re: Another (ESP?) scsi blk-mq problem on sparc64
Date: Mon, 24 Nov 2014 15:01:55 -0700 [thread overview]
Message-ID: <5473AAD3.7010409@kernel.dk> (raw)
In-Reply-To: <20141124.165623.42259031853400756.davem@davemloft.net>
On 11/24/2014 02:56 PM, David Miller wrote:
> From: Jens Axboe <axboe@kernel.dk>
> Date: Mon, 24 Nov 2014 10:16:15 -0700
>
>> How about this one?
>
> The "num" in num_possible_cpus() means a count, as in how many are
> there.
>
> It doesn't mean largest ID of members of set X, which is what you
> are asking for.
>
> Even worse, having num_online_cpus() and num_possible_cpus() count
> from a different perspective is really confusing.
Not disagreeing with you... Personally I don't care too much, I can just
work-around this in blk-mq. I'm more worried about others reimplementing
the same bugs later. And yes, the fact that's it's the weight of the
bitmap is exactly the problem, as we have no good way of saying
"allocate me this array indexed by cpu count", since we don't know the
numbers of the CPUs. This isn't a problem on x86 (or on anything but
sparc64, as far as I'm aware), since the weight and highest CPU count
are one and the same.
> Usually when people want a per-cpu thing they allocate percpu
> memory which hides all of these details, why don't you allocate
> the map as dynamic per-cpu memory?
>
> It will also do the NUMA node local allocations for you as well.
The allocation is node affine currently. This isn't per-cpu storage, for
the per-cpu storage blk-mq uses the normal per-cpu primitives for
alloctions. It's just a small array mapping a cpu number to a hardware
queue number. It's read-only storage, after it has been updated.
I'll just updated blk-mq to use nr_cpu_ids and be done with it.
--
Jens Axboe
next prev parent reply other threads:[~2014-11-24 22:01 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-14 11:32 Another (ESP?) scsi blk-mq problem on sparc64 Meelis Roos
2014-11-14 16:58 ` Christoph Hellwig
2014-11-14 17:01 ` Jens Axboe
2014-11-14 19:35 ` Meelis Roos
2014-11-14 19:42 ` Jens Axboe
2014-11-14 22:59 ` Meelis Roos
2014-11-14 23:29 ` Jens Axboe
2014-11-15 6:48 ` Meelis Roos
2014-11-15 15:31 ` Jens Axboe
2014-11-20 6:01 ` Christoph Hellwig
2014-11-21 19:56 ` David Miller
2014-11-24 8:21 ` Christoph Hellwig
2014-11-24 15:35 ` Jens Axboe
2014-11-24 16:22 ` Paul E. McKenney
2014-11-24 17:16 ` Jens Axboe
2014-11-24 17:31 ` Paul E. McKenney
2014-11-24 17:33 ` Jens Axboe
2014-11-24 17:44 ` Paul E. McKenney
2014-11-24 21:56 ` David Miller
2014-11-24 22:01 ` Jens Axboe [this message]
2014-11-24 22:09 ` David Miller
2014-11-24 22:20 ` Jens Axboe
2014-11-24 22:23 ` mroos
2014-11-24 22:28 ` David Miller
2015-01-29 7:53 ` Meelis Roos
2015-01-29 16:37 ` Jens Axboe
2015-09-04 8:33 ` Meelis Roos
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=5473AAD3.7010409@kernel.dk \
--to=axboe@kernel.dk \
--cc=davem@davemloft.net \
--cc=hch@infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mroos@linux.ee \
--cc=paulmck@linux.vnet.ibm.com \
--cc=sparclinux@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;
as well as URLs for NNTP newsgroup(s).