From: Steven Whitehouse <swhiteho@redhat.com>
To: Zheng Liu <gnehzuil.liu@gmail.com>
Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
Zheng Liu <wenqing.lz@taobao.com>,
Wang Shaoyan <wangshaoyan.pt@taobao.com>
Subject: Re: [PATCH v2 1/8] vfs: Add a new flag and related functions in buffer to count io types
Date: Fri, 11 Nov 2011 10:48:33 +0000 [thread overview]
Message-ID: <1321008513.2710.33.camel@menhir> (raw)
In-Reply-To: <1320921294-30321-2-git-send-email-wenqing.lz@taobao.com>
Hi,
On Thu, 2011-11-10 at 18:34 +0800, Zheng Liu wrote:
> From: Zheng Liu <wenqing.lz@taobao.com>
>
> 'Issue' flag is added into buffer_head to indicate that a request is issued
> to the disk. When an io doesn't hit page cache, 'Issue' flag will be set in
> submit_bh(). Filesystem can understand request is sent to the disk according
> to whether or not this flag is set. This flag will be cleared after filesystem
> tests it. If filesystem doesn't want to count the io type, it can ignore this
> flag.
>
> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
> Signed-off-by: Wang Shaoyan <wangshaoyan.pt@taobao.com>
> ---
> fs/buffer.c | 3 +++
> include/linux/buffer_head.h | 5 +++++
> 2 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/fs/buffer.c b/fs/buffer.c
> index 70a1974..f681caa 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -2920,6 +2920,9 @@ int submit_bh(int rw, struct buffer_head * bh)
> BUG_ON(buffer_delay(bh));
> BUG_ON(buffer_unwritten(bh));
>
> + /* set issue flag for indicating a request is issued to the disk */
> + set_buffer_issue(bh);
> +
> /*
> * Only clear out a write error when rewriting
> */
> diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
> index 458f497..2bccdb4 100644
> --- a/include/linux/buffer_head.h
> +++ b/include/linux/buffer_head.h
> @@ -38,6 +38,10 @@ enum bh_state_bits {
> BH_PrivateStart,/* not a state bit, but the first bit available
> * for private allocation by other entities
> */
> +
> + BH_Issue, /* Issue a request to the disk when this request
> + * doesn't hit cache
> + */
> };
This looks like it will collide with any fs using more than one private
flag, for example, ext4.
Steve.
>
> #define MAX_BUF_PER_PAGE (PAGE_CACHE_SIZE / 512)
> @@ -124,6 +128,7 @@ BUFFER_FNS(Delay, delay)
> BUFFER_FNS(Boundary, boundary)
> BUFFER_FNS(Write_EIO, write_io_error)
> BUFFER_FNS(Unwritten, unwritten)
> +BUFFER_FNS(Issue, issue)
>
> #define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK)
> #define touch_buffer(bh) mark_page_accessed(bh->b_page)
next prev parent reply other threads:[~2011-11-11 10:48 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 [this message]
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
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=1321008513.2710.33.camel@menhir \
--to=swhiteho@redhat.com \
--cc=gnehzuil.liu@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=wangshaoyan.pt@taobao.com \
--cc=wenqing.lz@taobao.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