linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* One Interrupted Threads per Interrupt line?
@ 2011-06-04 11:48 Monica Puig-Pey
  2011-06-04 12:03 ` I/O operations priority in RTOS Monica Puig-Pey
  0 siblings, 1 reply; 34+ messages in thread
From: Monica Puig-Pey @ 2011-06-04 11:48 UTC (permalink / raw)
  To: linux-rt-users, linux-kernel

Hi,

I'm using Ubuntu 10.04 with the 2.6.31-11-rt patch installed. I'm 
developing a PCI device driver using hardware interrupts.
I read in the “Internals of the RT Patch” document 
(http://www.kernel.org/doc/ols/2007/ols2007v2-pages-161-172.pdf ) that 
when a device driver requests an IRQ, a thread is created to service 
this interrupt line (Threaded interrupts). Only ONE thread can be 
created per interrupt line, so shared interrupts are still handled by a 
single thread.

My driver requests IRQ 16, which is shared with others handlers. Typing 
on the shell  $ps -eo pid,pri,rtprio,cmd I can see my driver requesting 
irq 16 and with 50 RTPRIO. At the same time I can see the others drivers 
requesting IRQ 16 with different real time priorities than mine( 80, 85, 
50). Does this mean that there are more than ONE Threaded Interrupts for 
IRQ 16? or it's just the thread priority when running each handler for 
IRQ 16?
Finally, how could I change the 50 RT PRIO for my handler pci_9111?

Here you have the shell:

   PID PRI RTPRIO CMD

   658 120     80 [irq/16-uhci_hcd]
  3852 125     85 [irq/16-HDA Inte]
  4303  90     50 [irq/16-radeon@p]
  5863  90     50 [irq/16-pci_9111]
  5865  19      - ps -eo pid,pri,rtprio,cmd


Thank you very much,

Mónica

^ permalink raw reply	[flat|nested] 34+ messages in thread
* Re: Changing Kernel thread priorities
@ 2011-06-06 12:10 Johannes Bauer
  2011-06-06 22:36 ` Peter Zijlstra
  0 siblings, 1 reply; 34+ messages in thread
From: Johannes Bauer @ 2011-06-06 12:10 UTC (permalink / raw)
  To: Monica Puig-Pey, Rolando Martins; +Cc: linux-rt-users, linux-kernel

Hi!

i thought i sent you the discussion already...

But again, here is how Remy Bohmer does it using the same sched_setscheduler call!
http://www.mail-archive.com/linux-rt-users@vger.kernel.org/msg01046.html

If it does not help you, i woul dsuggest to post your code, maybe this would help people to help you...

regards JB



----- Ursprüngliche Nachricht -----
Von: "Monica Puig-Pey" <puigpeym@unican.es>
Erhalten: 06.06.2011 13:58
An: "Rolando Martins" <rolando.martins@gmail.com>

El 06/06/11 13:54, Rolando Martins escribió:
> Hi,
> I use the following:
>
> PIDs=$(ps -eLo pid,cls,rtprio,pri,nice,cmd | grep -i "irq" | awk '{
> print $1; }' | xargs echo)
> for i in $PIDs
> do
> ret=$(chrt -f -p 99 $i)
> done
>
> This will change the kernel thread associated with an irq handler to
> RT FIFO prio 99.
> Just change the script to your specific interrupt.
>
> Hope it helps,
> Rolando
>
> On Mon, Jun 6, 2011 at 12:47 PM, Monica Puig-Pey wrote:
>> I am writing a driver which has one kernel thread associated with it.
>> I want to change the priority of this thread, so that I can specify the
>> order in which it is scheduled following an interrupt.
>> I'm using:
>>
>> sched_setscheduler(struct task_struct *, int, struct sched_param *);
>>
>> but it doesn't work. I tried to change the priority from the init_module,
>> and also from the Kernel Thread, but there is no way.
>>
>> Kernel version is 2.6.31-11-rt
>>
>> What do I call to change a kernel thread priority?
>>
>> Thanks you very much
>>
>> Mónica
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>

I need to change the priority from inside the driver, when creating the 
kernel thread.
Your script is useful but it is done in user context,
Any other help please?

Mónica


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

^ permalink raw reply	[flat|nested] 34+ messages in thread
* Re: Changing Kernel thread priorities
@ 2011-06-07  8:27 Johannes Bauer
  2011-06-07  8:41 ` Thomas Gleixner
  0 siblings, 1 reply; 34+ messages in thread
From: Johannes Bauer @ 2011-06-07  8:27 UTC (permalink / raw)
  To: Peter Zijlstra, hannes_bauer
  Cc: Monica Puig-Pey, Rolando Martins, linux-rt-users, linux-kernel, tglx

Absolutly correct!

However, if you are running the system on an embedded platform, where the _WHOLE_ system (including priorities) is preconfigured and never touched, starting a irq thread with the right prio from start is a more straightforward method than having to invoke a script that changes it using userspace chrt tool.

Regards JB
----- Ursprüngliche Nachricht -----
Von: "Peter Zijlstra" <peterz@infradead.org>
Erhalten: 07.06.2011 00:36
An: hannes_bauer@aon.at

"Monica Puig-Pey" wrote:
> 
> I need to change the priority from inside the driver, when creating the 
> kernel thread.

No you don't. How does you driver know about what priority is correct
wrt all the other running RT tasks on the system?

Determining the right priority in a fixed priority scheduling system is
a system wide problem, nobody but the administrator can possibly even
begin to solve it.

There's a reason all RT irq threads are started at 50, its plain
impossible to do better.

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

^ permalink raw reply	[flat|nested] 34+ messages in thread
[parent not found: <17185480.5304.1307435255996.JavaMail.root@WARSBL214.highway.tel ekom.at>]

end of thread, other threads:[~2011-06-11 17:39 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-04 11:48 One Interrupted Threads per Interrupt line? Monica Puig-Pey
2011-06-04 12:03 ` I/O operations priority in RTOS Monica Puig-Pey
2011-06-04 12:30   ` kernel threads in drivers using the RT patch Monica Puig-Pey
2011-06-06 11:47     ` Changing Kernel thread priorities Monica Puig-Pey
2011-06-06 11:54       ` Rolando Martins
2011-06-06 11:58         ` Monica Puig-Pey
2011-06-06 16:49           ` Mark Hounschell
2011-06-07  8:40             ` Monica Puig-Pey
2011-06-07  9:14               ` Mark Hounschell
2011-06-07  9:46                 ` Mark Hounschell
2011-06-07 18:34                   ` Monica Puig-Pey
2011-06-07 18:55                     ` Mark Hounschell
2011-06-10 10:12                       ` Monica Puig-Pey
2011-06-06 18:20       ` Armin Steinhoff
2011-06-06 12:10 Johannes Bauer
2011-06-06 22:36 ` Peter Zijlstra
2011-06-07  8:27 Johannes Bauer
2011-06-07  8:41 ` Thomas Gleixner
2011-06-07  9:40   ` Armin Steinhoff
2011-06-07  9:37     ` Peter Zijlstra
2011-06-07 11:02       ` Remy Bohmer
2011-06-07 14:14         ` Peter Zijlstra
2011-06-07 14:57           ` Lucas De Marchi
2011-06-07 15:15           ` Thomas Gleixner
2011-06-07 23:38             ` Nicholas Mc Guire
2011-06-07 23:35         ` Nicholas Mc Guire
2011-06-08 17:50           ` Remy Bohmer
2011-06-08 19:49             ` Thomas Gleixner
2011-06-10 14:04               ` Remy Bohmer
2011-06-10 15:37                 ` Thomas Gleixner
2011-06-11 17:16                   ` Remy Bohmer
2011-06-09 11:19             ` Nicholas Mc Guire
     [not found] <17185480.5304.1307435255996.JavaMail.root@WARSBL214.highway.tel ekom.at>
     [not found] ` <17185480.5304.1307435255996.JavaMail.root@WARSBL214.highway.te lekom.at>
2011-06-07  8:32   ` Monica Puig-Pey
2011-06-07  8:43     ` Thomas Gleixner

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).