Linux . , . , , . " ", , .
, Linux
.........
if (likely(prev != next)) {<-- if next and current are same, then no context switch
sched_info_switch(prev, next);
perf_event_task_sched_out(prev, next);
rq->nr_switches++;
rq->curr = next;
++*switch_count;
context_switch(rq, prev, next);
cpu = smp_processor_id();
rq = cpu_rq(cpu);
} else {
............
source
share