From: john stultz <johnstul@us.ibm.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: lkml <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Steven Rostedt <rostedt@goodmis.org>
Subject: [RFC][PATCH -rt] irqd starvation on SMP by a single process?
Date: Thu, 11 May 2006 19:43:32 -0700 [thread overview]
Message-ID: <1147401812.1907.14.camel@cog.beaverton.ibm.com> (raw)
Hey Ingo,
I've been seeing some odd behavior recently w/ the irq smp_affinity
masks. With a single runaway -rt thread, we were getting hard hangs on
an SMP system.
Clearly, if the runaway -rt thread is running on a cpu that is getting
critical interrupts (scsi, network, etc), a system hang would be
expected. However I started playing with the proc/irq/<num>/smp_affinity
masks and got some odd behavior.
Using taskset and a small script that sets all the irq smp_affinity
values, I got the following.
./irqbind.sh 1 ; taskset 1 ./runaway = HANG (as expected)
./irqbind.sh 1 ; taskset 2 ./runaway = NO HANG (as expected)
./irqbind.sh 2 ; taskset 1 ./runaway = NO HANG (as expected)
./irqbind.sh 2 ; taskset 2 ./runaway = HANG (as expected)
Everything is cool. However, I figured we could set the irq smp_affinity
mask to multiple cpus so a runaway thread could not cause a hang.
./irqbind.sh 3 ; taskset 1 ./runaway = Sometimes hang
./irqbind.sh 3 ; taskset 2 ./runaway = !Sometime hang
Basically it appeared that while the irq smp_affinity mask was set for
both cpus, the irq was really being delivered to only one cpu. Looking
at the code, sure enough, that is the case.
The patch below appears to correct this issue, however it also
repeatedly(on different irqs) causes the following BUG:
BUG: using smp_processor_id() in preemptible [00000000] code: IRQ 24/1518
caller is __do_softirq+0x10/0x51
[<c0263bc3>] debug_smp_processor_id+0x7b/0x88 (8)
[<c0126936>] __do_softirq+0x10/0x51 (12)
[<c0141195>] do_irqd+0xd8/0x10e (12)
[<c013250f>] kthread+0x7c/0xa6 (24)
[<c0132493>] kthread+0x0/0xa6 (20)
[<c0101041>] kernel_thread_helper+0x5/0xb (16)
---------------------------
| preempt count: 00000001 ]
| 1-level deep critical section nesting:
----------------------------------------
.. [<c0263b83>] .... debug_smp_processor_id+0x3b/0x88
.....[<00000000>] .. ( <= rest_init+0x3feffd64/0x3d)
------------------------------
| showing all locks held by: | (IRQ 24/1518 [f7b11070, 60]):
Thoughts?
-john
--- 2.6-rt/kernel/irq/manage.c 2006-05-11 18:37:36.000000000 -0500
+++ dev-rt/kernel/irq/manage.c 2006-05-11 21:09:10.000000000 -0500
@@ -731,10 +731,8 @@
/*
* Did IRQ affinities change?
*/
- if (!cpu_isset(smp_processor_id(), irq_affinity[irq])) {
- mask = cpumask_of_cpu(any_online_cpu(irq_affinity[irq]));
- set_cpus_allowed(current, mask);
- }
+ if(!cpus_equal(current->cpus_allowed, irq_affinity[irq]));
+ set_cpus_allowed(current, irq_affinity[irq]);
#endif
schedule();
}
next reply other threads:[~2006-05-12 2:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-12 2:43 john stultz [this message]
2006-05-12 5:50 ` Ingo Molnar
2006-05-12 7:59 ` Steven Rostedt
2006-05-12 8:10 ` Ingo Molnar
2006-05-12 11:39 ` Mark Hounschell
2006-05-12 11:56 ` Ingo Molnar
2006-05-12 11:59 ` Mark Hounschell
2006-05-12 12:53 ` Mark Hounschell
2006-05-12 13:03 ` Steven Rostedt
2006-05-12 13:06 ` Mark Hounschell
2006-05-12 13:19 ` Mark Hounschell
2006-05-12 17:47 ` john stultz
2006-05-12 18:04 ` john stultz
2006-05-12 19:16 ` Mark Hounschell
2006-05-12 20:04 ` Mark Hounschell
2006-05-12 4:22 Edward Killips
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=1147401812.1907.14.camel@cog.beaverton.ibm.com \
--to=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
--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
all inboxes | Powered by JetHome®