History

sched: simplify sched_slice()

Use the existing calc_delta_mine() calculation for sched_slice(). This saves a divide and simplifies the code because we share it with the other /cfs_rq->load users. It also improves code size: text data bss dec hex filename 42659 2740 144 45543 b1e7 sched.o.before 42093 2740 144 44977 afb1 sched.o.after

Ingo Molnar committed 18 years ago

Commit 6a6029b1 parent e22ecef1 file · +2 −6Browse files

Unified · Split

kernel/sched_fair.c+2−6
@@ -283,12 +283,8 @@ static u64 __sched_period(unsigned long nr_running) · 282 unmodified lines
283 */283 */
284static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se)284static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se)
285{285{
286 u64 slice = __sched_period(cfs_rq->nr_running);286 return calc_delta_mine(__sched_period(cfs_rq->nr_running),
287 287 se->load.weight, &cfs_rq->load);
288 slice *= se->load.weight;
289 do_div(slice, cfs_rq->load.weight);
290
291 return slice;
292}288}
293 289
294/*290/*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t