2010-08-27 18:13:44

by Suresh Siddha

[permalink] [raw]
Subject: [patch 1/3] x86, intr-remap: set redirection hint in the IRTE

Currently the redirection hint in the interrupt-remapping table entry
is set to 0, which means the remapped interrupt is directed to the
processors listed in the destination. So in logical flat mode
in the presence of intr-remapping, this results in a single
interrupt multi-casted to multiple cpu's as specified by the destination
bit mask. But what we really want is to send that interrupt to one of the cpus
based on the lowest priority delivery mode.

Set the redirection hint in the IRTE to '1' to indicate that we want
the remapped interrupt to be directed to only one of the processors
listed in the destination.

This fixes the issue of same interrupt getting delivered to multiple cpu's
in the logical flat mode in the presence of interrupt-remapping. While
there is no functional issue observed with this behavior, this will
impact performance of such configurations (<=8 cpu's using logical flat
mode in the presence of interrupt-remapping)

Signed-off-by: Suresh Siddha <[email protected]>
Cc: Weidong Han <[email protected]>
Cc: <[email protected]> # [v2.6.32+]
---

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index f1efeba..90f8a75 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1392,6 +1392,7 @@ int setup_ioapic_entry(int apic_id, int irq,
irte.dlvry_mode = apic->irq_delivery_mode;
irte.vector = vector;
irte.dest_id = IRTE_DEST(destination);
+ irte.redir_hint = 1;

/* Set source-id of interrupt request */
set_ioapic_sid(&irte, apic_id);
@@ -3343,6 +3344,7 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq,
irte.dlvry_mode = apic->irq_delivery_mode;
irte.vector = cfg->vector;
irte.dest_id = IRTE_DEST(dest);
+ irte.redir_hint = 1;

/* Set source-id of interrupt request */
if (pdev)


2010-08-30 01:35:49

by Weidong Han

[permalink] [raw]
Subject: Re: [patch 1/3] x86, intr-remap: set redirection hint in the IRTE

Siddha, Suresh B wrote:
> Currently the redirection hint in the interrupt-remapping table entry
> is set to 0, which means the remapped interrupt is directed to the
> processors listed in the destination. So in logical flat mode
> in the presence of intr-remapping, this results in a single
> interrupt multi-casted to multiple cpu's as specified by the destination
> bit mask. But what we really want is to send that interrupt to one of the cpus
> based on the lowest priority delivery mode.
>
> Set the redirection hint in the IRTE to '1' to indicate that we want
> the remapped interrupt to be directed to only one of the processors
> listed in the destination.
>
> This fixes the issue of same interrupt getting delivered to multiple cpu's
> in the logical flat mode in the presence of interrupt-remapping. While
> there is no functional issue observed with this behavior, this will
> impact performance of such configurations (<=8 cpu's using logical flat
> mode in the presence of interrupt-remapping)
>
> Signed-off-by: Suresh Siddha <[email protected]>
> Cc: Weidong Han <[email protected]>
> Cc: <[email protected]> # [v2.6.32+]
> ---
>
> diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
> index f1efeba..90f8a75 100644
> --- a/arch/x86/kernel/apic/io_apic.c
> +++ b/arch/x86/kernel/apic/io_apic.c
> @@ -1392,6 +1392,7 @@ int setup_ioapic_entry(int apic_id, int irq,
> irte.dlvry_mode = apic->irq_delivery_mode;
> irte.vector = vector;
> irte.dest_id = IRTE_DEST(destination);
> + irte.redir_hint = 1;
>
> /* Set source-id of interrupt request */
> set_ioapic_sid(&irte, apic_id);
> @@ -3343,6 +3344,7 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq,
> irte.dlvry_mode = apic->irq_delivery_mode;
> irte.vector = cfg->vector;
> irte.dest_id = IRTE_DEST(dest);
> + irte.redir_hint = 1;
>
> /* Set source-id of interrupt request */
> if (pdev)
>
>
>
Hi Suresh,

Your patch always sets redir_hint to 1 for all delivery modes. Why not
check if it's lowest priority delivery mode before set redit_hint to 1?

Regards,
Weidong

2010-08-30 01:47:22

by Weidong Han

[permalink] [raw]
Subject: Re: [patch 1/3] x86, intr-remap: set redirection hint in the IRTE

Siddha, Suresh B wrote:
> Currently the redirection hint in the interrupt-remapping table entry
> is set to 0, which means the remapped interrupt is directed to the
> processors listed in the destination. So in logical flat mode
> in the presence of intr-remapping, this results in a single
> interrupt multi-casted to multiple cpu's as specified by the destination
> bit mask. But what we really want is to send that interrupt to one of the cpus
> based on the lowest priority delivery mode.
>
> Set the redirection hint in the IRTE to '1' to indicate that we want
> the remapped interrupt to be directed to only one of the processors
> listed in the destination.
>
> This fixes the issue of same interrupt getting delivered to multiple cpu's
> in the logical flat mode in the presence of interrupt-remapping. While
> there is no functional issue observed with this behavior, this will
> impact performance of such configurations (<=8 cpu's using logical flat
> mode in the presence of interrupt-remapping)
>
> Signed-off-by: Suresh Siddha <[email protected]>
> Cc: Weidong Han <[email protected]>
> Cc: <[email protected]> # [v2.6.32+]
> ---
>
> diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
> index f1efeba..90f8a75 100644
> --- a/arch/x86/kernel/apic/io_apic.c
> +++ b/arch/x86/kernel/apic/io_apic.c
> @@ -1392,6 +1392,7 @@ int setup_ioapic_entry(int apic_id, int irq,
> irte.dlvry_mode = apic->irq_delivery_mode;
> irte.vector = vector;
> irte.dest_id = IRTE_DEST(destination);
> + irte.redir_hint = 1;
>
> /* Set source-id of interrupt request */
> set_ioapic_sid(&irte, apic_id);
> @@ -3343,6 +3344,7 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq,
> irte.dlvry_mode = apic->irq_delivery_mode;
> irte.vector = cfg->vector;
> irte.dest_id = IRTE_DEST(dest);
> + irte.redir_hint = 1;
>
> /* Set source-id of interrupt request */
> if (pdev)
>
>
>
hi Suresh,

I think it needs to set redir_hint only for lowest priority delivery
mode. Why set it for all delivery modes?

Regards,
Weidong

2010-08-30 17:18:29

by Suresh Siddha

[permalink] [raw]
Subject: Re: [patch 1/3] x86, intr-remap: set redirection hint in the IRTE

On Sun, 2010-08-29 at 18:47 -0700, Han, Weidong wrote:
> Siddha, Suresh B wrote:
> > Currently the redirection hint in the interrupt-remapping table entry
> > is set to 0, which means the remapped interrupt is directed to the
> > processors listed in the destination. So in logical flat mode
> > in the presence of intr-remapping, this results in a single
> > interrupt multi-casted to multiple cpu's as specified by the destination
> > bit mask. But what we really want is to send that interrupt to one of the cpus
> > based on the lowest priority delivery mode.
> >
> > Set the redirection hint in the IRTE to '1' to indicate that we want
> > the remapped interrupt to be directed to only one of the processors
> > listed in the destination.
> >
> > This fixes the issue of same interrupt getting delivered to multiple cpu's
> > in the logical flat mode in the presence of interrupt-remapping. While
> > there is no functional issue observed with this behavior, this will
> > impact performance of such configurations (<=8 cpu's using logical flat
> > mode in the presence of interrupt-remapping)
> >
> > Signed-off-by: Suresh Siddha <[email protected]>
> > Cc: Weidong Han <[email protected]>
> > Cc: <[email protected]> # [v2.6.32+]
> > ---
> >
> > diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
> > index f1efeba..90f8a75 100644
> > --- a/arch/x86/kernel/apic/io_apic.c
> > +++ b/arch/x86/kernel/apic/io_apic.c
> > @@ -1392,6 +1392,7 @@ int setup_ioapic_entry(int apic_id, int irq,
> > irte.dlvry_mode = apic->irq_delivery_mode;
> > irte.vector = vector;
> > irte.dest_id = IRTE_DEST(destination);
> > + irte.redir_hint = 1;
> >
> > /* Set source-id of interrupt request */
> > set_ioapic_sid(&irte, apic_id);
> > @@ -3343,6 +3344,7 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq,
> > irte.dlvry_mode = apic->irq_delivery_mode;
> > irte.vector = cfg->vector;
> > irte.dest_id = IRTE_DEST(dest);
> > + irte.redir_hint = 1;
> >
> > /* Set source-id of interrupt request */
> > if (pdev)
> >
> >
> >
> hi Suresh,
>
> I think it needs to set redir_hint only for lowest priority delivery
> mode. Why set it for all delivery modes?

Weidong, For all the IRQ types (irrespective of lowest priority/fixed
mode etc) x86 linux kernel doesn't use irq multi-cast model (which is
what irte.redir_hint == 0 means). So as it is not particularly tied with
lowest priority mode (irte.redir_hint is equally applicable for fixed
mode though we don't use it currently), it makes sense to set it
unconditionally for the current usages.

thanks,
suresh

2010-08-31 03:29:33

by Weidong Han

[permalink] [raw]
Subject: Re: [patch 1/3] x86, intr-remap: set redirection hint in the IRTE

Siddha, Suresh B wrote:
> On Sun, 2010-08-29 at 18:47 -0700, Han, Weidong wrote:
>
>> Siddha, Suresh B wrote:
>>
>>> Currently the redirection hint in the interrupt-remapping table entry
>>> is set to 0, which means the remapped interrupt is directed to the
>>> processors listed in the destination. So in logical flat mode
>>> in the presence of intr-remapping, this results in a single
>>> interrupt multi-casted to multiple cpu's as specified by the destination
>>> bit mask. But what we really want is to send that interrupt to one of the cpus
>>> based on the lowest priority delivery mode.
>>>
>>> Set the redirection hint in the IRTE to '1' to indicate that we want
>>> the remapped interrupt to be directed to only one of the processors
>>> listed in the destination.
>>>
>>> This fixes the issue of same interrupt getting delivered to multiple cpu's
>>> in the logical flat mode in the presence of interrupt-remapping. While
>>> there is no functional issue observed with this behavior, this will
>>> impact performance of such configurations (<=8 cpu's using logical flat
>>> mode in the presence of interrupt-remapping)
>>>
>>> Signed-off-by: Suresh Siddha <[email protected]>
>>> Cc: Weidong Han <[email protected]>
>>> Cc: <[email protected]> # [v2.6.32+]
>>> ---
>>>
>>> diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
>>> index f1efeba..90f8a75 100644
>>> --- a/arch/x86/kernel/apic/io_apic.c
>>> +++ b/arch/x86/kernel/apic/io_apic.c
>>> @@ -1392,6 +1392,7 @@ int setup_ioapic_entry(int apic_id, int irq,
>>> irte.dlvry_mode = apic->irq_delivery_mode;
>>> irte.vector = vector;
>>> irte.dest_id = IRTE_DEST(destination);
>>> + irte.redir_hint = 1;
>>>
>>> /* Set source-id of interrupt request */
>>> set_ioapic_sid(&irte, apic_id);
>>> @@ -3343,6 +3344,7 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq,
>>> irte.dlvry_mode = apic->irq_delivery_mode;
>>> irte.vector = cfg->vector;
>>> irte.dest_id = IRTE_DEST(dest);
>>> + irte.redir_hint = 1;
>>>
>>> /* Set source-id of interrupt request */
>>> if (pdev)
>>>
>>>
>>>
>>>
>> hi Suresh,
>>
>> I think it needs to set redir_hint only for lowest priority delivery
>> mode. Why set it for all delivery modes?
>>
>
> Weidong, For all the IRQ types (irrespective of lowest priority/fixed
> mode etc) x86 linux kernel doesn't use irq multi-cast model (which is
> what irte.redir_hint == 0 means). So as it is not particularly tied with
> lowest priority mode (irte.redir_hint is equally applicable for fixed
> mode though we don't use it currently), it makes sense to set it
> unconditionally for the current usages.
>
>
>
Thanks for your explanation. It's ok.

Regards,
Weidong