From: shentino@gmail.com (Raymond Jennings)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Fwd: Re: [PATCH] allow strictatime to be set as a global default
Date: Fri, 25 Dec 2015 09:23:06 -0800 [thread overview]
Message-ID: <1451064186.29678.1@smtp.gmail.com> (raw)
I've been cooking a very simple patch that hopefully gives both sides
of the "great strictatime war" what they want with minimal pain. I
sent it through kernelnewbies for a basic review and got some polish on
irc.
----
Signed-off-by: Raymond Jennings <shentino@gmail.com>
Reviewed-by: Mandeep Sandhu <mandeepsandhu.chd@gmail.com>
diff --git a/fs/Kconfig b/fs/Kconfig
index 6ce72d8..122a993 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -4,6 +4,20 @@
menu "File systems"
+config DEFAULT_STRICTATIME
+ bool "Use strictatime by default"
+ default n
+ help
+ Use strictatime as a default mount option.
+
+ Relatime became the default in 2007 to reduce I/O load on block
devices.
+
+ Enabling this option will restore historic behavior and provide
perfectly
+ accurate atimes, but the increase in write load may reduce
performance
+ and shorten the life of the block device.
+
+ If unsure, say N.
+
# Use unaligned word dcache accesses
config DCACHE_WORD_ACCESS
bool
diff --git a/fs/namespace.c b/fs/namespace.c
index 0570729..48e7c15 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2680,9 +2680,15 @@ long do_mount(const char *dev_name, const char
__user *dir_name,
if (retval)
goto dput_out;
- /* Default to relatime unless overriden */
+#ifdef CONFIG_DEFAULT_STRICTATIME
+ /* Default to strictatime unless overridden */
+ if (flags & MS_RELATIME)
+ mnt_flags |= MNT_RELATIME;
+#else
+ /* Default to relatime unless overridden */
if (!(flags & MS_NOATIME))
mnt_flags |= MNT_RELATIME;
+#endif
/* Separate the per-mountpoint flags */
if (flags & MS_NOSUID)
---------- Forwarded message ----------
From: Mandeep Sandhu <mandeepsandhu.chd@gmail.com>
Subject: Re: [PATCH] allow strictatime to be set as a global default
Date: Sat, 19 Dec 2015 17:25:37 -0800
To: Raymond Jennings <shentino@gmail.com>
Cc: kernelnewbies <kernelnewbies@kernelnewbies.org>
Looks good to me.
To test the real waters....you should send it to the lists you
mentioned (or whatever the maintainers script tells you).
Good luck,
-mandeep
On Sat, Dec 19, 2015 at 1:41 PM, Raymond Jennings <shentino@gmail.com>
wrote:
> How does this version look?
>
> (the other delta for the other file was untouched)
>
> Any chance it is ready to post to the big list (presumably fs with a
> cc to
> lkml)?
>
> diff --git a/fs/Kconfig b/fs/Kconfig
> index 6ce72d8..122a993 100644
> --- a/fs/Kconfig
> +++ b/fs/Kconfig
> @@ -4,6 +4,20 @@
>
> menu "File systems"
>
> +config DEFAULT_STRICTATIME
> + bool "Use strictatime by default"
> + default n
> + help
> + Use strictatime as a default mount option.
> +
> + Relatime became the default in 2007 to reduce I/O load on block
> devices.
> +
> + Enabling this option will restore historic behavior and provide
> perfectly
> + accurate atimes, but the increase in write load may reduce
> performance
> + and shorten the life of the block device.
> +
> + If unsure, say N.
> +
> # Use unaligned word dcache accesses
> config DCACHE_WORD_ACCESS
> bool
>
> On Fri, Dec 18, 2015 at 2:21 PM, Mandeep Sandhu
> <mandeepsandhu.chd@gmail.com> wrote:
>>
>> Ah yes...now it makes sense! :)
>>
>> The current 'word of caution' (about increased I/O load on block
>> devices), seems mild IMHO. Maybe we should we have a stricter
>> warning...something like enabling this option might be harmful to
>> the
>> life of your block device (due to excessive writes) and will also
>> lead
>> to reduced performance?
>>
>> HTH,
>> -mandeep
>>
>>
>> On Fri, Dec 18, 2015 at 2:12 PM, Raymond Jennings
>> <shentino@gmail.com>
>> wrote:
>> > On Fri, Dec 18, 2015 at 10:50 AM, Mandeep Sandhu
>> > <mandeepsandhu.chd@gmail.com> wrote:
>> >>
>> >> You've removed the strictatime option altogether. So how does
>> that
>> >> satisfy people who _do_ want it?
>> >
>> >
>> > ...actually it looks like I was an idiot and got my diff
>> backwards when
>> > I
>> > pulled it out of git :P
>> >
>> > Here's the correct version.
>> >
>> > diff --git a/fs/Kconfig b/fs/Kconfig
>> > index 6ce72d8..4b917eb 100644
>> > --- a/fs/Kconfig
>> > +++ b/fs/Kconfig
>> > @@ -4,6 +4,17 @@
>> >
>> > menu "File systems"
>> >
>> > +config DEFAULT_STRICTATIME
>> > + bool "Use strictatime by default"
>> > + default n
>> > + help
>> > + Use strictatime as a default mount option.
>> > +
>> > + Strictatime preserves ancient historic behavior of
>> keeping the
>> > atime field always up to date.
>> > + However, it was changed in 2007 to relatime to reduce
>> I/O load
>> > on
>> > block devices.
>> > +
>> > + If unsure, say N.
>> > +
>> > # Use unaligned word dcache accesses
>> > config DCACHE_WORD_ACCESS
>> > bool
>> > diff --git a/fs/namespace.c b/fs/namespace.c
>> > index 0570729..48e7c15 100644
>> > --- a/fs/namespace.c
>> > +++ b/fs/namespace.c
>> > @@ -2680,9 +2680,15 @@ long do_mount(const char *dev_name, const
>> char
>> > __user
>> > *dir_name,
>> > if (retval)
>> > goto dput_out;
>> >
>> > - /* Default to relatime unless overriden */
>> > +#ifdef CONFIG_DEFAULT_STRICTATIME
>> > + /* Default to strictatime unless overridden */
>> > + if (flags & MS_RELATIME)
>> > + mnt_flags |= MNT_RELATIME;
>> > +#else
>> > + /* Default to relatime unless overridden */
>> > if (!(flags & MS_NOATIME))
>> > mnt_flags |= MNT_RELATIME;
>> > +#endif
>> >
>> >
>> > /* Separate the per-mountpoint flags */
>> > if (flags & MS_NOSUID)
>> >
>> >
>> >
>
>
WARNING: multiple messages have this Message-ID (diff)
From: Raymond Jennings <shentino@gmail.com>
To: linux-fsdevel@vger.kernel.org
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
kernelnewbies <kernelnewbies@kernelnewbies.org>,
Mandeep Sandhu <mandeepsandhu.chd@gmail.com>
Subject: Fwd: Re: [PATCH] allow strictatime to be set as a global default
Date: Fri, 25 Dec 2015 09:23:06 -0800 [thread overview]
Message-ID: <1451064186.29678.1@smtp.gmail.com> (raw)
I've been cooking a very simple patch that hopefully gives both sides
of the "great strictatime war" what they want with minimal pain. I
sent it through kernelnewbies for a basic review and got some polish on
irc.
----
Signed-off-by: Raymond Jennings <shentino@gmail.com>
Reviewed-by: Mandeep Sandhu <mandeepsandhu.chd@gmail.com>
diff --git a/fs/Kconfig b/fs/Kconfig
index 6ce72d8..122a993 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -4,6 +4,20 @@
menu "File systems"
+config DEFAULT_STRICTATIME
+ bool "Use strictatime by default"
+ default n
+ help
+ Use strictatime as a default mount option.
+
+ Relatime became the default in 2007 to reduce I/O load on block
devices.
+
+ Enabling this option will restore historic behavior and provide
perfectly
+ accurate atimes, but the increase in write load may reduce
performance
+ and shorten the life of the block device.
+
+ If unsure, say N.
+
# Use unaligned word dcache accesses
config DCACHE_WORD_ACCESS
bool
diff --git a/fs/namespace.c b/fs/namespace.c
index 0570729..48e7c15 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2680,9 +2680,15 @@ long do_mount(const char *dev_name, const char
__user *dir_name,
if (retval)
goto dput_out;
- /* Default to relatime unless overriden */
+#ifdef CONFIG_DEFAULT_STRICTATIME
+ /* Default to strictatime unless overridden */
+ if (flags & MS_RELATIME)
+ mnt_flags |= MNT_RELATIME;
+#else
+ /* Default to relatime unless overridden */
if (!(flags & MS_NOATIME))
mnt_flags |= MNT_RELATIME;
+#endif
/* Separate the per-mountpoint flags */
if (flags & MS_NOSUID)
---------- Forwarded message ----------
From: Mandeep Sandhu <mandeepsandhu.chd@gmail.com>
Subject: Re: [PATCH] allow strictatime to be set as a global default
Date: Sat, 19 Dec 2015 17:25:37 -0800
To: Raymond Jennings <shentino@gmail.com>
Cc: kernelnewbies <kernelnewbies@kernelnewbies.org>
Looks good to me.
To test the real waters....you should send it to the lists you
mentioned (or whatever the maintainers script tells you).
Good luck,
-mandeep
On Sat, Dec 19, 2015 at 1:41 PM, Raymond Jennings <shentino@gmail.com>
wrote:
> How does this version look?
>
> (the other delta for the other file was untouched)
>
> Any chance it is ready to post to the big list (presumably fs with a
> cc to
> lkml)?
>
> diff --git a/fs/Kconfig b/fs/Kconfig
> index 6ce72d8..122a993 100644
> --- a/fs/Kconfig
> +++ b/fs/Kconfig
> @@ -4,6 +4,20 @@
>
> menu "File systems"
>
> +config DEFAULT_STRICTATIME
> + bool "Use strictatime by default"
> + default n
> + help
> + Use strictatime as a default mount option.
> +
> + Relatime became the default in 2007 to reduce I/O load on block
> devices.
> +
> + Enabling this option will restore historic behavior and provide
> perfectly
> + accurate atimes, but the increase in write load may reduce
> performance
> + and shorten the life of the block device.
> +
> + If unsure, say N.
> +
> # Use unaligned word dcache accesses
> config DCACHE_WORD_ACCESS
> bool
>
> On Fri, Dec 18, 2015 at 2:21 PM, Mandeep Sandhu
> <mandeepsandhu.chd@gmail.com> wrote:
>>
>> Ah yes...now it makes sense! :)
>>
>> The current 'word of caution' (about increased I/O load on block
>> devices), seems mild IMHO. Maybe we should we have a stricter
>> warning...something like enabling this option might be harmful to
>> the
>> life of your block device (due to excessive writes) and will also
>> lead
>> to reduced performance?
>>
>> HTH,
>> -mandeep
>>
>>
>> On Fri, Dec 18, 2015 at 2:12 PM, Raymond Jennings
>> <shentino@gmail.com>
>> wrote:
>> > On Fri, Dec 18, 2015 at 10:50 AM, Mandeep Sandhu
>> > <mandeepsandhu.chd@gmail.com> wrote:
>> >>
>> >> You've removed the strictatime option altogether. So how does
>> that
>> >> satisfy people who _do_ want it?
>> >
>> >
>> > ...actually it looks like I was an idiot and got my diff
>> backwards when
>> > I
>> > pulled it out of git :P
>> >
>> > Here's the correct version.
>> >
>> > diff --git a/fs/Kconfig b/fs/Kconfig
>> > index 6ce72d8..4b917eb 100644
>> > --- a/fs/Kconfig
>> > +++ b/fs/Kconfig
>> > @@ -4,6 +4,17 @@
>> >
>> > menu "File systems"
>> >
>> > +config DEFAULT_STRICTATIME
>> > + bool "Use strictatime by default"
>> > + default n
>> > + help
>> > + Use strictatime as a default mount option.
>> > +
>> > + Strictatime preserves ancient historic behavior of
>> keeping the
>> > atime field always up to date.
>> > + However, it was changed in 2007 to relatime to reduce
>> I/O load
>> > on
>> > block devices.
>> > +
>> > + If unsure, say N.
>> > +
>> > # Use unaligned word dcache accesses
>> > config DCACHE_WORD_ACCESS
>> > bool
>> > diff --git a/fs/namespace.c b/fs/namespace.c
>> > index 0570729..48e7c15 100644
>> > --- a/fs/namespace.c
>> > +++ b/fs/namespace.c
>> > @@ -2680,9 +2680,15 @@ long do_mount(const char *dev_name, const
>> char
>> > __user
>> > *dir_name,
>> > if (retval)
>> > goto dput_out;
>> >
>> > - /* Default to relatime unless overriden */
>> > +#ifdef CONFIG_DEFAULT_STRICTATIME
>> > + /* Default to strictatime unless overridden */
>> > + if (flags & MS_RELATIME)
>> > + mnt_flags |= MNT_RELATIME;
>> > +#else
>> > + /* Default to relatime unless overridden */
>> > if (!(flags & MS_NOATIME))
>> > mnt_flags |= MNT_RELATIME;
>> > +#endif
>> >
>> >
>> > /* Separate the per-mountpoint flags */
>> > if (flags & MS_NOSUID)
>> >
>> >
>> >
>
>
next reply other threads:[~2015-12-25 17:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-25 17:23 Raymond Jennings [this message]
2015-12-25 17:23 ` Fwd: Re: [PATCH] allow strictatime to be set as a global default Raymond Jennings
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=1451064186.29678.1@smtp.gmail.com \
--to=shentino@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.