From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@elte.hu>
Subject: [PATCH v2] sched: Make initial SCHED_RR timeslace RR_TIMESLICE
Date: Tue, 21 Feb 2012 16:29:35 +0900 [thread overview]
Message-ID: <4F4347DF.2050002@ct.jp.nec.com> (raw)
In-Reply-To: <1329744653.2293.342.camel@twins>
(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
next prev parent reply other threads:[~2012-02-21 7:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Hiroshi Shimamoto [this message]
2012-02-21 10:21 ` [PATCH v2] sched: Make initial SCHED_RR timeslace RR_TIMESLICE 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F4347DF.2050002@ct.jp.nec.com \
--to=h-shimamoto@ct.jp.nec.com \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox