Skip to contentSkip to conversation

allow strictatime to be set as a global default

PATCH New Raymond Jennings 2 participants 6 messages Dec 18, 2015 – Dec 20, 2015 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 allow strictatime to be set as a global default

I'm aware of a little tiff regarding strictatime in the past, and I think I came up with a patch that might help everyone get what they want. I'm already using it myself.

I've had some review on #kernelnewbies for technical issues, how does this look?

---

fs/Kconfig +0 -7
index 4b917eb..6ce72d8 100644
@@ -4,17 +4,6 @@
 
 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

fs/namespace.c +0 -0
index 48e7c15..0570729 100644
@@ -2680,15 +2680,9 @@ long do_mount(const char *dev_name, const char 

__user *dir_name,
if (retval)
goto dput_out;

-#ifdef CONFIG_DEFAULT_STRICTATIME
- /* Default to strictatime unless overridden */
- if (flags & MS_RELATIME)
- mnt_flags |= MNT_RELATIME;
-#else
- /* Default to relatime unless overridden */
+ /* Default to relatime unless overriden */
if (!(flags & MS_NOATIME))
mnt_flags |= MNT_RELATIME;
-#endif

/* Separate the per-mountpoint flags */
if (flags & MS_NOSUID)

#1 lore raw

PATCH 1/1 allow strictatime to be set as a global default

You've removed the strictatime option altogether. So how does that satisfy people who _do_ want it?

Is there some other option that will enable it? Just curious.

-mandeep

Quoted 63 lines · Raymond Jennings

I'm aware of a little tiff regarding strictatime in the past, and I think I came up with a patch that might help everyone get what they want. I'm already using it myself.

I've had some review on #kernelnewbies for technical issues, how does this look?

---

fs/Kconfig +0 -7
index 4b917eb..6ce72d8 100644
@@ -4,17 +4,6 @@
 
 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.

fs/Kconfig +0 -3
-
-         If unsure, say N.
-
 # Use unaligned word dcache accesses
 config DCACHE_WORD_ACCESS
        bool
fs/namespace.c +1 -7
index 48e7c15..0570729 100644
@@ -2680,15 +2680,9 @@ long do_mount(const char *dev_name, const char
 __user *dir_name,
        if (retval)
                goto dput_out;
 
-#ifdef CONFIG_DEFAULT_STRICTATIME
-       /* Default to strictatime unless overridden */
-       if (flags & MS_RELATIME)
-               mnt_flags |= MNT_RELATIME;
-#else
-       /* Default to relatime unless overridden */
+       /* Default to relatime unless overriden */
        if (!(flags & MS_NOATIME))
                mnt_flags |= MNT_RELATIME;
-#endif
 
        /* Separate the per-mountpoint flags */

if (flags & MS_NOSUID)

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

#2 lore raw

PATCH 1/1 allow strictatime to be set as a global default

Quoted 2 lines · Mandeep Sandhu

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.

fs/Kconfig +7 -0
index 6ce72d8..4b917eb 100644
@@ -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

fs/namespace.c +0 -0
index 0570729..48e7c15 100644
@@ -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)

#3 lore raw

PATCH 1/1 allow strictatime to be set as a global default

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

Quoted 62 lines · Raymond Jennings
Quoted 3 lines · Mandeep Sandhu

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.

fs/Kconfig +0 -0
index 6ce72d8..4b917eb 100644
@@ -4,6 +4,17 @@
 

menu "File systems"

fs/Kconfig +7 -0
+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.

fs/Kconfig +3 -0
+
+         If unsure, say N.
+

# Use unaligned word dcache accesses
config DCACHE_WORD_ACCESS
bool

fs/namespace.c +7 -1
index 0570729..48e7c15 100644
@@ -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)

#4 lore raw

PATCH 1/1 allow strictatime to be set as a global default

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)?

fs/Kconfig +14 -0
index 6ce72d8..122a993 100644
@@ -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 <[email protected]

Quoted 75 lines

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

Quoted 27 lines · Raymond Jennings
Quoted 3 lines · Mandeep Sandhu

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.

fs/Kconfig +0 -0
index 6ce72d8..4b917eb 100644
@@ -4,6 +4,17 @@
 

menu "File systems"

fs/Kconfig +7 -0
+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
Quoted 2 lines

atime field always up to date.
+ However, it was changed in 2007 to relatime to reduce I/O load

on

fs/namespace.c long do_mount(const char *dev_name, const char

Quoted 12 lines

block devices.

fs/Kconfig +3 -0
+
+         If unsure, say N.
+

# Use unaligned word dcache accesses
config DCACHE_WORD_ACCESS
bool

fs/namespace.c +0 -0
index 0570729..48e7c15 100644
@@ -2680,9 +2680,15 @@ long do_mount(const char *dev_name, const char

__user

Quoted 16 lines
fs/namespace.c +7 -1
 *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
 
 
Quoted 6 lines
Quoted 5 lines

/* Separate the per-mountpoint flags */
if (flags & MS_NOSUID)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20151219/06289244/attachment.html

#5 lore raw

PATCH 1/1 allow strictatime to be set as a global default

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

Quoted 117 lines · Raymond Jennings

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)?

fs/Kconfig +14 -0
index 6ce72d8..122a993 100644
@@ -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
Quoted 80 lines · Mandeep Sandhu

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

Quoted 65 lines · Raymond Jennings
Quoted 3 lines · Mandeep Sandhu

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.

fs/Kconfig +0 -0
index 6ce72d8..4b917eb 100644
@@ -4,6 +4,17 @@
 

menu "File systems"

fs/Kconfig +7 -0
+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.

fs/Kconfig +3 -0
+
+         If unsure, say N.
+

# Use unaligned word dcache accesses
config DCACHE_WORD_ACCESS
bool

fs/namespace.c +0 -0
index 0570729..48e7c15 100644
@@ -2680,9 +2680,15 @@ long do_mount(const char *dev_name, const char

__user
*dir_name,

        if (retval)
                goto dput_out;
fs/namespace.c +7 -1
-       /* 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)