* ext4: slow unmount with large clean page cache; is fsfreeze→umount recommended?
@ 2025-09-09 10:19 Richter, Rafael
0 siblings, 0 replies; 3+ messages in thread
From: Richter, Rafael @ 2025-09-09 10:19 UTC (permalink / raw)
To: linux-ext4@vger.kernel.org
Hi,
we consistently see slow unmounts (~6–8s) on ext4 after heavy buffered writes
(e.g., dd ~30 GiB) that grow the page cache. Same test on XFS unmounts <1s on
the same hardware, but we must stay on ext4.
Env:
- Kernel: 6.6.36 (Yocto-based)
- Device: SSD via mdraid (/dev/md0p1)
- Mount: ext4 on /mnt/disk (defaults)
Repro:
dd if=/dev/zero of=/mnt/disk/big.bin bs=1M count=30720 status=progress
sync -f /mnt/disk
time umount /mnt/disk # ext4: ~6–8s
Observations:
- Dirty/Writeback are ~0 before unmount.
- `fsfreeze -f /mnt/disk` immediately before `umount` makes unmount very fast.
- `mount -o remount,ro` before `umount` does NOT improve unmount time.
Questions:
1) Is this unmount time expected on ext4 with a large *clean* page cache?
2) Why is XFS unmount much faster here—any ext4-side reasons or regressions?
3) Is `fsfreeze -f` → `umount` acceptable/recommended for shutdown on ext4?
Any ext4/VFS options or per-filesystem methods to reduce unmount time?
Looking forward for an answer!
Thx,
Rafael
^ permalink raw reply [flat|nested] 3+ messages in thread* ext4: slow unmount with large clean page cache; is fsfreeze→umount recommended?
@ 2025-09-12 14:20 Richter, Rafael
2025-09-17 15:58 ` Jan Kara
0 siblings, 1 reply; 3+ messages in thread
From: Richter, Rafael @ 2025-09-12 14:20 UTC (permalink / raw)
To: linux-ext4@vger.kernel.org
Hi,
we consistently see slow unmounts (~6–8s) on ext4 after heavy buffered writes
(e.g., dd ~30 GiB) that grow the page cache. Same test on XFS unmounts <1s on
the same hardware, but we must stay on ext4.
Env:
- Kernel: 6.6.36 (Yocto-based)
- Device: SSD via mdraid (/dev/md0p1)
- Mount: ext4 on /mnt/disk (defaults)
Repro:
dd if=/dev/zero of=/mnt/disk/big.bin bs=1M count=30720 status=progress
sync -f /mnt/disk
time umount /mnt/disk # ext4: ~6–8s
Observations:
- Dirty/Writeback are ~0 before unmount.
- `fsfreeze -f /mnt/disk` immediately before `umount` makes unmount very fast.
- `mount -o remount,ro` before `umount` does NOT improve unmount time.
Questions:
1) Is this unmount time expected on ext4 with a large *clean* page cache?
2) Why is XFS unmount much faster here—any ext4-side reasons or regressions?
3) Is `fsfreeze -f` → `umount` acceptable/recommended for shutdown on ext4?
Any ext4/VFS options or per-filesystem methods to reduce unmount time?
Looking forward for an answer!
Thx,
Rafael
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ext4: slow unmount with large clean page cache; is fsfreeze→umount recommended?
2025-09-12 14:20 Richter, Rafael
@ 2025-09-17 15:58 ` Jan Kara
0 siblings, 0 replies; 3+ messages in thread
From: Jan Kara @ 2025-09-17 15:58 UTC (permalink / raw)
To: Richter, Rafael; +Cc: linux-ext4@vger.kernel.org
Hi!
On Fri 12-09-25 14:20:13, Richter, Rafael wrote:
> we consistently see slow unmounts (~6–8s) on ext4 after heavy buffered writes
> (e.g., dd ~30 GiB) that grow the page cache. Same test on XFS unmounts <1s on
> the same hardware, but we must stay on ext4.
>
> Env:
> - Kernel: 6.6.36 (Yocto-based)
> - Device: SSD via mdraid (/dev/md0p1)
> - Mount: ext4 on /mnt/disk (defaults)
>
> Repro:
> dd if=/dev/zero of=/mnt/disk/big.bin bs=1M count=30720 status=progress
> sync -f /mnt/disk
> time umount /mnt/disk # ext4: ~6–8s
Yes. This is because with this kernel version XFS uses large folios (upto
2MB in size) while ext4 uses only 4k folios for the page cache. And
evicting that many folios in ext4 takes time. Large folio support has been
added to ext4 recently (6.16?) so with that you should see similar umount
times again.
> Observations:
> - Dirty/Writeback are ~0 before unmount.
> - `fsfreeze -f /mnt/disk` immediately before `umount` makes unmount very fast.
> - `mount -o remount,ro` before `umount` does NOT improve unmount time.
Well, this is definitely not recommended. fsfreeze -f will acquire
superblock reference which means that the filesystem actually stays mounted
in the background after umount until you unfreeze it (for which you need to
mount it again ;)). That's a bit of a catch with fsfreeze.
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-17 15:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-09 10:19 ext4: slow unmount with large clean page cache; is fsfreeze→umount recommended? Richter, Rafael
-- strict thread matches above, loose matches on Subject: below --
2025-09-12 14:20 Richter, Rafael
2025-09-17 15:58 ` Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).