Patchwork [2/2] mke2fs: Enable lazy_itable_init on newer kernel by default

login
register
mail settings
Submitter Lukas Czerner
Date Feb. 24, 2014, 5:41 p.m.
Message ID <1393263666-21246-2-git-send-email-lczerner@redhat.com>
Download mbox | patch
Permalink /patch/323707/
State Accepted
Headers show

Comments

Lukas Czerner - Feb. 24, 2014, 5:41 p.m.
Currently is used did not specified lazy_itable_init option we rely on
information from ext4 module exported via sysfs interface. However if
the ext4 module is not loaded it will not be enabled even though kernel
might support it.

With this commit we set the default according to the kernel version,
however we still allow it to be set manually via extended option or be
enabled in case that ext4 module advertise that it supports this
feature.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 misc/mke2fs.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
Eric Sandeen - Feb. 24, 2014, 5:43 p.m.
On 2/24/14, 11:41 AM, Lukas Czerner wrote:
> Currently is used did not specified lazy_itable_init option we rely on

s/is used did not specified/if user did not specify/ :)

> information from ext4 module exported via sysfs interface. However if
> the ext4 module is not loaded it will not be enabled even though kernel
> might support it.
> 
> With this commit we set the default according to the kernel version,
> however we still allow it to be set manually via extended option or be
> enabled in case that ext4 module advertise that it supports this
> feature.
> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>

Thanks,
Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  misc/mke2fs.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/misc/mke2fs.c b/misc/mke2fs.c
> index 957b4b6..e1c6d09 100644
> --- a/misc/mke2fs.c
> +++ b/misc/mke2fs.c
> @@ -2146,7 +2146,15 @@ profile_error:
>  			blocksize, sys_page_size);
>  	}
>  
> -	lazy_itable_init = 0;
> +	/*
> +	 * On newer kernels we do have lazy_itable_init support. So pick the
> +	 * right default in case ext4 module is not loaded.
> +	 */
> +	if (is_before_linux_ver(2, 6, 37))
> +		lazy_itable_init = 0;
> +	else
> +		lazy_itable_init = 1;
> +
>  	if (access("/sys/fs/ext4/features/lazy_itable_init", R_OK) == 0)
>  		lazy_itable_init = 1;
>  
> 

--
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
Lukas Czerner - March 3, 2014, 12:53 p.m.
On Mon, 24 Feb 2014, Eric Sandeen wrote:

> Date: Mon, 24 Feb 2014 11:43:21 -0600
> From: Eric Sandeen <sandeen@redhat.com>
> To: Lukas Czerner <lczerner@redhat.com>, linux-ext4@vger.kernel.org
> Cc: tytso@mit.edu
> Subject: Re: [PATCH 2/2] mke2fs: Enable lazy_itable_init on newer kernel by
>     default
> 
> On 2/24/14, 11:41 AM, Lukas Czerner wrote:
> > Currently is used did not specified lazy_itable_init option we rely on
> 
> s/is used did not specified/if user did not specify/ :)
> 
> > information from ext4 module exported via sysfs interface. However if
> > the ext4 module is not loaded it will not be enabled even though kernel
> > might support it.
> > 
> > With this commit we set the default according to the kernel version,
> > however we still allow it to be set manually via extended option or be
> > enabled in case that ext4 module advertise that it supports this
> > feature.
> > 
> > Signed-off-by: Lukas Czerner <lczerner@redhat.com>
> 
> Thanks,
> Reviewed-by: Eric Sandeen <sandeen@redhat.com>

Hi Ted,

are you planning to take this in ?

Thanks!
-Lukas

> 
> > ---
> >  misc/mke2fs.c | 10 +++++++++-
> >  1 file changed, 9 insertions(+), 1 deletion(-)
> > 
> > diff --git a/misc/mke2fs.c b/misc/mke2fs.c
> > index 957b4b6..e1c6d09 100644
> > --- a/misc/mke2fs.c
> > +++ b/misc/mke2fs.c
> > @@ -2146,7 +2146,15 @@ profile_error:
> >  			blocksize, sys_page_size);
> >  	}
> >  
> > -	lazy_itable_init = 0;
> > +	/*
> > +	 * On newer kernels we do have lazy_itable_init support. So pick the
> > +	 * right default in case ext4 module is not loaded.
> > +	 */
> > +	if (is_before_linux_ver(2, 6, 37))
> > +		lazy_itable_init = 0;
> > +	else
> > +		lazy_itable_init = 1;
> > +
> >  	if (access("/sys/fs/ext4/features/lazy_itable_init", R_OK) == 0)
> >  		lazy_itable_init = 1;
> >  
> > 
> 
> 
--
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
Theodore Ts'o - July 6, 2014, 1:09 a.m.
On Mon, Feb 24, 2014 at 06:41:06PM +0100, Lukas Czerner wrote:
> Currently is used did not specified lazy_itable_init option we rely on
> information from ext4 module exported via sysfs interface. However if
> the ext4 module is not loaded it will not be enabled even though kernel
> might support it.
> 
> With this commit we set the default according to the kernel version,
> however we still allow it to be set manually via extended option or be
> enabled in case that ext4 module advertise that it supports this
> feature.
> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>

Thanks, applied.

					- Ted
--
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

Patch

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 957b4b6..e1c6d09 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -2146,7 +2146,15 @@  profile_error:
 			blocksize, sys_page_size);
 	}
 
-	lazy_itable_init = 0;
+	/*
+	 * On newer kernels we do have lazy_itable_init support. So pick the
+	 * right default in case ext4 module is not loaded.
+	 */
+	if (is_before_linux_ver(2, 6, 37))
+		lazy_itable_init = 0;
+	else
+		lazy_itable_init = 1;
+
 	if (access("/sys/fs/ext4/features/lazy_itable_init", R_OK) == 0)
 		lazy_itable_init = 1;