From nobody Mon Jan 08 22:21:29 2024 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T87nv3KJyz5711j for ; Mon, 8 Jan 2024 22:21:39 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from www121.sakura.ne.jp (www121.sakura.ne.jp [153.125.133.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4T87nt5btXz4s3H for ; Mon, 8 Jan 2024 22:21:37 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Authentication-Results: mx1.freebsd.org; none Received: from kalamity.joker.local (123-1-22-158.area1b.commufa.jp [123.1.22.158]) (authenticated bits=0) by www121.sakura.ne.jp (8.17.1/8.17.1/[SAKURA-WEB]/20201212) with ESMTPA id 408MLT7h066137; Tue, 9 Jan 2024 07:21:30 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Tue, 9 Jan 2024 07:21:29 +0900 From: Tomoaki AOKI To: Warner Losh Cc: Xin LI , freebsd-current@freebsd.org Subject: Re: noatime on ufs2 Message-Id: <20240109072129.3e6411b51a2f32945f41decd@dec.sakura.ne.jp> In-Reply-To: References: Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4T87nt5btXz4s3H X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:7684, ipnet:153.125.128.0/18, country:JP] On Mon, 8 Jan 2024 14:12:06 -0700 Warner Losh wrote: > On Mon, Jan 8, 2024 at 1:41 PM Xin LI wrote: > > > > > > > On Sun, Jan 7, 2024 at 5:27 AM void 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, Looks great if possible. Maybe /usr/bin/mail would be almost all of the MUA which actually require atime and local mailboxes (under /var/mail) would usually be used for local cron-generated ones. Others would use POP or IMAP running on different computer in most cases, I think. Regards. -- Tomoaki AOKI