From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45C36C7619A for ; Wed, 12 Apr 2023 08:13:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D5FFD280004; Wed, 12 Apr 2023 04:13:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CE850280003; Wed, 12 Apr 2023 04:13:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B1442280004; Wed, 12 Apr 2023 04:13:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 9DE2A280003 for ; Wed, 12 Apr 2023 04:13:31 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5B1814101B for ; Wed, 12 Apr 2023 08:13:31 +0000 (UTC) X-FDA: 80672024622.19.F3F4D85 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf19.hostedemail.com (Postfix) with ESMTP id 970421A0006 for ; Wed, 12 Apr 2023 08:13:29 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=HS8dWb6u; spf=pass (imf19.hostedemail.com: domain of gregkh@linuxfoundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681287209; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:dkim-signature; bh=/csAYwh+yZqbkVbIx7mlo19WWb9K993EkJw0a2gKFf4=; b=6haOsbn9uvtAvOFKnv6SzaNO82utnYstYdjJVG5kk955HXh0RQOph0rI4sfkKXTuNWinBE tkFoYOAAEgdln3d1aGGj5zTn6xvutbdvvKfddkrRYKNQ8uCBlLAJA6dcsG1vGLGbJ2ySp/ J1l6ZxdF42fcD5ZUrpopiU8Zai8Li7E= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=HS8dWb6u; spf=pass (imf19.hostedemail.com: domain of gregkh@linuxfoundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681287209; a=rsa-sha256; cv=none; b=uVpUF5AakePmJEAFkcFB0EAiuWJ2ysj8KF3Zdn0lMGbf8S+kzSVOb6MSls0h2L1a8mpwno /BhHzN8arv4oPfwYSEIwD8JTpi7bsrqq17hwm/nlVh5r0AdkxwKWVDXvoApdn//+06GFfd r+xhVmoYiff9L8r8zivJ1Dnf2hI2bCY= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D5F3162F55; Wed, 12 Apr 2023 08:13:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB2EDC4339B; Wed, 12 Apr 2023 08:13:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1681287208; bh=q7zIht3tQSIBgGnyX4/InAwo3JL6kioBgPSf8pcofI0=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=HS8dWb6u/q5zYEme25E7pNwT8fiUonqVUSQKuCq0RYOqH1gnY2rGEn8Gq9NvOiNcj 7bQUig2vL7Vz6DwdPb+RI0DAGmN6uQl/idnfcOGMA01NCLifADJRYwVwJ+FDWOD9r5 P3zuMAOZysK+d6b8K7Kvw26dEwYEnIYApxx5xdyM= Subject: Patch "maple_tree: detect dead nodes in mas_start()" has been added to the 6.1-stable tree To: Liam.Howlett@Oracle.com,Liam.Howlett@oracle.com,gregkh@linuxfoundation.org,linux-mm@kvack.org,maple-tree@lists.infradead.org Cc: From: Date: Wed, 12 Apr 2023 10:13:20 +0200 In-Reply-To: <20230411151055.2910579-10-Liam.Howlett@oracle.com> Message-ID: <2023041219-democrat-imminent-6063@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit X-stable: commit X-Patchwork-Hint: ignore X-Rspamd-Queue-Id: 970421A0006 X-Stat-Signature: zt9ms68i1xdja5opynd96rotf6pq1f7b X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1681287209-160929 X-HE-Meta: U2FsdGVkX18nAQ20uZB5SGdzEDoQaWSDs+UfbOPxNPt/+tQRNiyL0VF9inozB807tEkX9YJNEJAXIt6qB5A38kI7+GbPoiA8bkh8EFXC1cPXViGHszQ+wVMdnaHHePEB5sKpHP35no/lqw3mIH17AQkP+BRyTNp+T1R7lmhORSVpVNXH/4Kc+qx5Due96WcNcXuAcJvqQPe76QVCGmYmERajKo1DBHyxW031kCMS13vMMTfoRDml58c3huHEQ/bf4tSMASlx8xU3NSV72oZT4A3vqxRKRaLAoubC82i0CKwWHuJ3AcMYtJ3CAJ4CTvc0L8t8ECglomcRjFMDrJy+k/YiUccOWThnwO98jUm44FtGzTeR/yk1xKplx04mnCoxHY5+IY7jDH1BQ84oq7fIVBb63hbCYHrQ02W1frPk6aDUi7uLT/csTHVqPCsmks9hatX96iw1xv0OdaYeJFtKox5DuL5u0tnConw+hBBh3r1slWrC4we5wkQ+LpkkAhwVA4pUHPSCYok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WrH69pyYVF6mqvLw/aGL+f+3GjvXhoa/JCqJ8NPHoeuFzIvOb1g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This is a note to let you know that I've just added the patch titled maple_tree: detect dead nodes in mas_start() to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: maple_tree-detect-dead-nodes-in-mas_start.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From stable-owner@vger.kernel.org Tue Apr 11 17:13:23 2023 From: "Liam R. Howlett" Date: Tue, 11 Apr 2023 11:10:50 -0400 Subject: maple_tree: detect dead nodes in mas_start() To: Greg Kroah-Hartman , stable@vger.kernel.org Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Liam R. Howlett" , Stable@vger.kernel.org, Liam Howlett Message-ID: <20230411151055.2910579-10-Liam.Howlett@oracle.com> From: "Liam R. Howlett" commit a7b92d59c885018cb7bb88539892278e4fd64b29 upstream. When initially starting a search, the root node may already be in the process of being replaced in RCU mode. Detect and restart the walk if this is the case. This is necessary for RCU mode of the maple tree. Link: https://lkml.kernel.org/r/20230227173632.3292573-3-surenb@google.com Cc: Fixes: 54a611b60590 ("Maple Tree: add new data structure") Signed-off-by: Liam Howlett Signed-off-by: Greg Kroah-Hartman --- lib/maple_tree.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1352,12 +1352,16 @@ static inline struct maple_enode *mas_st mas->max = ULONG_MAX; mas->depth = 0; +retry: root = mas_root(mas); /* Tree with nodes */ if (likely(xa_is_node(root))) { mas->depth = 1; mas->node = mte_safe_root(root); mas->offset = 0; + if (mte_dead_node(mas->node)) + goto retry; + return NULL; } Patches currently in stable-queue which might be from stable-owner@vger.kernel.org are queue-6.1/maple_tree-fix-potential-rcu-issue.patch queue-6.1/maple_tree-add-smp_rmb-to-dead-node-detection.patch queue-6.1/maple_tree-add-rcu-lock-checking-to-rcu-callback-functions.patch queue-6.1/maple_tree-fix-handle-of-invalidated-state-in-mas_wr_store_setup.patch queue-6.1/maple_tree-reduce-user-error-potential.patch queue-6.1/maple_tree-fix-mas_prev-and-mas_find-state-handling.patch queue-6.1/maple_tree-remove-gfp_zero-from-kmem_cache_alloc-and-kmem_cache_alloc_bulk.patch queue-6.1/maple_tree-be-more-cautious-about-dead-nodes.patch queue-6.1/mm-enable-maple-tree-rcu-mode-by-default.patch queue-6.1/maple_tree-detect-dead-nodes-in-mas_start.patch queue-6.1/maple_tree-fix-freeing-of-nodes-in-rcu-mode.patch queue-6.1/maple_tree-remove-extra-smp_wmb-from-mas_dead_leaves.patch queue-6.1/maple_tree-refine-ma_state-init-from-mas_start.patch