[lkml]   [1999]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: cpu consumption calculation - why these difference ?

> I've got one question about how the cpu consumption is calculated.
> Bellow are two programs that do the same thing, play stuff to the soundcard.
> The first uses a blocking write, the second a nonblocking one with a select.
> The select does not block (if it did, the cpu consumption is reported to
> be the same than the first method, both by ps and top). It does an
> usleep(10*1000) if there is no space left in the audio buffers.
> My question is : why does the first get 5% of cpu consumption reported
> by both ps and top when the second gets only 0.1% ? They both do the same
> calculations, so it should be equal, nope ? Is it related to the kernel
> or just the ps and top programs ? (Is it only a problem ?)

Kernel cpu meters do not work too well, see may badboy examples and
discussion around them. I even have patch, somewhere... Search archives.


The best software in life is free (not shareware)! Pavel
GCM d? s-: !g p?:+ au- a--@ w+ v- C++@ UL+++ L++ N++ E++ W--- M- Y- R+

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:51    [W:0.040 / U:1.920 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site