[LAD] Realtime threads and security

torbenh torbenh at gmx.de
Fri Feb 18 11:18:52 UTC 2011


On Thu, Feb 17, 2011 at 10:04:31PM +0000, Fons Adriaensen wrote:
> On Thu, Feb 17, 2011 at 10:53:54PM +0100, Robin Gareus wrote:
>  
> > /proc/sys/kernel/sched_rt_runtime_us
> > /proc/sys/kernel/sched_rt_period_us
> > 
> > > I've been told than on OSX, when a process runs in realtime, it is only allowed
> > > to use a certain ratio of CPU time. And if it goes over this limit, it loses its
> > > priority. Is there something comparable on Linux? Maybe with the files in
> > > /proc/sys that you mention?
> > 
> > not exactly. /proc kernel.sched_rt_runtime_us globally limits realtime
> > scheduling time. To limit it per process you'll need cgroups.
>  
> Still this provides protection against any RT-process that goes
> out of control. If the limit is exceeded, all RT procs will be
> blocked for the next sched_rt_period_us (default seems to be 1s),
> which should give you the opportunity to kill the offending process.
> 
> There seem to be some restrictions on runtime / period, this must
> be between 0.95 and 1.00 or zero. Which means that in order to adjust
> period you first need to set runtime to zero, then adjust period, then
> reset runtime to a value within the accepted range.

if that restriction exists, its a bug.
i remember that i successfully set the ratio to 0.1 ...


> 
> -- 
> FA
> 
> _______________________________________________
> Linux-audio-dev mailing list
> Linux-audio-dev at lists.linuxaudio.org
> http://lists.linuxaudio.org/listinfo/linux-audio-dev

-- 
torben Hohn



More information about the Linux-audio-dev mailing list