All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3.4.62-rt77] fix irq thread scheduling
@ 2013-09-19  9:02 Thomas Pfaff
  2013-10-04 14:05 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Pfaff @ 2013-09-19  9:02 UTC (permalink / raw)
  To: tglx, linux-rt-users, rostedt

If an irq is requested during device open, for example by opening a serial 
device, then request_irq is called in the context of the opening process.
If the process lacks off CAP_SYS_NICE the irq thread is running with SCHED_OTHER 
priority.

The problem exists in other real time patches as well, 3.10 seems to be ok.

Signed-off-by: Thomas Pfaff <tpfaff@pcs.com>
---
diff -urp linux-3.4.62-rt.old/kernel/irq/manage.c linux-3.4.62-rt/kernel/irq/manage.c
--- linux-3.4.62-rt.old/kernel/irq/manage.c	2013-09-16 10:13:15.365559288 +0200
+++ linux-3.4.62-rt/kernel/irq/manage.c	2013-09-19 10:22:40.092831656 +0200
@@ -1024,7 +1024,7 @@ __setup_irq(unsigned int irq, struct irq
 			goto out_mput;
 		}
 
-		sched_setscheduler(t, SCHED_FIFO, &param);
+		sched_setscheduler_nocheck(t, SCHED_FIFO, &param);
 
 		/*
 		 * We keep the reference to the task struct even if

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

* Re: [PATCH 3.4.62-rt77] fix irq thread scheduling
  2013-09-19  9:02 [PATCH 3.4.62-rt77] fix irq thread scheduling Thomas Pfaff
@ 2013-10-04 14:05 ` Sebastian Andrzej Siewior
  2013-10-08 13:58   ` Thomas Pfaff
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-10-04 14:05 UTC (permalink / raw)
  To: Thomas Pfaff; +Cc: tglx, linux-rt-users, rostedt

* Thomas Pfaff | 2013-09-19 11:02:57 [+0200]:

>If an irq is requested during device open, for example by opening a serial 
>device, then request_irq is called in the context of the opening process.
>If the process lacks off CAP_SYS_NICE the irq thread is running with SCHED_OTHER 
>priority.
>
>The problem exists in other real time patches as well, 3.10 seems to be ok.

Hmmm. I see the same check in v3.10 compared to v3.6 which so I *think*
v3.10 has the same problem.
However this does not look to be -RT specific, you should see the same
problem in mainline, too. Could you please verify whether this does
affect v3.10? And if it does, we should try to fix up it upstream, too

Sebastian

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

* Re: [PATCH 3.4.62-rt77] fix irq thread scheduling
  2013-10-04 14:05 ` Sebastian Andrzej Siewior
@ 2013-10-08 13:58   ` Thomas Pfaff
  2013-10-08 14:12     ` Thomas Pfaff
  2013-10-11 10:58     ` Sebastian Andrzej Siewior
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Pfaff @ 2013-10-08 13:58 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: tglx, linux-rt-users, rostedt



On Fri, 4 Oct 2013, Sebastian Andrzej Siewior wrote:

> * Thomas Pfaff | 2013-09-19 11:02:57 [+0200]:
> 
> >If an irq is requested during device open, for example by opening a serial 
> >device, then request_irq is called in the context of the opening process.
> >If the process lacks off CAP_SYS_NICE the irq thread is running with SCHED_OTHER 
> >priority.
> >
> >The problem exists in other real time patches as well, 3.10 seems to be ok.
> 
> Hmmm. I see the same check in v3.10 compared to v3.6 which so I *think*
> v3.10 has the same problem.
> However this does not look to be -RT specific, you should see the same
> problem in mainline, too. Could you please verify whether this does
> affect v3.10? And if it does, we should try to fix up it upstream, too
> 

I did a quick check with 3.10.14-rt9 and it is not affected, because 
sched_setscheduler is called in the context of the irq thread as the mainline 
kernel does, but the 3.6 rt patch moved this into __setup_irq.

Thomas

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

* Re: [PATCH 3.4.62-rt77] fix irq thread scheduling
  2013-10-08 13:58   ` Thomas Pfaff
@ 2013-10-08 14:12     ` Thomas Pfaff
  2013-10-11 10:58     ` Sebastian Andrzej Siewior
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Pfaff @ 2013-10-08 14:12 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: tglx, linux-rt-users, rostedt



On Tue, 8 Oct 2013, Pfaff Thomas wrote:

> 
> 
> On Fri, 4 Oct 2013, Sebastian Andrzej Siewior wrote:
> 
> > * Thomas Pfaff | 2013-09-19 11:02:57 [+0200]:
> > 
> > >If an irq is requested during device open, for example by opening a serial 
> > >device, then request_irq is called in the context of the opening process.
> > >If the process lacks off CAP_SYS_NICE the irq thread is running with SCHED_OTHER 
> > >priority.
> > >
> > >The problem exists in other real time patches as well, 3.10 seems to be ok.
> > 
> > Hmmm. I see the same check in v3.10 compared to v3.6 which so I *think*
> > v3.10 has the same problem.
> > However this does not look to be -RT specific, you should see the same
> > problem in mainline, too. Could you please verify whether this does
> > affect v3.10? And if it does, we should try to fix up it upstream, too
> > 
> 
> I did a quick check with 3.10.14-rt9 and it is not affected, because 
> sched_setscheduler is called in the context of the irq thread as the mainline 
> kernel does, but the 3.6 rt patch moved this into __setup_irq.

Sorry, should have been 3.4 rt patch.

Thomas

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

* Re: [PATCH 3.4.62-rt77] fix irq thread scheduling
  2013-10-08 13:58   ` Thomas Pfaff
  2013-10-08 14:12     ` Thomas Pfaff
@ 2013-10-11 10:58     ` Sebastian Andrzej Siewior
  1 sibling, 0 replies; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-10-11 10:58 UTC (permalink / raw)
  To: Thomas Pfaff; +Cc: tglx, linux-rt-users, rostedt

* Thomas Pfaff | 2013-10-08 15:58:50 [+0200]:

>I did a quick check with 3.10.14-rt9 and it is not affected, because 
>sched_setscheduler is called in the context of the irq thread as the mainline 
>kernel does, but the 3.6 rt patch moved this into __setup_irq.

Thanks for that report. It looks that this is broken upstream as well.
I'm going to merge the patch that broke it, your fix and try to do the
same for upstream.

>Thomas

Sebastian

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

end of thread, other threads:[~2013-10-11 10:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-19  9:02 [PATCH 3.4.62-rt77] fix irq thread scheduling Thomas Pfaff
2013-10-04 14:05 ` Sebastian Andrzej Siewior
2013-10-08 13:58   ` Thomas Pfaff
2013-10-08 14:12     ` Thomas Pfaff
2013-10-11 10:58     ` Sebastian Andrzej Siewior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.