Re: Considerations on sched APIs under RT patch

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Bjoern Brandenburg
Date: Thursday, April 22, 2010 - 10:48 am

On Apr 22, 2010, at 12:28 PM, Peter Zijlstra wrote:

Since that reference is a bit coarse-grained, let me clarify by pointing out the actual implementation.

In particular, if you look at /usr/include/mach/thread_policy.h (on OS X, of course), you'll find:


I.e., THREAD_TIME_CONSTRAINT_POLICY implements the sporadic task model.

Global EDF is implemented in osfmk/kern/sched_prim.c (line numbers pertain to XNU 1504.3.12):

In line 473:


Further, in choose_processor() starting at line 26:


And in thread_setrun() at line 2482:



This Global EDF implementation might have been inherited from RT Mach, but I'm not sure about that. 

In LITMUS^RT [1], we implement Global EDF a bit differently. Instead of iterating over all processors, we keep the processors in a max heap (ordered by deadline, with no RT task == infinity). The xnu variant may be beneficial if you only expect a few RT tasks at any time, whereas ours is based on the assumption that most processors will be scheduling RT tasks most of the time.

- Björn

[1] http://www.cs.unc.edu/~anderson/litmus-rt (The posted patch is horribly out of date; we'll have something more recent based on 2.6.32 up soon.)

---
Björn B. Brandenburg
Ph.D. Candidate 
Dept. of Computer Science
University of North Carolina at Chapel Hill
http://www.cs.unc.edu/~bbb




--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Considerations on sched APIs under RT patch, Primiano Tucci, (Mon Apr 19, 1:48 pm)
Re: Considerations on sched APIs under RT patch, Peter Zijlstra, (Tue Apr 20, 2:20 am)
Re: Considerations on sched APIs under RT patch, Primiano Tucci, (Tue Apr 20, 2:56 pm)
Re: Considerations on sched APIs under RT patch, Steven Rostedt, (Tue Apr 20, 4:00 pm)
Re: Considerations on sched APIs under RT patch, Primiano Tucci, (Tue Apr 20, 10:16 pm)
Re: Considerations on sched APIs under RT patch, Peter Zijlstra, (Wed Apr 21, 1:49 am)
Re: Considerations on sched APIs under RT patch, Steven Rostedt, (Wed Apr 21, 5:46 am)
Re: Considerations on sched APIs under RT patch, Peter Zijlstra, (Wed Apr 21, 5:56 am)
Re: Considerations on sched APIs under RT patch, Primiano Tucci, (Wed Apr 21, 12:24 pm)
Re: Considerations on sched APIs under RT patch, Peter Zijlstra, (Wed Apr 21, 12:57 pm)
Re: Considerations on sched APIs under RT patch, Primiano Tucci, (Wed Apr 21, 1:38 pm)
Re: Considerations on sched APIs under RT patch, Peter Zijlstra, (Wed Apr 21, 1:58 pm)
Re: Considerations on sched APIs under RT patch, Steven Rostedt, (Thu Apr 22, 6:20 am)
Re: Considerations on sched APIs under RT patch, Primiano Tucci, (Thu Apr 22, 6:50 am)
Re: Considerations on sched APIs under RT patch, Peter Zijlstra, (Thu Apr 22, 6:57 am)
Re: Considerations on sched APIs under RT patch, Primiano Tucci, (Thu Apr 22, 8:40 am)
Re: Considerations on sched APIs under RT patch, Peter Zijlstra, (Thu Apr 22, 9:28 am)
Re: Considerations on sched APIs under RT patch, Bjoern Brandenburg, (Thu Apr 22, 10:48 am)
Re: Considerations on sched APIs under RT patch, Primiano Tucci, (Thu Apr 22, 12:33 pm)
Re: Considerations on sched APIs under RT patch, Thomas Gleixner, (Tue Apr 27, 6:18 am)