Mailinglist Archive: opensuse (946 mails)

< Previous Next >
[opensuse] About relatime and lazytime
Hi,

relatively recently, "lazytime" has been added as the default for mounts - from
man mount:


lazytime
Only update times (atime, mtime, ctime) on the
in-memory version of the file inode.

This mount option significantly reduces writes
to the inode table for workloads that perform
frequent random writes to preallocated files.

The on-disk timestamps are updated only when:

- the inode needs to be updated for some change
unrelated to file timestamps

- the application employs fsync(2), syncfs(2),
or sync(2)

- an undeleted inode is evicted from memory

- more than 24 hours have passed since the i-
node was written to disk.

I understand that using this option (which is the default) supersedes using
"relatime". However, I noticed that most mounts, not all, are using both
options:

Telcontar:~ # mount | grep relatime | grep lazytime
/dev/sdd2 on /data/storage_d type xfs
(rw,relatime,lazytime,attr2,inode64,noquota)
/dev/sdb8 on /opt type xfs (rw,relatime,lazytime,attr2,inode64,noquota)
/dev/sdb10 on /data/storage_b type xfs
(rw,relatime,lazytime,attr2,inode64,noquota)
/dev/sda13 on /data/storage_a type xfs
(rw,relatime,lazytime,attr2,inode64,noquota)
/dev/sdc13 on /var/spool/news type reiserfs
(rw,relatime,lazytime,user_xattr,acl)
/dev/sda12 on /data/vmware type xfs
(rw,relatime,lazytime,attr2,inode64,noquota)
/dev/sdc14 on /data/homedvl type reiserfs
(rw,relatime,lazytime,user_xattr,acl)
/dev/sdc7 on /usr/local type reiserfs (rw,relatime,lazytime,user_xattr,acl)
/dev/sdc12 on /usr/gamedata type reiserfs
(rw,relatime,lazytime,user_xattr,acl)
/dev/sdc6 on /usr/src type reiserfs (rw,relatime,lazytime,user_xattr,acl)
/dev/sdc16 on /data/storage_c type xfs
(rw,relatime,lazytime,attr2,inode64,noquota)
/dev/sdc5 on /home_aux type xfs (rw,relatime,lazytime,attr2,inode64,noquota)
/dev/sdc8 on /home1 type xfs (rw,relatime,lazytime,attr2,inode64,noquota)
/dev/md0 on /data/raid type xfs
(rw,relatime,lazytime,attr2,inode64,logbsize=128k,sunit=256,swidth=512,noquota)
/dev/mapper/cr_cripta on /data/cripta type xfs
(rw,relatime,lazytime,attr2,inode64,noquota)
/dev/sda7 on /other/test_a1 type reiserfs
(rw,relatime,lazytime,user_xattr,acl)
Telcontar:~ #


Mounts that only use relatime:

Telcontar:~ # mount | grep relatime | grep -v lazytime
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
securityfs on /sys/kernel/security type securityfs
(rw,nosuid,nodev,noexec,relatime)
devpts on /dev/pts type devpts
(rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
cgroup on /sys/fs/cgroup/systemd type cgroup
(rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/pids type cgroup
(rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup
(rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/memory type cgroup
(rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/freezer type cgroup
(rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup
(rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/hugetlb type cgroup
(rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/devices type cgroup
(rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/blkio type cgroup
(rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/cpuset type cgroup
(rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/perf_event type cgroup
(rw,nosuid,nodev,noexec,relatime,perf_event)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/sde5 on / type ext4 (rw,relatime,data=ordered)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs
(rw,relatime,fd=35,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
nfsd on /proc/fs/nfsd type nfsd (rw,relatime)
/dev/sde4 on /boot type ext2
(rw,relatime,block_validity,barrier,user_xattr,acl)
/dev/sdc17 on /home type ext4 (rw,relatime,data=ordered)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
tmpfs on /run/user/0 type tmpfs
(rw,nosuid,nodev,relatime,size=817444k,mode=700)
tmpfs on /var/run/user/0 type tmpfs
(rw,nosuid,nodev,relatime,size=817444k,mode=700)
tmpfs on /run/user/1000 type tmpfs
(rw,nosuid,nodev,relatime,size=817444k,mode=700,uid=1000,gid=100)
tmpfs on /var/run/user/1000 type tmpfs
(rw,nosuid,nodev,relatime,size=817444k,mode=700,uid=1000,gid=100)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse
(rw,nosuid,nodev,relatime,user_id=1000,group_id=100)
gvfsd-fuse on /var/run/user/1000/gvfs type fuse.gvfsd-fuse
(rw,nosuid,nodev,relatime,user_id=1000,group_id=100)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
Telcontar:~ #


Ie, ext4 parttions use only relatime, and non real disk partitions.
xfs and reiserfs use both relatime and lazytime.


It is not my doing:

Telcontar:~ # grep relatime /etc/fstab
# default is "relatime", no need to add it (or atime,nodiratime)
#/dev/mapper/cr_storage_e /data/test xfs
nofail,relatime,noauto 1 5
Telcontar:~ #


relatime
Update inode access times relative to mod-
ify or change time. Access time is only
updated if the previous access time was
earlier than the current modify or change
time. (Similar to noatime, but it doesn't
break mutt or other applications that need
to know if a file has been read since the
last time it was modified.)

Since Linux 2.6.30, the kernel defaults to
the behavior provided by this option
(unless noatime was specified), and the
strictatime option is required to obtain
traditional semantics. In addition, since
Linux 2.6.30, the file's last access time
is always updated if it is more than 1 day
old.



Should I use "norelatime" manually on fstab entries?


--
Cheers / Saludos,

Carlos E. R.
(from 42.2 x86_64 "Malachite" at Telcontar)

< Previous Next >