All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Anisov <andrii.anisov@gmail.com>
To: Julien Grall <julien.grall@arm.com>, xen-devel@lists.xenproject.org
Cc: Andre Przywara <andre.przywara@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Andrii Anisov <andrii_anisov@epam.com>
Subject: Re: [PATCH v2] gic: drop interrupts enabling on interrupts processing
Date: Wed, 29 May 2019 13:31:16 +0300	[thread overview]
Message-ID: <20d30591-bc90-5321-2de9-a11f7d36cb11@gmail.com> (raw)
In-Reply-To: <d63ff1d7-963a-bd1a-7835-ee5b30504628@arm.com>

Hello Julien,

On 28.05.19 20:07, Julien Grall wrote:
> Title: Interrupts are still unmasked when executing action for interrupt routed to Xen. So you need to be more specific. How about
> "xen/arm: gic: Defer the decision to unmask interrupts to do_{LPI, IRQ}()"?

Looks good.

> 
> On 5/27/19 10:29 AM, Andrii Anisov wrote:
>> From: Andrii Anisov <andrii_anisov@epam.com>
>>
>> This reduces the number of context switches in case we have coming guest
>> interrupts from different sources at a high rate. What is likely for
> 
> s/What/This/
> 
>> multimedia use-cases.
>> Having irqs unlocked here makes us go through trap path again in case we
> 
> what do you mean by "unlocked"?

It must be "enabled".

>> have a new guest interrupt arrived (even with the same priority, after
>> `desc->handler->end(desc)` in `do_IRQ()`), what is just a processor
>> cycles wasting.
> after `desc->....`. This is just a waste a processor cycle as we will catch them all in the function gic_interrupt() loop.
> 
>   We will catch them all in the `gic_interrupt() function
>> loop anyway. And the guest irqs arrival prioritization is meaningless
>> here, it is only effective at guest's level.
> 
> I am not sure why you speak about guest prioritization here.

I'm trying to say about guest interrupts prioritization in HW. But I can drop it from the commit message.

> The main issue would be an interrupt to Xen (i.e timer) that would get delayed because of longer period without interrupt enabled.

Here we will process it on the next loop. This should not be much longer than existing vgic_inject_irq() interrupts disabled period.

> I would also not rule out the possibility to prioritize guest interrupt at hardware level.> 
> I know we have been discussing on the problem in the past,

Now I'm trying to pick the worthy bits from [1].
BTW, do you hear about plans for the new vgic? Some time ago it was said that new vgic implementation going to replace the old one, and optimizing the old is worthless. But as I see, there are no updates into that area yet.

> but a summary in the commit message is quite important to not miss out all the problems.

> The real problem here is for interrupt routed to guest the interrupt will be kept unmasked when calling desc->handler->end(desc). This will result to receive the next interrupt as soon as desc->handler->end(desc) is called.
> 
> In the case of interrupt routed to Xen, interrupts will be kept enabled while executing the action but then disabled before calling desc->handler->end(desc).
> 
> It would be fine to keep the interrupts masked for interrupts routed to the guest because vgic_inject_irq(...) will be masking the interrupt in most of the cases.
> 
> The code below looks good to me. I am happy to help rewording the commit message if necessary.

It's good to hear. I'm ready to reword the commit message as required to get the stuff upstreamed.
I'd discuss the wordings here. With changes suggested by you, the commit title and message would be following:

     xen/arm: gic: Defer the decision to unmask interrupts to do_{LPI, IRQ}()

     This reduces the number of context switches in case we have coming guest
     interrupts from different sources at a high rate. That is likely for
     multimedia use-cases.
     Having irqs enabled here makes us go through trap path again in case we
     have a new guest interrupt arrived (even with the same or lower priority,
     after `desc->handler->end(desc)` in `do_IRQ()`), that is just a processor
     cycles wasting as we will catch them all in the `gic_interrupt() function
     loop.

[1] https://lists.xenproject.org/archives/html/xen-devel/2018-12/msg02297.html

-- 
Sincerely,
Andrii Anisov.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

WARNING: multiple messages have this Message-ID (diff)
From: Andrii Anisov <andrii.anisov@gmail.com>
To: Julien Grall <julien.grall@arm.com>, xen-devel@lists.xenproject.org
Cc: Andre Przywara <andre.przywara@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Andrii Anisov <andrii_anisov@epam.com>
Subject: Re: [Xen-devel] [PATCH v2] gic: drop interrupts enabling on interrupts processing
Date: Wed, 29 May 2019 13:31:16 +0300	[thread overview]
Message-ID: <20d30591-bc90-5321-2de9-a11f7d36cb11@gmail.com> (raw)
Message-ID: <20190529103116.rVT_0TbWV5BRHjWDKeevsasbf4hWyEn9gcf8jkqTYJ0@z> (raw)
In-Reply-To: <d63ff1d7-963a-bd1a-7835-ee5b30504628@arm.com>

Hello Julien,

On 28.05.19 20:07, Julien Grall wrote:
> Title: Interrupts are still unmasked when executing action for interrupt routed to Xen. So you need to be more specific. How about
> "xen/arm: gic: Defer the decision to unmask interrupts to do_{LPI, IRQ}()"?

Looks good.

> 
> On 5/27/19 10:29 AM, Andrii Anisov wrote:
>> From: Andrii Anisov <andrii_anisov@epam.com>
>>
>> This reduces the number of context switches in case we have coming guest
>> interrupts from different sources at a high rate. What is likely for
> 
> s/What/This/
> 
>> multimedia use-cases.
>> Having irqs unlocked here makes us go through trap path again in case we
> 
> what do you mean by "unlocked"?

It must be "enabled".

>> have a new guest interrupt arrived (even with the same priority, after
>> `desc->handler->end(desc)` in `do_IRQ()`), what is just a processor
>> cycles wasting.
> after `desc->....`. This is just a waste a processor cycle as we will catch them all in the function gic_interrupt() loop.
> 
>   We will catch them all in the `gic_interrupt() function
>> loop anyway. And the guest irqs arrival prioritization is meaningless
>> here, it is only effective at guest's level.
> 
> I am not sure why you speak about guest prioritization here.

I'm trying to say about guest interrupts prioritization in HW. But I can drop it from the commit message.

> The main issue would be an interrupt to Xen (i.e timer) that would get delayed because of longer period without interrupt enabled.

Here we will process it on the next loop. This should not be much longer than existing vgic_inject_irq() interrupts disabled period.

> I would also not rule out the possibility to prioritize guest interrupt at hardware level.> 
> I know we have been discussing on the problem in the past,

Now I'm trying to pick the worthy bits from [1].
BTW, do you hear about plans for the new vgic? Some time ago it was said that new vgic implementation going to replace the old one, and optimizing the old is worthless. But as I see, there are no updates into that area yet.

> but a summary in the commit message is quite important to not miss out all the problems.

> The real problem here is for interrupt routed to guest the interrupt will be kept unmasked when calling desc->handler->end(desc). This will result to receive the next interrupt as soon as desc->handler->end(desc) is called.
> 
> In the case of interrupt routed to Xen, interrupts will be kept enabled while executing the action but then disabled before calling desc->handler->end(desc).
> 
> It would be fine to keep the interrupts masked for interrupts routed to the guest because vgic_inject_irq(...) will be masking the interrupt in most of the cases.
> 
> The code below looks good to me. I am happy to help rewording the commit message if necessary.

It's good to hear. I'm ready to reword the commit message as required to get the stuff upstreamed.
I'd discuss the wordings here. With changes suggested by you, the commit title and message would be following:

     xen/arm: gic: Defer the decision to unmask interrupts to do_{LPI, IRQ}()

     This reduces the number of context switches in case we have coming guest
     interrupts from different sources at a high rate. That is likely for
     multimedia use-cases.
     Having irqs enabled here makes us go through trap path again in case we
     have a new guest interrupt arrived (even with the same or lower priority,
     after `desc->handler->end(desc)` in `do_IRQ()`), that is just a processor
     cycles wasting as we will catch them all in the `gic_interrupt() function
     loop.

[1] https://lists.xenproject.org/archives/html/xen-devel/2018-12/msg02297.html

-- 
Sincerely,
Andrii Anisov.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-05-29 10:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27  9:29 [PATCH v2] gic: drop interrupts enabling on interrupts processing Andrii Anisov
2019-05-27  9:29 ` [Xen-devel] " Andrii Anisov
2019-05-28 17:07 ` Julien Grall
2019-05-28 17:07   ` [Xen-devel] " Julien Grall
2019-05-29 10:31   ` Andrii Anisov [this message]
2019-05-29 10:31     ` Andrii Anisov
2019-05-29 15:32     ` Julien Grall
2019-05-29 15:32       ` [Xen-devel] " Julien Grall
2019-05-30 16:12       ` Andrii Anisov
2019-05-30 16:12         ` [Xen-devel] " Andrii Anisov
2019-05-31 17:11         ` Julien Grall
2019-05-31 17:11           ` [Xen-devel] " Julien Grall
2019-05-31 20:08           ` Stefano Stabellini
2019-05-31 20:08             ` [Xen-devel] " Stefano Stabellini
2019-06-10 15:49           ` Andrii Anisov
2019-06-10 19:51             ` Julien Grall
2019-06-11  7:38               ` Andrii Anisov
2019-05-30 16:14       ` Andrii Anisov
2019-05-30 16:14         ` [Xen-devel] " Andrii Anisov
2019-05-31 17:16         ` Julien Grall
2019-05-31 17:16           ` [Xen-devel] " Julien Grall
2019-05-31 17:28           ` Andre Przywara
2019-05-31 17:28             ` [Xen-devel] " Andre Przywara
2019-05-31 17:25   ` Andre Przywara
2019-05-31 17:25     ` [Xen-devel] " Andre Przywara
2019-05-31 17:54     ` Julien Grall
2019-05-31 17:54       ` [Xen-devel] " Julien Grall

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=20d30591-bc90-5321-2de9-a11f7d36cb11@gmail.com \
    --to=andrii.anisov@gmail.com \
    --cc=andre.przywara@arm.com \
    --cc=andrii_anisov@epam.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.