mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	frederic@kernel.org, linux-kernel@vger.kernel.org,
	linux-block@vger.kernel.org
Subject: Re: blk-softirq vs smp_call_function_single_async()
Date: Tue, 9 Jun 2020 15:38:37 +0200	[thread overview]
Message-ID: <20200609133837.GA2514@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20200608164254.GA2431@infradead.org>

On Mon, Jun 08, 2020 at 09:42:54AM -0700, Christoph Hellwig wrote:
> On Mon, Jun 08, 2020 at 06:40:09PM +0200, Peter Zijlstra wrote:
> > There isn't one, it was meant to be used with static allocations.
> > 
> > Frederic proposed changing all these to irq_work, and I think I'll go do
> > that. First dinner though.

OK, after having looked at this more, I think my initial analysis is
actually wrong and this code should work as-is.

The thing that I missed yesterday is that we only add the request to the
blk_cpu_done list in the IPI, this means that the race I described
earlier is not in fact possible.

The IPI must happen for progress to be made.

And the same is true for blk_mq_force_complete_rq(), which also uses
this csd.

> The irq_work API looks reasonable.  What are the tradeoffs for
> smp_call_single_async vs irq_work?

To still answer your question; irq_work_queue*() has an atomic op extra
that allows for more convenient semantics -- but is in your case
strictly superfluous.

Still, Jens' point about irq_work being smaller stands, and I think more
users could benefit from something intermediate. Let me continue with
the cleanups / audit and see what comes out at the end.

Thanks!

  reply	other threads:[~2020-06-09 13:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-08 11:58 Peter Zijlstra
2020-06-08 15:45 ` Christoph Hellwig
2020-06-08 15:58   ` Peter Zijlstra
2020-06-08 16:33     ` Christoph Hellwig
2020-06-08 16:40       ` Peter Zijlstra
2020-06-08 16:42         ` Christoph Hellwig
2020-06-09 13:38           ` Peter Zijlstra [this message]
2020-06-08 21:34         ` Jens Axboe

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=20200609133837.GA2514@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=axboe@kernel.dk \
    --cc=frederic@kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@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

Powered by JetHome