Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Xarray: distinguish large entries correctly in xas_split_alloc()

We don't support large entries which expand two more level xa_node in
split. For case "xas->xa_shift + 2 * XA_CHUNK_SHIFT == order", we also
need two level of xa_node to expand. Distinguish entry as large entry in
case "xas->xa_shift + 2 * XA_CHUNK_SHIFT == order".

As max order of folio in pagecache (MAX_PAGECACHE_ORDER) is <=
(XA_CHUNK_SHIFT * 2 - 1), this change is more likely a cleanup...

Link: https://lkml.kernel.org/r/20241213122523.12764-4-shikemeng@huaweicloud.com
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: Mattew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Kemeng Shi and committed by
Andrew Morton
97db889b c9ba5249

+1 -1
+1 -1
lib/xarray.c
··· 1027 1027 unsigned int mask = xas->xa_sibs; 1028 1028 1029 1029 /* XXX: no support for splitting really large entries yet */ 1030 - if (WARN_ON(xas->xa_shift + 2 * XA_CHUNK_SHIFT < order)) 1030 + if (WARN_ON(xas->xa_shift + 2 * XA_CHUNK_SHIFT <= order)) 1031 1031 goto nomem; 1032 1032 if (xas->xa_shift + XA_CHUNK_SHIFT > order) 1033 1033 return;