diff options
author | Ivo Sieben <meltedpianoman@gmail.com> | 2013-06-03 10:12:02 +0000 |
---|---|---|
committer | Steven Rostedt <rostedt@rostedt.homelinux.com> | 2014-03-24 18:27:09 -0400 |
commit | 55741d8d1309c30b626dcc0579694fd61a5d9295 (patch) | |
tree | 63bdbffa6ddfb37606cd30a69d324a0c67aedffd | |
parent | 71954e631aa20bc7ce4cde6d5cf7ca2b3cce2dc2 (diff) |
genirq: Set irq thread to RT priority on creation
When a threaded irq handler is installed the irq thread is initially
created on normal scheduling priority. Only after the irq thread is
woken up it sets its priority to RT_FIFO MAX_USER_RT_PRIO/2 itself.
This means that interrupts that occur directly after the irq handler
is installed will be handled on a normal scheduling priority instead
of the realtime priority that one would expect.
Fix this by setting the RT priority on creation of the irq_thread.
Cc: stable-rt@vger.kernel.org
Signed-off-by: Ivo Sieben <meltedpianoman@gmail.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1370254322-17240-1-git-send-email-meltedpianoman@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
-rw-r--r-- | kernel/irq/manage.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 9e1a7716e86f..12ebfe3fa162 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -796,9 +796,6 @@ static void wake_threads_waitq(struct irq_desc *desc) */ static int irq_thread(void *data) { - static const struct sched_param param = { - .sched_priority = MAX_USER_RT_PRIO/2, - }; struct irqaction *action = data; struct irq_desc *desc = irq_to_desc(action->irq); irqreturn_t (*handler_fn)(struct irq_desc *desc, @@ -810,7 +807,6 @@ static int irq_thread(void *data) else handler_fn = irq_thread_fn; - sched_setscheduler(current, SCHED_FIFO, ¶m); current->irq_thread = 1; while (!irq_wait_for_interrupt(action)) { @@ -943,6 +939,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) */ if (new->thread_fn && !nested) { struct task_struct *t; + static const struct sched_param param = { + .sched_priority = MAX_USER_RT_PRIO/2, + }; t = kthread_create(irq_thread, new, "irq/%d-%s", irq, new->name); @@ -950,6 +949,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) ret = PTR_ERR(t); goto out_mput; } + + sched_setscheduler(t, SCHED_FIFO, ¶m); + /* * We keep the reference to the task struct even if * the thread dies to avoid that the interrupt code |