I am attaching a patch by Thomas Gleixner which adds a kernel command line parameter to set the defauilt IRQ affinity mask. Could you please integrate this in your tree for the next Linaro release?
I've been using this patch for sometime now and it doesn't introduce any regressions. There is a possibility that this patch will make it upstream via the RT patches in the near future but in the meanwhile, we'd like to carry this patch as well.
Cheers, Punit
From 52a7d44f58a262e166575abc57aa0bd3bfc8cfbb Mon Sep 17 00:00:00 2001
From: Thomas Gleixner tglx@linutronix.de Date: Fri, 25 May 2012 16:59:47 +0200 Subject: [PATCH] genirq: Add default affinity mask command line option
If we isolate CPUs, then we don't want random device interrupts on them. Even w/o the user space irq balancer enabled we can end up with irqs on non boot cpus.
Allow to restrict the default irq affinity mask.
Signed-off-by: Thomas Gleixner tglx@linutronix.de --- Documentation/kernel-parameters.txt | 9 +++++++++ kernel/irq/irqdesc.c | 21 +++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 7d82468..00fedab 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -1164,6 +1164,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted. See comment before ip2_setup() in drivers/char/ip2/ip2base.c.
+ irqaffinity= [SMP] Set the default irq affinity mask + Format: + <cpu number>,...,<cpu number> + or + <cpu number>-<cpu number> + (must be a positive range in ascending order) + or a mixture + <cpu number>,...,<cpu number>-<cpu number> + irqfixup [HW] When an interrupt is not handled search all handlers for it. Intended to get systems with badly broken diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 192a302..473b2b6 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -23,10 +23,27 @@ static struct lock_class_key irq_desc_lock_class;
#if defined(CONFIG_SMP) +static int __init irq_affinity_setup(char *str) +{ + zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT); + cpulist_parse(str, irq_default_affinity); + /* + * Set at least the boot cpu. We don't want to end up with + * bugreports caused by random comandline masks + */ + cpumask_set_cpu(smp_processor_id(), irq_default_affinity); + return 1; +} +__setup("irqaffinity=", irq_affinity_setup); + static void __init init_irq_default_affinity(void) { - alloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT); - cpumask_setall(irq_default_affinity); +#ifdef CONFIG_CPUMASK_OFFSTACK + if (!irq_default_affinity) + zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT); +#endif + if (cpumask_empty(irq_default_affinity)) + cpumask_setall(irq_default_affinity); } #else static void __init init_irq_default_affinity(void)
On 12 November 2012 22:27, Punit Agrawal punit.agrawal@arm.com wrote:
I am attaching a patch by Thomas Gleixner which adds a kernel command line parameter to set the defauilt IRQ affinity mask. Could you please integrate this in your tree for the next Linaro release?
I've been using this patch for sometime now and it doesn't introduce any regressions. There is a possibility that this patch will make it upstream via the RT patches in the near future but in the meanwhile, we'd like to carry this patch as well.
Hi Punit,
I agree with you that many of us would be interested in using this patch, but i am not sure about which tree should it land into?
@Andrey/Tixy: Any other better tree you can suggest for carrying this one? Or is my tree the best place :)
From 52a7d44f58a262e166575abc57aa0bd3bfc8cfbb Mon Sep 17 00:00:00 2001 From: Thomas Gleixner tglx@linutronix.de Date: Fri, 25 May 2012 16:59:47 +0200 Subject: [PATCH] genirq: Add default affinity mask command line option
If we isolate CPUs, then we don't want random device interrupts on them. Even w/o the user space irq balancer enabled we can end up with irqs on non boot cpus.
Allow to restrict the default irq affinity mask.
Signed-off-by: Thomas Gleixner tglx@linutronix.de
Documentation/kernel-parameters.txt | 9 +++++++++ kernel/irq/irqdesc.c | 21 +++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 7d82468..00fedab 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -1164,6 +1164,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted. See comment before ip2_setup() in drivers/char/ip2/ip2base.c.
irqaffinity= [SMP] Set the default irq affinity mask
Format:
<cpu number>,...,<cpu number>
or
<cpu number>-<cpu number>
(must be a positive range in ascending order)
or a mixture
<cpu number>,...,<cpu number>-<cpu number>
irqfixup [HW] When an interrupt is not handled search all handlers for it. Intended to get systems with badly broken
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 192a302..473b2b6 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -23,10 +23,27 @@ static struct lock_class_key irq_desc_lock_class;
#if defined(CONFIG_SMP) +static int __init irq_affinity_setup(char *str) +{
zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT);
cpulist_parse(str, irq_default_affinity);
/*
* Set at least the boot cpu. We don't want to end up with
* bugreports caused by random comandline masks
*/
cpumask_set_cpu(smp_processor_id(), irq_default_affinity);
return 1;
+} +__setup("irqaffinity=", irq_affinity_setup);
static void __init init_irq_default_affinity(void) {
alloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT);
cpumask_setall(irq_default_affinity);
+#ifdef CONFIG_CPUMASK_OFFSTACK
if (!irq_default_affinity)
zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT);
+#endif
if (cpumask_empty(irq_default_affinity))
cpumask_setall(irq_default_affinity);
} #else static void __init init_irq_default_affinity(void) -- 1.7.9.5
On Mon, 2012-11-12 at 22:32 +0530, Viresh Kumar wrote:
On 12 November 2012 22:27, Punit Agrawal punit.agrawal@arm.com wrote:
I am attaching a patch by Thomas Gleixner which adds a kernel command line parameter to set the defauilt IRQ affinity mask. Could you please integrate this in your tree for the next Linaro release?
I've been using this patch for sometime now and it doesn't introduce any regressions. There is a possibility that this patch will make it upstream via the RT patches in the near future but in the meanwhile, we'd like to carry this patch as well.
Hi Punit,
I agree with you that many of us would be interested in using this patch, but i am not sure about which tree should it land into?
@Andrey/Tixy: Any other better tree you can suggest for carrying this one? Or is my tree the best place :)
It's not really anything to do with vexpress enablement and I don't believe it's Andrey's job to maintain patches, but I assume it's not strictly related to big.LITTLE MP either. So I guess I'm saying that it wants someone who agrees the patch is good to have to volunteer to maintain it and create/find a suitable topic branch for inclusion into llct.
But if someone called Viresh thought the patch looked useful for people testing or experimenting with power management, and wasn't too worried about it being the thin end of the wedge, then he might just take the simplest approach and add it to his big.LITTLE MP branch ;-)
On 11/13/2012 12:51 PM, Jon Medhurst (Tixy) wrote:
On Mon, 2012-11-12 at 22:32 +0530, Viresh Kumar wrote:
On 12 November 2012 22:27, Punit Agrawal punit.agrawal@arm.com wrote:
I am attaching a patch by Thomas Gleixner which adds a kernel command line parameter to set the defauilt IRQ affinity mask. Could you please integrate this in your tree for the next Linaro release?
I've been using this patch for sometime now and it doesn't introduce any regressions. There is a possibility that this patch will make it upstream via the RT patches in the near future but in the meanwhile, we'd like to carry this patch as well.
Hi Punit,
I agree with you that many of us would be interested in using this patch, but i am not sure about which tree should it land into?
@Andrey/Tixy: Any other better tree you can suggest for carrying this one? Or is my tree the best place :)
It's not really anything to do with vexpress enablement and I don't believe it's Andrey's job to maintain patches, but I assume it's not strictly related to big.LITTLE MP either. So I guess I'm saying that it wants someone who agrees the patch is good to have to volunteer to maintain it and create/find a suitable topic branch for inclusion into llct.
But if someone called Viresh thought the patch looked useful for people testing or experimenting with power management, and wasn't too worried about it being the thin end of the wedge, then he might just take the simplest approach and add it to his big.LITTLE MP branch ;-)
+1
Me to maintain patches is not the best option at all, as often I have very little idea of what the patch is doing. (Though I have to do that in very rare cases, and right now I have another patch floating around with no one willing to maintain it as it seems :( )
Thanks, Andrey
On 13 November 2012 21:13, Andrey Konovalov andrey.konovalov@linaro.org wrote:
+1
Me to maintain patches is not the best option at all, as often I have very little idea of what the patch is doing. (Though I have to do that in very rare cases, and right now I have another patch floating around with no one willing to maintain it as it seems :( )
Great. I will keep it in my tree then.
-- viresh
On 12 November 2012 22:27, Punit Agrawal punit.agrawal@arm.com wrote:
I am attaching a patch by Thomas Gleixner which adds a kernel command line parameter to set the defauilt IRQ affinity mask. Could you please integrate this in your tree for the next Linaro release?
I've been using this patch for sometime now and it doesn't introduce any regressions. There is a possibility that this patch will make it upstream via the RT patches in the near future but in the meanwhile, we'd like to carry this patch as well.
Applied to misc-patches
-- viresh
Hi,
On 11/12/2012 05:57 PM, Punit Agrawal wrote:
I am attaching a patch by Thomas Gleixner which adds a kernel command line parameter to set the defauilt IRQ affinity mask. Could you please integrate this in your tree for the next Linaro release?
I've been using this patch for sometime now and it doesn't introduce any regressions. There is a possibility that this patch will make it upstream via the RT patches in the near future but in the meanwhile, we'd like to carry this patch as well.
Cheers, Punit
From 52a7d44f58a262e166575abc57aa0bd3bfc8cfbb Mon Sep 17 00:00:00 2001 From: Thomas Gleixner tglx@linutronix.de Date: Fri, 25 May 2012 16:59:47 +0200 Subject: [PATCH] genirq: Add default affinity mask command line option
If we isolate CPUs, then we don't want random device interrupts on them. Even w/o the user space irq balancer enabled we can end up with irqs on non boot cpus.
Allow to restrict the default irq affinity mask.
Signed-off-by: Thomas Gleixner tglx@linutronix.de
Documentation/kernel-parameters.txt | 9 +++++++++ kernel/irq/irqdesc.c | 21 +++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 7d82468..00fedab 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -1164,6 +1164,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted. See comment before ip2_setup() in drivers/char/ip2/ip2base.c.
- irqaffinity= [SMP] Set the default irq affinity mask
Format:
<cpu number>,...,<cpu number>
or
<cpu number>-<cpu number>
(must be a positive range in ascending order)
or a mixture
<cpu number>,...,<cpu number>-<cpu number>
- irqfixup [HW] When an interrupt is not handled search all handlers for it. Intended to get systems with badly broken
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 192a302..473b2b6 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -23,10 +23,27 @@ static struct lock_class_key irq_desc_lock_class; #if defined(CONFIG_SMP) +static int __init irq_affinity_setup(char *str) +{
- zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT);
- cpulist_parse(str, irq_default_affinity);
Since cpulist_parse() sets all the bits of its cpumask argument, it's not necessary to initialize them to zero during allocation, so I would use alloc_cpumask_var() instead of zalloc_cpumask_var().
- /*
* Set at least the boot cpu. We don't want to end up with
* bugreports caused by random comandline masks
*/
- cpumask_set_cpu(smp_processor_id(), irq_default_affinity);
- return 1;
+} +__setup("irqaffinity=", irq_affinity_setup);
static void __init init_irq_default_affinity(void) {
- alloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT);
- cpumask_setall(irq_default_affinity);
+#ifdef CONFIG_CPUMASK_OFFSTACK
- if (!irq_default_affinity)
zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT);
+#endif
The #ifdefery is not necessary here, because if CONFIG_CPUMASK_OFFSTACK is not defined irq_default_affinity cannot be NULL.
-- Francesco
Hi Francesco,
Thanks for your comments on the patch.
On 18/11/12 10:41, Francesco Lavra wrote:
Hi,
On 11/12/2012 05:57 PM, Punit Agrawal wrote:
I am attaching a patch by Thomas Gleixner which adds a kernel command line parameter to set the defauilt IRQ affinity mask. Could you please integrate this in your tree for the next Linaro release?
I've been using this patch for sometime now and it doesn't introduce any regressions. There is a possibility that this patch will make it upstream via the RT patches in the near future but in the meanwhile, we'd like to carry this patch as well.
Cheers, Punit
From 52a7d44f58a262e166575abc57aa0bd3bfc8cfbb Mon Sep 17 00:00:00 2001 From: Thomas Gleixner tglx@linutronix.de Date: Fri, 25 May 2012 16:59:47 +0200 Subject: [PATCH] genirq: Add default affinity mask command line option
If we isolate CPUs, then we don't want random device interrupts on them. Even w/o the user space irq balancer enabled we can end up with irqs on non boot cpus.
Allow to restrict the default irq affinity mask.
Signed-off-by: Thomas Gleixner tglx@linutronix.de
Documentation/kernel-parameters.txt | 9 +++++++++ kernel/irq/irqdesc.c | 21 +++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 7d82468..00fedab 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -1164,6 +1164,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted. See comment before ip2_setup() in drivers/char/ip2/ip2base.c.
- irqaffinity= [SMP] Set the default irq affinity mask
Format:
<cpu number>,...,<cpu number>
or
<cpu number>-<cpu number>
(must be a positive range in ascending order)
or a mixture
<cpu number>,...,<cpu number>-<cpu number>
- irqfixup [HW] When an interrupt is not handled search all handlers for it. Intended to get systems with badly broken
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 192a302..473b2b6 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -23,10 +23,27 @@ static struct lock_class_key irq_desc_lock_class;
#if defined(CONFIG_SMP) +static int __init irq_affinity_setup(char *str) +{
- zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT);
- cpulist_parse(str, irq_default_affinity);
Since cpulist_parse() sets all the bits of its cpumask argument, it's not necessary to initialize them to zero during allocation, so I would use alloc_cpumask_var() instead of zalloc_cpumask_var().
- /*
* Set at least the boot cpu. We don't want to end up with
* bugreports caused by random comandline masks
*/
- cpumask_set_cpu(smp_processor_id(), irq_default_affinity);
- return 1;
+} +__setup("irqaffinity=", irq_affinity_setup);
- static void __init init_irq_default_affinity(void) {
- alloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT);
- cpumask_setall(irq_default_affinity);
+#ifdef CONFIG_CPUMASK_OFFSTACK
- if (!irq_default_affinity)
zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT);
+#endif
The #ifdefery is not necessary here, because if CONFIG_CPUMASK_OFFSTACK is not defined irq_default_affinity cannot be NULL.
The patch was picked up as-is from the RT patches as it implements a functionality that we wanted to better control IRQ affinity. Being part of the RT patches, I hope that it'll merge into mainline via that route and I am not going to try to mainline it. So your comments will be best addressed to the original patch postings on the lkml (Search for RT patches).
If you think it is really important to address your comments for the patch that goes into Linaro kernel, I could address them and send an updated patch. Though in that case, I am not quite sure how to attribute the original author who wrote the patch.
Thanks, Punit
-- Francesco
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Hi,
On 11/19/2012 03:47 PM, Punit Agrawal wrote:
The patch was picked up as-is from the RT patches as it implements a functionality that we wanted to better control IRQ affinity. Being part of the RT patches, I hope that it'll merge into mainline via that route and I am not going to try to mainline it. So your comments will be best addressed to the original patch postings on the lkml (Search for RT patches).
If you think it is really important to address your comments for the patch that goes into Linaro kernel, I could address them and send an updated patch. Though in that case, I am not quite sure how to attribute the original author who wrote the patch.
I sent my comments to the patch author and the RT mailing list, so these changes will hopefully be included in a subsequent version of the RT patches.
Thanks, Francesco
On 19 November 2012 20:17, Punit Agrawal punit.agrawal@arm.com wrote:
The patch was picked up as-is from the RT patches as it implements a functionality that we wanted to better control IRQ affinity. Being part of the RT patches, I hope that it'll merge into mainline via that route and I am not going to try to mainline it. So your comments will be best addressed to the original patch postings on the lkml (Search for RT patches).
If you think it is really important to address your comments for the patch that goes into Linaro kernel, I could address them and send an updated patch. Though in that case, I am not quite sure how to attribute the original author who wrote the patch.
Hi Punit,
Can you please follow up on this patch to see its status. Its not mainlined yet.
-- viresh
(adding Robin to 'cc)
On 22/04/13 07:51, Viresh Kumar wrote:
On 19 November 2012 20:17, Punit Agrawal punit.agrawal@arm.com wrote:
The patch was picked up as-is from the RT patches as it implements a functionality that we wanted to better control IRQ affinity. Being part of the RT patches, I hope that it'll merge into mainline via that route and I am not going to try to mainline it. So your comments will be best addressed to the original patch postings on the lkml (Search for RT patches).
If you think it is really important to address your comments for the patch that goes into Linaro kernel, I could address them and send an updated patch. Though in that case, I am not quite sure how to attribute the original author who wrote the patch.
Hi Punit,
Hello Viresh,
Apologies for the delay in getting back on this.
Can you please follow up on this patch to see its status. Its not mainlined yet.
Robin will be following up with the patch author for upstream inclusion. In the meanwhile, it'd be good if you continued carrying this patch in your MP tree.
Thanks, Punit
-- viresh
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.