linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG+PATCH] RT-Preempt: IRQ threads running at prio 0 SCHED_OTHER
@ 2006-12-19 20:52 Remy Bohmer
  2006-12-19 21:24 ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Remy Bohmer @ 2006-12-19 20:52 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1031 bytes --]

Hello Ingo,

I am using your yum-distributed kernel 2.6.19.1-rt15, and
unfortunately I experienced very worse latencies.
It turned out that ALL the IRQ threads were all running at prio 0, SCHED_OTHER.

Looking at the current code in kernel/irq/manage.c, the goal was to
put them at MAX_RT_PRIO, but the call to sys_sched_setscheduler()
fails with EINVAL. I have attached a patch to set them to
(MAX_RT_PRIO-1). This works.

Further I believe that each application of the RT-kernel requires a
different configuration of these thread-priorities and I prefer to
reconfigure these prios from userland during boot. As these
threadnames contain whitespaces in its name, they make the
shell-scripts unnecessary complex that I use to reconfigure the thread
priorities.
So, I would prefer a slight modification of the names: The attached
patch also changes the names from [IRQ nn] to [IRQ-nn]. I hope that
you agree with me here. (If not, I stick to do this patch each time
myself ;-) )

Kind Regards,

Remy Böhmer

[-- Attachment #2: fix-kernel-irq-thread-prio.patch --]
[-- Type: application/octet-stream, Size: 803 bytes --]

--- linux-2.6.19.i686/kernel/irq/manage.c.orig	2006-12-18 22:59:59.000000000 +0100
+++ linux-2.6.19.i686/kernel/irq/manage.c	2006-12-19 21:22:09.000000000 +0100
@@ -692,9 +692,9 @@
 	current->flags |= PF_NOFREEZE | PF_HARDIRQ;
 
 	/*
-	 * Scale irq thread priorities from prio 50 to prio 25
+	 * Scale irq thread priorities to prio 99
 	 */
-	param.sched_priority = MAX_RT_PRIO;
+	param.sched_priority = MAX_RT_PRIO-1;
 
 	sys_sched_setscheduler(current->pid, SCHED_FIFO, &param);
 
@@ -725,7 +725,7 @@
 	if (desc->thread || !ok_to_create_irq_threads)
 		return 0;
 
-	desc->thread = kthread_create(do_irqd, desc, "IRQ %d", irq);
+	desc->thread = kthread_create(do_irqd, desc, "IRQ-%d", irq);
 	if (!desc->thread) {
 		printk(KERN_ERR "irqd: could not create IRQ thread %d!\n", irq);
 		return -ENOMEM;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG+PATCH] RT-Preempt: IRQ threads running at prio 0 SCHED_OTHER
  2006-12-19 20:52 [BUG+PATCH] RT-Preempt: IRQ threads running at prio 0 SCHED_OTHER Remy Bohmer
@ 2006-12-19 21:24 ` Ingo Molnar
  2006-12-19 21:37   ` Clark Williams
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Molnar @ 2006-12-19 21:24 UTC (permalink / raw)
  To: linux; +Cc: linux-kernel, Clark Williams


* Remy Bohmer <l.pinguin@gmail.com> wrote:

> Hello Ingo,
> 
> I am using your yum-distributed kernel 2.6.19.1-rt15, and 
> unfortunately I experienced very worse latencies. It turned out that 
> ALL the IRQ threads were all running at prio 0, SCHED_OTHER.
> 
> Looking at the current code in kernel/irq/manage.c, the goal was to 
> put them at MAX_RT_PRIO, but the call to sys_sched_setscheduler() 
> fails with EINVAL. I have attached a patch to set them to 
> (MAX_RT_PRIO-1). This works.

oops - my intention was to set all IRQs and softirqs to SCHED_FIFO prio 
50. I have fixed that now in my tree.

prio 99 is pretty extensive and makes it hard to move tasks 'above' 
hardirq priority, without setting the priority of /every/ IRQ thread. So 
i picked SCHED_FIFO:50 - at exact half way.

> Further I believe that each application of the RT-kernel requires a 
> different configuration of these thread-priorities and I prefer to 
> reconfigure these prios from userland during boot. As these 
> threadnames contain whitespaces in its name, they make the 
> shell-scripts unnecessary complex that I use to reconfigure the thread 
> priorities.

ok - lets try it. Clark: does this impact the set_kthread_prio utility? 
I've changed "IRQ 123" to "IRQ-123" to make pidof & friends work better.

	Ingo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG+PATCH] RT-Preempt: IRQ threads running at prio 0 SCHED_OTHER
  2006-12-19 21:24 ` Ingo Molnar
@ 2006-12-19 21:37   ` Clark Williams
  0 siblings, 0 replies; 3+ messages in thread
From: Clark Williams @ 2006-12-19 21:37 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux, linux-kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ingo Molnar wrote:
> 
> ok - lets try it. Clark: does this impact the set_kthread_prio utility? 
> I've changed "IRQ 123" to "IRQ-123" to make pidof & friends work better.

Yes it does, but I believe I can fix that. Most of the logic is in awk
and I believe one call to sub() will handle the change.

Clark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFFiFutHyuj/+TTEp0RAjKlAKCaVK8hf4jY6ZUIZ0Ixc56lhSUcHgCgoqT0
HiDbdVXrwY/LYlZN7AFwHOI=
=1YgX
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-12-19 21:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-19 20:52 [BUG+PATCH] RT-Preempt: IRQ threads running at prio 0 SCHED_OTHER Remy Bohmer
2006-12-19 21:24 ` Ingo Molnar
2006-12-19 21:37   ` Clark Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).