btrfs: use kvmalloc() for cases where allocation can be more than one page
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | btrfs: use kvmalloc() for btrfs_encoded_read_inline()fs/ | +2 | 0 replies | |
| 2/3 | btrfs: use kvzalloc() for btrfs_raid_bio::csum_buffs/ | +4 | 0 replies | |
| 3/3 | btrfs: use kvmalloc() inside test_eb_bitmaps()fs/ | +2 | 0 replies |
Reviews trailers per patch
None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Sun YangKai |
|---|---|
| Series | R-b |
| 1/3 | |
| 2/3 | |
| 3/3 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/3] btrfs: use kvmalloc() for cases where allocation can be more than one page
There are still some cases where kmalloc() and its variants are called where the memory allocated can be multiple pages on x86_64.
Normally any kmalloc() with a size that <= PAGE_ALLOC_COSTLY_ORDER (3) should not fail that easily, so even we allocate a multi-page buffer using kmalloc() as long as it's not reaching 64K (4K page size) it should still be fine.
Thus those cases are all very rare:
- An inlined extent larger than 4K
This can only be archived by a system with page size larger than 4K, along with larger max_inline.
And still, only 64K sized inlined extent can really cause problems.
- Too many RAID56 data stripes with SHA256
To go beyond 4K, it only requires 9 data stripes, but to reach 64K (order > 3) it requires 128 data stripes which is beyond sanity.
- Fragmented memory at btrfs module load time
This is in fact more common than the above 2 cases, but this requires CONFIG_BTRFS_FS_RUN_SANITY_TESTS and load the module after the memory is fragmented, it's still very rare.
So all of those fixes are just another bike shred problem, but considering it's not that hard to fix, so here comes the patches.
Qu Wenruo (3):
btrfs: use kvmalloc() for btrfs_encoded_read_inline()
btrfs: use kvzalloc() for btrfs_raid_bio::csum_buf
btrfs: use kvmalloc() inside test_eb_bitmaps()
fs/btrfs/inode.c | 4 ++-- fs/btrfs/raid56.c | 8 ++++---- fs/btrfs/tests/extent-io-tests.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-)
Signature · 1 line
2.55.0