Re: Setting the priority of an IRQ thread

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 16 Jun 2009, Martin Shepherd wrote:
> #ifdef CONFIG_PREEMPT_HARDIRQS
> 
> int set_irq_thread_prio(unsigned int irq, int prio)
> {
>         struct irq_desc *desc = irq_to_desc(irq);
>         struct sched_param param = { 0, };
>         int status;
> 
>         param.sched_priority = prio;
> 
>         if(desc) {
>                 read_lock(&tasklist_lock);
>                 if(desc->thread)

That's racy. desc->thread can go away between the check and the
call. That needs locking of desc->lock, but that might have other
implications. Need to have a closer look at the semantics.

>                         status = sched_setscheduler(desc->thread, SCHED_FIFO,
>                                                     &param);
>                 else
>                         status = -ENODEV;
>                 read_unlock(&tasklist_lock);
>         } else {
>                 status = -ENODEV;
>         }
>         return status;
> }
> 
> EXPORT_SYMBOL(set_irq_thread_prio);

EXPORT_SYMBOL_GPL if any.

OTOH, I think that as I said in the other reply already that none of
this magic is really necessary. We need some sysfs based information
of the thread id in addition to the irq nr which is already
there. Then you can just use sched_setscheduler(2) or chrt(1) from user
space. You can do this already, the irq information in sysfs is
already there you just have to decode output of ps(1) to find the IRQ
thread.

Thanks,

	tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux