From patchwork Mon Dec 24 07:55:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC, 9/9, v1] ext4: set dioread_nolock by default for extent-based files From: Zheng Liu X-Patchwork-Id: 208039 Message-Id: <1356335742-11793-10-git-send-email-wenqing.lz@taobao.com> To: linux-ext4@vger.kernel.org Cc: Zheng Liu Date: Mon, 24 Dec 2012 15:55:42 +0800 From: Zheng Liu After a dio improvement had been done, we can try to set dioread_nolock by default for extent-based files when block size is not smaller than page size. Signed-off-by: Zheng Liu --- Documentation/filesystems/ext4.txt | 5 ++--- fs/ext4/super.c | 8 ++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt index 34ea4f1..b377a1e 100644 --- a/Documentation/filesystems/ext4.txt +++ b/Documentation/filesystems/ext4.txt @@ -368,9 +368,8 @@ dioread_nolock locking. If the dioread_nolock option is specified speed storages. However this does not work with data journaling and dioread_nolock option will be ignored with kernel warning. Note that dioread_nolock - code path is only used for extent-based files. - Because of the restrictions this options comprises - it is off by default (e.g. dioread_lock). + code path is only used for extent-based files. it is + on by default for extent-based files. max_dir_size_kb=n This limits the size of directories so that any attempt to expand them beyond the specified diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 3cdb0a2..e6def09 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3402,6 +3402,14 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) set_opt(sb, DELALLOC); /* + * enable dioread_nolock by default + * Use -o dioread_lock to turn it off + */ + if (!IS_EXT3_SB(sb) && !IS_EXT2_SB(sb) && + EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS)) + set_opt(sb, DIOREAD_NOLOCK); + + /* * set default s_li_wait_mult for lazyinit, for the case there is * no mount option specified. */