Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sched: Remove sched_switch

Currently we don't utilize the sched_switch field anymore.

But, simply removing sched_switch field from the middle of the
sched_stat output will break tools.

So, to stay compatible we hardcode it to zero and remove the
field from the scheduler data structures.

Update the schedstat documentation accordingly.

Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1327422836.27181.5.camel@localhost.localdomain
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by

Rakib Mullick and committed by
Ingo Molnar
30fd049a 4ec4412e

+4 -5
+2 -1
Documentation/scheduler/sched-stats.txt
··· 38 38 1) # of times sched_yield() was called 39 39 40 40 Next three are schedule() statistics: 41 - 2) # of times we switched to the expired queue and reused it 41 + 2) This field is a legacy array expiration count field used in the O(1) 42 + scheduler. We kept it for ABI compatibility, but it is always set to zero. 42 43 3) # of times schedule() was called 43 44 4) # of times schedule() left the processor idle 44 45
-1
kernel/sched/debug.c
··· 288 288 289 289 P(yld_count); 290 290 291 - P(sched_switch); 292 291 P(sched_count); 293 292 P(sched_goidle); 294 293 #ifdef CONFIG_SMP
-1
kernel/sched/sched.h
··· 462 462 unsigned int yld_count; 463 463 464 464 /* schedule() stats */ 465 - unsigned int sched_switch; 466 465 unsigned int sched_count; 467 466 unsigned int sched_goidle; 468 467
+2 -2
kernel/sched/stats.c
··· 32 32 33 33 /* runqueue-specific stats */ 34 34 seq_printf(seq, 35 - "cpu%d %u %u %u %u %u %u %llu %llu %lu", 35 + "cpu%d %u 0 %u %u %u %u %llu %llu %lu", 36 36 cpu, rq->yld_count, 37 - rq->sched_switch, rq->sched_count, rq->sched_goidle, 37 + rq->sched_count, rq->sched_goidle, 38 38 rq->ttwu_count, rq->ttwu_local, 39 39 rq->rq_cpu_time, 40 40 rq->rq_sched_info.run_delay, rq->rq_sched_info.pcount);