On Monday 26 February 2007 17:42, Arjan van de Ven wrote: > > The original question from Liran was about the open read write syscalls, > > however, i am interested more in the I/O of a process so it suits my > > purposes. I am looking to see if there is a way to measure per process > > I/O like a TaskManager in windows does. Obviously, there are other > > problems with the submit_bio function that it does not measure dirtied > > buffers which i believe are being updated by a kupdated process. I.e., > > you will also have to change something in the kupdated process to tell > > you for which process he is doing the de-dirty buffering :). > > yeah in Linux a lot of IO is done by "background" stuff, not by the apps > that dirty the data in the first place. The mmap case is just the most > ultimate example. EXT3 data ordered mode is just another example of > this. > > But in general it's really not easy. For example.. In Linux, if 2 apps > write to the same file (not theoretical, just think of logfiles) in the > end only 1 IO is actually done. Even if you could identify one of the > dirtiers.. the question is.. how to account this? For the first part, in the submit_bio function, they use the current->pid to account for who wrote the block. If the changes of two programs are written on behalf of only the current process than it should be counted as one for the current process only. Imagine two processes: 1 client and one server. the client generates the data, and the server writes them. who should we count this, the server of course. Same thing for two processes contending for one file. Whoever gets the block written gets the count. The only problem remaining is the dirty buffers that kupdated is taking care of. Btw, note that kupdated is also reported by the block_dump in submit_bio however, by that point there is no way of knowing the origin of that write/read (yes read, weird ha, what does it have to read anyway). -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ