sched: Make initial SCHED_RR timeslace DEF_TIMESLICE
PATCH 1/1 sched: Make initial SCHED_RR timeslace DEF_TIMESLICE
From: Hiroshi Shimamoto <[email protected]>
Current the initial SCHED_RR timeslice of init_task is HZ, which means 1s, and is not same as the default SCHED_RR timeslice DEF_TIMESLICE.
Change that initial timeslice to the DEF_TIMESLICE.
--- include/linux/init_task.h | 2 +- include/linux/sched.h | 6 ++++++ kernel/sched/sched.h | 4 ---- 3 files changed, 7 insertions(+), 5 deletions(-)
include/linux/init_task.h +1 -1
@@ -149,7 +149,7 @@ extern struct cred init_cred; }, \ .rt = { \ .run_list = LIST_HEAD_INIT(tsk.rt.run_list), \ - .time_slice = HZ, \ + .time_slice = DEF_TIMESLICE, \ .nr_cpus_allowed = NR_CPUS, \ }, \ .tasks = LIST_HEAD_INIT(tsk.tasks), \
include/linux/sched.h +6 -0
@@ -1234,6 +1234,12 @@ struct sched_rt_entity {#endif }; +/* +* default timeslice is 100 msecs (used only for SCHED_RR tasks). +* Timeslices get refilled after they expire. +*/ +#define DEF_TIMESLICE (100 * HZ / 1000) +struct rcu_node ;enum perf_event_task_context {
kernel/sched/sched.h +0 -4
@@ -36,11 +36,7 @@ extern __read_mostly int scheduler_running;/* * These are the 'tuning knobs' of the scheduler: -* -* default timeslice is 100 msecs (used only for SCHED_RR tasks). -* Timeslices get refilled after they expire. */ -#define DEF_TIMESLICE (100 * HZ / 1000)/* * single value that denotes runtime == period, ie unlimited time.
Signature · 1 line
1.7.7.6
Quoted 8 lines · Hiroshi Shimamoto
From: Hiroshi Shimamoto <[email protected]>
Current the initial
SCHED_RRtimeslice ofinit_taskis HZ, which means 1s, and is not same as the defaultSCHED_RRtimesliceDEF_TIMESLICE.Change that initial timeslice to the
DEF_TIMESLICE.Signed-off-by Hiroshi Shimamoto <[email protected]>
No real objection, should we take the opportunity to rename to RR_TIMESLICE or somesuch?
PATCH v2 1/1 sched: Make initial SCHED_RR timeslace RR_TIMESLICE
Quoted 6 lines · Peter Zijlstra
Quoted 5 lines · Hiroshi Shimamoto
From: Hiroshi Shimamoto <[email protected]>
Current the initial
SCHED_RRtimeslice ofinit_taskis HZ, which means 1s, and is not same as the defaultSCHED_RRtimesliceDEF_TIMESLICE.
Quoted 7 lines
Quoted 3 lines
Change that initial timeslice to the
DEF_TIMESLICE.Signed-off-by Hiroshi Shimamoto <[email protected]>No real objection, should we take the opportunity to rename to
RR_TIMESLICEor somesuch?
sounds reasonable.
===
From: Hiroshi Shimamoto <[email protected]>
Current the initial SCHED_RR timeslice of init_task is HZ, which means 1s, and is not same as the default SCHED_RR timeslice DEF_TIMESLICE.
Change the initial timeslice to the RR_TIMESLICE, which is renamed from DEF_TIMESLICE to clarify it's for SCHED_RR.
--- include/linux/init_task.h | 2 +- include/linux/sched.h | 6 ++++++ kernel/sched/sched.h | 4 ---- 3 files changed, 7 insertions(+), 5 deletions(-)
include/linux/init_task.h +1 -1
@@ -149,7 +149,7 @@ extern struct cred init_cred; }, \ .rt = { \ .run_list = LIST_HEAD_INIT(tsk.rt.run_list), \ - .time_slice = HZ, \ + .time_slice = RR_TIMESLICE, \ .nr_cpus_allowed = NR_CPUS, \ }, \ .tasks = LIST_HEAD_INIT(tsk.tasks), \
include/linux/sched.h +6 -0
@@ -1234,6 +1234,12 @@ struct sched_rt_entity {#endif }; +/* +* default timeslice is 100 msecs (used only for SCHED_RR tasks). +* Timeslices get refilled after they expire. +*/ +#define RR_TIMESLICE (100 * HZ / 1000) +struct rcu_node ;enum perf_event_task_context {
kernel/sched/sched.h +0 -4
@@ -36,11 +36,7 @@ extern __read_mostly int scheduler_running;/* * These are the 'tuning knobs' of the scheduler: -* -* default timeslice is 100 msecs (used only for SCHED_RR tasks). -* Timeslices get refilled after they expire. */ -#define DEF_TIMESLICE (100 * HZ / 1000)/* * single value that denotes runtime == period, ie unlimited time.
Signature · 1 line
1.7.7.6
Re: [PATCH v2] sched: Make initial SCHED_RR timeslace RR_TIMESLICE
Quoted 1 line · Hiroshi Shimamoto
sounds reasonable.
Thanks!
Re: [PATCH v2] sched: Make initial SCHED_RR timeslace RR_TIMESLICE
In reply to Hiroshi Shimamoto2012/2/21 Hiroshi Shimamoto <[email protected]>:
Quoted 9 lines
Quoted 8 lines · Peter Zijlstra
Quoted 7 lines · Hiroshi Shimamoto
From: Hiroshi Shimamoto <[email protected]>
Current the initial
SCHED_RRtimeslice ofinit_taskis HZ, which means 1s, and is not same as the defaultSCHED_RRtimesliceDEF_TIMESLICE.Change that initial timeslice to the
DEF_TIMESLICE.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Hiroshi Shimamoto <[email protected]>No real objection, should we take the opportunity to rename to
RR_TIMESLICEor somesuch?sounds reasonable.
Oops, the below patch is wrong.
Definitely I missed something.
Will resend, sorry about that.
Quoted 73 lines
===
From: Hiroshi Shimamoto <[email protected]>Current the initial
SCHED_RRtimeslice ofinit_taskis HZ, which means 1s, and is not same as the defaultSCHED_RRtimesliceDEF_TIMESLICE.Change the initial timeslice to the
RR_TIMESLICE, which is renamed fromDEF_TIMESLICEto clarify it's forSCHED_RR.Signed-off-by Hiroshi Shimamoto <[email protected]>CC Peter Zijlstra <[email protected]>---
include/linux/init_task.h | 2 +-
include/linux/sched.h | 6 ++++++
kernel/sched/sched.h | 4 ----3 files changed, 7 insertions(+), 5 deletions(-)include/linux/init_task.h +1
-1@@ -149,7 +149,7 @@ extern struct cred init_cred; }, \ .rt = { \ .run_list = LIST_HEAD_INIT(tsk.rt.run_list), \ - .time_slice = HZ, \ + .time_slice = RR_TIMESLICE, \ .nr_cpus_allowed = NR_CPUS, \ }, \ .tasks = LIST_HEAD_INIT(tsk.tasks), \include/linux/sched.h +6
-0@@ -1234,6 +1234,12 @@ struct sched_rt_entity { #endif }; +/* +* default timeslice is 100 msecs (used only for SCHED_RR tasks). +* Timeslices get refilled after they expire. +*/ +#define RR_TIMESLICE (100 * HZ / 1000) + struct rcu_node; enum perf_event_task_context {kernel/sched/sched.h +0
-5@@ -36,11 +36,7 @@ extern __read_mostly int scheduler_running; /* * These are the 'tuning knobs' of the scheduler: -* -* default timeslice is 100 msecs (used only for SCHED_RR tasks). -* Timeslices get refilled after they expire. */ -#define DEF_TIMESLICE (100 * HZ / 1000) /** single value that denotes runtime == period, ie unlimited time. -- 1.7.7.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] sched: Make initial SCHED_RR timeslace RR_TIMESLICE
Quoted 3 lines · Hiroshi Shimamoto
Definitely I missed something.
Will resend, sorry about that.
no worries, already fixed it up..
Commit-ID: de5bdff7a72acc281219be2b8edeeca1fd81c542 Gitweb: http://git.kernel.org/tip/de5bdff7a72acc281219be2b8edeeca1fd81c542 Author: Hiroshi Shimamoto <[email protected]> AuthorDate: Thu, 16 Feb 2012 14:52:21 +0900 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 22 Feb 2012 12:28:29 +0100
sched: Make initial SCHED_RR timeslace DEF_TIMESLICE
Current the initial SCHED_RR timeslice of init_task is HZ, which means 1s, and is not same as the default SCHED_RR timeslice DEF_TIMESLICE.
Change that initial timeslice to the DEF_TIMESLICE.
--- include/linux/init_task.h | 2 +- include/linux/sched.h | 6 ++++++ kernel/sched/rt.c | 4 ++-- kernel/sched/sched.h | 4 ---- 4 files changed, 9 insertions(+), 7 deletions(-)
include/linux/init_task.h +1 -1
@@ -149,7 +149,7 @@ extern struct cred init_cred; }, \ .rt = { \ .run_list = LIST_HEAD_INIT(tsk.rt.run_list), \ - .time_slice = HZ, \ + .time_slice = RR_TIMESLICE, \ .nr_cpus_allowed = NR_CPUS, \ }, \ .tasks = LIST_HEAD_INIT(tsk.tasks), \
include/linux/sched.h +6 -0
@@ -1234,6 +1234,12 @@ struct sched_rt_entity {#endif }; +/* +* default timeslice is 100 msecs (used only for SCHED_RR tasks). +* Timeslices get refilled after they expire. +*/ +#define RR_TIMESLICE (100 * HZ / 1000) +struct rcu_node ;enum perf_event_task_context {
kernel/sched/rt.c +2 -2
@@ -1972,7 +1972,7 @@ static void task_tick_rt(struct rq *rq, struct task_struct *p, int queued)if (--p->rt.time_slice)return ; - p->rt.time_slice =DEF_TIMESLICE ; + p->rt.time_slice =RR_TIMESLICE ;/* * Requeue to the end of queue if we are not the only element
@@ -2000,7 +2000,7 @@ static unsigned int get_rr_interval_rt(struct rq *rq, struct task_struct *task)* Time slice is 0 for SCHED_FIFO tasks */ if (task->policy ==SCHED_RR ) -return DEF_TIMESLICE ; +return RR_TIMESLICE ;else return 0 ; }
kernel/sched/sched.h +0 -4
@@ -36,11 +36,7 @@ extern __read_mostly int scheduler_running;/* * These are the 'tuning knobs' of the scheduler: -* -* default timeslice is 100 msecs (used only for SCHED_RR tasks). -* Timeslices get refilled after they expire. */ -#define DEF_TIMESLICE (100 * HZ / 1000)/* * single value that denotes runtime == period, ie unlimited time.