From 473ebbd499b816bfb7a22dced3a57b7b9c82bef2 Mon Sep 17 00:00:00 2001 From: Hiroshi Shimamoto Date: Thu, 16 Feb 2012 14:52:21 +0900 Subject: [PATCH] --- yaml --- r: 288746 b: refs/heads/master c: de5bdff7a72acc281219be2b8edeeca1fd81c542 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/init_task.h | 2 +- trunk/include/linux/sched.h | 6 ++++++ trunk/kernel/sched/rt.c | 4 ++-- trunk/kernel/sched/sched.h | 4 ---- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index b27a71f094dc..6fe5a6ee12ba 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 62f6536a630affe3176deb48554d27ee58b65077 +refs/heads/master: de5bdff7a72acc281219be2b8edeeca1fd81c542 diff --git a/trunk/include/linux/init_task.h b/trunk/include/linux/init_task.h index 9c66b1ada9d7..f994d51f70f2 100644 --- a/trunk/include/linux/init_task.h +++ b/trunk/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/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index 5dba2ad52431..eb5de466f099 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/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/trunk/kernel/sched/rt.c b/trunk/kernel/sched/rt.c index f42ae7fb5ec5..f70206c2c802 100644 --- a/trunk/kernel/sched/rt.c +++ b/trunk/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/trunk/kernel/sched/sched.h b/trunk/kernel/sched/sched.h index 8a2c768d2f98..c0660a1a0cd1 100644 --- a/trunk/kernel/sched/sched.h +++ b/trunk/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.