Re: [PATCH] RFC: Set irq thread to RT priority on creation

From: Steven Rostedt
Date: Thu May 30 2013 - 10:53:37 EST


On Thu, 2013-05-30 at 14:12 +0200, Ivo Sieben wrote:

> kernel/irq/manage.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
> index fa17855..0ffe37b 100644
> --- a/kernel/irq/manage.c
> +++ b/kernel/irq/manage.c
> @@ -950,6 +950,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);
> @@ -957,6 +960,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, &param);
> +

If you are adding this here, might as well remove the
sched_set_scheduler() from irq_thread() as well. No need to do it twice.

-- Steve

> /*
> * We keep the reference to the task struct even if
> * the thread dies to avoid that the interrupt code


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/