From: Steven Whitehouse <swhiteho@redhat.com>
To: Zheng Liu <gnehzuil.liu@gmail.com>
Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2 0/8] Filesystem io types statistic
Date: Mon, 14 Nov 2011 10:23:01 +0000 [thread overview]
Message-ID: <1321266181.2731.8.camel@menhir> (raw)
In-Reply-To: <20111111153246.GA6826@gmail.com>
Hi,
On Fri, 2011-11-11 at 23:32 +0800, Zheng Liu wrote:
> On Fri, Nov 11, 2011 at 10:55:26AM +0000, Steven Whitehouse wrote:
> > Hi,
> >
> > On Thu, 2011-11-10 at 18:34 +0800, Zheng Liu wrote:
> > > Hi all,
> > >
> > > v1->v2: totally redesign this mechanism
> > >
> > > This patchset implements an io types statistic mechanism for filesystem
> > > and it has been added into ext4 to let us know how the ext4 is used by
> > > applications. It is useful for us to analyze how to improve the filesystem
> > > and applications. Nowadays, I have added it into ext4, but other filesytems
> > > also can use it to count the io types by themselves.
> > >
> > > A 'Issue' flag is added into buffer_head and will be set in submit_bh().
> > > Thus, we can check this flag in filesystem to know that a request is issued
> > > to the disk when this flag is set. Filesystems just need to check it in
> > > read operation because filesystem should know whehter a write request hits
> > > cache or not, at least in ext4. In filesystem, buffer needs to be locked in
> > > checking and clearing this flag, but it doesn't cost much overhead.
> > >
>
> Hi Steve,
>
> Thank you for your attention.
>
> > There is already a REQ_META flag available which allows distinction
> > between data and metadata I/O (at least when they are not contained
> > within the same block). If that was to be extended to allow some
> > filesystem specific bits that would solve the problem that you appear to
> > be addressing with these patches in a fs independent way.
>
> You are right. REQ_META flag quite can distinguish between metadata and
> data. But it is difficulty to check this flag in filesystem because
> buffer_head doesn't use it and most of filesystems still use buffer_head
> to submit a IO request. This is the reason why I added a new flag into
> buffer_head.
>
I don't understand what you mean here.... submit_bh() takes a bh and a
set of REQ flags, so there is no reason to not use REQ_META. Using a bh
doesn't prevent setting those flags. The issue is only that few bits
remain unused in those flags and solving the problem in a "nice" way, by
adding a few more flags, may be tricky.
> >
> > That would probably have already been done, except that the REQ_ flags
> > field is already almost full - so it might need the addition of an extra
> > field or some other solution.
>
> In v1[1], a structure called ios is defined. This structure saves some
> information (e.g. IO type) and a callback function. Some interfaces in
> buffer layer are modifed to add a new argument that points to this
> structure. When this request doesn't hit cache and is issued to the
> disk, the callback function in this structure will be called. Filesystem
> can define a function to do some operations. A defect in this solution
> is that it needs to change some interfaces, such bread, breadahead and
> so on. So in v2, I re-implement a new mechanism.
>
> >
> > Either way, an fs independent solution to this problem would be worth
> > considering,
>
> Yes, I am willing to implement an fs independent solution. This is my
> original intention too. So any suggestions are welcome. Thank you.
>
> [1] http://www.spinics.net/lists/linux-ext4/msg28608.html
>
> Regards,
> Zheng
>
Ok. Sounds good. GFS2 already sets REQ_META in all places where metadata
is being written. Now that REQ_META as been demerged from the REQ_PRIO
flag, there is no reason that filesystems cannot set it without fear of
side effects. Its only purpose is as a notification to blktrace now,
Steve.
next prev parent reply other threads:[~2011-11-14 10:23 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-10 10:34 [PATCH v2 0/8] Filesystem io types statistic Zheng Liu
2011-11-10 10:34 ` [PATCH v2 1/8] vfs: Add a new flag and related functions in buffer to count io types Zheng Liu
2011-11-11 10:48 ` Steven Whitehouse
2011-11-11 15:36 ` Zheng Liu
2011-11-10 10:34 ` [PATCH v2 2/8] ext4: Add new data structures and related functions " Zheng Liu
2011-11-11 10:58 ` Steven Whitehouse
2011-11-11 15:45 ` Zheng Liu
2011-11-10 10:34 ` [PATCH v2 3/8] ext4: Count metadata request of read operations in buffered io Zheng Liu
2011-11-10 10:34 ` [PATCH v2 4/8] ext4: Count data " Zheng Liu
2011-11-10 10:34 ` [PATCH v2 5/8] ext4: Count metadata request of write " Zheng Liu
2011-11-10 10:34 ` [PATCH v2 6/8] ext4: Count data " Zheng Liu
2011-11-10 10:34 ` [PATCH v2 7/8] ext4: Count all requests in direct io Zheng Liu
2011-11-10 10:34 ` [PATCH v2 8/8] ext4: Show the result of io types statistic in sysfs Zheng Liu
2011-11-11 10:55 ` [PATCH v2 0/8] Filesystem io types statistic Steven Whitehouse
2011-11-11 15:32 ` Zheng Liu
2011-11-14 10:23 ` Steven Whitehouse [this message]
2011-11-14 13:35 ` Zheng Liu
2011-11-15 18:34 ` Aditya Kali
2011-11-16 8:43 ` Zheng Liu
2011-11-16 10:14 ` Steven Whitehouse
2011-11-18 2:48 ` Zheng Liu
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=1321266181.2731.8.camel@menhir \
--to=swhiteho@redhat.com \
--cc=gnehzuil.liu@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@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).