summaryrefslogtreecommitdiffstats
path: root/fs/erofs/compress.h
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@redhat.com>2020-12-09 13:37:17 +0100
committerGao Xiang <hsiangkao@redhat.com>2020-12-09 13:42:02 +0100
commit1825c8d7ce93c4725cb04ad09627fc2829de32ca (patch)
tree5cc5a28a3839c7d2dd7e05bfd998110da83f88a6 /fs/erofs/compress.h
parenterofs: simplify try_to_claim_pcluster() (diff)
downloadlinux-1825c8d7ce93c4725cb04ad09627fc2829de32ca.tar.xz
linux-1825c8d7ce93c4725cb04ad09627fc2829de32ca.zip
erofs: force inplace I/O under low memory scenario
Try to forcely switch to inplace I/O under low memory scenario in order to avoid direct memory reclaim due to cached page allocation. Link: https://lore.kernel.org/r/20201209123717.12430-1-hsiangkao@aol.com Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
Diffstat (limited to 'fs/erofs/compress.h')
-rw-r--r--fs/erofs/compress.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/erofs/compress.h b/fs/erofs/compress.h
index 4dadde18cdf1..aea129ddda74 100644
--- a/fs/erofs/compress.h
+++ b/fs/erofs/compress.h
@@ -28,11 +28,13 @@ struct z_erofs_decompress_req {
/* some special page->private (unsigned long, see below) */
#define Z_EROFS_SHORTLIVED_PAGE (-1UL << 2)
+#define Z_EROFS_PREALLOCATED_PAGE (-2UL << 2)
/*
* For all pages in a pcluster, page->private should be one of
* Type Last 2bits page->private
* short-lived page 00 Z_EROFS_SHORTLIVED_PAGE
+ * preallocated page (tryalloc) 00 Z_EROFS_PREALLOCATED_PAGE
* cached/managed page 00 pointer to z_erofs_pcluster
* online page (file-backed, 01/10/11 sub-index << 2 | count
* some pages can be used for inplace I/O)
@@ -40,6 +42,7 @@ struct z_erofs_decompress_req {
* page->mapping should be one of
* Type page->mapping
* short-lived page NULL
+ * preallocated page NULL
* cached/managed page non-NULL or NULL (invalidated/truncated page)
* online page non-NULL
*