Date: Mon, 8 Jan 2024 14:12:06 -0700 From: Warner Losh <imp@bsdimp.com> To: Xin LI <delphij@gmail.com> Cc: freebsd-current@freebsd.org Subject: Re: noatime on ufs2 Message-ID: <CANCZdfpf0k4od%2B1_cNDiKR=HPwMZ0GsWhH9O6yRi=F72BwJRDg@mail.gmail.com> In-Reply-To: <CAGMYy3vsSD7HHtGxYXJn%2Busr8GCOd-0Xe1crs-Nx=qw-bYJ6HA@mail.gmail.com> References: <ZZqmmM-6f606bLJx@int21h> <CAGMYy3vsSD7HHtGxYXJn%2Busr8GCOd-0Xe1crs-Nx=qw-bYJ6HA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Mon, Jan 8, 2024 at 1:41 PM Xin LI <delphij@gmail.com> wrote: > > > On Sun, Jan 7, 2024 at 5:27 AM void <void@f-m.fm> wrote: > >> Hi, >> >> Does /var/mail still need atime? >> >> I've installed a ufs2-based -current main-n267425-aa1223ac3afc on >> rpi4/8BG which installs into one / . If it's mounted with noatime, >> will it have consequences for /var/mail ? > > > It doesn't matter if you don't normally receive emails locally (nowadays, > it's rare). > > If you do receive emails locally, it depends on what application(s) that > you are using. Most applications nowadays check both mtime and atime plus > sizes of the mailbox file and do not rely on atime (because they saved the > previous mtime). Without atime updates, some application may claim that > you have new mail when the mailbox is not empty when they first start. > > That's said, if I were you and I'm using some flash based storage (with > rpi it's highly likely) regardless if I'm using mail locally; most of the > time the data is not really useful for anything, and it does increase the > wear of your storage. > > This reminds me that -- we probably should have implemented the Linux > "relative atime" (update atime iff (atime <= mtime || atime <= ctime) || > atime is older than a day) and "no diratime" (don't update directory atime) > for UFS and make the "relatime" option the default; I had an > incomplete implementation about a decade ago somewhere but with the recent > VFS changes it's probably easier to start over. IMHO, updating atime every > time when a file is accessed is not really providing useful data (like who > accessed the file, etc.) for audit purposes and does come with performance > (more write I/O) and reliability (wear of SSD and other flash devices) > cost, therefore not generally useful in modern days. The Linux relative > atime is a pretty clever idea that has covered the most useful use case for > atime (Did I accessed the file after it was last modified) and also > provided a coarse-grained update (capped to daily, which is a reasonable > compromise) to the atime. > I like that compromise. It will miss a lot, but that 'miss' results in atime being good to only about a day, which for the vast majority of things is fine. Warner > Cheers, > [-- Attachment #2 --] <div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 8, 2024 at 1:41 PM Xin LI <<a href="mailto:delphij@gmail.com">delphij@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div style="font-family:monospace,monospace"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 7, 2024 at 5:27 AM void <<a href="mailto:void@f-m.fm" target="_blank">void@f-m.fm</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br> <br> Does /var/mail still need atime?<br> <br> I've installed a ufs2-based -current main-n267425-aa1223ac3afc on<br> rpi4/8BG which installs into one / . If it's mounted with noatime,<br> will it have consequences for /var/mail ?</blockquote><div><br></div><div style="font-family:monospace,monospace">It doesn't matter if you don't normally receive emails locally (nowadays, it's rare).</div><div style="font-family:monospace,monospace"><br></div><div style="font-family:monospace,monospace">If you do receive emails locally, it depends on what application(s) that you are using. Most applications nowadays check both mtime and atime plus sizes of the mailbox file and do not rely on atime (because they saved the previous mtime). Without atime updates, some application may claim that you have new mail when the mailbox is not empty when they first start.</div><div style="font-family:monospace,monospace"><br></div><div style="font-family:monospace,monospace">That's said, if I were you and I'm using some flash based storage (with rpi it's highly likely) regardless if I'm using mail locally; most of the time the data is not really useful for anything, and it does increase the wear of your storage.</div><div style="font-family:monospace,monospace"><br></div><div style="font-family:monospace,monospace">This reminds me that -- we probably should have implemented the Linux "relative atime" (update atime iff (atime <= mtime || atime <= ctime) || atime is older than a day) and "no diratime" (don't update directory atime) for UFS and make the "relatime" option the default; I had an incomplete implementation about a decade ago somewhere but with the recent VFS changes it's probably easier to start over. IMHO, updating atime every time when a file is accessed is not really providing useful data (like who accessed the file, etc.) for audit purposes and does come with performance (more write I/O) and reliability (wear of SSD and other flash devices) cost, therefore not generally useful in modern days. The Linux relative atime is a pretty clever idea that has covered the most useful use case for atime (Did I accessed the file after it was last modified) and also provided a coarse-grained update (capped to daily, which is a reasonable compromise) to the atime.</div></div></div></blockquote><div><br></div><div>I like that compromise. It will miss a lot, but that 'miss' results in atime being good to only about a day, which for the vast majority of things is fine. </div><div><br></div><div>Warner</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div style="font-family:monospace,monospace">Cheers,</div></div></div> </blockquote></div></div>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpf0k4od%2B1_cNDiKR=HPwMZ0GsWhH9O6yRi=F72BwJRDg>
