diff options
author | Qu Wenruo <wqu@suse.com> | 2025-08-14 04:14:48 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2025-09-23 09:49:16 +0300 |
commit | 74e8f002b772686408d62e420d9f70a4bcb1c2c4 (patch) | |
tree | 86e44fee1637e9495949f50bda0e1ce3cc4f510e /fs/btrfs/backref.c | |
parent | 0d0b80929eff93e7e0323060899d04905b8e6de9 (diff) | |
download | linux-74e8f002b772686408d62e420d9f70a4bcb1c2c4.tar.xz |
btrfs: reduce compression workspace buffer space to block size
Currently the compression workspace buffer size is always based on
PAGE_SIZE, but btrfs has support subpage sized block size for some time.
This means for one-shot compression algorithm like lzo, we're wasting
quite some memory if the block size is smaller than page size, as the
LZO only works on one block (thus one-shot).
On 64K page sized systems with 4K block size, it means we only need at
most 8K buffer space for lzo, but in reality we're allocating 64K
buffer.
So to reduce the memory usage, change all workspace buffer to base its
size based on block size other than page size.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/backref.c')
0 files changed, 0 insertions, 0 deletions