From patchwork Fri Dec 25 17:23:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raymond Jennings X-Patchwork-Id: 7920841 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 70046BEEE5 for ; Fri, 25 Dec 2015 17:23:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6A1B8203F4 for ; Fri, 25 Dec 2015 17:23:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2488E203EC for ; Fri, 25 Dec 2015 17:23:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753180AbbLYRXM (ORCPT ); Fri, 25 Dec 2015 12:23:12 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:34986 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753141AbbLYRXL (ORCPT ); Fri, 25 Dec 2015 12:23:11 -0500 Received: by mail-pa0-f51.google.com with SMTP id jx14so136056959pad.2 for ; Fri, 25 Dec 2015 09:23:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:subject:to:cc:message-id:mime-version:content-type; bh=OLRR0F0HtYwmk0JFscI5swVv7+ROJQo4/yCgubjVia4=; b=CIiKgOhNLFWEoafePcP9/9tbaUHHGnBUR1+E2DSsWt/4EMBcHR+49zz88APTTKgbxC +Lz1MUYnMawq/IsvZ6awyyaBmBEGeG9yExIcmy3tjRYt4eSX7Afyv5xDBCjUQZWA8R+z +RTLYiVtgtDgFtpJbn0qadKgboM7XE4/JJTZVBSm3ZXNz5UA8oWLQ6dPOvSZSIZl10m1 1z9LqIQVp/safnGXG8wNfFJ+gGJ+OGsTCmjn1j10UYWG0g4d82hQ6gDqBPJxQqWEKAZ8 zsf4lkJfMLf/f9SJA4lKAWD+brv/9/u8KFVz9HB+dDGckRKpih5eWF7E3Ema521dJJuu F82A== X-Received: by 10.66.227.231 with SMTP id sd7mr60715002pac.60.1451064189305; Fri, 25 Dec 2015 09:23:09 -0800 (PST) Received: from [192.168.1.3] (96-41-208-3.dhcp.elbg.wa.charter.com. [96.41.208.3]) by smtp.gmail.com with ESMTPSA id l64sm60753367pfb.40.2015.12.25.09.23.07 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Dec 2015 09:23:08 -0800 (PST) Date: Fri, 25 Dec 2015 09:23:06 -0800 From: Raymond Jennings Subject: Fwd: Re: [PATCH] allow strictatime to be set as a global default To: linux-fsdevel@vger.kernel.org Cc: Alexander Viro , kernelnewbies , Mandeep Sandhu Message-Id: <1451064186.29678.1@smtp.gmail.com> X-Mailer: geary/0.10.0 MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Mandeep Sandhu if (flags & MS_NOSUID) ---------- Forwarded message ---------- From: Mandeep Sandhu Subject: Re: [PATCH] allow strictatime to be set as a global default Date: Sat, 19 Dec 2015 17:25:37 -0800 To: Raymond Jennings Cc: kernelnewbies 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 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 > 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 >> >> wrote: >> > On Fri, Dec 18, 2015 at 10:50 AM, Mandeep Sandhu >> > 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) >> > >> > >> > > > --- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 */