]> www.infradead.org Git - users/hch/xfs.git/commit
xfs: remove the kmalloc to page allocator fallback
authorChristoph Hellwig <hch@lst.de>
Thu, 16 Jan 2025 04:21:38 +0000 (05:21 +0100)
committerChristoph Hellwig <hch@lst.de>
Tue, 4 Mar 2025 14:01:24 +0000 (07:01 -0700)
commitc54633ffa57fb2f535ba56e859a7891ab6c429c0
treeeedfd9b5b919f7d7e74f3040c0f0a139cafa0ee0
parent7a631031bae876a4fafa5c56f382cdae3aa4085f
xfs: remove the kmalloc to page allocator fallback

Since commit 59bb47985c1d ("mm, sl[aou]b: guarantee natural alignment
for kmalloc(power-of-two)", kmalloc and friends guarantee that power of
two sized allocations are naturally aligned.  Limit our use of kmalloc
for buffers to these power of two sizes and remove the fallback to
the page allocator for this case, but keep a check in addition to
trusting the slab allocator to get the alignment right.

Also refactor the kmalloc path to reuse various calculations for the
size and gfp flags.

Signed-off-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_buf.c