aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2007-08-02 11:41:40 -0400
committerIngo Molnar <mingo@elte.hu>2007-08-02 11:41:40 -0400
commit6cfb0d5d06bea2b8791f32145eae539d524e5f6c (patch)
treeec84e29c73833fac72f7307b7573410b2e60b291 /kernel/sched.c
parent8179ca23d513717cc5e3dc81a1ffe01af0955468 (diff)
[PATCH] sched: reduce debug code
move the rest of the debugging/instrumentation code to under CONFIG_SCHEDSTATS too. This reduces code size and speeds code up: text data bss dec hex filename 33044 4122 28 37194 914a sched.o.before 32708 4122 28 36858 8ffa sched.o.after Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index a9d374061a46..72bb9483d949 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -983,18 +983,21 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu)
983 u64 clock_offset, fair_clock_offset; 983 u64 clock_offset, fair_clock_offset;
984 984
985 clock_offset = old_rq->clock - new_rq->clock; 985 clock_offset = old_rq->clock - new_rq->clock;
986 fair_clock_offset = old_rq->cfs.fair_clock - 986 fair_clock_offset = old_rq->cfs.fair_clock - new_rq->cfs.fair_clock;
987 new_rq->cfs.fair_clock; 987
988 if (p->se.wait_start)
989 p->se.wait_start -= clock_offset;
990 if (p->se.wait_start_fair) 988 if (p->se.wait_start_fair)
991 p->se.wait_start_fair -= fair_clock_offset; 989 p->se.wait_start_fair -= fair_clock_offset;
990 if (p->se.sleep_start_fair)
991 p->se.sleep_start_fair -= fair_clock_offset;
992
993#ifdef CONFIG_SCHEDSTATS
994 if (p->se.wait_start)
995 p->se.wait_start -= clock_offset;
992 if (p->se.sleep_start) 996 if (p->se.sleep_start)
993 p->se.sleep_start -= clock_offset; 997 p->se.sleep_start -= clock_offset;
994 if (p->se.block_start) 998 if (p->se.block_start)
995 p->se.block_start -= clock_offset; 999 p->se.block_start -= clock_offset;
996 if (p->se.sleep_start_fair) 1000#endif
997 p->se.sleep_start_fair -= fair_clock_offset;
998 1001
999 __set_task_cpu(p, new_cpu); 1002 __set_task_cpu(p, new_cpu);
1000} 1003}
@@ -1555,17 +1558,19 @@ int fastcall wake_up_state(struct task_struct *p, unsigned int state)
1555static void __sched_fork(struct task_struct *p) 1558static void __sched_fork(struct task_struct *p)
1556{ 1559{
1557 p->se.wait_start_fair = 0; 1560 p->se.wait_start_fair = 0;
1558 p->se.wait_start = 0;
1559 p->se.exec_start = 0; 1561 p->se.exec_start = 0;
1560 p->se.sum_exec_runtime = 0; 1562 p->se.sum_exec_runtime = 0;
1561 p->se.delta_exec = 0; 1563 p->se.delta_exec = 0;
1562 p->se.delta_fair_run = 0; 1564 p->se.delta_fair_run = 0;
1563 p->se.delta_fair_sleep = 0; 1565 p->se.delta_fair_sleep = 0;
1564 p->se.wait_runtime = 0; 1566 p->se.wait_runtime = 0;
1567 p->se.sleep_start_fair = 0;
1568
1569#ifdef CONFIG_SCHEDSTATS
1570 p->se.wait_start = 0;
1565 p->se.sum_wait_runtime = 0; 1571 p->se.sum_wait_runtime = 0;
1566 p->se.sum_sleep_runtime = 0; 1572 p->se.sum_sleep_runtime = 0;
1567 p->se.sleep_start = 0; 1573 p->se.sleep_start = 0;
1568 p->se.sleep_start_fair = 0;
1569 p->se.block_start = 0; 1574 p->se.block_start = 0;
1570 p->se.sleep_max = 0; 1575 p->se.sleep_max = 0;
1571 p->se.block_max = 0; 1576 p->se.block_max = 0;
@@ -1573,6 +1578,7 @@ static void __sched_fork(struct task_struct *p)
1573 p->se.wait_max = 0; 1578 p->se.wait_max = 0;
1574 p->se.wait_runtime_overruns = 0; 1579 p->se.wait_runtime_overruns = 0;
1575 p->se.wait_runtime_underruns = 0; 1580 p->se.wait_runtime_underruns = 0;
1581#endif
1576 1582
1577 INIT_LIST_HEAD(&p->run_list); 1583 INIT_LIST_HEAD(&p->run_list);
1578 p->se.on_rq = 0; 1584 p->se.on_rq = 0;
@@ -6579,12 +6585,14 @@ void normalize_rt_tasks(void)
6579 do_each_thread(g, p) { 6585 do_each_thread(g, p) {
6580 p->se.fair_key = 0; 6586 p->se.fair_key = 0;
6581 p->se.wait_runtime = 0; 6587 p->se.wait_runtime = 0;
6588 p->se.exec_start = 0;
6582 p->se.wait_start_fair = 0; 6589 p->se.wait_start_fair = 0;
6590 p->se.sleep_start_fair = 0;
6591#ifdef CONFIG_SCHEDSTATS
6583 p->se.wait_start = 0; 6592 p->se.wait_start = 0;
6584 p->se.exec_start = 0;
6585 p->se.sleep_start = 0; 6593 p->se.sleep_start = 0;
6586 p->se.sleep_start_fair = 0;
6587 p->se.block_start = 0; 6594 p->se.block_start = 0;
6595#endif
6588 task_rq(p)->cfs.fair_clock = 0; 6596 task_rq(p)->cfs.fair_clock = 0;
6589 task_rq(p)->clock = 0; 6597 task_rq(p)->clock = 0;
6590 6598