erofs: complete a missing case for inplace I/O
authorGao Xiang <hsiangkao@redhat.com>
Sun, 21 Mar 2021 18:32:27 +0000 (02:32 +0800)
committerGao Xiang <hsiangkao@redhat.com>
Mon, 29 Mar 2021 02:18:01 +0000 (10:18 +0800)
commit0b964600d3aae56ff9d5bdd710a79f39a44c572c
tree550634ce6fb92373b5691fbf2c5b5b7660ca6847
parent30048cdac4b92f39ee50e2a1344f5899f8e70cb6
erofs: complete a missing case for inplace I/O

Add a missing case which could cause unnecessary page allocation but
not directly use inplace I/O instead, which increases runtime extra
memory footprint.

The detail is, considering an online file-backed page, the right half
of the page is chosen to be cached (e.g. the end page of a readahead
request) and some of its data doesn't exist in managed cache, so the
pcluster will be definitely kept in the submission chain. (IOWs, it
cannot be decompressed without I/O, e.g., due to the bypass queue).

Currently, DELAYEDALLOC/TRYALLOC cases can be downgraded as NOINPLACE,
and stop online pages from inplace I/O. After this patch, unneeded page
allocations won't be observed in pickup_page_for_submission() then.

Link: https://lore.kernel.org/r/20210321183227.5182-1-hsiangkao@aol.com
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
fs/erofs/zdata.c