From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael Kerrisk (man-pages)" Subject: Re: Documenting MS_LAZYTIME Date: Fri, 27 Feb 2015 09:01:10 +0100 Message-ID: <54F02446.2050008@gmail.com> References: <54E7578E.4090809@redhat.com> <20150221025636.GB7922@thunk.org> <54EEDE23.6080009@gmail.com> <20150226133113.GD11217@thunk.org> <54EF2161.90607@gmail.com> <20150227000409.GC17174@thunk.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <20150227000409.GC17174-AKGzg7BKzIDYtjvyW6yDsg@public.gmane.org> Sender: linux-man-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Theodore Ts'o Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, Eric Sandeen , Ext4 Developers List , Linux btrfs Developers List , XFS Developers , linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linux-Fsdevel , Linux API List-Id: linux-api@vger.kernel.org On 02/27/2015 01:04 AM, Theodore Ts'o wrote: > On Thu, Feb 26, 2015 at 02:36:33PM +0100, Michael Kerrisk (man-pages)= wrote: >> >> The disadvantage of MS_STRICTATIME | MS_LAZYTIME is that >> in the case of a system crash, the atime and mtime fields >> on disk might be out of date by at most 24 hours. >=20 > I'd change to "The disadvantage of MS_LAZYTIME is that..." and > perhaps move that so it's clear it applies to any use of MS_LAZYTIME > has this as a downside. >=20 > Does that make sense? Thanks, Ted. Got it. So, now we have: MS_LAZYTIME (since Linux 3.20) Reduce on-disk updates of inode timestamps (atime, mtime, ctime) by maintaining these changes only in mem=E2= =80=90 ory. The on-disk timestamps are updated only when: (a) the inode needs to be updated for some change unre=E2= =80=90 lated to file timestamps; (b) the application employs fsync(2), syncfs(2), or sync(2); (c) an undeleted inode is evicted from memory; or (d) more than 24 hours have passed since the inode was written to disk. This mount significantly reduces writes needed to update the inode's timestamps, especially mtime and atime. However, in the event of a system crash, the atime and mtime fields on disk might be out of date by up to 24 hours. Examples of workloads where this option could be of sig=E2= =80=90 nificant benefit include frequent random writes to pre=E2= =80=90 allocated files, as well as cases where the MS_STRICTA=E2= =80=90 TIME mount option is also enabled. (The advantage of (MS_STRICTATIME | MS_LAZYTIME) is that stat(2) will return the correctly updated atime, but the atime updates will be flushed to disk only when (1) the inode needs to be updated for filesystem / data consistency reasons or (2) the inode is pushed out of memory, or (3) the filesystem is unmounted.) Cheers, Michael --=20 Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f177.google.com ([74.125.82.177]:39907 "EHLO mail-we0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754720AbbB0IBV (ORCPT ); Fri, 27 Feb 2015 03:01:21 -0500 Message-ID: <54F02446.2050008@gmail.com> Date: Fri, 27 Feb 2015 09:01:10 +0100 From: "Michael Kerrisk (man-pages)" MIME-Version: 1.0 To: "Theodore Ts'o" CC: mtk.manpages@gmail.com, Eric Sandeen , Ext4 Developers List , Linux btrfs Developers List , XFS Developers , linux-man@vger.kernel.org, Linux-Fsdevel , Linux API Subject: Re: Documenting MS_LAZYTIME References: <54E7578E.4090809@redhat.com> <20150221025636.GB7922@thunk.org> <54EEDE23.6080009@gmail.com> <20150226133113.GD11217@thunk.org> <54EF2161.90607@gmail.com> <20150227000409.GC17174@thunk.org> In-Reply-To: <20150227000409.GC17174@thunk.org> Content-Type: text/plain; charset=UTF-8 Sender: linux-btrfs-owner@vger.kernel.org List-ID: On 02/27/2015 01:04 AM, Theodore Ts'o wrote: > On Thu, Feb 26, 2015 at 02:36:33PM +0100, Michael Kerrisk (man-pages) wrote: >> >> The disadvantage of MS_STRICTATIME | MS_LAZYTIME is that >> in the case of a system crash, the atime and mtime fields >> on disk might be out of date by at most 24 hours. > > I'd change to "The disadvantage of MS_LAZYTIME is that..." and > perhaps move that so it's clear it applies to any use of MS_LAZYTIME > has this as a downside. > > Does that make sense? Thanks, Ted. Got it. So, now we have: MS_LAZYTIME (since Linux 3.20) Reduce on-disk updates of inode timestamps (atime, mtime, ctime) by maintaining these changes only in mem‐ ory. The on-disk timestamps are updated only when: (a) the inode needs to be updated for some change unre‐ lated to file timestamps; (b) the application employs fsync(2), syncfs(2), or sync(2); (c) an undeleted inode is evicted from memory; or (d) more than 24 hours have passed since the inode was written to disk. This mount significantly reduces writes needed to update the inode's timestamps, especially mtime and atime. However, in the event of a system crash, the atime and mtime fields on disk might be out of date by up to 24 hours. Examples of workloads where this option could be of sig‐ nificant benefit include frequent random writes to pre‐ allocated files, as well as cases where the MS_STRICTA‐ TIME mount option is also enabled. (The advantage of (MS_STRICTATIME | MS_LAZYTIME) is that stat(2) will return the correctly updated atime, but the atime updates will be flushed to disk only when (1) the inode needs to be updated for filesystem / data consistency reasons or (2) the inode is pushed out of memory, or (3) the filesystem is unmounted.) Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 379AA7F50 for ; Fri, 27 Feb 2015 02:01:29 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id A9AC8AC006 for ; Fri, 27 Feb 2015 00:01:25 -0800 (PST) Received: from mail-we0-f179.google.com (mail-we0-f179.google.com [74.125.82.179]) by cuda.sgi.com with ESMTP id N7U5wHXUvyAMqjAc (version=TLSv1 cipher=RC4-SHA bits=128 verify=NO) for ; Fri, 27 Feb 2015 00:01:20 -0800 (PST) Received: by wevl61 with SMTP id l61so18130070wev.2 for ; Fri, 27 Feb 2015 00:01:19 -0800 (PST) Message-ID: <54F02446.2050008@gmail.com> Date: Fri, 27 Feb 2015 09:01:10 +0100 From: "Michael Kerrisk (man-pages)" MIME-Version: 1.0 Subject: Re: Documenting MS_LAZYTIME References: <54E7578E.4090809@redhat.com> <20150221025636.GB7922@thunk.org> <54EEDE23.6080009@gmail.com> <20150226133113.GD11217@thunk.org> <54EF2161.90607@gmail.com> <20150227000409.GC17174@thunk.org> In-Reply-To: <20150227000409.GC17174@thunk.org> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: Theodore Ts'o Cc: Eric Sandeen , linux-man@vger.kernel.org, Linux API , XFS Developers , mtk.manpages@gmail.com, Linux-Fsdevel , Ext4 Developers List , Linux btrfs Developers List T24gMDIvMjcvMjAxNSAwMTowNCBBTSwgVGhlb2RvcmUgVHMnbyB3cm90ZToKPiBPbiBUaHUsIEZl YiAyNiwgMjAxNSBhdCAwMjozNjozM1BNICswMTAwLCBNaWNoYWVsIEtlcnJpc2sgKG1hbi1wYWdl cykgd3JvdGU6Cj4+Cj4+ICAgICBUaGUgZGlzYWR2YW50YWdlIG9mIE1TX1NUUklDVEFUSU1FIHwg TVNfTEFaWVRJTUUgaXMgdGhhdAo+PiAgICAgaW4gdGhlIGNhc2Ugb2YgYSBzeXN0ZW0gY3Jhc2gs IHRoZSBhdGltZSBhbmQgbXRpbWUgZmllbGRzCj4+ICAgICBvbiBkaXNrIG1pZ2h0IGJlIG91dCBv ZiBkYXRlIGJ5IGF0IG1vc3QgMjQgaG91cnMuCj4gCj4gSSdkIGNoYW5nZSB0byAiVGhlIGRpc2Fk dmFudGFnZSBvZiBNU19MQVpZVElNRSBpcyB0aGF0Li4uI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1vdW50IHNpZ25pZmljYW50bHkgcmVkdWNlcyB3cml0ZXMgbmVlZGVkIHRvIHVw ZGF0ZQogICAgICAgICAgICAgIHRoZSAgaW5vZGUncyAgdGltZXN0YW1wcywgIGVzcGVjaWFsbHkg IG10aW1lICBhbmQgYXRpbWUuCiAgICAgICAgICAgICAgSG93ZXZlciwgaW4gdGhlIGV2ZW50IG9m IGEgc3lzdGVtIGNyYXNoLCB0aGUgIGF0aW1lICBhbmQKICAgICAgICAgICAgICBtdGltZSAgZmll bGRzICBvbiAgZGlzayBtaWdodCBiZSBvdXQgb2YgZGF0ZSBieSB1cCB0byAyNAogICAgICAgICAg ICAgIGhvdXJzLgoKICAgICAgICAgICAgICBFeGFtcGxlcyBvZiB3b3JrbG9hZHMgd2hlcmUgdGhp cyBvcHRpb24gY291bGQgYmUgb2Ygc2ln4oCQCiAgICAgICAgICAgICAgbmlmaWNhbnQgIGJlbmVm aXQgaW5jbHVkZSBmcmVxdWVudCByYW5kb20gd3JpdGVzIHRvIHByZeKAkAogICAgICAgICAgICAg IGFsbG9jYXRlZCBmaWxlcywgYXMgd2VsbCBhcyBjYXNlcyB3aGVyZSB0aGUgIE1TX1NUUklDVEHi gJAKICAgICAgICAgICAgICBUSU1FICBtb3VudCAgb3B0aW9uICBpcyBhbHNvIGVuYWJsZWQuICAo VGhlIGFkdmFudGFnZSBvZgogICAgICAgICAgICAgIChNU19TVFJJQ1RBVElNRSB8ICBNU19MQVpZ VElNRSkgIGlzICB0aGF0ICBzdGF0KDIpICB3aWxsCiAgICAgICAgICAgICAgcmV0dXJuICB0aGUg IGNvcnJlY3RseSAgdXBkYXRlZCAgYXRpbWUsICBidXQgIHRoZSAgYXRpbWUKICAgICAgICAgICAg ICB1cGRhdGVzIHdpbGwgYmUgZmx1c2hlZCB0byBkaXNrIG9ubHkgd2hlbiAoMSkgdGhlICBpbm9k ZQogICAgICAgICAgICAgIG5lZWRzICB0byAgYmUgIHVwZGF0ZWQgZm9yIGZpbGVzeXN0ZW0gLyBk YXRhIGNvbnNpc3RlbmN5CiAgICAgICAgICAgICAgcmVhc29ucyBvciAoMikgdGhlIGlub2RlIGlz IHB1c2hlZCBvdXQgb2YgbWVtb3J5LCBvciAoMykKICAgICAgICAgICAgICB0aGUgZmlsZXN5c3Rl bSBpcyB1bm1vdW50ZWQuKQoKQ2hlZXJzLAoKTWljaGFlbAoKCi0tIApNaWNoYWVsIEtlcnJpc2sK TGludXggbWFuLXBhZ2VzIG1haW50YWluZXI7IGh0dHA6Ly93d3cua2VybmVsLm9yZy9kb2MvbWFu LXBhZ2VzLwpMaW51eC9VTklYIFN5c3RlbSBQcm9ncmFtbWluZyBUcmFpbmluZzogaHR0cDovL21h bjcub3JnL3RyYWluaW5nLwoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX18KeGZzIG1haWxpbmcgbGlzdAp4ZnNAb3NzLnNnaS5jb20KaHR0cDovL29zcy5zZ2ku Y29tL21haWxtYW4vbGlzdGluZm8veGZzCg==