lkml.org 
[lkml]   [2004]   [Aug]   [2]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateMon, 2 Aug 2004 09:57:42 -0700
FromAndrew Morton <>
SubjectRe: [Patch for review] BSD accounting IO stats
Guillaume Thouvenin <guillaume.thouvenin@bull.net> wrote:
>
> diff -uprN -X dontdiff linux-2.6.8-rc2/drivers/block/ll_rw_blk.c linux-2.6.8-rc2+BSDacct_IO/drivers/block/ll_rw_blk.c
>  --- linux-2.6.8-rc2/drivers/block/ll_rw_blk.c	2004-07-18 06:57:42.000000000 +0200
>  +++ linux-2.6.8-rc2+BSDacct_IO/drivers/block/ll_rw_blk.c	2004-07-27 09:17:33.149321480 +0200
>  @@ -1949,10 +1949,12 @@ void drive_stat_acct(struct request *rq,
> 
>   	if (rw == READ) {
>   		disk_stat_add(rq->rq_disk, read_sectors, nr_sectors);
>  +		current->rblk += nr_sectors;
>   		if (!new_io)
>   			disk_stat_inc(rq->rq_disk, read_merges);
>   	} else if (rw == WRITE) {
>   		disk_stat_add(rq->rq_disk, write_sectors, nr_sectors);
>  +		current->wblk += nr_sectors;
>   		if (!new_io)
>   			disk_stat_inc(rq->rq_disk, write_merges);
>   	}

The `wblk' accounting will be quite wrong - most writes will be accounted
to pdflush, kjournald, etc.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [from the cache]
©2003-2008