CFS scheduler: documentation about scheduling policies
PATCH 1/1 CFS scheduler: documentation about scheduling policies
The documentation about the CFS scheduler is scarse when it comes to scheduling policies. This patch adds a chapter about the scheduling policies it supports. Peter Zijlstra provided most of the information for it in
http://marc.info/?l=linux-kernel&m=122210038326356&w=2
This patch is based on 2.6.27-rc7.
---
sched-design-CFS.txt 2008-09-23 10:33:01.107393509 +0200 renamed from sched-design-CFS.txt-2.6.27-rc7 2008-07-13 23:51:29.000000000 +0200 +23 -0
@@ -118,6 +118,29 @@ Some implementation details: quite a bit simpler as a result. +Supported scheduling policies +============================= + +CFS implements three scheduling policies: + + - SCHED_NORMAL (traditionally called SCHED_OTHER): The scheduling + policy that is used for regular tasks. + + - SCHED_BATCH: Does not preempt nearly as often as regular tasks + would, thereby allowing tasks to run longer and make better use of + caches but at the cost of interactivity. This is well suited for + batch jobs. + + - SCHED_IDLE: This is even weaker than nice 19, but its not a true + idle timer scheduler in order to avoid to get into priority + inversion problems which would deadlock the machine. + +SCHED_FIFO/_RR are implemented in sched_rt.c and are as specified by +POSIX. + +The command chrt from util-linux-ng 2.13.1.1 can set all of these except +SCHED_IDLE. + Group scheduler extension to CFS ================================
Signature · 2 lines
Martin Steigerwald - team(ix) GmbH - http://www.teamix.de gpg: 19E3 8D42 896F D004 08AC A0CA 1E10 C593 0399 AE90
Quoted 9 lines · Martin Steigerwald
The documentation about the CFS scheduler is scarse when it comes to scheduling policies. This patch adds a chapter about the scheduling policies it supports. Peter Zijlstra provided most of the information for it in
http://marc.info/?l=linux-kernel&m=122210038326356&w=2
This patch is based on 2.6.27-rc7.
Signed-off-by Martin Steigerwald <[email protected]>
looks good to me - but could you please do the patch against the latest scheduler tree, which has already updated this file (and which made your patch not apply cleanly):
http://people.redhat.com/mingo/tip.git/README
also:
sched-design-CFS.txt 2008-09-23 10:33:01.107393509 +0200
Quoted 2 lines
sched-design-CFS.txt 2008-09-23 10:33:01.107393509 +0200 renamed from sched-design-CFS.txt-2.6.27-rc7 2008-07-13 23:51:29.000000000 +0200 +0
-0
please use -p1 to create patches - or since you've just set up the tip/master tracking, do something like:
<modify Documentation/scheduler/sched-design-CFS.txt>
git-commit Documentation/scheduler/sched-design-CFS.txt
<add commit log>
and then export the commit you just created for use in emailing, via:
git log --pretty=email --stat -1 -p > mail.txt
Ingo
Am Dienstag, 23. September 2008 schrieb Ingo Molnar:
Quoted 10 lines · Martin Steigerwald
Quoted 9 lines
The documentation about the CFS scheduler is scarse when it comes to scheduling policies. This patch adds a chapter about the scheduling policies it supports. Peter Zijlstra provided most of the information for it in
http://marc.info/?l=linux-kernel&m=122210038326356&w=2
This patch is based on 2.6.27-rc7.
Quoted 7 lines
Quoted 1 line
Signed-off-by Martin Steigerwald <[email protected]>looks good to me - but could you please do the patch against the latest scheduler tree, which has already updated this file (and which made your patch not apply cleanly):
Should I use
checkout -b tip-latest tip/master
as described in the README or tip/sched/devel or even something else?
I am new to git. I know Bazaar quite well however, so I am not compeltely new to DVCS.
Ciao,
Signature · 2 lines
Martin Steigerwald - team(ix) GmbH - http://www.teamix.de gpg: 19E3 8D42 896F D004 08AC A0CA 1E10 C593 0399 AE90
Quoted 17 lines · Martin Steigerwald
Am Dienstag, 23. September 2008 schrieb Ingo Molnar:
Quoted 16 lines · Martin Steigerwald
Quoted 10 lines
The documentation about the CFS scheduler is scarse when it comes to scheduling policies. This patch adds a chapter about the scheduling policies it supports. Peter Zijlstra provided most of the information for it in
http://marc.info/?l=linux-kernel&m=122210038326356&w=2
This patch is based on 2.6.27-rc7.
Signed-off-by Martin Steigerwald <[email protected]>looks good to me - but could you please do the patch against the latest scheduler tree, which has already updated this file (and which made your patch not apply cleanly):
Quoted 7 lines
Quoted 1 line
Should I use
checkout -b tip-latest tip/master
as described in the README or tip/sched/devel or even something else?
tip/master should be fine - it has sched/devel integrated. I'll sort out any cross-topic impact.
Quoted 2 lines
I am new to git. I know Bazaar quite well however, so I am not compeltely new to DVCS.
the -tip tree, maintained by Thomas Gleixner, H. Peter Anvin and myself is a "forest of trees" based on Linus's very latest -git tree. Currently it's a collection of more than 180 topic trees. Most topic trees are based on upstream -git, some topic trees are based on each other and tip/master has them all integrated together.
there are a few main themes within -tip: tip/x86/* are all the currently active x86 topics - all changes that are for v2.6.28. tip/sched/* are the pending scheduler changes. tip/timers/* are timer changes, tip/tracing/* are tracing patches, etc.
Unless you are a high-volume patch submitter or a maintainer of a given topic tree it's not necessary for you to know/follow/interpret the internal structure of -tip - you can send patches against tip/master and we'll sort the patch out into the right topic branch. (and resolve conflicts, if any)
Generally tip/master is not supposed to break in any way anytime: it must build and boot on all hardware, no ifs and when. So it's not a development tree in the classic sense, i.e. temporary breakages and user-visible transition periods are not accepted. We do a lot of automated testing against tip/master so it should be fine for daily desktop use and daily development work. I use latest tip/master on about 7 x86 boxes at the moment.
The individual topic trees are development trees, and might contain bugs at times - but we filter those out and only represent/merge a known-stable version of each sub-tree in tip/master.
At least that's the theory - it's still a high-flux tree with multiple updates every day and has an average of ~15 new commits added per day, 24/7. If you see a problem with it then please report it.
Ingo
Am Dienstag, 23. September 2008 schrieb Ingo Molnar:
Quoted 16 lines · Martin Steigerwald
Quoted 10 lines
The documentation about the CFS scheduler is scarse when it comes to scheduling policies. This patch adds a chapter about the scheduling policies it supports. Peter Zijlstra provided most of the information for it in
http://marc.info/?l=linux-kernel&m=122210038326356&w=2
This patch is based on 2.6.27-rc7.
Signed-off-by Martin Steigerwald <[email protected]>looks good to me - but could you please do the patch against the latest scheduler tree, which has already updated this file (and which made your patch not apply cleanly):
Quoted 8 lines
http://people.redhat.com/mingo/tip.git/README
also:
Quoted 2 lines
--- sched-design-CFS.txt-2.6.27-rc7 2008-07-13 23:51:29.000000000 +0200 +++ sched-design-CFS.txt 2008-09-23 10:33:01.107393509 +0200
please use -p1 to create patches - or since you've just set up the tip/master tracking, do something like:
Okay, lets see how this works out.
---
From a57581d4ec3b13f63920b89c336ac9c93c6cf9f0 Mon Sep 17 00:00:00 2001
From: Martin Steigerwald <[email protected]>
Date: Tue, 23 Sep 2008 13:45:46 +0200
Subject: [PATCH] CFS: Documentation about scheduling policies
The documentation about the CFS scheduler is scarse when it comes to scheduling policies. This patch adds a chapter about the scheduling policies it supports. Peter Zijlstra provided most of the information for it in
http://marc.info/?l=linux-kernel&m=122210038326356&w=2
--- Documentation/scheduler/sched-design-CFS.txt | 28 ++++++++++++++++++++++++- 1 files changed, 26 insertions(+), 2 deletions(-)
Documentation/scheduler/sched-design-CFS.txt +26 -2
@@ -114,7 +114,31 @@ result. -5. SCHEDULING CLASSES +5. Scheduling policies + +CFS implements three scheduling policies: + + - SCHED_NORMAL (traditionally called SCHED_OTHER): The scheduling + policy that is used for regular tasks. + + - SCHED_BATCH: Does not preempt nearly as often as regular tasks + would, thereby allowing tasks to run longer and make better use of + caches but at the cost of interactivity. This is well suited for + batch jobs. + + - SCHED_IDLE: This is even weaker than nice 19, but its not a true + idle timer scheduler in order to avoid to get into priority + inversion problems which would deadlock the machine. + +SCHED_FIFO/_RR are implemented in sched_rt.c and are as specified by +POSIX. + +The command chrt from util-linux-ng 2.13.1.1 can set all of these except +SCHED_IDLE. + + + +6. SCHEDULING CLASSES The new CFS scheduler has been designed in such a way to introduce "Scheduling Classes," an extensible hierarchy of scheduler modules. These modules
@@ -179,7 +203,7 @@ This is the (partial) list of the hooks: -6. GROUP SCHEDULER EXTENSIONS TO CFS +7. GROUP SCHEDULER EXTENSIONS TO CFS Normally, the scheduler operates on individual tasks and strives to provide fair CPU time to each task. Sometimes, it may be desirable to group tasks and
Signature · 2 lines
Martin Steigerwald - team(ix) GmbH - http://www.teamix.de gpg: 19E3 8D42 896F D004 08AC A0CA 1E10 C593 0399 AE90
Ingo Molnar
AppliedQuoted 10 lines · Martin Steigerwald
Quoted 2 lines
please use -p1 to create patches - or since you've just set up the tip/master tracking, do something like:
Okay, lets see how this works out.
---
Froma57581d4ec3b13f63920b89c336ac9c93c6cf9f0Mon Sep 17 00:00:00 2001
From: Martin Steigerwald <[email protected]>
Date: Tue, 23 Sep 2008 13:45:46 +0200
Subject: [PATCH] CFS: Documentation about scheduling policies
Applied to tip/sched/devel, merged it into tip/master and pushed the result out - thanks Martin.
this was a perfect patch :)
Ingo
Am Dienstag, 23. September 2008 schrieb Ingo Molnar:
Quoted 12 lines · Martin Steigerwald
Quoted 10 lines
Quoted 2 lines
please use -p1 to create patches - or since you've just set up the tip/master tracking, do something like:
Okay, lets see how this works out.
---
Froma57581d4ec3b13f63920b89c336ac9c93c6cf9f0Mon Sep 17 00:00:00 2001
From: Martin Steigerwald <[email protected]>
Date: Tue, 23 Sep 2008 13:45:46 +0200
Subject: [PATCH] CFS: Documentation about scheduling policies
Quoted 4 lines
Applied to tip/sched/devel, merged it into tip/master and pushed the result out - thanks Martin.
this was a perfect patch :)
Thanks. Now I can learn how I can update my local tip-master ;-). Hmmm, git pull seemed to do the trick although it did not touch Documentation/scheduler/sched-design-CFS.txt again. Seems it detected that I applied the patch I sent you already.
Will it be in 2.6.28 or even in 2.6.27? 8-)
Looking forward to further documentation patches - these can't break any code ;-).
Signature · 2 lines
Martin Steigerwald - team(ix) GmbH - http://www.teamix.de gpg: 19E3 8D42 896F D004 08AC A0CA 1E10 C593 0399 AE90
Quoted 16 lines · Martin Steigerwald
Am Dienstag, 23. September 2008 schrieb Ingo Molnar:
Quoted 15 lines · Martin Steigerwald
Quoted 10 lines
Quoted 2 lines
please use -p1 to create patches - or since you've just set up the tip/master tracking, do something like:
Okay, lets see how this works out.
---
Froma57581d4ec3b13f63920b89c336ac9c93c6cf9f0Mon Sep 17 00:00:00 2001
From: Martin Steigerwald <[email protected]>
Date: Tue, 23 Sep 2008 13:45:46 +0200
Subject: [PATCH] CFS: Documentation about scheduling policiesApplied to tip/sched/devel, merged it into tip/master and pushed the result out - thanks Martin.
Quoted 6 lines
Quoted 1 line
this was a perfect patch :)
Thanks. Now I can learn how I can update my local tip-master ;-). Hmmm, git pull seemed to do the trick although it did not touch
Documentation/scheduler/sched-design-CFS.txtagain. Seems it detected that I applied the patch I sent you already.
yes.
the best way to update is to have tip as a remote and to update via 'git remote update'. Then you can do "git merge tip/master" - or if this does not work (tip/master is an integration branch and has to be reset occasionally) then you can do a 'git-reset --hard tip/master' to switch over to the new tree.
NOTE: a hard reset means you'll lose local commits. If you want to carry them over then do something like:
git rebase -i --onto tip/master 123412341234
where 123412341234 is the sha1 of the previous tip/master you based your local changes on.
Quoted 1 line
Will it be in 2.6.28 or even in 2.6.27? 8-)
yes, it's queued up for v2.6.28. For v2.6.27 we [in -tip] dont do documentation updates starting at around -rc4 or so (to reduce the upstream churn).
Quoted 2 lines
Looking forward to further documentation patches - these can't break any code ;-).
definitely ;-)
Ingo
Quoted 16 lines · Martin Steigerwald
Am Dienstag, 23. September 2008 schrieb Ingo Molnar:
Quoted 15 lines · Martin Steigerwald
Quoted 10 lines
Quoted 2 lines
please use -p1 to create patches - or since you've just set up the tip/master tracking, do something like:
Okay, lets see how this works out.
---
Froma57581d4ec3b13f63920b89c336ac9c93c6cf9f0Mon Sep 17 00:00:00 2001
From: Martin Steigerwald <[email protected]>
Date: Tue, 23 Sep 2008 13:45:46 +0200
Subject: [PATCH] CFS: Documentation about scheduling policiesApplied to tip/sched/devel, merged it into tip/master and pushed the result out - thanks Martin.
Quoted 6 lines
Quoted 1 line
this was a perfect patch :)
Thanks. Now I can learn how I can update my local tip-master ;-). Hmmm, git pull seemed to do the trick although it did not touch
Documentation/scheduler/sched-design-CFS.txtagain. Seems it detected that I applied the patch I sent you already.
'git remote update' will be best, 'git pull' only works if the underlying stuff never gets rebased.