Commit 448b5a15 authored by Gao Xiang's avatar Gao Xiang

erofs: avoid consecutive detection for Highmem memory

Currently, vmap()s are avoided if physical addresses are
consecutive for decompressed buffers.

I observed that is very common for 4KiB pclusters since the
numbers of decompressed pages are almost 2 or 3.

However, such detection doesn't work for Highmem pages on
32-bit machines, let's fix it now.
Reported-by: default avatarLiu Jinbao <liujinbao1@xiaomi.com>
Fixes: 7fc45dbc ("staging: erofs: introduce generic decompression backend")
Link: https://lore.kernel.org/r/20220708101001.21242-1-hsiangkao@linux.alibaba.comSigned-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
parent 2df7c4bd
...@@ -91,14 +91,18 @@ static int z_erofs_lz4_prepare_dstpages(struct z_erofs_lz4_decompress_ctx *ctx, ...@@ -91,14 +91,18 @@ static int z_erofs_lz4_prepare_dstpages(struct z_erofs_lz4_decompress_ctx *ctx,
if (page) { if (page) {
__clear_bit(j, bounced); __clear_bit(j, bounced);
if (kaddr) { if (!PageHighMem(page)) {
if (kaddr + PAGE_SIZE == page_address(page)) if (!i) {
kaddr = page_address(page);
continue;
}
if (kaddr &&
kaddr + PAGE_SIZE == page_address(page)) {
kaddr += PAGE_SIZE; kaddr += PAGE_SIZE;
else continue;
kaddr = NULL; }
} else if (!i) {
kaddr = page_address(page);
} }
kaddr = NULL;
continue; continue;
} }
kaddr = NULL; kaddr = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment