[Devel] [PATCH RHEL7 COMMIT] fs/ext4: Make "lazytime" mount option by default

Vasily Averin vvs at virtuozzo.com
Wed Mar 3 19:43:52 MSK 2021


The commit is pushed to "branch-rh7-3.10.0-1160.15.2.vz7.173.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.15.2.vz7.173.3
------>
commit f198023f31c6791ac76670be7700b3ebe8362f4d
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Wed Mar 3 19:43:52 2021 +0300

    fs/ext4: Make "lazytime" mount option by default
    
    "lazytime" mount option significantly decreases the number of metadata
    updates thus decreasing amount of random i/o.
    
    We definitely want this option to be enabled for all ploop mounts as
    well as for filesystems underlying under ploop images (e.g. /vz).
    
    So the only filesystems which we don't care "lazytime" presense are
    "/", "/boot", etc.
    
    But even for them the option should not hurt, so let's just enable
    the option by default for all ext4 mounts.
    
    To disable "lazytime" option use "-o nolazytime" mount option.
    
    https://jira.sw.ru/browse/PSBM-106544
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 fs/ext4/super.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index ab2abc1..8105567 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4069,6 +4069,13 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 		set_opt(sb, DELALLOC);
 
 	/*
+	 * enable "lazytime" mount option for all ext4 mounts by default
+	 * Use -o nolazytime to turn it off
+	 */
+	if (!IS_EXT3_SB(sb) && !IS_EXT2_SB(sb))
+		sb->s_flags |= MS_LAZYTIME;
+
+	/*
 	 * set default s_li_wait_mult for lazyinit, for the case there is
 	 * no mount option specified.
 	 */


More information about the Devel mailing list