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 601EEC77B70 for ; Tue, 11 Apr 2023 15:12:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EB7946B008A; Tue, 11 Apr 2023 11:12:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E6814900004; Tue, 11 Apr 2023 11:12:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CB9D3900002; Tue, 11 Apr 2023 11:12:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id AC76F6B008A for ; Tue, 11 Apr 2023 11:12:02 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id ECB4AC0DB6 for ; Tue, 11 Apr 2023 15:12:01 +0000 (UTC) X-FDA: 80669450442.16.1F151B9 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf24.hostedemail.com (Postfix) with ESMTP id 5B917180005 for ; Tue, 11 Apr 2023 15:11:58 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="Nt/9lQGW"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="h7/VlL1B"; spf=pass (imf24.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681225918; 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:references:dkim-signature; bh=70WhY/iq4hVIgzn5mnWWfTDRC8B2eF1U3/aQ9O7MvDI=; b=o+5Ftt4D0eNknW6rg9Ih9YdJcOVsW5xroYVrUf0jwsygidzc6lT9UTVLb8HcIVxMBT0CKw YTh8ffSd8p7R5QvsWOWmE+fIbH6LnT6S+/eqf8++iRBi+JARLGEuWJMwrs74ggkyUBGfyR dcJz8rJX9tZVlIEVLrAfqKidU4SgtTU= ARC-Authentication-Results: i=2; imf24.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="Nt/9lQGW"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="h7/VlL1B"; spf=pass (imf24.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1681225918; a=rsa-sha256; cv=pass; b=LM6+2qm4uuoCZaDte4PaIyAaUIxXiVBN7tVUfQ/Ld+8tTR376yZ2s3uWeANVUOP6BLTdKb fF/VnQBgv3XGhpcDbLPxoEHZgXEdIYqXiffwTxoJ5l2PJJgJbsNxrpMHNRTbWx996z9HQZ wqrReEw622xPNT5rBWw2YLi/1XQvQKg= Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33BEwu5G022973; Tue, 11 Apr 2023 15:11:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=70WhY/iq4hVIgzn5mnWWfTDRC8B2eF1U3/aQ9O7MvDI=; b=Nt/9lQGWr2s0aSfo5j7j1whv4To+jX/PCjDSYkTLJzTa0HmjM8pEOY7FoQo26bThcM42 jQizf6E6qrnFUY4S7I499KD3BN9zhmTBR3/HOkD4ri6QpcvoyqIkxBGoa9PfxliUJUfO eitcZ4JsOJNTbuX22rf7IORLNRWduj3SAy9bGeRkpm6bl+p4fxmZOg5nwCT3BxAGuxb9 keRijE8wtZP+XQ/HamMd0o6ul/CSFGKiDOHwmPXLpK0qucj2+BBXLgQBhOSqTkB1FqIL LUFQ4M0DFDJ+IaGEy5LvjC76+j9ENFb+mMGbztMkiHkQqGMfVvzUvA5aSqvW51lqxxxx eg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3pu0bwdrx6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Apr 2023 15:11:55 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 33BEStdU030608; Tue, 11 Apr 2023 15:11:54 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3puw918dr2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Apr 2023 15:11:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LWJz3CBGCUwEBKNIX6EOUaPEbcaSDUy/go7WWSesaUt7uv47D71zq0DkEa1uCOOLez86FmA50FwhfXmwCvKxrHrPe21lhpTOC2UHSv5MGdG0hKsOw7X+sqp2mbdlePkXbuby4OAY/RiavyolI+6aIx0XPm7Yd+iWQ2dj9zBmmRJCug6ePSieMyTBfHSpcDYvHHhuiZg4C5E6DmbTl72yPBFkEMMg0zm8Vsact7mEbE9htUZwpmsaQQiaMsnqxuTUcEE1KHSAhDEWKy1M140EOe5oKYMUDg4P74QmErHWrUpJRBypUiE17BnmcXXwUqgajiBTHDzlck1BpNKYnZsmVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=70WhY/iq4hVIgzn5mnWWfTDRC8B2eF1U3/aQ9O7MvDI=; b=GUx92sEljHQDI4KO0kcjcF6EbRijoSZ3ebMjNiZcv3UjmzZrw+SCE8Li06Cmu8otg/590rV08Pz0K3JdpTyWncfMgo23aO8xAiow8mnloZFV3QkA2nRvvG3auqeu4Xiot6CHJgZMC1veLL0663S4g0CkJBj8XLHLR8VtAjd3ZwiPO/0URdfDNuGL7AjCS34q07jTYvKRudRnzIvdUZ0ba/Y9s2DNTTCXVLatRihzjz7E26jyltlRn2PFZuJLijHN0698Q86Xa/g2cyktBG+OZghoCh411VMPbXbhKgTDmOUZXyVjIjd0e+g6o6JfN+yq/j69O16JSoYHvwX8Pr3Mgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=70WhY/iq4hVIgzn5mnWWfTDRC8B2eF1U3/aQ9O7MvDI=; b=h7/VlL1BvYaWT9DVnaszhRBpjPHCe3kse3C15MZbBJBinUlTWW0oOVVZfmA24BqiCyJEdNZfRYWQR0fI1URtlFgNidGpowVip5da+VYNkltnsJ+EGWPwC6UhAqnxXLLZUMjq3Qx3bT0gZC0ypSbcIyAmWLq1FlRRNQsWTp41yR4= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SJ0PR10MB4718.namprd10.prod.outlook.com (2603:10b6:a03:2dd::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.35; Tue, 11 Apr 2023 15:11:52 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6277.035; Tue, 11 Apr 2023 15:11:52 +0000 From: "Liam R. Howlett" 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" , Suren Baghdasaryan , "Liam R . Howlett" Subject: [PATCH 6.1 13/14] maple_tree: add RCU lock checking to rcu callback functions Date: Tue, 11 Apr 2023 11:10:54 -0400 Message-Id: <20230411151055.2910579-14-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230411151055.2910579-1-Liam.Howlett@oracle.com> References: <20230411151055.2910579-1-Liam.Howlett@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: YT4PR01CA0067.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:111::22) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|SJ0PR10MB4718:EE_ X-MS-Office365-Filtering-Correlation-Id: 047467f1-c50c-484b-6880-08db3a9f146a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KBCHEVpx8RIybaWGLBhwtWxc+xprB9MGMUCgqi5FYYtg4JRCxi9SlUNhM+/Xgw031FGdwCu6yssNVjDkM0lYnHXG8IGyz2vnOcDrzlRNEKVWr7mvrHY3GWUzvJp/3l3AgniKMald3LDASFiWONNFSj8LMj7Qfh6LxAkgYnUzQCsiQop5GthHDvvjmYcQIZSLbFqUKqVkuDqnHDWU7bq4bqSFnIv+3NPQN/K3sEg0VOWhynKOex4dtAdnDByda+TMFnze7pky11tFBfV0U0t+M4Q6nlfbdbKbUF2hvd7IKxX+vQu7aDyU5sx7Rh6JokGUJotoh/aI1dQxnRWcZnkYiLYBbq8oKuxP6zyE4ygmLZ4LHPSQFVkrtuQ2HFkTrI+p3yQRtGJ8fXXbtKoWa2SCLC7qusTUi9tL02z0EDsF1ZoyNaoLJC/EuXzWR4mbNnjpMxvFU68K6G0Wm5A+VGL2dDM0owD/EV7xAnsAD+OkadBCqGxsegRJrAp3jGTosZPsDLEU2UJj65QwXDa/ol84KzD2WO8/bokS+mXYEL+Lsy0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(346002)(396003)(366004)(376002)(39860400002)(451199021)(38100700002)(6512007)(30864003)(6506007)(186003)(26005)(1076003)(107886003)(2616005)(8676002)(83380400001)(2906002)(6486002)(5660300002)(8936002)(966005)(36756003)(478600001)(4326008)(86362001)(316002)(66476007)(41300700001)(66556008)(54906003)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-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U5+zaTKApQ19DyfJrH+BzsiP51fKa3H3Zrvrk5VS?= =?us-ascii?Q?88JNmzFN8Ua1OiJYl7Hbs0lPmbWujIrzbMe726qkFyDhF48qStXsCr2wr3fm?= =?us-ascii?Q?vwHTQ2j96qBxtSR602t7DzushPW+uH745ZJfNmmdPVmN1c113ORr+jnZ5K3t?= =?us-ascii?Q?KtgJZE24PQs/MZnsMw5kY2l409eQrTESrnwYoSOb9XMqYqRGhyQ0ITRpKYrd?= =?us-ascii?Q?c8r284yHvX1iyxk2qZ1y7EHuF4zuEG/x06GCoUl9MUPVYGQg0YlOpTUs2Otr?= =?us-ascii?Q?gc+UDjj7p/DZE62/WekKer3m80ctLYbe7ykDJC7YwltrTHawkNTkd6NwFMpI?= =?us-ascii?Q?RElcTkUwzgcbHXrIp/hB6Bi/q5svvtNBIWF2MY/Lk6z9UC9bgkM3FM8v0F0E?= =?us-ascii?Q?fmVYIvr6MYq98OcVB2DgpSvJue4ydWt4yjVW9Lh+fATJZ6Qp8VcjVEUumYAw?= =?us-ascii?Q?NPGuq66E2W6SJ2JQT07mXF4bUu2hDA62YIgh1DcRiaNnYx1i8JjtNPc/DSoc?= =?us-ascii?Q?xRkgJlY4D6e7o2usJbCNKr0sE/0/ISslJWSL2eTpgqH7ZB0RRZ1nn8npdFcy?= =?us-ascii?Q?BAfAGWwf+ZDIHL1StgW2ayrtPvW8EFnW+jp4ZFTdNXonSmeewwgJCUfIETG8?= =?us-ascii?Q?zdcOR19m0RpMfnXIioHcvLLgk5/x5PBt13YkP/sjVypWyNBzaam/DDGik1+z?= =?us-ascii?Q?1uR+J7NfPjipxyVELhZ8juX+uqg0+MCxUXegdMBw/sosvyVVl7Wcdb8yJkRT?= =?us-ascii?Q?Lg=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: tjqavJt4Pq7zw9IV0oxgUnvVR8msKJCZzbOSpKBoHeYxXL99PRCCuRnyvjFUsXDpnpeuYSuqp7rDGTld9snDnWcNfuw2EaxLDYVkJorYJP+86OzE1S3+av54ZT7moAShWnED81505kAoicfwXm/bcjavLRJjKgoVlAglMMDEGLjCpyYbu3FxVkkm4Rgm2ixCp4ueaeVG20Krt7VwMVNz7Ozde//U7UJRBHp1WXtVERR9iEVMnH/cfIACYuQW5+ET3JNinAHFUBoeEPHIoIsWfbCgrr6N1spJ5sv+cNGaHGchHVfrTwaoc8CdS4MoYRwUxdR3NOlHVTXpB57lrC5iihUEI4In2oTpMPpfyPjAwQdof5rrkun5xF2Tn77jN1SbY4mzZ+IPAWg1CVN6eZf8OtrjPxtVyi4H378ok0Eox1lOpj5YHaDyw4/jNRuqa1l8AICVo4ai7+q44ajBongdOv/tObCO29PtYGWX8bhfDXrqKSPqCDB31bKUQr/mfZYQkq4X55bYifd3qOMHC69EwuzzzXsBXIC4hZmmsvZLt2OPnW7yAW/qzycMWhbc3Bor0prlvtDhMyTmmriWaTIhLAfN+C641Rwf9ujejZnTkzTAuCy25VuRjrv3gBBfh7pO5HngM/vSzLQGu9Du0aBRpUjU9NbHEmW5w6kMk00H+WTy4n33NNEfh6SvppwQV4bWe8tbloQYsrIVc0OhkvW5fEFqTo4ppfsgG6DOzCcFptTr0ashI3LTJRm4WvFHrp4xI7DQfXlzQjapZbPV3eu0TEqyc5yZXl9eOEO+SvpVZw8wWrTjoKB9pxAiJnlp5ZWYgQG1zLjAdNOoBch2YTdv/vRVNbUQdutwGQZ9Hfhfn3Btl6rdvyD1p6ZNNPKcl220Zo36Fjdzm/3yudj3tthzxOWfi8ypyNCjKqJlouNs+b8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 047467f1-c50c-484b-6880-08db3a9f146a X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2023 15:11:52.1256 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZfLRLJ1kClu9Xsxs1PXRi3elWScfssYFKjj2wWR3+5gD5qZyLDo/dAj2ZXOb3TVn556JLJjflGn7to0F2/yhew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4718 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-11_10,2023-04-11_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 suspectscore=0 mlxscore=0 bulkscore=0 malwarescore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304110138 X-Proofpoint-ORIG-GUID: aSCaMUxqfSbgSz_lc2FdydzCgLLMBPWE X-Proofpoint-GUID: aSCaMUxqfSbgSz_lc2FdydzCgLLMBPWE X-Stat-Signature: fnj7sdysqr97g7bsxfx8ez65fh97pors X-Rspam-User: X-Rspamd-Queue-Id: 5B917180005 X-Rspamd-Server: rspam06 X-HE-Tag: 1681225918-609668 X-HE-Meta: U2FsdGVkX19NOfn8SKge1QeDdeS5/6ynSHwg+46OuKGbzsNJKJXj9cTaZuB+wQWZQtmb+XcySeS7TbMGcirG9StaTPhmvKkVEcWdYI6KJZme150lPQIxY5MIfBT7MEeyP/bg/Js/u2WAf0JHNEPtZ0N2kkPDrUqbo+zrDTPOYKFh63Ledh4ZkeAT56m3N+MFMJNITdYQIIjqPADD4EpPrNGW6BClFrga9qkaypG5Kj72d/I+qum7Uk+WhQHEQ8h08h1aRL0JTEYTuOfXXBEitZb3ryPSKaBXWZOb5WyBryYOTTmXcDJMQ32SyWAAEqJo3g4vHIwZsLMu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TPqXbkfNLDhCCIb1qyZJ53WC4Bkc9FLzBR/npYGQZzUswyZsqAwQcjncdNvXu5Z+ErZRckh0RD/IY7zsURRuJRsz3A1irMj9H5bM71pIVFSzXq8Q== 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: From: "Liam R. Howlett" commit 790e1fa86b340c2bd4a327e01c161f7a1ad885f6 upstream. Dereferencing RCU objects within the RCU callback without the RCU check has caused lockdep to complain. Fix the RCU dereferencing by using the RCU callback lock to ensure the operation is safe. Also stop creating a new lock to use for dereferencing during destruction of the tree or subtree. Instead, pass through a pointer to the tree that has the lock that is held for RCU dereferencing checking. It also does not make sense to use the maple state in the freeing scenario as the tree walk is a special case where the tree no longer has the normal encodings and parent pointers. Link: https://lkml.kernel.org/r/20230227173632.3292573-8-surenb@google.com Fixes: 54a611b60590 ("Maple Tree: add new data structure") Cc: stable@vger.kernel.org Reported-by: Suren Baghdasaryan Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 188 ++++++++++++++++++++++++----------------------- 1 file changed, 96 insertions(+), 92 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 2f9af64edad9..b6e29081d2cc 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -814,6 +814,11 @@ static inline void *mt_slot(const struct maple_tree *mt, return rcu_dereference_check(slots[offset], mt_locked(mt)); } +static inline void *mt_slot_locked(struct maple_tree *mt, void __rcu **slots, + unsigned char offset) +{ + return rcu_dereference_protected(slots[offset], mt_locked(mt)); +} /* * mas_slot_locked() - Get the slot value when holding the maple tree lock. * @mas: The maple state @@ -825,7 +830,7 @@ static inline void *mt_slot(const struct maple_tree *mt, static inline void *mas_slot_locked(struct ma_state *mas, void __rcu **slots, unsigned char offset) { - return rcu_dereference_protected(slots[offset], mt_locked(mas->tree)); + return mt_slot_locked(mas->tree, slots, offset); } /* @@ -897,34 +902,35 @@ static inline void ma_set_meta(struct maple_node *mn, enum maple_type mt, } /* - * mas_clear_meta() - clear the metadata information of a node, if it exists - * @mas: The maple state + * mt_clear_meta() - clear the metadata information of a node, if it exists + * @mt: The maple tree * @mn: The maple node - * @mt: The maple node type + * @type: The maple node type * @offset: The offset of the highest sub-gap in this node. * @end: The end of the data in this node. */ -static inline void mas_clear_meta(struct ma_state *mas, struct maple_node *mn, - enum maple_type mt) +static inline void mt_clear_meta(struct maple_tree *mt, struct maple_node *mn, + enum maple_type type) { struct maple_metadata *meta; unsigned long *pivots; void __rcu **slots; void *next; - switch (mt) { + switch (type) { case maple_range_64: pivots = mn->mr64.pivot; if (unlikely(pivots[MAPLE_RANGE64_SLOTS - 2])) { slots = mn->mr64.slot; - next = mas_slot_locked(mas, slots, - MAPLE_RANGE64_SLOTS - 1); - if (unlikely((mte_to_node(next) && mte_node_type(next)))) - return; /* The last slot is a node, no metadata */ + next = mt_slot_locked(mt, slots, + MAPLE_RANGE64_SLOTS - 1); + if (unlikely((mte_to_node(next) && + mte_node_type(next)))) + return; /* no metadata, could be node */ } fallthrough; case maple_arange_64: - meta = ma_meta(mn, mt); + meta = ma_meta(mn, type); break; default: return; @@ -5478,7 +5484,7 @@ static inline int mas_rev_alloc(struct ma_state *mas, unsigned long min, } /* - * mas_dead_leaves() - Mark all leaves of a node as dead. + * mte_dead_leaves() - Mark all leaves of a node as dead. * @mas: The maple state * @slots: Pointer to the slot array * @type: The maple node type @@ -5488,16 +5494,16 @@ static inline int mas_rev_alloc(struct ma_state *mas, unsigned long min, * Return: The number of leaves marked as dead. */ static inline -unsigned char mas_dead_leaves(struct ma_state *mas, void __rcu **slots, - enum maple_type mt) +unsigned char mte_dead_leaves(struct maple_enode *enode, struct maple_tree *mt, + void __rcu **slots) { struct maple_node *node; enum maple_type type; void *entry; int offset; - for (offset = 0; offset < mt_slots[mt]; offset++) { - entry = mas_slot_locked(mas, slots, offset); + for (offset = 0; offset < mt_slot_count(enode); offset++) { + entry = mt_slot(mt, slots, offset); type = mte_node_type(entry); node = mte_to_node(entry); /* Use both node and type to catch LE & BE metadata */ @@ -5512,162 +5518,160 @@ unsigned char mas_dead_leaves(struct ma_state *mas, void __rcu **slots, return offset; } -static void __rcu **mas_dead_walk(struct ma_state *mas, unsigned char offset) +/** + * mte_dead_walk() - Walk down a dead tree to just before the leaves + * @enode: The maple encoded node + * @offset: The starting offset + * + * Note: This can only be used from the RCU callback context. + */ +static void __rcu **mte_dead_walk(struct maple_enode **enode, unsigned char offset) { - struct maple_node *next; + struct maple_node *node, *next; void __rcu **slots = NULL; - next = mas_mn(mas); + next = mte_to_node(*enode); do { - mas->node = mt_mk_node(next, next->type); - slots = ma_slots(next, next->type); - next = mas_slot_locked(mas, slots, offset); + *enode = ma_enode_ptr(next); + node = mte_to_node(*enode); + slots = ma_slots(node, node->type); + next = rcu_dereference_protected(slots[offset], + lock_is_held(&rcu_callback_map)); offset = 0; } while (!ma_is_leaf(next->type)); return slots; } +/** + * mt_free_walk() - Walk & free a tree in the RCU callback context + * @head: The RCU head that's within the node. + * + * Note: This can only be used from the RCU callback context. + */ static void mt_free_walk(struct rcu_head *head) { void __rcu **slots; struct maple_node *node, *start; - struct maple_tree mt; + struct maple_enode *enode; unsigned char offset; enum maple_type type; - MA_STATE(mas, &mt, 0, 0); node = container_of(head, struct maple_node, rcu); if (ma_is_leaf(node->type)) goto free_leaf; - mt_init_flags(&mt, node->ma_flags); - mas_lock(&mas); start = node; - mas.node = mt_mk_node(node, node->type); - slots = mas_dead_walk(&mas, 0); - node = mas_mn(&mas); + enode = mt_mk_node(node, node->type); + slots = mte_dead_walk(&enode, 0); + node = mte_to_node(enode); do { mt_free_bulk(node->slot_len, slots); offset = node->parent_slot + 1; - mas.node = node->piv_parent; - if (mas_mn(&mas) == node) - goto start_slots_free; - - type = mte_node_type(mas.node); - slots = ma_slots(mte_to_node(mas.node), type); - if ((offset < mt_slots[type]) && (slots[offset])) - slots = mas_dead_walk(&mas, offset); - - node = mas_mn(&mas); + enode = node->piv_parent; + if (mte_to_node(enode) == node) + goto free_leaf; + + type = mte_node_type(enode); + slots = ma_slots(mte_to_node(enode), type); + if ((offset < mt_slots[type]) && + rcu_dereference_protected(slots[offset], + lock_is_held(&rcu_callback_map))) + slots = mte_dead_walk(&enode, offset); + node = mte_to_node(enode); } while ((node != start) || (node->slot_len < offset)); slots = ma_slots(node, node->type); mt_free_bulk(node->slot_len, slots); -start_slots_free: - mas_unlock(&mas); free_leaf: mt_free_rcu(&node->rcu); } -static inline void __rcu **mas_destroy_descend(struct ma_state *mas, - struct maple_enode *prev, unsigned char offset) +static inline void __rcu **mte_destroy_descend(struct maple_enode **enode, + struct maple_tree *mt, struct maple_enode *prev, unsigned char offset) { struct maple_node *node; - struct maple_enode *next = mas->node; + struct maple_enode *next = *enode; void __rcu **slots = NULL; + enum maple_type type; + unsigned char next_offset = 0; do { - mas->node = next; - node = mas_mn(mas); - slots = ma_slots(node, mte_node_type(mas->node)); - next = mas_slot_locked(mas, slots, 0); - if ((mte_dead_node(next))) { - mte_to_node(next)->type = mte_node_type(next); - next = mas_slot_locked(mas, slots, 1); - } + *enode = next; + node = mte_to_node(*enode); + type = mte_node_type(*enode); + slots = ma_slots(node, type); + next = mt_slot_locked(mt, slots, next_offset); + if ((mte_dead_node(next))) + next = mt_slot_locked(mt, slots, ++next_offset); - mte_set_node_dead(mas->node); - node->type = mte_node_type(mas->node); - mas_clear_meta(mas, node, node->type); + mte_set_node_dead(*enode); + node->type = type; node->piv_parent = prev; node->parent_slot = offset; - offset = 0; - prev = mas->node; + offset = next_offset; + next_offset = 0; + prev = *enode; } while (!mte_is_leaf(next)); return slots; } -static void mt_destroy_walk(struct maple_enode *enode, unsigned char ma_flags, +static void mt_destroy_walk(struct maple_enode *enode, struct maple_tree *mt, bool free) { void __rcu **slots; struct maple_node *node = mte_to_node(enode); struct maple_enode *start; - struct maple_tree mt; - - MA_STATE(mas, &mt, 0, 0); - mas.node = enode; if (mte_is_leaf(enode)) { node->type = mte_node_type(enode); goto free_leaf; } - ma_flags &= ~MT_FLAGS_LOCK_MASK; - mt_init_flags(&mt, ma_flags); - mas_lock(&mas); - - mte_to_node(enode)->ma_flags = ma_flags; start = enode; - slots = mas_destroy_descend(&mas, start, 0); - node = mas_mn(&mas); + slots = mte_destroy_descend(&enode, mt, start, 0); + node = mte_to_node(enode); // Updated in the above call. do { enum maple_type type; unsigned char offset; struct maple_enode *parent, *tmp; - node->type = mte_node_type(mas.node); - node->slot_len = mas_dead_leaves(&mas, slots, node->type); + node->slot_len = mte_dead_leaves(enode, mt, slots); if (free) mt_free_bulk(node->slot_len, slots); offset = node->parent_slot + 1; - mas.node = node->piv_parent; - if (mas_mn(&mas) == node) - goto start_slots_free; + enode = node->piv_parent; + if (mte_to_node(enode) == node) + goto free_leaf; - type = mte_node_type(mas.node); - slots = ma_slots(mte_to_node(mas.node), type); + type = mte_node_type(enode); + slots = ma_slots(mte_to_node(enode), type); if (offset >= mt_slots[type]) goto next; - tmp = mas_slot_locked(&mas, slots, offset); + tmp = mt_slot_locked(mt, slots, offset); if (mte_node_type(tmp) && mte_to_node(tmp)) { - parent = mas.node; - mas.node = tmp; - slots = mas_destroy_descend(&mas, parent, offset); + parent = enode; + enode = tmp; + slots = mte_destroy_descend(&enode, mt, parent, offset); } next: - node = mas_mn(&mas); - } while (start != mas.node); + node = mte_to_node(enode); + } while (start != enode); - node = mas_mn(&mas); - node->type = mte_node_type(mas.node); - node->slot_len = mas_dead_leaves(&mas, slots, node->type); + node = mte_to_node(enode); + node->slot_len = mte_dead_leaves(enode, mt, slots); if (free) mt_free_bulk(node->slot_len, slots); -start_slots_free: - mas_unlock(&mas); - free_leaf: if (free) mt_free_rcu(&node->rcu); else - mas_clear_meta(&mas, node, node->type); + mt_clear_meta(mt, node, node->type); } /* @@ -5683,10 +5687,10 @@ static inline void mte_destroy_walk(struct maple_enode *enode, struct maple_node *node = mte_to_node(enode); if (mt_in_rcu(mt)) { - mt_destroy_walk(enode, mt->ma_flags, false); + mt_destroy_walk(enode, mt, false); call_rcu(&node->rcu, mt_free_walk); } else { - mt_destroy_walk(enode, mt->ma_flags, true); + mt_destroy_walk(enode, mt, true); } } -- 2.39.2