randomly wondering: Are there file systems that support auto-freeing cache files on demand when disk space runs low? Like how, in memory management, there are ways to mark memory as "please discard these pages/mappings if the OS wants more RAM"?

In memory management, people say "free space is wasted space", and while I know SSDs and free space are a complicated topic, it kinda seems like the idea should also work for disks to some extent?

@jann thats a fun idea! I haven't heard of anything of the sort
@jann jounald has a similar way of handling retention policies
snapper(8) — Arch manual pages

@kmichal @jann that's cute but I don't think the snapshot with cache files question could be simultaneously available to access and to delete? ;)
@vbabka @jann Hm, then something like `systemd-tmpfiles --clean` + appropriate configuration. One could keep the files through an open FD. (Not sure, maybe it could work with the snapshots and lazy unmounts too.)
All in all, what prevents userspace implementation?
@kmichal @vbabka yeah it could probably work somewhat, I think the main drawback of a pure userspace implementation would be that you couldn't reliably do on-demand reclaim and would instead have to poll how much free space is available in sufficiently low intervals, and assume that nothing wants to reserve large amounts of disk space at once, otherwise there'd still be spurious errors...