Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 288746
b: refs/heads/master
c: de5bdff
h: refs/heads/master
v: v3
  • Loading branch information
Hiroshi Shimamoto authored and Ingo Molnar committed Feb 22, 2012
1 parent 08c3f39 commit 473ebbd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 62f6536a630affe3176deb48554d27ee58b65077
refs/heads/master: de5bdff7a72acc281219be2b8edeeca1fd81c542
2 changes: 1 addition & 1 deletion trunk/include/linux/init_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -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), \
Expand Down
6 changes: 6 additions & 0 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions trunk/kernel/sched/rt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 0 additions & 4 deletions trunk/kernel/sched/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 473ebbd

Please sign in to comment.