Re: [patch 2.6.8.1] BSD accounting: update chars transferred value

From: Guillaume Thouvenin
Date: Wed Sep 08 2004 - 06:04:20 EST


On Wed, Sep 08, 2004 at 10:17:04AM +0100, Christoph Hellwig wrote:
> On Wed, Sep 08, 2004 at 11:06:57AM +0200, Guillaume Thouvenin wrote:
> > Hello,
> >
> > The goal of this patch is to improve BSD accounting by using what
> > is done in the CSA into BSD accounting. The final goal is to have a
> > uniform accounting structure.
> >
> > This patch updates information given by BSD accounting concerning
> > bytes read and written. A field is already present in the BSD accounting
> > structure but it is never updated. We don't add information about blocks
> > read and written because, as it was discussed in previous email, the
> > information is inaccurate. Most writes which are flushed delayed would
> > get accounted to pdflushd. Thus, one solution to get this kind of
> > information is to add counters when the write back is performed. The
> > problem is that we don't know how to get information about the IID at
> > the page level (ie from struct page). So we remove this information for
> > the moment and it will be provided in another patch.
> >
> > Changelog:
> >
> > - Adds two counters in the task_struct (rchar, wchar)
> > - Init fields during the creation of the process (during the fork)
> > - File I/O operations are done through sys_read(), sys_write(),
> > sys_readv(), sys_writev() and sys_sendfile(). Thus we increment
> > counters into those functions except with sys_sendfile(). For the
> > latter, the incrementation is done in the do_sendfile() because this
> > routine be directly called from the return of sys_sendfile().
>
> I think it should be done in vfs_readv/vfs_write. Else we'll miss the
> updates from inekrnel consumers like nfsd.

Yes you're right. vfs_readv() and vfs_writev() called do_readv_writev().
Thus I will send a new patch which updates counters in functions
vfs_read(), vfs_write(), do_readv_writev() and sys_sendfile()
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/