Re: [RFC][PATCH v2 08/10] smp,irq_work: Use the new irq_work API

2020-09-09 Thread Christoph Hellwig
On Thu, Aug 20, 2020 at 03:40:01PM +0200, pet...@infradead.org wrote: > Anyway, tl;dr, what do we actually want? Do we favour the embedded > irq_work variant over smp_call_function_single_asyn() ? For blk-mq we really like an embedded structure that allows to bounce the work to another CPU using I

Re: [RFC][PATCH v2 08/10] smp,irq_work: Use the new irq_work API

2020-08-20 Thread peterz
On Thu, Aug 20, 2020 at 08:19:27AM +0200, Christoph Hellwig wrote: > On Tue, Aug 18, 2020 at 12:51:10PM +0200, Peter Zijlstra wrote: > > if (blk_mq_complete_need_ipi(rq)) { > > - INIT_CSD(&rq->csd, __blk_mq_complete_request_remote, rq); > > - smp_call_function_single_async(r

Re: [RFC][PATCH v2 08/10] smp,irq_work: Use the new irq_work API

2020-08-20 Thread peterz
On Wed, Aug 19, 2020 at 03:04:56PM -0700, Linus Torvalds wrote: > On Wed, Aug 19, 2020 at 12:41 PM wrote: > > > > I'm not sure I get the "expensive irq_work queues" argument, I fully > > agree with you that adding the atomic op is fairly crap. > > There's an atomic op on the actual runing side to

Re: [RFC][PATCH v2 08/10] smp,irq_work: Use the new irq_work API

2020-08-19 Thread Christoph Hellwig
On Wed, Aug 19, 2020 at 11:50:55AM -0700, Linus Torvalds wrote: > On Wed, Aug 19, 2020 at 12:22 AM wrote: > > > > That is, the external serialization comes from the non-atomic > > test-and-set they both have. This works nicely when there is external > > state that already serializes things, but to

Re: [RFC][PATCH v2 08/10] smp,irq_work: Use the new irq_work API

2020-08-19 Thread Christoph Hellwig
On Tue, Aug 18, 2020 at 12:51:10PM +0200, Peter Zijlstra wrote: > if (blk_mq_complete_need_ipi(rq)) { > - INIT_CSD(&rq->csd, __blk_mq_complete_request_remote, rq); > - smp_call_function_single_async(rq->mq_ctx->cpu, &rq->csd); > + rq->work = IRQ_WORK_INIT_H

Re: [RFC][PATCH v2 08/10] smp,irq_work: Use the new irq_work API

2020-08-19 Thread Linus Torvalds
On Wed, Aug 19, 2020 at 12:41 PM wrote: > > I'm not sure I get the "expensive irq_work queues" argument, I fully > agree with you that adding the atomic op is fairly crap. There's an atomic op on the actual runing side too, because of the whole IRQ_WORK_PENDING thing. So you get that double hit.

Re: [RFC][PATCH v2 08/10] smp,irq_work: Use the new irq_work API

2020-08-19 Thread peterz
On Wed, Aug 19, 2020 at 11:50:55AM -0700, Linus Torvalds wrote: > On Wed, Aug 19, 2020 at 12:22 AM wrote: > > > > That is, the external serialization comes from the non-atomic > > test-and-set they both have. This works nicely when there is external > > state that already serializes things, but to

Re: [RFC][PATCH v2 08/10] smp,irq_work: Use the new irq_work API

2020-08-19 Thread Linus Torvalds
On Wed, Aug 19, 2020 at 12:22 AM wrote: > > That is, the external serialization comes from the non-atomic > test-and-set they both have. This works nicely when there is external > state that already serializes things, but totally comes apart (and > causes trivial list corruption) when you get it w

Re: [RFC][PATCH v2 08/10] smp,irq_work: Use the new irq_work API

2020-08-19 Thread peterz
On Tue, Aug 18, 2020 at 06:25:42PM +0200, Christoph Hellwig wrote: > On Tue, Aug 18, 2020 at 12:51:10PM +0200, Peter Zijlstra wrote: > > Convert the performance sensitive users of > > smp_call_single_function_async() over to the new > > irq_work_queue_remote_static(). > > > > The new API is margin

Re: [RFC][PATCH v2 08/10] smp,irq_work: Use the new irq_work API

2020-08-18 Thread Christoph Hellwig
On Tue, Aug 18, 2020 at 12:51:10PM +0200, Peter Zijlstra wrote: > Convert the performance sensitive users of > smp_call_single_function_async() over to the new > irq_work_queue_remote_static(). > > The new API is marginally less crap but taking these users away allows > fixing up smp_call_single_f

[RFC][PATCH v2 08/10] smp,irq_work: Use the new irq_work API

2020-08-18 Thread Peter Zijlstra
Convert the performance sensitive users of smp_call_single_function_async() over to the new irq_work_queue_remote_static(). The new API is marginally less crap but taking these users away allows fixing up smp_call_single_function_async() without risk of performance regressions. Signed-off-by: Pet