On 26/04/2020 03:06, Ming Lei wrote:
On Sat, Apr 25, 2020 at 05:48:32PM +0200, Christoph Hellwig wrote:
FYI, here is what I think we should be doing (but the memory model
experts please correct me):
Hi Ming,
- just drop the direct_issue flag and check for the CPU, which is
cheap enough
That isn't correct because the CPU for running async queue may not be
same with rq->mq_ctx->cpu since hctx->cpumask may include several CPUs
and we run queue in RR style and it is really a normal case.
So I'd rather to keep 'direct_issue' flag given it is just a constant
How about changing the function argument name from 'direct_issue' to
something which better expresses the intent, like 'may_migrate' or
similar? (I know you mention the reason this in the comment also).
argument and gcc is smart enough to optimize this case if you don't have
better idea.
- replace the raw_smp_processor_id with a get_cpu to make sure we
don't hit the tiny migration windows
I do wonder if the barrier always may be cheaper than this.
Will do that.
- a bunch of random cleanups to make the code easier to read, mostly
by being more self-documenting or improving the comments.
The cleanup code looks fine.
Cheers,
John