[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080727163323.GA1802@tv-sign.ru>
Date: Sun, 27 Jul 2008 20:33:23 +0400
From: Oleg Nesterov <oleg@...sign.ru>
To: Andrea Righi <righi.andrea@...il.com>
Cc: torvalds@...ux-foundation.org, akpm@...ux-foundation.org,
balbir@...ux.vnet.ibm.com, matt@...ehost.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] task IO accounting: improve code readability
On 07/27, Andrea Righi wrote:
>
> Put all i/o statistics in struct proc_io_accounting and use inline functions to
> initialize and increment statistics, removing a lot of single variable
> assignments.
Imho, the change like this is obviously good, but can't we simplify
this a little bit? Just make
struct task_io_accounting
{
#ifdef CONFIG_TASK_XACCT
/* bytes read */
u64 rchar;
/* bytes written */
u64 wchar;
/* # of read syscalls */
u64 syscr;
/* # of write syscalls */
u64 syscw;
#endif /* CONFIG_TASK_XACCT */
#ifdef CONFIG_TASK_IO_ACCOUNTING
/*
* The number of bytes which this task has caused to be read from
* storage.
*/
u64 read_bytes;
/*
* The number of bytes which this task has caused, or shall cause to be
* written to disk.
*/
u64 write_bytes;
/*
* A task can cause "negative" IO too. If this task truncates some
* dirty pagecache, some IO which another task has been accounted for
* (in its write_bytes) will not be happening. We _could_ just
* subtract that from the truncating task's write_bytes, but there is
* information loss in doing that.
*/
u64 cancelled_write_bytes;
#endif
};
This should make the patch much smaller with the same effect, no?
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists