All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Linux scheduling question
@ 2011-09-09 19:08 Jeremy Friesner
  2011-09-09 19:40 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 2+ messages in thread
From: Jeremy Friesner @ 2011-09-09 19:08 UTC (permalink / raw)
  To: xenomai

Hi all,

In the bad old days, when I was running my software on a 233MHz PowerPC computer with (non-Xenomai) Linux, I could instantly hang the machine using the following code:

	struct sched_param schedparam; 
	memset(&schedparam, 0, sizeof(schedparam));
	schedparam.sched_priority = 11;
	if (sched_setscheduler(0, SCHED_RR, &schedparam) != 0) perror("sched_setscheduler");
	while(1) {/* spin forever, wheee! */}

To recover I would have to power-cycle, since there was no way to kill the spinning process.

Now my software runs on a quad-core Xeon under Xenomai, so I would expect that it would take four simultaneous instances of the above to hang the Linux layers of the machine (the Xenomai real-time bits should still run, of course).  However, that is not what I am seeing.... I can run 4, 8, or even 12 SCHED_RR (or SCHED_FIFO) spinning processes like the above, and my regular (SCHED_OTHER) Linux process continue to respond (albeit sometimes rather slowly).

Can anyone hazard a guess as to why I'm unable to spin my Linux OS to death?  I'm curious... :^)

Jeremy



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

* Re: [Xenomai-help] Linux scheduling question
  2011-09-09 19:08 [Xenomai-help] Linux scheduling question Jeremy Friesner
@ 2011-09-09 19:40 ` Gilles Chanteperdrix
  0 siblings, 0 replies; 2+ messages in thread
From: Gilles Chanteperdrix @ 2011-09-09 19:40 UTC (permalink / raw)
  To: Jeremy Friesner; +Cc: xenomai

On 09/09/2011 09:08 PM, Jeremy Friesner wrote:
> Hi all,
> 
> In the bad old days, when I was running my software on a 233MHz
> PowerPC computer with (non-Xenomai) Linux, I could instantly hang the
> machine using the following code:
> 
> struct sched_param schedparam; memset(&schedparam, 0,
> sizeof(schedparam)); schedparam.sched_priority = 11; if
> (sched_setscheduler(0, SCHED_RR, &schedparam) != 0)
> perror("sched_setscheduler"); while(1) {/* spin forever, wheee! */}
> 
> To recover I would have to power-cycle, since there was no way to
> kill the spinning process.
> 
> Now my software runs on a quad-core Xeon under Xenomai, so I would
> expect that it would take four simultaneous instances of the above to
> hang the Linux layers of the machine (the Xenomai real-time bits
> should still run, of course).  However, that is not what I am
> seeing.... I can run 4, 8, or even 12 SCHED_RR (or SCHED_FIFO)
> spinning processes like the above, and my regular (SCHED_OTHER) Linux
> process continue to respond (albeit sometimes rather slowly).
> 
> Can anyone hazard a guess as to why I'm unable to spin my Linux OS to
> death?  I'm curious... :^)

That is because SCHED_FIFO and SCHED_RR tasks can only use
/proc/sys/kernel/sched_rt_runtime_us every
/proc/sys/kernel/sched_rt_period_us.

-- 
                                                                Gilles.


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

end of thread, other threads:[~2011-09-09 19:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-09 19:08 [Xenomai-help] Linux scheduling question Jeremy Friesner
2011-09-09 19:40 ` Gilles Chanteperdrix

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.