Re: Egg on my face -- disk speed

Richard Gooch (rgooch@atnf.csiro.au)
Sat, 7 Nov 1998 11:31:07 +1100


Pavel Machek writes:
> Hi!
>
> > The way to handle this is to only have the idle process burn idle cycles
> > after a "start benchmark" system call, and then have it stop burning
> > idle cycles (and return the number burnt cycles :-) upon having received
> > a "end benchmark" system call.
> >
> > Having such a feature (even if it were an optional kernel patch) would
> > make it a *lot* easier to benchmark device drivers for CPU efficiency.
> > (Hint, hint, to potential budding kernel programmers out there --- this
> > would be a pretty good beginning-to-intermediate kernel hacking
> > project.)
>
> I think it is pretty well to do this in userland - as someone already
> shown... It is going to be precise unless you are _so_ tight on memory
> so that while(1) loop is swapped out...

No problem: mlock(2) is your friend. IMHO timing driver CPU usage is
properly done with this userspace technique. No need to slow down
drivers with benchmarking code. I don't even see how adding
benchmarking code to the kernel would provide any benefits.

Regards,

Richard....

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/