From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55477422523; Fri, 4 Sep 2026 06:22:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788502977; cv=none; b=NOblT5PEEmxtkQtEktFhefXsB2TJfSbIaVAPWZ40/khQA1Zxxo8GwIwI9anvaEU5Eq68AWraVZ03i60U1XH7Y2F8PfP7tZLVHnR9X+MUw2yHZ5GxfLIVVt8od6mVNrHyhNyUQBlTWQj67pnoX04pm5BfpiEXdmnQbTErEctaYi0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788502977; c=relaxed/simple; bh=IMKqMDhWxEhiOcK+AkWl9QFr9PT9Gidaks3rxLvLmvY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SMLBlmbCK3qBS5z2srR5sWqqs+HZE1mWlthAQJt2JdmE69U4avR1fTLKFEbAGnhrHESbqo1BsrTONAxVx+Q9bAQdzgU+LyhtJ3IBRX85EsUUQfTZMAIcZp5OkMz98wgSnTvN5cEU+8ZMWu16QcePNQq33KZs8pf69klcXxwvIxs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cbg5VdVz; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="cbg5VdVz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A36D11F00A3E; Fri, 4 Sep 2026 06:22:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788502976; bh=iSRpn1DsNQ9bO+QZE9R3KYQVhHW7GZddKfwVtnQKHQ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cbg5VdVzLdaPEPn6jPLtmStA+6EbRVKJN84m/Mmygc3ckagPYc+VOtDGvEunsFFvV 09JpFfnEF9Jo6V5vmL9xo4bRuK2v2S+PlqegToJdhNPa8ZX78UcVz2kV8Iw3DOT6+t EoGhTtfoBxlG1wGz2jJ2T1BMbBJyEZzyVCS6M7Uw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zi Yan , "Lorenzo Stoakes (ARM)" , Johannes Weiner , Baolin Wang , Barry Song , David Hildenbrand , Dev Jain , Lance Yang , "Liam R. Howlett" , "Matthew Wilcox (Oracle)" , Ryan Roberts , William Kucharski , Andrew Morton Subject: [PATCH 6.12 395/403] xarray: honor XA_FLAGS_ACCOUNT in xas_split_alloc() Date: Fri, 4 Sep 2026 07:03:18 +0200 Message-ID: <20260904045743.765765092@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260904045734.806166532@linuxfoundation.org> References: <20260904045734.806166532@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zi Yan commit 789763523fb43cdc328de5cb5dcd19240ccf90d8 upstream. XArray operations that allocate xa_nodes, such as xas_nomem() and xas_alloc(), add __GFP_ACCOUNT when the array has XA_FLAGS_ACCOUNT set. This charges the allocated memory and avoids the workingset convergence issue described by commit 7b785645e8f13 ("mm: fix page cache convergence regression"). xas_split_alloc() does not add _GFP_ACCOUNT when XA_FLAGS_ACCOUNT is present. Fix it. Link: https://lore.kernel.org/20260804-add-gfp_account-to-xas_split_alloc-v3-2-38cb3ff325c5@nvidia.com Fixes: 6b24ca4a1a8d ("mm: Use multi-index entries in the page cache") Signed-off-by: Zi Yan Reviewed-by: Lorenzo Stoakes (ARM) Acked-by: Johannes Weiner Cc: Baolin Wang Cc: Barry Song Cc: David Hildenbrand Cc: Dev Jain Cc: Lance Yang Cc: Liam R. Howlett Cc: Matthew Wilcox (Oracle) Cc: Ryan Roberts Cc: William Kucharski Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- lib/xarray.c | 3 +++ 1 file changed, 3 insertions(+) --- a/lib/xarray.c +++ b/lib/xarray.c @@ -1027,6 +1027,9 @@ void xas_split_alloc(struct xa_state *xa if (xas->xa_shift + XA_CHUNK_SHIFT > order) return; + if (xas->xa->xa_flags & XA_FLAGS_ACCOUNT) + gfp |= __GFP_ACCOUNT; + do { unsigned int i; void *sibling = NULL;