diff options
author | Qu Wenruo <wqu@suse.com> | 2022-08-08 13:45:40 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-09-26 12:27:55 +0200 |
commit | f3e01e0e3c1f929d2ac39c335b024054b55e445a (patch) | |
tree | 13cc5efd995b60d75cae4fd5d04fcf9023281335 /fs/btrfs/tree-log.c | |
parent | 5dd3d8e4680be763bdb34300d507a55cca0ec86e (diff) |
btrfs: scrub: introduce scrub_block::pages for more efficient memory usage for subpage
[BACKGROUND]
Currently for scrub, we allocate one page for one sector, this is fine
for PAGE_SIZE == sectorsize support, but can waste extra memory for
subpage support.
[CODE CHANGE]
Make scrub_block contain all the pages, so if we're scrubbing an extent
sized 64K, and our page size is also 64K, we only need to allocate one
page.
[LIFESPAN CHANGE]
Since now scrub_sector no longer holds a page, but is using
scrub_block::pages[] instead, we have to ensure scrub_block has a longer
lifespan for write bio. The lifespan for read bio is already large
enough.
Now scrub_block will only be released after the write bio finished.
[COMING NEXT]
Currently we only added scrub_block::pages[] for this purpose, but
scrub_sector is still utilizing the old scrub_sector::page.
The switch will happen in the next patch.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
0 files changed, 0 insertions, 0 deletions