On Sun, May 04, 2025 at 11:25:11PM -0700, Christoph Hellwig wrote: > On Fri, May 02, 2025 at 04:13:09PM -0700, Luis Chamberlain wrote: > > Devices which have a requirement for bs > ps cannot be supported for > > swap as swap still needs work. > > This should work just fine for swap through intelligent enough file > systems not using the generic ->bmap based swap path, although > performance would still be horrible. "intelligent enough" is doing a lot of heavy lifting there. Setting aside that only netfs (nfs and cifs) implement ->swap_rw today, a block fs which wanted to support sub-block-size swap accesses would need to pad writes (not a huge problem), but on reads, it'd need to either discard the extra data somewhere or (better) bring the other pages into the swap cache. Really, I think it needs a major rethink of the swap system, which is happening anyway.