Commit 859471ce authored by Sidhartha Kumar's avatar Sidhartha Kumar Committed by Kefeng Wang
Browse files

mm/hugetlb: have CONFIG_HUGETLB_PAGE select CONFIG_XARRAY_MULTI

mainline inclusion
from mainline-v6.7-rc5
commit 4a3ef6be03e6700037fc20e63aa5ffd972e435ca
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I9H84X
CVE: NA

-------------------------------------------------

After commit a08c7193e4f1 "mm/filemap: remove hugetlb special casing in
filemap.c", hugetlb pages are stored in the page cache in base page sized
indexes.  This leads to multi index stores in the xarray which is only
supporting through CONFIG_XARRAY_MULTI.  The other page cache user of
multi index stores ,THP, selects XARRAY_MULTI.  Have CONFIG_HUGETLB_PAGE
follow this behavior as well to avoid the BUG() with a CONFIG_HUGETLB_PAGE
&& !CONFIG_XARRAY_MULTI config.

Link: https://lkml.kernel.org/r/20231204183234.348697-1-sidhartha.kumar@oracle.com


Fixes: a08c7193e4f1 ("mm/filemap: remove hugetlb special casing in filemap.c")
Signed-off-by: default avatarSidhartha Kumar <sidhartha.kumar@oracle.com>
Reported-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Muchun Song <muchun.song@linux.dev>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 4a3ef6be03e6700037fc20e63aa5ffd972e435ca)
Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
parent d1c74e5f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -280,6 +280,7 @@ config HUGETLBFS

config HUGETLB_PAGE
	def_bool HUGETLBFS
	select XARRAY_MULTI

config HUGETLB_PAGE_OPTIMIZE_VMEMMAP
	def_bool HUGETLB_PAGE