On Fri, Nov 08, 2024 at 11:08:40AM +0100, Vlastimil Babka wrote: > Right, IIRC xfs was one of the usecases that prompted us towards defining > the kmalloc alignment guarantees, which was around 2019. > So today, kmalloc() allocations will not cross a page boundary if the > requested size is lower than page size, and it's a power-of-two value. Even > if SLUB debugging is enabled (before the alignment became guaranteed, it > would happen naturally, and only be violated by either using SLOB, or > enabling SLUB debugging). > xfs_buf_alloc_kmem() could be thus simplified. I'm not sure we'll want to fully trust future allocator changes, but maybe switching the fallback logic to an assert or WARN_ON might be wortwhile.