Thread (4 messages) 4 messages, 2 authors, 2012-11-03

Re: [PATCH RFC] irq: Honor /proc/irq core affinity when an IRQ thread is created

From: Thomas Gleixner <hidden>
Date: 2012-09-04 15:43:39
Subsystem: irq subsystem, the rest · Maintainers: Thomas Gleixner, Linus Torvalds

On Mon, 27 Aug 2012, Sankara Muthukrishnan wrote:
Hi everyone,

I would like to get some feedback from the RT community before
submitting to the mainline.

Currently, by writing to /proc/irq/../smp_affinity file, core affinity
of already running IRQ threads can be modified. However, after writing
to the /proc file, an IRQ thread that gets created later does not
inherit the affinity specified in the file. This happens because the
irq action is registered in irq description only after setup_affinity
function is called. This patch addresses this problem by calling
setup_affinity function after the irq action is updated in the irq
description structure. It looks like the existing behavior (without
this patch) is inconsistent because in the case of multiple action
handlers for an irq, the IRQ thread associated with the new action
handler that is being registered does not inherit the core affinity
from the /proc file, however, the IRQ threads of the existing action
handlers do inherit the affinity.
I understand the problem, but the proposed patch is not going to solve
it. setup_affinity() is just called in the !shared case, which is the
first action which is set up. So that works for the first irq, but not
for later ones.

Does the following patch fix the problem for both shared and non
shared interrupts ?
 
Thanks,

	tglx
---
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 4c69326..a16ff28 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -936,6 +936,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
 		 */
 		get_task_struct(t);
 		new->thread = t;
+		set_bit(IRQTF_AFFINITY, &new->thread_flags);
 	}
 
 	if (!alloc_cpumask_var(&mask, GFP_KERNEL)) {
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help