These are defined as UINTegers, are you sure that is appropriate type ?
What to do when they will overflow ? For short term activity tracking
they may be ok (4GB/200 MB/sec = 20 sec to wrap around), but for accounting
the overflow might not be liked thing..
For short-term IO-activity tracking they may indeed make sense, but I
would add another pair of counters to assist on that tracking. Namely
"values at the end of previous interval", which are maintained by the
activity tracking code.
Reading one byte at the time won't grow those counters very fast, but will
cause massive amounts of syscalls, and context switches, so tracking data
amount alone isn't good enough.
....
> diff -u -r ../temp/linux-2.5.12/include/linux/sched.h ./include/linux/sched.h
> --- ../temp/linux-2.5.12/include/linux/sched.h Wed May 1 05:38:47 2002
> +++ ./include/linux/sched.h Mon May 20 09:25:32 2002
> @@ -315,6 +315,7 @@
> int link_count, total_link_count;
> struct tty_struct *tty; /* NULL if no tty */
> unsigned int locks; /* How many file locks are being held */
> + unsigned int bytes_written, bytes_read;
> /* ipc stuff */
> struct sysv_sem sysvsem;
> /* CPU-specific state of this task */
/Matti Aarnio
-
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/