From: Steven Rostedt <rostedt@goodmis.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>,
RT <linux-rt-users@vger.kernel.org>
Subject: [PATCH RT] Only check IRQ Thread affinity update if CPU affinity changed.
Date: Tue, 19 Jun 2007 15:41:31 -0400 [thread overview]
Message-ID: <1182282091.15228.19.camel@localhost.localdomain> (raw)
This patch cleans up the softirq in hardirq change. The hard irq threads
pin themselves to one of the CPUs that the IRQ affinity is on.
This patch cleans up this by only updating the cpu affinity, if the cpu
that the thread is pinned on is no longer part of the IRQ affinity.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Index: linux-2.6-rt-test/kernel/irq/manage.c
===================================================================
--- linux-2.6-rt-test.orig/kernel/irq/manage.c
+++ linux-2.6-rt-test/kernel/irq/manage.c
@@ -762,13 +762,15 @@ static int do_irqd(void * __desc)
#ifdef CONFIG_SMP
cpumask_t cpus_allowed, mask;
+ int pinned_cpu;
cpus_allowed = desc->affinity;
/*
* Restrict it to one cpu so we avoid being migrated inside of
* do_softirq_from_hardirq()
*/
- mask = cpumask_of_cpu(first_cpu(desc->affinity));
+ pinned_cpu = first_cpu(desc->affinity);
+ mask = cpumask_of_cpu(pinned_cpu);
set_cpus_allowed(current, mask);
#endif
current->flags |= PF_NOFREEZE | PF_HARDIRQ;
@@ -793,14 +795,15 @@ static int do_irqd(void * __desc)
/*
* Did IRQ affinities change?
*/
- if (!cpus_equal(cpus_allowed, desc->affinity)) {
+ if (!cpu_isset(pinned_cpu, desc->affinity)) {
cpus_allowed = desc->affinity;
/*
* Restrict it to one cpu so we avoid being
* migrated inside of
* do_softirq_from_hardirq()
*/
- mask = cpumask_of_cpu(first_cpu(desc->affinity));
+ pinned_cpu = first_cpu(desc->affinity);
+ mask = cpumask_of_cpu(pinned_cpu);
set_cpus_allowed(current, mask);
}
#endif
reply other threads:[~2007-06-19 19:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1182282091.15228.19.camel@localhost.localdomain \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox