On 2021-12-14 12:41, Carlos E. R. wrote:
Hi,
I have a problem with my one remaining reiserfs partition on rotating rust.
The problem I initially detected was that telling the machine to hibernate sometimes appeared to stall, and I had to force a power off (via physical power switch) to recover. In fact, I found out later, the kernel was simply syncing one partition, and this operation would take half an hour, which it is absurd.
Later I found out that it was only one partition affected, and this partition was (is) reiserfs. Then I guessed that the slow operation was syncing the metadata (the time stamps) of the news (nntp) spool.
Traditionally a news server touches (and use) the access timestamp each time a post is read, affecting one file per read. With the default mount options used nowdays this modification stays in RAM for long, many hours.
So, the cronjob that scans the news spool now also calls sync on that filesystem, and when hibernating I call sync in advance. This improved things, but not completely.
Thus I finally resorted to moving the news spool only to another reiserfs partition created on an SSD disk, which usually syncs in seconds, instead of half an hour.
So I thought, problem solved.
But later on I noticed that the sync operation prior to hibernating on the old reiserfs partition still takes long, but only on some days - even if nothing writes there now. This is astonishing. Look, last Monday:
Telcontar:~ # hibernate 2021-12-13 04:26:18+01:00 Checking news to send 2021-12-13 04:26:22+01:00 Syncing rm: cannot remove '/var/lib/news/bin/cronscriptparafetchnews.enabled': No such file or directory 2021-12-13 06:06:09+01:00 synced. Now screensaver xscreensaver-command: no screensaver is running on display :0.0
touch /var/lib/news/bin/cronscriptparafetchnews.enabled Telcontar:~ #
An hour and a half to sync a not used partition!
(I know it is only one partition because I monitor it with gkrellm)
Hibernation script:
date --rfc-3339=seconds echo Checking news to send /var/lib/news/bin/cronscriptparaenviarnewspendientes date --rfc-3339=seconds echo Syncing rm /var/lib/news/bin/cronscriptparafetchnews.enabled strace -o /tmp/hibernate.strace sync date --rfc-3339=seconds echo "synced. Now screensaver" xscreensaver-command -lock sleep 3 #sudo chvt 10 #sleep 1 sudo /usr/local/sbin/beep sleep 1
#systemctl hibernate sudo /usr/bin/systemctl hibernate
The structure of the mount is this:
Telcontar:~ # mount | grep sdc9 /dev/sdc9 on /data/Lareiserfs type reiserfs (rw,relatime,lazytime,user_xattr,acl) /dev/sdc9 on /usr/src type reiserfs (rw,relatime,lazytime,user_xattr,acl) /dev/sdc9 on /home/cer/terrasync type reiserfs (rw,relatime,lazytime,user_xattr,acl) /dev/sdc9 on /data/homedvl type reiserfs (rw,relatime,lazytime,user_xattr,acl) /dev/sdc9 on /usr/share/flightgear type reiserfs (rw,relatime,lazytime,user_xattr,acl) Telcontar:~ #
The first one is the actual mount, the rest are bind mounts - fstab:
LABEL=c_data_reiser /data/Lareiserfs reiserfs acl,user_xattr,barrier=flush,lazytime 1 3
/data/Lareiserfs/gamedata/flightgear /usr/share/flightgear none bind 0 0 /data/Lareiserfs/gamedata/terrasync /home/cer/terrasync none bind 0 0 /data/Lareiserfs/data_homedvl /data/homedvl none bind 0 0 /data/Lareiserfs/usr_src /usr/src none bind 0 0
Now I have added entries to my hibernate script to sync each reiserfs bind mount separately, find out which one it is, if any.
When I started upgrading my machines to 15.3, I learned that Reiserfs is no longer supported (not mentioned in the release notes), so I finally migrated this partition to ext4. Apparently both XFS and btrfs behave badly with many small files, and ext4 has a tuning for news: Telcontar:~ # mkfs.ext4 -T news -L c_data_exreiser /dev/sdc9 -T usage-type[,...] Specify how the filesystem is going to be used, so that mke2fs can choose optimal filesystem parameters for that use. The usage types that are sup- ported are defined in the configuration file /etc/mke2fs.conf. The user may specify one or more usage types using a comma separated list. If this option is is not specified, mke2fs will pick a single default usage type based on the size of the filesys- tem to be created. If the filesystem size is less than 3 megabytes, mke2fs will use the filesystem type floppy. If the filesystem size is greater than or equal to 3 but less than 512 megabytes, mke2fs(8) will use the filesystem type small. If the filesys- tem size is greater than or equal to 4 terabytes but less than 16 terabytes, mke2fs(8) will use the filesystem type big. If the filesystem size is greater than or equal to 16 terabytes, mke2fs(8) will use the filesystem type huge. Otherwise, mke2fs(8) will use the default filesystem type default. /etc/mke2fs.conf: news = { inode_ratio = 4096 } (default is 16384) Mount options are: LABEL=c_data_exreiser /data/WasReiserfs ext4 \ acl,user_xattr,relatime,lazytime 1 3 which results in: /dev/sdc9 on /data/WasReiserfs type ext4 (rw,relatime,lazytime) (why the other options are ignored I don't know, but I suspect systemd interfering somehow). I do not observe any delay in hibernating the machine or issuing sync orders, which run instantly (5 seconds for the entire filesystem), so my take is that currently reiserfs has a problem with lazytime that other filesystems do not have. -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)