Re: blk-softirq vs smp_call_function_single_async()

2020-06-09 Thread Peter Zijlstra
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. Firs

Re: blk-softirq vs smp_call_function_single_async()

2020-06-08 Thread Jens Axboe
On 6/8/20 10:40 AM, Peter Zijlstra wrote: > On Mon, Jun 08, 2020 at 09:33:42AM -0700, Christoph Hellwig wrote: >> On Mon, Jun 08, 2020 at 05:58:33PM +0200, Peter Zijlstra wrote: A request can only be completed once. >>> >>> Sure, but that doesn't help. >>> >>> CPU0

Re: blk-softirq vs smp_call_function_single_async()

2020-06-08 Thread Christoph Hellwig
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. The irq_work API looks reasonable. What are the tradeoffs

Re: blk-softirq vs smp_call_function_single_async()

2020-06-08 Thread Peter Zijlstra
On Mon, Jun 08, 2020 at 09:33:42AM -0700, Christoph Hellwig wrote: > On Mon, Jun 08, 2020 at 05:58:33PM +0200, Peter Zijlstra wrote: > > > A request can only be completed once. > > > > Sure, but that doesn't help. > > > > CPU0CPU1 > > > > raise_blk_irq()

Re: blk-softirq vs smp_call_function_single_async()

2020-06-08 Thread Christoph Hellwig
On Mon, Jun 08, 2020 at 05:58:33PM +0200, Peter Zijlstra wrote: > > A request can only be completed once. > > Sure, but that doesn't help. > > CPU0 CPU1 > > raise_blk_irq() BLOCK_SOFTIRQ >IPI -> CPU1 > > // picks up thing

Re: blk-softirq vs smp_call_function_single_async()

2020-06-08 Thread Peter Zijlstra
On Mon, Jun 08, 2020 at 08:45:57AM -0700, Christoph Hellwig wrote: > On Mon, Jun 08, 2020 at 01:58:00PM +0200, Peter Zijlstra wrote: > > Hi Jens, > > > > I've been going through smp_call_function_single_async() users and > > stumbled upon blk-softirq.c, which has: > > > > static int raise_blk_irq

Re: blk-softirq vs smp_call_function_single_async()

2020-06-08 Thread Christoph Hellwig
On Mon, Jun 08, 2020 at 01:58:00PM +0200, Peter Zijlstra wrote: > Hi Jens, > > I've been going through smp_call_function_single_async() users and > stumbled upon blk-softirq.c, which has: > > static int raise_blk_irq(int cpu, struct request *rq) > { > if (cpu_online(cpu)) { >