* [PATCH] sched: Make initial SCHED_RR timeslace DEF_TIMESLICE
@ 2012-02-16 5:52 Hiroshi Shimamoto
2012-02-20 13:30 ` Peter Zijlstra
2012-02-22 16:12 ` [tip:sched/core] sched: Make initial SCHED_RR timeslace DEF_TIMESLICE tip-bot for Hiroshi Shimamoto
0 siblings, 2 replies; 7+ messages in thread
From: Hiroshi Shimamoto @ 2012-02-16 5:52 UTC (permalink / raw)
To: linux-kernel, Ingo Molnar, Peter Zijlstra
From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
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.
Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
---
include/linux/init_task.h | 2 +-
include/linux/sched.h | 6 ++++++
kernel/sched/sched.h | 4 ----
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 9c66b1a..d04d67d 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -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), \
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 3dbc6b5..e84315a 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -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 {
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 8a2c768..c0660a1 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] sched: Make initial SCHED_RR timeslace DEF_TIMESLICE
2012-02-16 5:52 [PATCH] sched: Make initial SCHED_RR timeslace DEF_TIMESLICE Hiroshi Shimamoto
@ 2012-02-20 13:30 ` Peter Zijlstra
2012-02-21 7:29 ` [PATCH v2] sched: Make initial SCHED_RR timeslace RR_TIMESLICE Hiroshi Shimamoto
2012-02-22 16:12 ` [tip:sched/core] sched: Make initial SCHED_RR timeslace DEF_TIMESLICE tip-bot for Hiroshi Shimamoto
1 sibling, 1 reply; 7+ messages in thread
From: Peter Zijlstra @ 2012-02-20 13:30 UTC (permalink / raw)
To: Hiroshi Shimamoto; +Cc: linux-kernel, Ingo Molnar
On Thu, 2012-02-16 at 14:52 +0900, Hiroshi Shimamoto wrote:
> From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
>
> 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.
>
> Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
No real objection, should we take the opportunity to rename to
RR_TIMESLICE or somesuch?
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] sched: Make initial SCHED_RR timeslace RR_TIMESLICE
2012-02-20 13:30 ` Peter Zijlstra
@ 2012-02-21 7:29 ` Hiroshi Shimamoto
2012-02-21 10:21 ` Peter Zijlstra
2012-02-21 11:25 ` Hiroshi Shimamoto
0 siblings, 2 replies; 7+ messages in thread
From: Hiroshi Shimamoto @ 2012-02-21 7:29 UTC (permalink / raw)
To: Peter Zijlstra; +Cc: linux-kernel, Ingo Molnar
(2012/02/20 22:30), Peter Zijlstra wrote:
> On Thu, 2012-02-16 at 14:52 +0900, Hiroshi Shimamoto wrote:
>> From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
>>
>> 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.
>>
>> Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
>
> No real objection, should we take the opportunity to rename to
> RR_TIMESLICE or somesuch?
>
sounds reasonable.
===
From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
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.
Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
CC: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
include/linux/init_task.h | 2 +-
include/linux/sched.h | 6 ++++++
kernel/sched/sched.h | 4 ----
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 9c66b1a..f994d51 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -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), \
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 2df7646..ee882cb 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -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 {
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 8a2c768..c0660a1 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2] sched: Make initial SCHED_RR timeslace RR_TIMESLICE
2012-02-21 7:29 ` [PATCH v2] sched: Make initial SCHED_RR timeslace RR_TIMESLICE Hiroshi Shimamoto
@ 2012-02-21 10:21 ` Peter Zijlstra
2012-02-21 11:25 ` Hiroshi Shimamoto
1 sibling, 0 replies; 7+ messages in thread
From: Peter Zijlstra @ 2012-02-21 10:21 UTC (permalink / raw)
To: Hiroshi Shimamoto; +Cc: linux-kernel, Ingo Molnar
On Tue, 2012-02-21 at 16:29 +0900, Hiroshi Shimamoto wrote:
> sounds reasonable.
Thanks!
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] sched: Make initial SCHED_RR timeslace RR_TIMESLICE
2012-02-21 7:29 ` [PATCH v2] sched: Make initial SCHED_RR timeslace RR_TIMESLICE Hiroshi Shimamoto
2012-02-21 10:21 ` Peter Zijlstra
@ 2012-02-21 11:25 ` Hiroshi Shimamoto
2012-02-21 11:27 ` Peter Zijlstra
1 sibling, 1 reply; 7+ messages in thread
From: Hiroshi Shimamoto @ 2012-02-21 11:25 UTC (permalink / raw)
To: Peter Zijlstra; +Cc: linux-kernel, Ingo Molnar
2012/2/21 Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>:
> (2012/02/20 22:30), Peter Zijlstra wrote:
>> On Thu, 2012-02-16 at 14:52 +0900, Hiroshi Shimamoto wrote:
>>> From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
>>>
>>> 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.
>>>
>>> Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
>>
>> No real objection, should we take the opportunity to rename to
>> RR_TIMESLICE or somesuch?
>>
>
> sounds reasonable.
Oops, the below patch is wrong.
Definitely I missed something.
Will resend, sorry about that.
>
> ===
> From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
>
> 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.
>
> Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> CC: Peter Zijlstra <a.p.zijlstra@chello.nl>
> ---
> include/linux/init_task.h | 2 +-
> include/linux/sched.h | 6 ++++++
> kernel/sched/sched.h | 4 ----
> 3 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/init_task.h b/include/linux/init_task.h
> index 9c66b1a..f994d51 100644
> --- a/include/linux/init_task.h
> +++ b/include/linux/init_task.h
> @@ -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), \
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index 2df7646..ee882cb 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -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 {
> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
> index 8a2c768..c0660a1 100644
> --- a/kernel/sched/sched.h
> +++ b/kernel/sched/sched.h
> @@ -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 majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] sched: Make initial SCHED_RR timeslace RR_TIMESLICE
2012-02-21 11:25 ` Hiroshi Shimamoto
@ 2012-02-21 11:27 ` Peter Zijlstra
0 siblings, 0 replies; 7+ messages in thread
From: Peter Zijlstra @ 2012-02-21 11:27 UTC (permalink / raw)
To: Hiroshi Shimamoto; +Cc: linux-kernel, Ingo Molnar
On Tue, 2012-02-21 at 20:25 +0900, Hiroshi Shimamoto wrote:
> Definitely I missed something.
>
> Will resend, sorry about that.
no worries, already fixed it up..
^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip:sched/core] sched: Make initial SCHED_RR timeslace DEF_TIMESLICE
2012-02-16 5:52 [PATCH] sched: Make initial SCHED_RR timeslace DEF_TIMESLICE Hiroshi Shimamoto
2012-02-20 13:30 ` Peter Zijlstra
@ 2012-02-22 16:12 ` tip-bot for Hiroshi Shimamoto
1 sibling, 0 replies; 7+ messages in thread
From: tip-bot for Hiroshi Shimamoto @ 2012-02-22 16:12 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, h-shimamoto, hpa, mingo, a.p.zijlstra, tglx, mingo
Commit-ID: de5bdff7a72acc281219be2b8edeeca1fd81c542
Gitweb: http://git.kernel.org/tip/de5bdff7a72acc281219be2b8edeeca1fd81c542
Author: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
AuthorDate: Thu, 16 Feb 2012 14:52:21 +0900
Committer: Ingo Molnar <mingo@elte.hu>
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.
Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
[ s/DEF_TIMESLICE/RR_TIMESLICE/g ]
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/4F3C9995.3010800@ct.jp.nec.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 9c66b1a..f994d51 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -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), \
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 5dba2ad..eb5de46 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -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 {
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index f42ae7f..f70206c 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -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;
}
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 8a2c768..c0660a1 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -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.
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-02-22 16:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-16 5:52 [PATCH] sched: Make initial SCHED_RR timeslace DEF_TIMESLICE Hiroshi Shimamoto
2012-02-20 13:30 ` Peter Zijlstra
2012-02-21 7:29 ` [PATCH v2] sched: Make initial SCHED_RR timeslace RR_TIMESLICE Hiroshi Shimamoto
2012-02-21 10:21 ` Peter Zijlstra
2012-02-21 11:25 ` Hiroshi Shimamoto
2012-02-21 11:27 ` Peter Zijlstra
2012-02-22 16:12 ` [tip:sched/core] sched: Make initial SCHED_RR timeslace DEF_TIMESLICE tip-bot for Hiroshi Shimamoto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).