From: Jiaying Zhang <jiayingz@google.com>
To: "Aneesh Kumar K. V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>,
Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH v4 2/3] ext4: use ext4_get_block_write in buffer write
Date: Sun, 17 Jan 2010 21:25:53 -0800 [thread overview]
Message-ID: <5df78e1d1001172125j35bb2925o235c5380ee551d03@mail.gmail.com> (raw)
In-Reply-To: <87zl4c24o5.fsf@linux.vnet.ibm.com>
I agree that unwritten flag would be a better choice. I was thinking
to use it at the beginning but found it would be tricky to get it work.
See e.g. the unwritten flag usage in the current ext4_get_block.
I guess at some time later, we should clean up the buffer head
flag usage.
Jiaying
On Sun, Jan 17, 2010 at 6:21 AM, Aneesh Kumar K. V
<aneesh.kumar@linux.vnet.ibm.com> wrote:
>
> On Fri, 15 Jan 2010 14:30:11 -0500, "Theodore Ts'o" <tytso@mit.edu> wrote:
> > Allocate uninitialized extent before ext4 buffer write and
> > convert the extent to initialized after io completes.
> > The purpose is to make sure an extent can only be marked
> > initialized after it has been written with new data so
> > we can safely drop the i_mutex lock in ext4 DIO read without
> > exposing stale data. This helps to improve multi-thread DIO
> > read performance on high-speed disks.
> >
> > Skip the nobh and data=journal mount cases to make things simple for now.
> >
> > Signed-off-by: Jiaying Zhang <jiayingz@google.com>
> > Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> > ---
> > fs/ext4/ext4.h | 12 +++++-
> > fs/ext4/ext4_jbd2.h | 24 ++++++++++++
> > fs/ext4/extents.c | 22 ++++++-----
> > fs/ext4/inode.c | 105 ++++++++++++++++++++++++++++++++++++++++----------
> > fs/ext4/super.c | 30 +++++++++++++--
> > 5 files changed, 157 insertions(+), 36 deletions(-)
> >
> > diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> > index b1dcbb7..b8b4887 100644
> > --- a/fs/ext4/ext4.h
> > +++ b/fs/ext4/ext4.h
> > @@ -134,6 +134,7 @@ struct mpage_da_data {
> > int retval;
> > };
> > #define EXT4_IO_UNWRITTEN 0x1
> > +#define EXT4_IO_WRITTEN 0x2
> > typedef struct ext4_io_end {
> > struct list_head list; /* per-file finished AIO list */
> > struct inode *inode; /* file being written to */
> > @@ -370,7 +371,7 @@ struct ext4_new_group_data {
> > EXT4_GET_BLOCKS_CREATE_UNINIT_EXT)
> > /* Convert extent to initialized after IO complete */
> > #define EXT4_GET_BLOCKS_IO_CONVERT_EXT (EXT4_GET_BLOCKS_CONVERT|\
> > - EXT4_GET_BLOCKS_IO_CREATE_EXT)
> > + EXT4_GET_BLOCKS_CREATE_UNINIT_EXT)
> >
> > /*
> > * Flags used by ext4_free_blocks
> > @@ -761,6 +762,7 @@ struct ext4_inode_info {
> > #define EXT4_MOUNT_QUOTA 0x80000 /* Some quota option set */
> > #define EXT4_MOUNT_USRQUOTA 0x100000 /* "old" user quota */
> > #define EXT4_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */
> > +#define EXT4_MOUNT_DIOREAD_NOLOCK 0x400000 /* Enable support for dio read nolocking */
> > #define EXT4_MOUNT_JOURNAL_CHECKSUM 0x800000 /* Journal checksums */
> > #define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT 0x1000000 /* Journal Async Commit */
> > #define EXT4_MOUNT_I_VERSION 0x2000000 /* i_version support */
> > @@ -1774,6 +1776,14 @@ static inline void set_bitmap_uptodate(struct buffer_head *bh)
> > set_bit(BH_BITMAP_UPTODATE, &(bh)->b_state);
> > }
> >
> > +/* BH_Uninit flag: blocks are allocated but uninitialized on disk */
> > +enum ext4_state_bits {
> > + BH_Uninit /* blocks are allocated but uninitialized on disk */
> > + = BH_JBDPrivateStart,
> > +};
> > +
> > +BUFFER_FNS(Uninit, uninit)
> > +
>
>
> I asked this in the last post. Why we need a new buffer head flag ?
> Why can't we use the unwritten flag ?
>
> -aneesh
>
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2010-01-18 5:25 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-15 19:30 [PATCH v4 0/3] dioread_nolock patch Theodore Ts'o
2010-01-15 19:30 ` [PATCH v4 1/3] ext4: mechanical change on dio get_block code in prepare for it to be used by buffer write Theodore Ts'o
2010-01-17 14:36 ` Aneesh Kumar K. V
2010-01-17 16:19 ` Eric Sandeen
2010-01-17 16:42 ` Aneesh Kumar K. V
2010-01-18 3:57 ` tytso
2010-01-15 19:30 ` [PATCH v4 2/3] ext4: use ext4_get_block_write in " Theodore Ts'o
2010-01-16 2:17 ` tytso
2010-01-17 14:21 ` Aneesh Kumar K. V
2010-01-18 5:25 ` Jiaying Zhang [this message]
2010-01-15 19:30 ` [PATCH v4 3/3] ext4: Use direct_IO_no_locking in ext4 dio read Theodore Ts'o
2010-01-17 14:19 ` Aneesh Kumar K. V
2010-01-15 19:39 ` [PATCH v4 0/3] dioread_nolock patch Ric Wheeler
2010-01-15 19:52 ` Eric Sandeen
2010-01-15 20:15 ` tytso
2010-01-15 20:17 ` Eric Sandeen
2010-01-15 21:47 ` Michael Rubin
2010-01-22 20:47 ` Valerie Aurora
2010-02-20 0:56 ` Michael Rubin
2010-02-23 0:36 ` Andreas Dilger
2010-02-16 21:07 ` Darrick J. Wong
2010-02-17 19:34 ` Jiaying Zhang
2010-02-19 21:25 ` Darrick J. Wong
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=5df78e1d1001172125j35bb2925o235c5380ee551d03@mail.gmail.com \
--to=jiayingz@google.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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).