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 5C67D390610; Fri, 4 Sep 2026 06:04:23 +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=1788501864; cv=none; b=rBNYhmB2GDEr2abE1+m4RogeTYhezb6lC8QjTmARnRjoNi0Dd8NqcHy9oRHUI9xsk4BSyDbbziusYhNeK6ZpmVak6fwPLasZimAQapEAjCZ+Mgx/VCTJzbSYwv3Eyz7iwjD5RuUzoKtDZyng+OS/Wcajh6l6A6moO2CXKxWpwfs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788501864; c=relaxed/simple; bh=8s6Bi5JvziqjPUJ1QD5Wkp2uQ9za+qHBCJRAS0zDBp0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KpG2EkHO2gcgZqkc9wdpC6Er8Y/dhwOJKxQ4x0nxjypTPahpPs/ZeSILy2KqV6L3XOGT5parWIWEBbqd8diRwiSDK99SIltVe78ki1BYXfFgpcv0ibKwLGJ4jJA+ceYD++2ynpdft9uMqu2WHlHMTD6QHqhveFK8nLeDkng5dYA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lwDP6Fpy; 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="lwDP6Fpy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B23211F00A3D; Fri, 4 Sep 2026 06:04:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788501863; bh=KpyTa5f9fk6NdgaUTx/Pc0+hce/ZyBbVBoJEkHBm1GM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=lwDP6FpyZmQnwfXxbwhAAeKUSLxSyeP18WFX4dy3I9usv4U/8OkKRFUcQX7HzHbb2 MdOHnSMCMZsEDMrpm2BkN8e+Ul9wJLTidi52mTjNQw9Fegi9TIJYDA3WT+MNq1zcLn ytKtaRDtIEfsTlyKL7UVyRR6eq3kESzYQLxu765E= 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.18 540/552] xarray: honor XA_FLAGS_ACCOUNT in xas_split_alloc() Date: Fri, 4 Sep 2026 07:01:37 +0200 Message-ID: <20260904045802.853564513@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260904045747.813364717@linuxfoundation.org> References: <20260904045747.813364717@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-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 @@ -1053,6 +1053,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 { struct xa_node *node;