mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matti Aarnio <matti.aarnio@zmailer.org>
To: Manik Raina <manik@cisco.com>
Cc: linux-kernel@vger.kernel.org, torvalds@transmeta.com
Subject: Re: [PATCH]: adding counters to count bytes read/written
Date: Mon, 20 May 2002 13:12:22 +0300	[thread overview]
Message-ID: <20020520131222.K9955@mea-ext.zmailer.org> (raw)
In-Reply-To: <Pine.LNX.4.21.0205201506240.14394-100000@localhost.localdomain>

On Mon, May 20, 2002 at 03:09:36PM +0530, Manik Raina wrote:
> Hi Linus,
> 
> 	This patch adds 2 counters to the task_struct for
> 	counting how many bytes were read/written using
> 	the read()/write() system calls. 
> 
> 	These counters may be useful in determining how
> 	many IO requests are made by each process.

  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

  reply	other threads:[~2002-05-20 10:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-20  9:39 Manik Raina
2002-05-20 10:12 ` Matti Aarnio [this message]
2002-05-20 11:03   ` Manik Raina
2002-05-20 18:32     ` Mike Fedyk
2002-05-20 18:51     ` Matti Aarnio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020520131222.K9955@mea-ext.zmailer.org \
    --to=matti.aarnio@zmailer.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manik@cisco.com \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®