On Wed, 12 Jan 2005, Muli Ben-Yehuda wrote:

> > Well, it seems right. I am not sure if its all the io disk calls though.
> > The code is not easy to read but it seems this is the same data
> > that /proc/stat -> page line uses thru kstat.pgpgout.
> > I am looking at what seems to be the point where this happens,
> > at the file drivers/block/ll_rw_blk.c at function -
> > void submit_bh(int rw, struct buffer_head * bh) .
> > Is there a way to pull this data out without recompiling the kernel?
>
> Depending on what data you mean, probably not.
[..snip..]
> > here is some output of the dmesg, the blocks seems to be after the "/"
> > and I will need to sum them up for each process. although, it uses the
> > name
> > instead of PIDs so I'll need to figure out also where are the PIDs,
> > I am guessing current->pid.
>
> Right.

but that's not the PID of the process that caused the buffer to be written
in the first place. that'll be the PID of pdflush (except for some cases
where the file system's code specifically writes out certain buffer
heads).

in fact, it's very hard to achieve a proper "which process caused this
I/O" log. consider the case where two processes wrote to the same position
in a file - there's likely to be only one disk write operation - which of
the two processes will you account this I/O against?

also, what about read-ahead? when a process reads data from the disk, the
operating system typically performs a read-ahead. in fact, sometimes the
mere opening of a file will cause the VFS layer to perform read-ahead of
data for the file - even if your application didn't read anything.

thus, you should try to _properly_ define what is it that you're trying to
account for, including those 'multiple updates - single disk I/O'
and 'read ahead' cases.

-- 
guy

"For world domination - press 1,
 or dial 0, and please hold, for the creator." -- nob o. dy

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to