Re: [PATCH] 2.6.0-test4 -- add context switch counters

From: Peter Chubb
Date: Tue Aug 26 2003 - 20:54:12 EST


>>>>> "Mike" == Mike Fedyk <mfedyk@xxxxxxxxxxxxx> writes:

Mike> On Tue, Aug 26, 2003 at 06:18:07PM -0700, Andrew Morton wrote:
>> Peter Chubb <peterc@xxxxxxxxxxxxxxxxxx> wrote:
>> >
>> > Currently, the context switch counters reported by getrusage()
>> are > always zero. The appended patch adds fields to struct
>> task_struct to > count context switches, and adds code to do the
>> counting.
>> >
>> > The patch adds 4 longs to struct task struct, and a single
>> addition to > the fast path in schedule().
>>
>> OK... Why is this useful? A bit of googling doesn't show much
>> interest in it.
>>
>> What apps should be reporting this info? /usr/bin/time?

Mike> Voluntary context switches: 0

Mike> How can you have voluntary context switches in a preemptive
Mike> environment?

A voluntary context switch is where a task gives up the processor
(e.g., by going to sleep, or by calling sched_yield()).

An involuntary context switch is where a task is preempted by some
other task.

(Another figure-of-merit might be how many times the process is
interrupted by a hardware interrupt)

--
Dr Peter Chubb http://www.gelato.unsw.edu.au peterc AT gelato.unsw.edu.au
You are lost in a maze of BitKeeper repositories, all slightly different.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/