Skip to content

Commit 97db889

Browse files
Kemeng Shiakpm00
authored andcommitted
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>
1 parent c9ba524 commit 97db889

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/xarray.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ void xas_split_alloc(struct xa_state *xas, void *entry, unsigned int order,
10271027
unsigned int mask = xas->xa_sibs;
10281028

10291029
/* 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))
10311031
goto nomem;
10321032
if (xas->xa_shift + XA_CHUNK_SHIFT > order)
10331033
return;

0 commit comments

Comments
 (0)