From: Theodore Tso <tytso@mit.edu>
To: Girish Shilamkar <girish@clusterfs.com>
Cc: Ext4 Mailing List <linux-ext4@vger.kernel.org>,
Andreas Dilger <adilger@clusterfs.com>
Subject: Re: [Patch 1/13] iostats
Date: Tue, 24 Jul 2007 10:29:50 -0400 [thread overview]
Message-ID: <20070724142950.GB11826@thunk.org> (raw)
In-Reply-To: <1185275076.3789.66.camel@dhcp4.linsyssoft.com>
On Tue, Jul 24, 2007 at 04:34:36PM +0530, Girish Shilamkar wrote:
>
> +struct struct_io_stats {
> + unsigned long long reads;
> + unsigned long long writes;
> +};
I'd suggest doing something like this instead:
struct struct_io_stats {
int num_fields;
int reserved;
unsigned long long bytes_read;
unsigned long long bytes_written;
};
There are other statistics that you might want to gather. For
example, "read_requests" and "write_requests". Or perhaps some
statistics based on discontiguous read/writes (i.e., i/o operations
that cause seeks). Also, in the future we might want to add some kind
of readahead functionality, and that would probably require more
statistics as well.
> + memset(&track->io_start, 0, sizeof(struct struct_io_stats));
> + if (channel && channel->manager && channel->manager->get_stats)
> + channel->manager->get_stats(channel, &track->io_start);
> }
If you're going to use a caller allocates paradigm, then the caller
would be responsible for doing this:
track->io_start.num_fields = 2;
... so the library routine knows how much of the structure it is safe
for it to fill in. Alternatively, it might be easier to simply have
the io_manager pass back a pointer to its own stats structure, and
then the caller would use the num_fields_size to figure out how much
of the structure it can trust.
- Ted
next prev parent reply other threads:[~2007-07-24 14:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-24 11:04 [Patch 1/13] iostats Girish Shilamkar
2007-07-24 14:29 ` Theodore Tso [this message]
2007-08-04 0:07 ` Theodore Tso
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=20070724142950.GB11826@thunk.org \
--to=tytso@mit.edu \
--cc=adilger@clusterfs.com \
--cc=girish@clusterfs.com \
--cc=linux-ext4@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).