Re: [PATCH] genirq: Expose default irq affinity mask (take 3)

Previous thread: Re: [PATCH] edd: fix error paths in module_init by devzero on Thursday, May 29, 2008 - 1:56 pm. (2 messages)

Next thread: flashing to H2200 ipaq doesn't work: bug or feature? kernel or application? by Udo van den Heuvel on Thursday, May 29, 2008 - 2:03 pm. (1 message)
To: <mingo@...>
Cc: <pj@...>, <a.p.zijlstra@...>, <linux-kernel@...>, <tglx@...>, <rdunlap@...>, Max Krasnyansky <maxk@...>
Date: Thursday, May 29, 2008 - 2:02 pm

Current IRQ affinity interface does not provide a way to set affinity
for the IRQs that will be allocated/activated in the future.
This patch creates /proc/irq/default_smp_affinity that lets users set
default affinity mask for the newly allocated IRQs. Changing the default
does not affect affinity masks for the currently active IRQs, they
have to be changed explicitly.

Updated based on Paul J's comments and added some more documentation.

Signed-off-by: Max Krasnyansky <maxk@qualcomm.com>
---
Documentation/IRQ-affinity.txt | 37 +++++++++++++++++-----
Documentation/filesystems/proc.txt | 29 +++++++++++-------
arch/alpha/kernel/irq.c | 5 +--
include/linux/irq.h | 14 +++-----
kernel/irq/manage.c | 28 ++++++++++++++++-
kernel/irq/proc.c | 59 +++++++++++++++++++++++++++++++++--
6 files changed, 134 insertions(+), 38 deletions(-)

diff --git a/Documentation/IRQ-affinity.txt b/Documentation/IRQ-affinity.txt
index 938d7dd..5f07fa5 100644
--- a/Documentation/IRQ-affinity.txt
+++ b/Documentation/IRQ-affinity.txt
@@ -1,17 +1,26 @@
+ChangeLog:
+ Started by Ingo Molnar <mingo@redhat.com>
+ Update by Max Krasnyansky <maxk@qualcomm.com>

-SMP IRQ affinity, started by Ingo Molnar <mingo@redhat.com>
-
+SMP IRQ affinity

/proc/irq/IRQ#/smp_affinity specifies which target CPUs are permitted
for a given IRQ source. It's a bitmask of allowed CPUs. It's not allowed
to turn off all CPUs, and if an IRQ controller does not support IRQ
affinity then the value will not change from the default 0xffffffff.

+/proc/irq/default_smp_affinity specifies default affinity mask that applies
+to all non-active IRQs. Once IRQ is allocated/activated its affinity bitmask
+will be set to the default mask. It can then be changed as described above.
+Default mask is 0xffffffff.
+
Here is an example of restricting IRQ44 (eth1) to CPU0-3 then restricting
-the IRQ to CPU4-7 (this is an 8-CPU SMP box):
+...

To: Max Krasnyansky <maxk@...>
Cc: <mingo@...>, <a.p.zijlstra@...>, <linux-kernel@...>, <tglx@...>, <rdunlap@...>
Date: Monday, June 2, 2008 - 11:23 am

Max,

I realized, when reading this again, that the default masks
are not ffffffff. That's the default only on systems with
no more than 32 CPUs. Rather I suspect that the default is
CPU_MASK_ALL. Indeed, your patch has:

cpumask_t irq_default_affinity = CPU_MASK_ALL;

This affects a few mentions of ffffffff in the Docs.

Otherwise looks good - thanks.

Acked-by: Paul Jackson <pj@sgi.com>

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.940.382.4214
--

To: Paul Jackson <pj@...>
Cc: <mingo@...>, <a.p.zijlstra@...>, <linux-kernel@...>, <tglx@...>, <rdunlap@...>
Date: Monday, June 2, 2008 - 12:37 pm

Thanx.

btw What's the procedure for including Acked-by ?
cut&paste into the patch description and resend ?

Max

--

To: Max Krasnyansky <maxk@...>
Cc: <mingo@...>, <a.p.zijlstra@...>, <linux-kernel@...>, <tglx@...>, <rdunlap@...>
Date: Thursday, June 5, 2008 - 3:25 pm

If the acked-by comes fairly shortly after the original
patch, and isn't excessively buried in a bunch of discussion,
then Andrew will catch it, and add it to the patch in his
queue.

If you have to resubmit the patch anyway, then of course,
add the acked-by then.

If neither of the above applies, and the acked-by is lost,
but your patch is successfully applied anyway, then either of
(1) if you're feeling lazy, don't worry about it, or
(2) reply again to that lkml thread, being sure akpm is on
the cc list, asking Andrew to add the acked-by.

Andrew is the expert, of course, in such matters.

If he says something contrary to the above, ignore me.

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.940.382.4214
--

Previous thread: Re: [PATCH] edd: fix error paths in module_init by devzero on Thursday, May 29, 2008 - 1:56 pm. (2 messages)

Next thread: flashing to H2200 ipaq doesn't work: bug or feature? kernel or application? by Udo van den Heuvel on Thursday, May 29, 2008 - 2:03 pm. (1 message)