From patchwork Fri Aug 4 16:59:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13342115 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 504ADC001DE for ; Fri, 4 Aug 2023 17:00:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BC0646B0071; Fri, 4 Aug 2023 13:00:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B703F6B0072; Fri, 4 Aug 2023 13:00:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9C32F8D0001; Fri, 4 Aug 2023 13:00:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 8D42C6B0071 for ; Fri, 4 Aug 2023 13:00:29 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 23787C1588 for ; Fri, 4 Aug 2023 17:00:29 +0000 (UTC) X-FDA: 81087035778.30.204F7A7 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf04.hostedemail.com (Postfix) with ESMTP id 4055B4001B for ; Fri, 4 Aug 2023 17:00:23 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=2YijfXjT; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=v7f5DHXD; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf04.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691168424; 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=FX3AVzelaw6ITZi6EysUWnMmnKX/hf4MQkplrvHqWt8=; b=hszeqi1+a3P8x4Bn4HiE9U6/wm2Dd/mW0aDs0p+DvuRt2Zg4Lmgmw7FPGCpRjKgEXnxrvj iyvPnMoegcUjQyOZzzikH6TqA/byYhd3JkRMEGkOqgs9cgiG5a4HcpgVl4Y7U2J5wrnP0X HaUVukxGaWiFDtjbf4o7tPWvUVw+xew= ARC-Authentication-Results: i=2; imf04.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=2YijfXjT; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=v7f5DHXD; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf04.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1691168424; a=rsa-sha256; cv=pass; b=Ufcy8nWy5gsePToaRIZaclp1kac14iOvKrA8DCLhmk3cNv/OU8u1G3LQ42zDscRayGTRXV up3/Np8O31wLRYUfFIgwraiTQvuCLe1RZQbZBmHFEGNC7m3LYpNW9CNM5W7FhpIaP69IVc j8CTBiLQh5gCvaBtCQww29r/1LnVp1U= Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 374EiEkq002988; Fri, 4 Aug 2023 17:00:17 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=FX3AVzelaw6ITZi6EysUWnMmnKX/hf4MQkplrvHqWt8=; b=2YijfXjTiAbI8pZDFTkVBwIhoeuSdoPw2zUyJ6SngNzto+6LCsvOvv5KwOujCfpIC5Rx Bkwlzz9F4VvmEm45brMT8CPWr0WvGDVE+HOPR1H8lj2bOii1i3gxIWM52mNkbAUbhA3h rScIpQwlgRvxExsoYhr8WDMQNnKHpHrHo7CK42pnMgkr9wQvIMntsn2kvJr0Pwq9NTrc dzfWCfdLnBmnPUcB4n79P+S4N9ClT0PnmZIQr3caSYugua5Xcu/cmhRsOKjgg8/IfOUi Bm3CA1rdyzmZnSown8wX55UMvCLrTslGhq1oX4g+ygl2OP8H6T/k7VX5Bk7Zm1MRZMAp Gw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3s4spcc9v4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 04 Aug 2023 17:00:17 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 374Gt8Y0029324; Fri, 4 Aug 2023 17:00:17 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2175.outbound.protection.outlook.com [104.47.73.175]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3s8m29bmms-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 04 Aug 2023 17:00:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TOZt6J+fR95OXDTDPq8mSe1+yIc414rz89GFy2D9Z95sXjUqlOBsGiNVTz4vTcUyew5ebVi9TE5OyAFWKMWPWKA5zauT7pbQ5zmYY6e29x8gdTOyEZjprYENdEY5I8wTAs46gDaxE0iIzpbZz9d7BEm9PhIn10eB70mZWXS4lnVNOxo3PIi6XmNxMuyh5WCH1F8YhShaH7pM4wqp90sUaKdPjceFI/mPtv+dvXn1cnGlT7FK+BmZk3oRkuzS51ayLUkb9vvY1Efn7vUNa5uti6c5EAq1Fqsgy7VK60RHLc3zjSCBVIx9zBh3B94P2/5d7ux3AQEK0mnFmSmJ09aMGg== 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=FX3AVzelaw6ITZi6EysUWnMmnKX/hf4MQkplrvHqWt8=; b=cximcLXJsO6Vtj6EykUo3Jp/LwVoxsfzTd+qkHFvGDVmFVAENpcD6B7sLSBFeU2bLYIOwzAGcOUYzKYBkOBk/4V0x5LVQw86aXqusy/5oA45m7NVcLlhwpeRFRzrMYtCQHnpqidGTiA5vxDDYJKv2ZfBmR9qflg+rxBUQrBylcJF3vSxja4gp/Z5CWvcas3S8XhRDsq3s2ItRCaTB1Vu0v8jX+EdhCoOyizzXN8FJyA0RImnOJ1g2m/ZVjGj4YrLRbr8/8W1ClbnYZfn/nt6t+zr8T92KfflgXHMm30CyYTosWbcVBRvEhWqG0eovrkDXTCvnaBI+l1/vC7kDKTN7g== 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=FX3AVzelaw6ITZi6EysUWnMmnKX/hf4MQkplrvHqWt8=; b=v7f5DHXDp4ghxTE+tb3rPGDm2IDu4iG4/CswdFtSWaem5kA3AYqWLg2XQuIuPnfiCUB6ZCsN5pYZGqY+cm0KdwsZoflaDEUn7n0O9CpxTfIkiEgLFII+XNWEf1mWdLEyxPDjnokBtnP8imU+/owHEudpzTcALkoYFEp8Xy0UiAI= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CH0PR10MB4939.namprd10.prod.outlook.com (2603:10b6:610:c0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.21; Fri, 4 Aug 2023 17:00:14 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::26d3:6f41:6415:8c35]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::26d3:6f41:6415:8c35%3]) with mapi id 15.20.6631.046; Fri, 4 Aug 2023 17:00:14 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Paul E . McKenney" , Suren Baghdasaryan , Matthew Wilcox , "Liam R. Howlett" Subject: [PATCH 1/6] maple_tree: Add hex output to maple_arange64 dump Date: Fri, 4 Aug 2023 12:59:46 -0400 Message-Id: <20230804165951.2661157-2-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230804165951.2661157-1-Liam.Howlett@oracle.com> References: <20230804165951.2661157-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0175.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:110::9) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|CH0PR10MB4939:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b912ad6-9581-4633-6c86-08db950c4560 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d7Zktq7fjjhwSy+rvEgLak+wzE911BkqwjT30JR+5NLBLvX6PmGllI39s2KRGh0e353e7LWh33uV0fmtoNFtY+X0uXvBCc7H5UivO8h3qE8+mCXUNMrufOsa/2bDifO52EdJKcMp4o+aZzzCB24JXsPrdbTSznkA8CB2ux8MFzwKc0UohREz12U49U1DvdOjOUla2pVyPHruQuQMN5fdPnPa4syRHitCwm90NgATQvjBCFWkviWfFJFVYLWsm6f0MHf62weicQsq0XzxR+CRFppo7Zfxm3qOWL6knbOX1jCk0RoNDSSO5fFuu1rPKBVJzcZge44rg0A8SouZZM7RsBrlknlfEIW6QS7G3Ezd/JzCFv/YVWQNQwY5gimTuzZIsq5p0Lt7qrv6aIlcQebKQDPCCoKfb8djKTzSJzmVtliFdl/nIvZFBYI+kYUJz0RRzlQbZ4TM6nhjK9PR+HQRvi8Px7geqYafzAMUktTfzukq++/tjfCfggkvbu7zQIiAcn3EQNrHs2XnBu2C2NaKoB6zTSEfjS+nJN93u/805HiybdJ4nsxe2RBoo6YlL4EB 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)(366004)(396003)(39860400002)(346002)(376002)(136003)(186006)(451199021)(1800799003)(6666004)(6486002)(6512007)(86362001)(6506007)(26005)(1076003)(107886003)(36756003)(2616005)(83380400001)(38100700002)(5660300002)(41300700001)(8936002)(8676002)(4326008)(6916009)(66476007)(2906002)(66556008)(66946007)(316002)(478600001)(54906003);DIR:OUT;SFP:1101; X-MS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840TdBFh52evBILcd/quGiCdlz1suAMUUqQdmxqfWBdQu77YFNUqVcP1fIU1M0HA+fLtqmepAP5efa8DFbXOFuV6oTOgfG7NHCMHnsG7o4zxez1iZCZEb3VnL3khyPD5xSaZp/vy6BQ2Wdun4HiRxPy7lZxjGWrZ2aScDd0QHvk+w4G80QZf0+QMQWJRpSB7x5xDKcAQUNG9BMu9vzem/R//rZn6T+oyd0Cr0N6yvaQfL106Mf8UYPE0P/Ucpz6xDwuZIK4agMr2E2QfealzrGqwvNipYLMpWV1PVG+yt4vuBSelfzFUYmfSE9ohUX8IuMa8uezmKMPIik6TDL6o68LeURzXcw+de7dVgy1kWqcnX3Tcf6k8tLMnqJFH7TsKDYPyaYk1yaqnWDMQdBzGEyuFRh82PBghTU3pu0DTHzxqid+B1P88utmSqFFO1rScETooxDQheDjipuKffOyH+w3Xlb2jLOlNob7lOuVeXmYFajUFYCGTNKNnUBRCGBzahhJqOGEeTTzkSNCR0uEjcsouG8wkPVZI/GOUm+EAHaETnG5orPC9VIJP9DgM0DWG4KwovWgzn+yUoqkE8QLuYsffAD+EfGi2OOQYs= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b912ad6-9581-4633-6c86-08db950c4560 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2023 17:00:14.0317 (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: ZwStVAYx/5TY+2sIIgw5sl1Pzvjdrd7oNXb0hgzkM4eMRBuiTQQXqaYNwZPRh20CO8y6DRSgo2pLCCPeSjM4Rw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB4939 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-04_17,2023-08-03_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 phishscore=0 bulkscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308040151 X-Proofpoint-ORIG-GUID: T-VwZFYPxZ1PUH_Y7Vj4TK1BF2Xb-T4a X-Proofpoint-GUID: T-VwZFYPxZ1PUH_Y7Vj4TK1BF2Xb-T4a X-Rspamd-Queue-Id: 4055B4001B X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: jomcpw3b73qxrbbwght5prwfzw1iindg X-HE-Tag: 1691168423-438243 X-HE-Meta: U2FsdGVkX1/kKQavdZRWUiM8u5X5svBRV5EniitxzZXVvkIozWZMPe53yg2mSmZ6+TLwCtvhies60uwD5kXKCoWQY8xICinL4RiJ7EyUtLvMLwVPE/w2tiFauQ6V1Mf3DFKXsa4XxsCkoja99chgaS2AkQP1hG1aeOotCH5k72lBCgxL16A1JGY3cA7Ij+CefqD3Uh0I8WxHVr5e6iVXVMxZKzBrztpvdD/QQOEP2LcoxO+RXsIlBmi1U92tvlz8WhOytQRyujXu5+3Qa03trKy+o1YG9jJ+V1/ErWkX9dpwP27FJ19xFhG+AloEqub7xHXryKUG5OmqF8dxfIdlvI10tD2+XYbLpdehNdpNOB5uWQs4BRFYKbJNSS4GMwOMGYwbOlEXbsBpuVNcFj6MUNj/72p5YA/fevYaxTn4H90X5VOEOVxvWmSyVH9FZB91SwiAj//8g/LcWF0TtRq3CZd6k2vasWe4H3dl54lrEDf774VUmYBooAryPkN8itI478DrZmOc7XDQABtf20rGj+g5Lk4xvFOIqRyLfWYmmGXOfRBbjmHSHeyimirHF3NsV+T/tGkoPaKZr5r83YqSF7rdKLrJ9ir5tfkkCTbwG0cC2tQUz5mQmSNO7qqm5Dcr+54HYwwh5rgTADTCU4zXlItMaC51vOzdlsZR8YwAMv/pwqPg3lDzF1XOEyDb1nF7zNBFJB+0FDw8wbB0yqemyLrtV6EXbcpfyY2EQRl7cg3yBY1Qn0WXyIgYhL9QT7v7wwMjkjVGKoIDH53SMt5wmThnU5Wtue4nPmssFoJuDvXROavyN2WpH0KopJQbQm5G8vbhe9NbqljzON6+WH+SuJQKN1V51Mcw7n7cgAeu/5dgLt7c/y02rOyPfTPy9MTxrNsfYn8+3TX1GLGO5NqwCI9MJSluIyjUVwC7F8zGZd2XGC94DEQDXgdrohNOeaqct2eAeOKY1rxWFsOoqoJ yQHWxyIb LVkj+r+kbE/uTp7zp1mZmA/57VYH4DrX+BmGUUQsgzhk3EY5LkEPxxPdc0q4ood1D+MgQpAmr0vE+hweKLxo7ohydoUj3w/V7npqDc6fR1vnzYJ0DPWCC/hIxoGIqMXxe+rtWdzIytSQNs5dC8R+WMSoE+KIZJs3RWvCe9d4JDZKq961FrmYD8rdr1Ze9/zmWFvGTtfjoeMaSvnTq28YB8+peliO4qsh12J9jBq1O/NLUdKwGVmqCzl2r+v0YdrU14BetAugl4FiwY7WwpypOGRD/7DENDab5VexN4fUmgMSSrdUWZiOJF7m90i0GdqAlz5J4qitq55cDTchNLDQsjWnTyR0+sBQOQRHT2M2JurCFEYZGXveS+0YYr4BsTj/Qp49fFq17qepd7QoyiaM8rSgBHSYz1qxGoi5/+/bqoOHYxRI= 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: When dumping the tree, honour formatting request to output hex for the maple node type arange64. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index a3d602cfd030..880ce0fcdcac 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -6833,11 +6833,27 @@ static void mt_dump_arange64(const struct maple_tree *mt, void *entry, int i; pr_cont(" contents: "); - for (i = 0; i < MAPLE_ARANGE64_SLOTS; i++) - pr_cont("%lu ", node->gap[i]); + for (i = 0; i < MAPLE_ARANGE64_SLOTS; i++) { + switch (format) { + case mt_dump_hex: + pr_cont("%lx ", node->gap[i]); + break; + default: + case mt_dump_dec: + pr_cont("%lu ", node->gap[i]); + } + } pr_cont("| %02X %02X| ", node->meta.end, node->meta.gap); - for (i = 0; i < MAPLE_ARANGE64_SLOTS - 1; i++) - pr_cont("%p %lu ", node->slot[i], node->pivot[i]); + for (i = 0; i < MAPLE_ARANGE64_SLOTS - 1; i++) { + switch (format) { + case mt_dump_hex: + pr_cont("%p %lX ", node->slot[i], node->pivot[i]); + break; + default: + case mt_dump_dec: + pr_cont("%p %lu ", node->slot[i], node->pivot[i]); + } + } pr_cont("%p\n", node->slot[i]); for (i = 0; i < MAPLE_ARANGE64_SLOTS; i++) { unsigned long last = max; From patchwork Fri Aug 4 16:59:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13342120 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 456E4C001DF for ; Fri, 4 Aug 2023 17:00:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D477F6B007B; Fri, 4 Aug 2023 13:00:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CF83C6B007D; Fri, 4 Aug 2023 13:00:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B71126B007E; Fri, 4 Aug 2023 13:00:48 -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 A5A586B007B for ; Fri, 4 Aug 2023 13:00:48 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 038DC12152E for ; Fri, 4 Aug 2023 17:00:47 +0000 (UTC) X-FDA: 81087036576.25.B7BA8D2 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf07.hostedemail.com (Postfix) with ESMTP id 93BB24007D for ; Fri, 4 Aug 2023 17:00:28 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=eYdumrFq; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=QXSeBrbr; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf07.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691168429; 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=u4CFjppFxp9l2MaITKNmsStPN7oSuRkt18qYVROXvto=; b=2q5b/ZPryi2JT+bTbddMuhSugAKSrz2FGuKstXhB5S8KZ45nG0j7rtWS6Ygp//1jpDZw5H nfQ8UNWw7e6z6XVQSoh78Eg7QWS4beDgBzik42C0I693x2pBfXw4rPRfMVsryDPbb8O2m9 zRc2Ha9A1e3eiga7d/SuImLllGp8gj4= ARC-Authentication-Results: i=2; imf07.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=eYdumrFq; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=QXSeBrbr; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf07.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1691168429; a=rsa-sha256; cv=pass; b=Mlf+DsnUFtpqnISRjpuoQKCEBP0pv6feJKiGZyI54XIjEUEM+eAH+AVhbfcRIoke/STiRX BwfON0aK2Ti19icHVu3O9nPPqYJ5QStNGq+aFb668NZH7vnOAtGPEElZhxndHcPCF3urBk hnJIMEt2XMXGHwg7iphEAwFytYzirnw= Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 374EiDF3002950; Fri, 4 Aug 2023 17:00:20 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=u4CFjppFxp9l2MaITKNmsStPN7oSuRkt18qYVROXvto=; b=eYdumrFqyYhH4qPEX/i+0YDHILjZdjdwZj3bHwLlv32izcpXTLGhilcy2fF5Co/3iCiw aVkeL6r3J0RATkpgBR0bujYMoDSYRUaeWlwQqjeH/W630tev1HsNVkZhkvld2/R8KaGW wWe/APJEzeAj8ZQcyRwbzs3UK1fc3F0/0focCN7gQoa20jptC2HQo7PrcAODHBoyRYme fo/cn44Esn8384iYmK6PL8/0fPJJaG4uVJX3je+ht4KavMzGkdXpslBlPw20L2peoDvC KeCuDrWGwDVX3m3RqyI57CAORTrHYFdi3Jzt/v1KqgCmx8XuB/LZpGKoGFQ8U1XxyuUG iw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3s4spcc9v7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 04 Aug 2023 17:00:20 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 374FJgoG029618; Fri, 4 Aug 2023 17:00:19 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2108.outbound.protection.outlook.com [104.47.70.108]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3s8m29bmtm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 04 Aug 2023 17:00:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WrVIitj3IUCky6F5fD9u7X31poirUjinnNhoJVR6qh7boNn4gHkKYGtr3oldmApl9+QtXGkfBR1GpplbaNCf55ECuR1O8FaSRmv1c3gd2vo2oSivfqlP2gwBYs2Q/bj5NyAt/gtNcXfMY7aieIw5s6bojik+acYP1wDN+w0euQHheE91o5SCefMaFfAR58PwK7vV1yIDnpMyxmDrSfYm21mnyBQXAPg3MmH5PrLseergrOtcj7EeOFqE1L01gbWn84j15w9plfop9Q0NDCpQPSca/UKIc0mj5S6WLYpeXJiq4lfu4kdah8fZP5JEJNowhANGs3odCEqH1t9XMOLy6w== 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=u4CFjppFxp9l2MaITKNmsStPN7oSuRkt18qYVROXvto=; b=g+qWeLZo7usR/KWrSY8m7wNw/O8PO32pRdPAb3IQ+BLjWEtr0PBRvNTMiNEULDjobaGBy3UeUGrGser5pcdQWcP1ZSJVwOWBWKnNYAGqjjhfq9v+oeYI1ULSZaDGr+B2LValyRV5QdLClJx/epFkdDSlrDOcxI7NvjuoJmN3+TveQ09OAY8utD9BA2c/ieReLlxQ+/0MW/LU5ykwwhs3ZiqbSGEYHHIWy6j/Rg80oCTN4afS7B+4RVUv6jANxfN6UFhif5w0hHPSAkGu63J8MMHGLZiJzJvl5Jx37dhKmGC+QAGA94OIY+JHYgffaHyrht75kIBWD+TbWTF1FxmTeA== 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=u4CFjppFxp9l2MaITKNmsStPN7oSuRkt18qYVROXvto=; b=QXSeBrbrKegpOXrUs3h8PJt131fnQ//0JVG3wkyVS1+2FZevwMwGek/RUUHw8/0yJNpyXtuEY/SFD6MiOXya7/9ltPCsSqExsycdS57/tygpK0ALX75A5c+QH3TpQ4m1UZBv5mMCDWdmQXEIWteq9DtsK5uQxK2v0jF+IJyEsJM= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CH0PR10MB4939.namprd10.prod.outlook.com (2603:10b6:610:c0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.21; Fri, 4 Aug 2023 17:00:17 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::26d3:6f41:6415:8c35]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::26d3:6f41:6415:8c35%3]) with mapi id 15.20.6631.046; Fri, 4 Aug 2023 17:00:17 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Paul E . McKenney" , Suren Baghdasaryan , Matthew Wilcox , "Liam R. Howlett" Subject: [PATCH 2/6] maple_tree: Reorder replacement of nodes to avoid live lock Date: Fri, 4 Aug 2023 12:59:47 -0400 Message-Id: <20230804165951.2661157-3-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230804165951.2661157-1-Liam.Howlett@oracle.com> References: <20230804165951.2661157-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0456.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10d::20) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|CH0PR10MB4939:EE_ X-MS-Office365-Filtering-Correlation-Id: 7868e07f-7abd-4d31-c7b8-08db950c4708 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pVgEEq0a7N5gMOXBNiGz/MvTEkOsQAjuthf3BC/2wAOiVnKwxuj12rBGIdT/iJRG7o0wJGif8PxMf/SENfbpHdStJ0Anx9ivwtF0lAyieyxLi0RoikmQas/JFlpg85708E5+RM/WU/CP3a9+pHjenecAHs2erzqcxEukTo4uIME62phS9gPAeL+oAAi1Tx6b747eQ8RswOqy8j4kOhDncCU1duQ3GEWX1HEUQ2wDVERLrDkK6OQFm/EgVE803EPNtPUSntQRmE9Z8EzqXOgZBTveJBf+4OmqtOkWSW3Y7hyB0RYy2XYcvGW+ypjtVv7FsPsod+Y10QabgJUVla75xNydicKyPewigOU1VeaLWmiuCvVBowW2FN7mBvt5F1qismXeOpARm6hjIXzSqhNjzLZiXdG5eRAvai/i5lKi0xCjxNnuI0ZNTkyzM1e53LdUD2aLidfqbEotIuZp4po2aqTM1JhenlwZOQk3PoW0dKd+AdxLd2xK4WRfBvtkBjp25Zh5USlLFx85ut3U5L04xBuEST/e2qzBlwO4esd+UpeGIuqTaWg/+dgcBtmvfQcp 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)(366004)(396003)(39860400002)(346002)(376002)(136003)(186006)(451199021)(1800799003)(6666004)(6486002)(6512007)(86362001)(6506007)(26005)(1076003)(107886003)(36756003)(2616005)(83380400001)(38100700002)(5660300002)(41300700001)(8936002)(8676002)(4326008)(6916009)(66476007)(2906002)(66556008)(66946007)(316002)(478600001)(54906003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9M437dGkuFLrkEsKZm60ZHDhqnZ4k1Ek39n/DcMvvfmmhHqen9lgsQkBznUhWQPN0ssUPggLJY65NJc9bRao6a6+aR+fLgEyQ5DVRAqaTVpsPvylYgt3UoAXTF3kza6/A8PRXoE3JchOFBsE22pbM1aokDzdaQ399rHJ6piIo4SN4Jro5pzfL2iW4JOqif7TDtPU11I9WYRFn1ZmGSw7LUV4zPtxCzpxSx/FbRuFUK3C6zTZh4EXl4tgk9Ux59mrTc93i+Gt9t0bDHHpXXNCh0isX2wKKZmCIQmhPOwUx0eiuzBdtGI6tUliuRdX+Nufg/7vZYJpCyhpY+6xCDW55TsVHFKaHf41DZ8t6SA9kSYQI2ISP+IbFJAfYK8vMF5VaWp5HxukVGRklxL37sPVkTthIhwkLcHRq6TXo0C7BJGPyuQBkzie6ZbPoJanqwaOqU1b2iDbuyMtcjCXl+Qmil4+FQBBhZPfnvl7Rf+suq4SyXCZE7u7DjsXFFuiZ28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KpnFmCM6GsHMeVlYXOfeQogwZT6nxuse3258ASp9VSzpizAi3a0PY7Lfo465+LeBU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7868e07f-7abd-4d31-c7b8-08db950c4708 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2023 17:00:16.8120 (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: yM3cU92b+h4k4v1Mw/dw1AEpX6lRMpISHE79cxFSFCWGY01YDO3IciwNy+9BK7jXeS1Zfot69NcufnbUcmpocA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB4939 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-04_17,2023-08-03_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 phishscore=0 bulkscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308040151 X-Proofpoint-ORIG-GUID: JL9Ja1WvvKDzbuFLUnp6brBA8IABs5-C X-Proofpoint-GUID: JL9Ja1WvvKDzbuFLUnp6brBA8IABs5-C X-Rspamd-Queue-Id: 93BB24007D X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 9hrb175jqa7368wo8zgjkxdj8n1tfgua X-HE-Tag: 1691168428-437681 X-HE-Meta: U2FsdGVkX1/qLX3IEMasKeMucqkWpHLhZBTByPjuFMHUwDDp4OGe0mH/DbOA/RdNO70/Y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HvvKE1noe8GRjlezkWnkWGDuUHaRUp4jBnLDzpItc5nfYAwEO2pzxwbze7RYmjpaU/6MlPXjgFae704aCNTPEEebjC1ck1jZkK63aVyHNCg4fxkVCn/WCepp5sU5m380+7GPJcUHQWnAIJozfsxK4YPG2G/iDMZWHs0ob0IPBe8iQbt6ZOU660HN4FIjMOSxL8CvlfdREPtTGmkBhdVWNrd9dVMZzSAa5MTcjQ0caYSUM98GjxUWgyYvF5wnqzvUBIbKV3Ky2ODo/u/unUaFXPU= 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: Replacing nodes may cause a live lock-up if CPU resources are saturated by write operations on the tree by continuously retrying on dead nodes. To avoid the continuous retry scenario, ensure the new node is inserted into the tree prior to marking the old data as dead. This will define a window where old and new data is swapped. When reusing lower level nodes, ensure the parent pointer is updated after the parent is marked dead. This ensures that the child is still reachable from the top of the tree, but walking up to a dead node will result in a single retry that will start a fresh walk from the top down through the new node. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 56 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 880ce0fcdcac..0d4573a8d134 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1756,6 +1756,36 @@ static inline void mas_replace(struct ma_state *mas, bool advanced) } } +/* + * mas_replace_node() - Replace a node by putting it in the tree, marking it + * dead, and freeing it. + * the parent encoding to locate the maple node in the tree. + * @mas - the ma_state with @mas->node pointing to the new node. + * @old_enode - The old maple encoded node. + */ +static inline void mas_replace_node(struct ma_state *mas, + struct maple_enode *old_enode) + __must_hold(mas->tree->ma_lock) +{ + if (mte_is_root(mas->node)) { + mas_mn(mas)->parent = ma_parent_ptr( + ((unsigned long)mas->tree | MA_ROOT_PARENT)); + rcu_assign_pointer(mas->tree->ma_root, mte_mk_root(mas->node)); + mas_set_height(mas); + } else { + unsigned char offset = 0; + void __rcu **slots = NULL; + + offset = mte_parent_slot(mas->node); + slots = ma_slots(mte_parent(mas->node), + mas_parent_type(mas, mas->node)); + rcu_assign_pointer(slots[offset], mas->node); + } + + mte_set_node_dead(old_enode); + mas_free(mas, old_enode); +} + /* * mas_new_child() - Find the new child of a node. * @mas: the maple state @@ -3176,7 +3206,7 @@ static inline void mas_destroy_rebalance(struct ma_state *mas, unsigned char end { enum maple_type mt = mte_node_type(mas->node); struct maple_node reuse, *newnode, *parent, *new_left, *left, *node; - struct maple_enode *eparent; + struct maple_enode *eparent, *old_eparent; unsigned char offset, tmp, split = mt_slots[mt] / 2; void __rcu **l_slots, **slots; unsigned long *l_pivs, *pivs, gap; @@ -3218,7 +3248,7 @@ static inline void mas_destroy_rebalance(struct ma_state *mas, unsigned char end l_mas.max = l_pivs[split]; mas->min = l_mas.max + 1; - eparent = mt_mk_node(mte_parent(l_mas.node), + old_eparent = mt_mk_node(mte_parent(l_mas.node), mas_parent_type(&l_mas, l_mas.node)); tmp += end; if (!in_rcu) { @@ -3234,7 +3264,7 @@ static inline void mas_destroy_rebalance(struct ma_state *mas, unsigned char end memcpy(node, newnode, sizeof(struct maple_node)); ma_set_meta(node, mt, 0, tmp - 1); - mte_set_pivot(eparent, mte_parent_slot(l_mas.node), + mte_set_pivot(old_eparent, mte_parent_slot(l_mas.node), l_pivs[split]); /* Remove data from l_pivs. */ @@ -3242,6 +3272,7 @@ static inline void mas_destroy_rebalance(struct ma_state *mas, unsigned char end memset(l_pivs + tmp, 0, sizeof(unsigned long) * (max_p - tmp)); memset(l_slots + tmp, 0, sizeof(void *) * (max_s - tmp)); ma_set_meta(left, mt, 0, split); + eparent = old_eparent; goto done; } @@ -3266,7 +3297,7 @@ static inline void mas_destroy_rebalance(struct ma_state *mas, unsigned char end parent = mas_pop_node(mas); slots = ma_slots(parent, mt); pivs = ma_pivots(parent, mt); - memcpy(parent, mte_to_node(eparent), sizeof(struct maple_node)); + memcpy(parent, mte_to_node(old_eparent), sizeof(struct maple_node)); rcu_assign_pointer(slots[offset], mas->node); rcu_assign_pointer(slots[offset - 1], l_mas.node); pivs[offset - 1] = l_mas.max; @@ -3278,8 +3309,10 @@ static inline void mas_destroy_rebalance(struct ma_state *mas, unsigned char end mte_set_gap(eparent, mte_parent_slot(l_mas.node), gap); mas_ascend(mas); - if (in_rcu) - mas_replace(mas, false); + if (in_rcu) { + mas_replace_node(mas, old_eparent); + mas_adopt_children(mas, mas->node); + } mas_update_gap(mas); } @@ -3596,11 +3629,13 @@ static noinline_for_kasan int mas_commit_b_node(struct ma_wr_state *wr_mas, struct maple_big_node *b_node, unsigned char end) { struct maple_node *node; + struct maple_enode *old_enode; unsigned char b_end = b_node->b_end; enum maple_type b_type = b_node->type; + old_enode = wr_mas->mas->node; if ((b_end < mt_min_slots[b_type]) && - (!mte_is_root(wr_mas->mas->node)) && + (!mte_is_root(old_enode)) && (mas_mt_height(wr_mas->mas) > 1)) return mas_rebalance(wr_mas->mas, b_node); @@ -3618,7 +3653,7 @@ static noinline_for_kasan int mas_commit_b_node(struct ma_wr_state *wr_mas, node->parent = mas_mn(wr_mas->mas)->parent; wr_mas->mas->node = mt_mk_node(node, b_type); mab_mas_cp(b_node, 0, b_end, wr_mas->mas, false); - mas_replace(wr_mas->mas, false); + mas_replace_node(wr_mas->mas, old_enode); reuse_node: mas_update_gap(wr_mas->mas); return 1; @@ -4117,9 +4152,10 @@ static inline bool mas_wr_node_store(struct ma_wr_state *wr_mas, done: mas_leaf_set_meta(mas, newnode, dst_pivots, maple_leaf_64, new_end); if (in_rcu) { - mte_set_node_dead(mas->node); + struct maple_enode *old_enode = mas->node; + mas->node = mt_mk_node(newnode, wr_mas->type); - mas_replace(mas, false); + mas_replace_node(mas, old_enode); } else { memcpy(wr_mas->node, newnode, sizeof(struct maple_node)); } From patchwork Fri Aug 4 16:59:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13342117 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 0F1FFC04A6A for ; Fri, 4 Aug 2023 17:00:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 929DE6B0074; Fri, 4 Aug 2023 13:00:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 865928D0002; Fri, 4 Aug 2023 13:00:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F5D68D0001; Fri, 4 Aug 2023 13:00:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 4F3136B0074 for ; Fri, 4 Aug 2023 13:00:38 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 07DA71414FE for ; Fri, 4 Aug 2023 17:00:38 +0000 (UTC) X-FDA: 81087036156.14.99E860C Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf30.hostedemail.com (Postfix) with ESMTP id 641E780034 for ; Fri, 4 Aug 2023 17:00:33 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=eSOhx8Tg; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=dgnDjNti; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf30.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; 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=1691168433; 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=Z7Gj5S0j9aJuMmiu8QbGEoIFKbCYb02+sSjKCP66TtU=; b=niOh51vvCVAfdUiCNM66CI19LyoSeH7iKH2fGCz/zn4XKI+180YLKNmfq7uS23cm3F5CLf LLoIOGXrqOLR2/1QWX0L8EKtCqK5zayDnp+/MPwl9S65De1z3IqHEGJ+J7N6/uCvNtEim0 udLF8oRec7JPlGIPkY+ld10zePfddbI= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1691168433; a=rsa-sha256; cv=pass; b=k6RKnSvDijIJY00B1tflyCzE80aaLX4esfLb+Yuw02Pe7wXhNpBsbXUz0ZGa2z+FUCLeEB Zp5JvlUPg8+mK5Msa31Bnsd1Hz6VuH74oi6x/C0FZ14df8ZdNgbZwkjughZKtdP7vhW8Hz 9qjQDn7c5OX8o4R3awyW0ZRUVUF86P4= ARC-Authentication-Results: i=2; imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=eSOhx8Tg; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=dgnDjNti; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf30.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 374Ei6wF032152; Fri, 4 Aug 2023 17:00:23 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=Z7Gj5S0j9aJuMmiu8QbGEoIFKbCYb02+sSjKCP66TtU=; b=eSOhx8TgRZwZc3YlZY6Ir19XNkq2l/W3HO5GD8fM4Fp1qpuqZ9HvlEUF1Q3xEbsudyl5 YSzxtdqZvL/V65dpOxu3yMhXQi1rGa8ub/sOrfUit++S0XxBoSNBupS5xfLP4VvqjtXk Xv5htHm3FJGBmZF+4nonpbcYPN/zEJrAQw3+eIVAZrFuAJ8T8f6KoxnW7XnpWafWfo4W 6X7AXzk537jAaUpQ7MMqv+nM439wZsbiaKP8enoy+26VSdbrQBiqVeR1ZwLlMbB+aPES y9l/ZfjNmvj8TpBU+CSXFNCpgiJeILXluhPbt1LQtAHWtSSBzDKLB8d5QgUhlB+v6JNu rA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3s79vbx9eq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 04 Aug 2023 17:00:23 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 374FBTWQ029325; Fri, 4 Aug 2023 17:00:22 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2102.outbound.protection.outlook.com [104.47.70.102]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3s8m29bn0g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 04 Aug 2023 17:00:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KyqsAiCRKCZuWfF9Ah7S2aYj0Sva/MFw0cOqYhL5cRXjd+V1j/GL84nDQ7gjK1eSwrSUff3B4l8O+Y3qoIWyDFc2aBEyLWG0WP7Ujl8EsrCa1kG9I5KJDYLyWkTdszUddFeqLCTJ8DLEKcS92P6liH50xEjm/YJmjH1sSeNM/CF2rpUeOTib157mLHC+p6vaUO52IKJzzL4fTXVrFWoexN2gVw+vc8pOEhshW4k7BWf4D8xLmAmvgSmklK1zNrN9V5eYI0OVBjxhLHgqQqufobZp83SI5l+/FMYuKdm1CGxYUJ71fymrgX+ivLAc58Jdqv6OvN8FvcVnQCWJADzNGw== 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=Z7Gj5S0j9aJuMmiu8QbGEoIFKbCYb02+sSjKCP66TtU=; b=SZx+r65ZhWHNFAMAeri3p+YUdv4AC/SgVO1S6zA2lFFVT3mEPiFEcLEpTCJj9a6hHVfdOtmBXFNgI71AYjDK0FtdvGn+5ORVWVnO5+QvO6+Hipw9UES0ctL+3pvxzpmQGsyh2q40g4uPmtCUndl3D9ARC8Vyuz7DUHDc6sdssCu1QyDuak0BkC6CBfsD2KNHzWBNs4J0XKN6CSQV/Ph2Y0tB/u2mwS7WveSkgPJRJiPfpwQZbya1aGpstOYpFIBJjN9p137bUIOYfatYVVb/dhQ+xkD9qBBoeI8jlBa+qneyKcPDipQsqR+9nw0vkf1fkN/K7Ys7qp2W90VQxjoVEQ== 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=Z7Gj5S0j9aJuMmiu8QbGEoIFKbCYb02+sSjKCP66TtU=; b=dgnDjNtibR7qwsGr4ZK1RxfsyJNSplNaSrr3VFp9O/Mc94MqIyBo8OYnge2PqIF+qUT/YqrcTFSru4mVqRm16r5Y9b+k6dOV2/cBcDZdTg1MGPLyPlKF084jMMH5o1uXyGkEkV/luvNRDM/3mnMPI1ogP0VoEaEEi6CDnjvD3wE= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CH0PR10MB4939.namprd10.prod.outlook.com (2603:10b6:610:c0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.21; Fri, 4 Aug 2023 17:00:19 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::26d3:6f41:6415:8c35]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::26d3:6f41:6415:8c35%3]) with mapi id 15.20.6631.046; Fri, 4 Aug 2023 17:00:19 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Paul E . McKenney" , Suren Baghdasaryan , Matthew Wilcox , "Liam R. Howlett" Subject: [PATCH 3/6] maple_tree: introduce mas_put_in_tree() Date: Fri, 4 Aug 2023 12:59:48 -0400 Message-Id: <20230804165951.2661157-4-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230804165951.2661157-1-Liam.Howlett@oracle.com> References: <20230804165951.2661157-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0277.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:109::10) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|CH0PR10MB4939:EE_ X-MS-Office365-Filtering-Correlation-Id: dc592ef8-9cd4-4fdd-8541-08db950c48b3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H+0tr6yQAUTv9uVDHF4xH4n91gbWXUUC35WD4lLSv/D3QFyIWDEIEzAYjMX8SIEQBE2a9HiK/YuHCoZzRsKUzkVB/IJyUUgoY0KmiGuXdlyecfcmovWdBMDvrldVKm+VBezW3wfTCnFStd+xaBECNjGCtYvU6qwedV69+mjVfnIFH7SN+UlivD9NeL4RISxSo4EL9CPM3nN8bSitCtaeuqqhNAA1IIXNPBz9OBLmd9p+UL2zZsUsxqT8G0D3kN+se8EDBFVzlbBvOACQxBUJUAx8/ZHOzGmq6RumyAP1xs62T7mpxkR7x7Eku6rS+NsE0cKnQfo5JBEkD+bSzaLzONb0SNlhcesVelJbsYYAToJb96mJj3hmtOpeYHN324fAPBdhLbD/a4F2IgKGlpRVTlfthf3oti/dcVBVvvh7bQQ0NuvPJeXKUsywzGopO6gogObf2Y+XU8Bfd/wP9GW0X+cBq6HWjeSLzNdCNIy0MqE1cSgHjeueAY0EsYBxj2n6YhCQ7W/Dv0FbEuIKK5byFvwKCaiiWb9U3WvDD9b+eWv85JJyMGQa1KBgAyYvEHZs 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)(366004)(396003)(39860400002)(346002)(376002)(136003)(186006)(451199021)(1800799003)(6666004)(6486002)(6512007)(86362001)(6506007)(26005)(1076003)(107886003)(36756003)(2616005)(83380400001)(38100700002)(5660300002)(41300700001)(8936002)(8676002)(4326008)(6916009)(66476007)(2906002)(66556008)(66946007)(316002)(478600001)(54906003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X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iiLzyon+4juFF9M0IOqCGk8CZKJ/Fh0ziw1Qk8NCvoh7rgaZ9vzoJhaZxuWAbpLJX6dW28T8gXYfGQrTTzaP0BwWHk3S9ZfNx9Q8qUybSmpPwVXDIKp3OqUd1smcRk0sDJ8sYBKSIHR8QeFc6XkcFfmCyzxWNQiA5xVuXUx318mST/TqcYzFUsV6OYhrW+aSlPAr4u7lXqAE6+z0u0hzGIKYw0IYP4Leb/DxtfCeyfDdQo54pPtOX209AfwqN7pQVW5D9sAOXz466DWsuF8FU7AjdmWC7BwVDpet/7MNsPxt/Koxc0Zroor6cRWD3uf+93pYRug+LJJBRh7AQv8dhD0YwSR+4D9J8pyIMEnCV0vCseHhiU4fZcx0vrU20TlgT9iQgXEHC5DpG6YCPbQzdu8lIiRuJQau42xkg8/M4rP5PEmd2MPQwbpDiM0TBZdgDoFVvzyOBL0cdZlutPwUd9QLIXiywLaXxjdRaZKPj9Nvc/0UGF5iLg2eDnhd9IW5GptMohjKizyaJEcISR0zlF30rhcsn7HWhuuclaof5+Lq3HfUSXwvZPTagxnLx237kds= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc592ef8-9cd4-4fdd-8541-08db950c48b3 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2023 17:00:19.8035 (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: WlWdKj4W1aijM1nMtEpg1WrbNxT0sRcU+m3Q9v/Xou/BcYtwW/wYVtUobhg72QAxSuzjRdV+6NBKX7+BpMdsVw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB4939 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-04_17,2023-08-03_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 phishscore=0 bulkscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308040151 X-Proofpoint-GUID: jESdJAkz7tnNYuATUmTO2uzn7cRKzltb X-Proofpoint-ORIG-GUID: jESdJAkz7tnNYuATUmTO2uzn7cRKzltb X-Stat-Signature: 94wh3pj964kf7357a96193ngupwak3he X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 641E780034 X-Rspam-User: X-HE-Tag: 1691168433-263626 X-HE-Meta: U2FsdGVkX182tG9UgfIDLeibsLEtbEU4OHAuX1icbBgtKR3YLYx8fNS52B9GEwK5rqQQffPr1niW0KYCJ4whoYNywbipjT08JYnxIeItw3+WNo1L9QYWYVNRoKOOikHsJo9yFBi/2BSuV2fkF84t81gl7EUherlBBWxr24XYNOk+qWcrKW/tAHnxdiN4Xuel8/p05v3N5bdUqcbANq3Su5YFGB9NbLm8ivNmiIJfxXM546h76rXclidPNvUNBmBlANM56y4WiMLoRsVU09k34blJJsdyjAomzCIYqijAxRbCw8a1uq1DGrAVYF1Uu9s7w14eiijIIA9k8l3YYim3YUo7tkO4NdVfjspGg1KOWDfkRdSuc2ht/9BZkpRRaidwDqyJOB0i7jCl9i7Y114iUXVMfPJM63Gm5kEzPOeEHcPEXavZh2CaOePVH5K8rMRFDBl95X0ikJqWikDYGARRLSbSiVv2W2Xrph/kfvY86sMxNQWZyWe35D9VFU7oi7Nd1sp3ATpnueChUBfMTdST7mqBjwrUvzdXreQmFwghwhSomlcIL328IwikFhmjaQgjnXkTTo59PXBC58XWGEJY3jAj1yxL7tXsrPuHyKX/smgE7FVZoUGxtqk0shuf1ekdwCujx5e2en5WaFC4prdqsSBDpfRPuzR8qAoJXwoMm22yx0R8RVEP92IwTHN+2keG9oNbN2LikUXxZjpOE07QKqzNta/8VftS9JR9o2n+FgkFEj0+wrX+Ckap93yV+cg1t61wJH4S4Z8hFeppeFPp/pc6VnwSr8livpHAeTfQCr4ZMHq1DyTnWvgAv5Z/+tyhSgV0bDmlz/ybVCisrxh+hlPnFvW3F7U8ouG1UFAWkLq0ZNB4USP1SgFXOmUpKu+r9bBAckeyjS/knCn/VI6XWiRbCtLVTM+GgLpvODecikJ5U/JoAAwaMeGcq2TcFW3jjYfPVyfIxpN5Rkub6h+ R0JvvoQY Ufwhw8ZRgG/BybhrNvNglqy4bFy3nZiRcsZuXsWhoDVNKMsF4IA1cBokkzOrRNczfmUYTpjMqku4NDSkpvHiU6v615fJDGE5rItBLg0ndXIfIrArn45wbufCPeXKC49LNFaeRAtFCNuukzXZuBq3TjKHPdvmQGAM3gv6Dzqq2WnpONDQb6C4j/oToTAhrNi8tCXmp/ZIXUOa2xtyQ7FcwSHPZ5kuZ8YGfdFs4qAp7HJ6GR1s+uHIp44LmSR3Z0JYSGT+nw0EETj+XJGiafvJ79KN8InOiorXBbNKTDUMAjzY9ARWiByXQtX343cVHzW4nqYaAol4niDFlIH47UF22nmsMapg3kb3Mm19buZJ/Vy23voXGefbNkzMtRMo+SW7MzuJ1sLaiAEDkAZY5uOJOy9AEPJH7bPSTZ6HU7h2bqs0vIAM= 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: mas_replace() has a single user that takes a flag which is now always true. Replace this function with mas_put_in_tree() to better align with mas_replace_node(). Inline the remaining logic into the only caller; mas_wmb_replace(). Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 73 ++++++++++++++++++------------------------------ 1 file changed, 27 insertions(+), 46 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 0d4573a8d134..c01b1be1480c 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1715,45 +1715,32 @@ static inline void mas_adopt_children(struct ma_state *mas, } /* - * mas_replace() - Replace a maple node in the tree with mas->node. Uses the - * parent encoding to locate the maple node in the tree. - * @mas - the ma_state to use for operations. - * @advanced - boolean to adopt the child nodes and free the old node (false) or - * leave the node (true) and handle the adoption and free elsewhere. + * mas_put_in_tree() - Put a new node in the tree, smp_wmb(), and mark the old + * node as dead. + * @mas - the maple state with the new node + * @old_enode - The old maple encoded node to replace. */ -static inline void mas_replace(struct ma_state *mas, bool advanced) +static inline void mas_put_in_tree(struct ma_state *mas, + struct maple_enode *old_enode) __must_hold(mas->tree->ma_lock) { - struct maple_node *mn = mas_mn(mas); - struct maple_enode *old_enode; - unsigned char offset = 0; - void __rcu **slots = NULL; - - if (ma_is_root(mn)) { - old_enode = mas_root_locked(mas); - } else { - offset = mte_parent_slot(mas->node); - slots = ma_slots(mte_parent(mas->node), - mas_parent_type(mas, mas->node)); - old_enode = mas_slot_locked(mas, slots, offset); - } - - if (!advanced && !mte_is_leaf(mas->node)) - mas_adopt_children(mas, mas->node); + unsigned char offset; + void __rcu **slots; if (mte_is_root(mas->node)) { - mn->parent = ma_parent_ptr( + mas_mn(mas)->parent = ma_parent_ptr( ((unsigned long)mas->tree | MA_ROOT_PARENT)); rcu_assign_pointer(mas->tree->ma_root, mte_mk_root(mas->node)); mas_set_height(mas); } else { + + offset = mte_parent_slot(mas->node); + slots = ma_slots(mte_parent(mas->node), + mas_parent_type(mas, mas->node)); rcu_assign_pointer(slots[offset], mas->node); } - if (!advanced) { - mte_set_node_dead(old_enode); - mas_free(mas, old_enode); - } + mte_set_node_dead(old_enode); } /* @@ -1767,22 +1754,7 @@ static inline void mas_replace_node(struct ma_state *mas, struct maple_enode *old_enode) __must_hold(mas->tree->ma_lock) { - if (mte_is_root(mas->node)) { - mas_mn(mas)->parent = ma_parent_ptr( - ((unsigned long)mas->tree | MA_ROOT_PARENT)); - rcu_assign_pointer(mas->tree->ma_root, mte_mk_root(mas->node)); - mas_set_height(mas); - } else { - unsigned char offset = 0; - void __rcu **slots = NULL; - - offset = mte_parent_slot(mas->node); - slots = ma_slots(mte_parent(mas->node), - mas_parent_type(mas, mas->node)); - rcu_assign_pointer(slots[offset], mas->node); - } - - mte_set_node_dead(old_enode); + mas_put_in_tree(mas, old_enode); mas_free(mas, old_enode); } @@ -2789,11 +2761,20 @@ static inline void mas_wmb_replace(struct ma_state *mas, struct ma_topiary *free, struct ma_topiary *destroy) { - /* All nodes must see old data as dead prior to replacing that data */ - smp_wmb(); /* Needed for RCU */ + struct maple_enode *old_enode; + + if (mte_is_root(mas->node)) { + old_enode = mas_root_locked(mas); + } else { + unsigned char offset = mte_parent_slot(mas->node); + void __rcu **slots = ma_slots(mte_parent(mas->node), + mas_parent_type(mas, mas->node)); + + old_enode = mas_slot_locked(mas, slots, offset); + } /* Insert the new data in the tree */ - mas_replace(mas, true); + mas_put_in_tree(mas, old_enode); if (!mte_is_leaf(mas->node)) mas_descend_adopt(mas); From patchwork Fri Aug 4 16:59:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13342116 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 0B025C001DE for ; Fri, 4 Aug 2023 17:00:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 976716B0072; Fri, 4 Aug 2023 13:00:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 926B26B0074; Fri, 4 Aug 2023 13:00:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7792F6B0075; Fri, 4 Aug 2023 13:00:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 66E6C6B0072 for ; Fri, 4 Aug 2023 13:00:37 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 3206B16154B for ; Fri, 4 Aug 2023 17:00:37 +0000 (UTC) X-FDA: 81087036114.29.0309CEA Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf30.hostedemail.com (Postfix) with ESMTP id 0643380010 for ; Fri, 4 Aug 2023 17:00:32 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="vL/f7lN9"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="fkb/JbfH"; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf30.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691168433; 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=CSBRiN3QDXn+UdttUmnB30Ar+vyLKFI9e7V3W37fdL0=; b=YPhu9dVYRVbqM9Wf2aO2xBG/4JLk1cJPC78MHnh4RY8zMSDoSvsJRmL5k03bRRW2TOtaDV 6EU52Vz7+JUCFlmNCjEseqsKU0jRXQE5/stQwYbL8fNPG0YAg2gAmDzhAAcFm24KlIPC+G EKOcnVDdU23hNEEzLlV7TqS/0I8Nr9s= ARC-Authentication-Results: i=2; imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="vL/f7lN9"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="fkb/JbfH"; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf30.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1691168433; a=rsa-sha256; cv=pass; b=LkOJ46MQzoEQiely7A86ICZa4tUcfvYsB3mUjIajv/wApdq8m7QetnQKCS7W6Xc8hfpm4h 4x+8M0WSZyqe/Sy8SrDLVMYNNUCnKRMfADAzsT9EUuT/BR9UxnrpZBkpcHqHieZ/KiV05M Ao7bRVGQlCc9ODaIMSNmMjXAVadXWEU= Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 374EiPjS019904; Fri, 4 Aug 2023 17:00:27 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=CSBRiN3QDXn+UdttUmnB30Ar+vyLKFI9e7V3W37fdL0=; b=vL/f7lN9E7+9n+zVgvdsuH3Nc6hULuQrWyNPN9219tI5gQFHBFNfaCqlc3WkGVVOlH1q OHWpjLRONSNTpeFcu7P+1ec0WlGQHeF6LzAR3bviB4Y7c70m+PfGLH46j2z2ofbJvGP5 FOZDl4ICM219iijRHQHKjbhGyZtm8f6ueXyineIFUHQFtq7Ea47vLAeVpej+ctWNYjr0 5rsr0dIffxERRCJY/RAzJCx6rWW5UXo1eu9Yt42zMRMHf1qgR4vA9K9JmKvKtmGZjTuY XNiVswn+cZbqRTBzEhXMaEyqY77vohhgYXJOLpqOZmeIvm5p1smXdluyNAqplNPNDOf+ vw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3s4sc2m942-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 04 Aug 2023 17:00:26 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 374Gghws040734; Fri, 4 Aug 2023 17:00:25 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2177.outbound.protection.outlook.com [104.47.73.177]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3s8kpkmhy4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 04 Aug 2023 17:00:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OUptpqReCMyNwnLvcLGqM9CslKvJYSUWsA5F0BaZdk6QEgr1ofPAtFDg5Vg0lF1lCmjV5Kw1ZKnY2cCtuyHIagpUvhBwUv3/evSHkGqGz4MGamjgOciBUH7DgBv9vNhLlJrlIsjJFyI6iN1rJUZRTdzN0lrDauG56vn8e66IZR/lUraiUdgu6OIJdejHUp71yKQvN8bD2dQt2wJ0BBwoyOgxFmQt2PMFjC8s8H6xg7DxoExyvHQuIIxFzwqJBwl5FsO0HUS79kvohvzcQW4L72Rl6Yk/qMOgerCqxEsA1vR0+ClI8uZEm99ZoP55jUSvLcy597uVqz5brMDONYZ0RA== 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=CSBRiN3QDXn+UdttUmnB30Ar+vyLKFI9e7V3W37fdL0=; b=AnruR5XiAgajrB8ECVilyiq8dVqrcyoMu+/Y4HDq/6mUvIP9iTx6jyUc1nAN3H/MiURB2Ba+r3n/4k1Ir1S2R+pxPu+Yw/YmlwnC2qPb2/hzn2etim9OFtaBQ6W25PQ3YOAxX+Xwyz95ZFHGZ7hGBNzPygESbyzmIX9qCvHKVBScDiV3cy8fJge75neE4mrJg+2RoM0xRnee8dx+50rnkSsbEhaJ8GBoZ0UBkskYGx9AZYQ9Q+BYrTk6a1kkFGJUknK9mN1Y7hY9TcM0i1zESjQEGeoAP1Shxg1yhXOwAN4X3T3WLbYm+fs7xPoRIjMdMNupP8hZWbpkidw+kDG4pQ== 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=CSBRiN3QDXn+UdttUmnB30Ar+vyLKFI9e7V3W37fdL0=; b=fkb/JbfH+7ggYfasiZ4JOJlBaUirZCYcq6OcnHCPzrK8cfpgpxaK1S3vkN9fwC9bkjhFu4ynx/xAIoNcDOSe3LEsc1iPbDm1A/Pv50GiwrkrjGlqWqRDHN2JQ973UjdVaEp3dxpixH7qgcMs4Tt3IUxrvFNvSsGrEa7itCs1bNI= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CH0PR10MB4939.namprd10.prod.outlook.com (2603:10b6:610:c0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.21; Fri, 4 Aug 2023 17:00:22 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::26d3:6f41:6415:8c35]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::26d3:6f41:6415:8c35%3]) with mapi id 15.20.6631.046; Fri, 4 Aug 2023 17:00:22 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Paul E . McKenney" , Suren Baghdasaryan , Matthew Wilcox , "Liam R. Howlett" Subject: [PATCH 4/6] maple_tree: Introduce mas_tree_parent() definition Date: Fri, 4 Aug 2023 12:59:49 -0400 Message-Id: <20230804165951.2661157-5-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230804165951.2661157-1-Liam.Howlett@oracle.com> References: <20230804165951.2661157-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0286.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:109::6) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|CH0PR10MB4939:EE_ X-MS-Office365-Filtering-Correlation-Id: 80cf2793-7ba3-4480-2e65-08db950c4a6a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kABZ5l4rOAILR0fqwkZ7OGNhs24/hRUJRyJvRpTZfMAtqwBTRdFO3RmUqM+jhN1shqqB8ccw/PHv2z3wnZYkQszTTHEGBNzOvibVMiob1iQzg5U6rVvE0X+QHn8IJ6GAJWBOEbt70/Q81w4FVU5ecY5ao9JRLkcvkiVMQht0u+frtCIJDtO8dNIdE/F8YXEcX+3Ch6aZqWhWjP1S0V+5ZmJBUPYAI3xbdT3DK5Ysi7dDXR7W5MSONnx1DR4nVg6OobUNDhj3u0EuhSUpnrvCO1ijDa2LHFAtMgdc8geOw1dkDFLde4QkyfxSVC7SRRSrRL/zILeNXBhbd4gjr1yacLJUCPztkqINrnkOOGrqJU+hiUvO/kSu342+1g2c4zlosHbwXqQDIIpgi/yY0KrESv+KuzCFXwIuVRyhB53gma1wz2y5fieN3E50AkfjMM9nEG04D+fxAV17Lr5zuoVp7UviPbVQMmmzjLLcjkJIO5Nv5wGYa2qqikFo5guEeR0CM0z6zw0YZGlFP9LknnBgu+OCpnA8U6tk0Al9a+oSseRNQoFPSR1wFFnz369MQlw6 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)(366004)(396003)(39860400002)(346002)(376002)(136003)(186006)(451199021)(1800799003)(6666004)(6486002)(6512007)(86362001)(6506007)(26005)(1076003)(107886003)(36756003)(2616005)(83380400001)(38100700002)(5660300002)(41300700001)(8936002)(8676002)(4326008)(6916009)(66476007)(2906002)(66556008)(66946007)(316002)(478600001)(54906003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pKpNAdwRhUUrAvdRLMeaQtL+1d7Yxs3ttZs1YrIsKP4Ed6HncUAu3izdlRUvvmrUJaXEbQqnrZaPQIDHUemAYHYfBF+QhXCxtYw8ddcLIDmuhLcWvP2Ak75Vdo6nDQIE2Qbd7bDxaKTj0OmgPkxdv/I1KBVWv8G8eDp/Y9IHpuAHT72YIZerKelxnd15VIBFpdD9DErblwQ4ubG2QDZIaAD45ih6q1AhJpSxzE+lbt7mmF+k3Rbj9qQXcxEOG347NPXdJQWC8A8+7mvYi3fsQ3itYOeCmiic6S4/A/+7+R0ZlEQVq2K3WG1juG/+vKavtPWZWSwWSAl1XOTCEoX+Eo4ecnMl0tnOBwwDOh6+Ev90wSxex1IRN8vT9H9XyAKSJtga4ZnJ1vcbtZk6GNdKBYWKcj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wr+szlL1v9vRtNzDlaU9ieNywBOAy4P11zJBlciHx+mcrUaR5qZt1b0Y46hC83nEjteHGig9SPxCK9GyZjoSu7NYifvPig5ZuhcyFGQmC6sQ2RRX3X5CdAjQqNUukDDFDgmY2rpA== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ckoAJr2ULvhjkE4Jd261i8V7kjLEeVp+2V32gx9spiO9E2rpQujf90DITUcjN7fUMApJPpZFFEbK4NNqGOOCDXCk46P5CJSasEkrWht1Z4fCIUJlh4hpIht0tTV21rwYUiE8isfY8rqCINslRhiori2X3oYjFA2zklko/oQEEcEBARici6s6tADCuLdnqZn1Cx6fKChKjvDXCs434PzveBLTxt69gaqgVGZxcd5Uxzk5ZcJzM/kuRXFhfbdJ5b9XGFZzkpItzWixvDlLbhia8vROBFbJzC4vweEWlgUDrdEYsx0XNIxiesTXQywhwqvq1uIjb2heuyglV9IjCSqKYMvMMoQRroRzx1htr4minwzrOxGEEpQzgqS7iUIt/3TT44OCvRzLti5ibXweHZThcy+L4yHBlPEhPQ3AjTAYg1WoGPM/Mm/qO7t1weBPmfy11V9mPvfxQWf67xxUb64d76gOvG1Pmj3RwQZvnhrT5mFoMr+BsQSGSNmpd3EWkt8ovPj3RnxG3eOreq4rSHDd5qUYjAJzQcGdFn5dhQqE23QOKqabmt50ozlI/5laARMGNl6mjt2zEJ3eAkAits3udl9wRe2RoVLN7XhXTCZlsLIUIPhGFy6VhxhEM/VTSBv9Ei4ZQIK3xtCl7q+AZ6VNyQKCXq16kN1flbgeRiUeaOd1ECjUGm7ZDnG5Pznc34jizflHrtLA2EPi7jZUqdmCQr9bfr+s5tVZbxzkNqv0jEQnEBA5Bh8KVVCL/QtXO2Uts6xd/ew6zY0sQwjk6P21ukMBeixk044t3unTN8GsthvFmi/iJ/FP8VKcZZhjYyThIxdIK4Xasz+/lrJ4aEhtrkrbOedM9x/M9txTCKq3m/F2RDB2NTEYdaAhm/dYvPjHxFFEqAHRib+QlbvTkwoBdMzlGafPZAuB+6bZq9WPVvTq7X+1XDxL6EkundSFBE0ycX+49j4JMFWZJAZNcIDRvm8hc+HNeG+eKCnnDLNew5s= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80cf2793-7ba3-4480-2e65-08db950c4a6a X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2023 17:00:22.5366 (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: fS5pV1J8KCqHxjkdlzikOOeI9QLIsGsy+g7qCNkgRDzceDGemusCnFA5mfu8rmUkJ/jwdq0CXGzFuAlJ/opK2A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB4939 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-04_17,2023-08-03_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 bulkscore=0 adultscore=0 phishscore=0 mlxscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308040151 X-Proofpoint-ORIG-GUID: SYYsx-cerzgYfAgzjKl_eg0581WQsUrB X-Proofpoint-GUID: SYYsx-cerzgYfAgzjKl_eg0581WQsUrB X-Rspam-User: X-Stat-Signature: i1ubi4otxwg54s688kjrd9eofnqunihd X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 0643380010 X-HE-Tag: 1691168432-301935 X-HE-Meta: U2FsdGVkX1/oICp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Vfz8yzBJ7+0o+63FriS9Fz5GWmJMOYOdAR0m1tP0fXHk9uK5EvJWo3kz604/dsM2b+lZ5BXCaoagJqORrl8F4D7l+BPGsBzTFpUoCKIeCwtAklbYIqMCAJEE5M8RCM5lCoqvnSA9FXaU/8w1fY8wjj0rx43rf4DAWCAdStNIKl/gQ7t7Uubz+VWT07Ou6GjJN+MbwydAo7PLW1qxkVX+46E66F/Hcwgwvo5RHT5n6oLLILVHdogkPVobj/Lp9lz07DjzKWQitRYNM7CjXO9Zi+Oq6kZhFL9um6zJgPI+uUxEXUvkV8sJ+Z42oWaXkpkCwBEOT7q43hQHHyxt/tMc= 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: Add a definition to shorten long code lines and clarify what the code is doing. Use the new definition to get the maple tree parent pointer from the maple state where possible. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index c01b1be1480c..cf41e0dbb87b 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -75,6 +75,7 @@ #define MA_STATE_PREALLOC 4 #define ma_parent_ptr(x) ((struct maple_pnode *)(x)) +#define mas_tree_parent(x) ((unsigned long)(x->tree) | MA_ROOT_PARENT) #define ma_mnode_ptr(x) ((struct maple_node *)(x)) #define ma_enode_ptr(x) ((struct maple_enode *)(x)) static struct kmem_cache *maple_node_cache; @@ -1728,8 +1729,7 @@ static inline void mas_put_in_tree(struct ma_state *mas, void __rcu **slots; if (mte_is_root(mas->node)) { - mas_mn(mas)->parent = ma_parent_ptr( - ((unsigned long)mas->tree | MA_ROOT_PARENT)); + mas_mn(mas)->parent = ma_parent_ptr(mas_tree_parent(mas)); rcu_assign_pointer(mas->tree->ma_root, mte_mk_root(mas->node)); mas_set_height(mas); } else { @@ -2798,8 +2798,7 @@ static inline void mas_wmb_replace(struct ma_state *mas, static inline void mast_new_root(struct maple_subtree_state *mast, struct ma_state *mas) { - mas_mn(mast->l)->parent = - ma_parent_ptr(((unsigned long)mas->tree | MA_ROOT_PARENT)); + mas_mn(mast->l)->parent = ma_parent_ptr(mas_tree_parent(mas)); if (!mte_dead_node(mast->orig_l->node) && !mte_is_root(mast->orig_l->node)) { do { @@ -3661,8 +3660,7 @@ static inline int mas_root_expand(struct ma_state *mas, void *entry) node = mas_pop_node(mas); pivots = ma_pivots(node, type); slots = ma_slots(node, type); - node->parent = ma_parent_ptr( - ((unsigned long)mas->tree | MA_ROOT_PARENT)); + node->parent = ma_parent_ptr(mas_tree_parent(mas)); mas->node = mt_mk_node(node, type); if (mas->index) { @@ -3938,8 +3936,7 @@ static inline int mas_new_root(struct ma_state *mas, void *entry) node = mas_pop_node(mas); pivots = ma_pivots(node, type); slots = ma_slots(node, type); - node->parent = ma_parent_ptr( - ((unsigned long)mas->tree | MA_ROOT_PARENT)); + node->parent = ma_parent_ptr(mas_tree_parent(mas)); mas->node = mt_mk_node(node, type); rcu_assign_pointer(slots[0], entry); pivots[0] = mas->last; From patchwork Fri Aug 4 16:59:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13342119 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 8DFFFC41513 for ; Fri, 4 Aug 2023 17:00:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 161B06B0078; Fri, 4 Aug 2023 13:00:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 111968D0001; Fri, 4 Aug 2023 13:00:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA5EB6B007D; Fri, 4 Aug 2023 13:00:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id DAA596B0078 for ; Fri, 4 Aug 2023 13:00:46 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id AEA62B330D for ; Fri, 4 Aug 2023 17:00:46 +0000 (UTC) X-FDA: 81087036492.16.EF11E0C Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf27.hostedemail.com (Postfix) with ESMTP id 45EAE4003F for ; Fri, 4 Aug 2023 17:00:38 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=xn6DBMaf; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=XdI4kVBT; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf27.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; 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=1691168439; 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=+FX2dSTi4gdLWV9WMkxLANUNbJ9NL7dPJboXF2A/Zbo=; b=3D7o9pEGqMz7EM235ufS+N+ZavRq/qU09auHAl1vxmMcIlfKWN0TLKxnqZlNe+qNHGTSXj 5H79+hLLc59QONk4h80XXfKRy2MNwkt+kvZDUEb9D2zGr7A05vczsY9Jx+N0lt8gKjuc8C nqToWPKUDCkUc59R7PaoHznlpMlF0oY= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1691168439; a=rsa-sha256; cv=pass; b=EvwLs5us4CtJZvbtsLymFNypP/8RhWKAN9zTjl7qJXWwr8dGh7Yizl54hziqz9CHHiflAC cclvJw/CJxTQ4vNjc/KQmxgSmnp+HRmmKwinjc4eASwQsBbKVSdzyeZNBQnboEIjUamSgI QB8EtOgT51QetVaPCeO6+X6JmaBzVv4= ARC-Authentication-Results: i=2; imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=xn6DBMaf; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=XdI4kVBT; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf27.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 374Ei3U8031787; Fri, 4 Aug 2023 17:00:32 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=+FX2dSTi4gdLWV9WMkxLANUNbJ9NL7dPJboXF2A/Zbo=; b=xn6DBMafeB1x+lfRrzT7+/6MT0H2fl1f27DhyInof7u9t8E0krZZTurCAFrJrDM/eWfO uPtm3FY3j42agfF5gptNChFCnkZyulZZ6QCxbTx5N2h/MgiikvEcmtwkkyUvDbwKCWT4 TCY/nRjUSV3Xa1SBn26HsacmZ1bwiNsuDZ4LiLL3lEiS9+ymHuRATW77qhoSoU1LV/aF Lh06klQo4Hc8exh5ISwEkYHN6davLuY03Tn1bghlXwx13SzRRdxo18Bs3/CBEEpDkRbb xVdnuJU5Hp2rUZyRXyABoe4MMo159zFbLTszMOne7TmLkLQ7eFge/nZkYCZkD4YUyKy/ eA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3s79vbx9et-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 04 Aug 2023 17:00:32 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 374FJgoX029618; Fri, 4 Aug 2023 17:00:31 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2101.outbound.protection.outlook.com [104.47.70.101]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3s8m29bngp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 04 Aug 2023 17:00:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iV11Fx5Mx3I7s5MhB0JJZrs3TM8iRA2sq/BabKICYxx0pq8LeszxoPuVOk9JtLr+n9MciKy+pKVun9XCaKhRU1bzvwQzdvl14bdOLM1Zfw11/1X3Ob+rORTZ9UntULXEMa3PMssYAuVmeoSCnuO5Vg3/ie7Xlf2VGM+8cLPSnAfdk0JbQ4JP+DJ2yTvTuQSsrViUCBO11dqDVsSbTgF7KbG03eanWERUwgV2WyDi6QCYVyD1NtNUM2vV0aMw6xw5BoDx+y212jvjGHODhDFJEGcBkt4r7T0VKxHgDkBH9B335ffMpR8IM58l4a0L6s4kkKKdKS37PsemXdshaXqpaw== 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=+FX2dSTi4gdLWV9WMkxLANUNbJ9NL7dPJboXF2A/Zbo=; b=aldS8nkp/efxtZ5Und2PzaNbRnHGJ4MiuY7wPN7TMxzYD5C8f/+SWohCCL7Plh+BOxagZAT12KCal9GlA3IUPx59k9I2qRWTERs2rOQ1OWBuVMXlO9jqyPyrFB0nab4zepH5eYLgIaIGV2TOzgrbRjy8QYQkYpWZ3BMvm+UnSi9B0pKNFJyyWIKsrFj5Hx47IsZFnLAbuOBMaerDTKOOEl06i/3Pw8W88pSdRUJu71hxld8LozdoByMumeCi06zPC87dGCG1osyjVRbUAyRe4b3pBoeAa9xJ0s+c1OL/lazFdS8gbLcQdJ4AITCnEjTwT2ycEZHlW9R8fu1vcFVMRg== 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=+FX2dSTi4gdLWV9WMkxLANUNbJ9NL7dPJboXF2A/Zbo=; b=XdI4kVBTxIkvEc1SWjy3RNJ1RETCKfL0WB2JkP8RiGyqFzBO6PZ2i6s92REY+Nu7XGOsCUUA0ZHSSq1piJeBjxF1oRtwls9PpI7+jCYE78vJDWcSr3zAJbYY2/Xr3LK9L6JwNli26DD/S22AvoNPNCCXh8ww/9vx60MFD0zCz/s= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CH0PR10MB4939.namprd10.prod.outlook.com (2603:10b6:610:c0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.21; Fri, 4 Aug 2023 17:00:28 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::26d3:6f41:6415:8c35]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::26d3:6f41:6415:8c35%3]) with mapi id 15.20.6631.046; Fri, 4 Aug 2023 17:00:28 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Paul E . McKenney" , Suren Baghdasaryan , Matthew Wilcox , "Liam R. Howlett" Subject: [PATCH 5/6] maple_tree: Change mas_adopt_children() parent usage Date: Fri, 4 Aug 2023 12:59:50 -0400 Message-Id: <20230804165951.2661157-6-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230804165951.2661157-1-Liam.Howlett@oracle.com> References: <20230804165951.2661157-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0414.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10b::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_|CH0PR10MB4939:EE_ X-MS-Office365-Filtering-Correlation-Id: 6127e6f2-a361-449d-471f-08db950c4dbd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kdbRdliBhZuprvvy/Bg/p+D/lK2ECMsIgcXW5EghNkhprQFJoPwMdaXDKw8d+dVSBr7Gsq0lJFmf+fHuFp9AC9PUavamTZrseDuRKlgdZVnXhUyNODTFiNtLJL9DdegchhmwhWXXddtDzrP1wwHy+0ESlJ8QMIohH1e13WtXU2/7529/rUQRanXs++BaiYY/1quLqaSjC9Fjzfdxn0xH8NmQdY0WUaQMC/cpzvBAHT76mmRGwR6/uDMCzAaTGDwl20dSX8JvlHmFn3Jfohiv1ftiRocb7hlFiiLvKjjMvLD5r8Rlpfj+T4Ae28y/El+JuFjtPsMxMt3GHZWxshsHx8jevRmvS8vStC9yO45Fpe4XSpXjywd6NMWETsFF3fMFCf3tcr0Cyci8uLR+hfId13vN6dWcuWx0GY0k9Vfz+rSluwslsO6lsRuhrL1npwPxH1JtCDk/dF3vF8OljrjNTLxDgkPhIY0WI+nctMJfsZo2Yv9kqDK+vfWLKVBqjIjM6F98d0QGN53SwhJNRbIeP5zglN0DJ0Y1JgGdtNIanZDWQ/jTrGffiMNFaj/2c7i4 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)(366004)(396003)(39860400002)(346002)(376002)(136003)(186006)(451199021)(1800799003)(6666004)(6486002)(6512007)(86362001)(6506007)(26005)(1076003)(107886003)(36756003)(2616005)(83380400001)(38100700002)(5660300002)(41300700001)(8936002)(8676002)(4326008)(6916009)(66476007)(2906002)(66556008)(66946007)(4744005)(316002)(478600001)(54906003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PLIrrkQQqcwypLoGVzPMoQDqCLXIncDCchem/Her+9352AQ1miIPhxn8ezpL33QOLN6pqOAdRVuS/rZOrnvn2CZZBPIQ37ElhCgbbMSSotp1aTZVthLAYROHm9MYUXmTi/v6RKPUeM29EdZmD/S9lNwBs1Js4Ayksuy/s1EwPaGe0DbuXXQ4v57Oa+bopTduuRLtctcCqfmngGqohOXHM3PCu4CQ4TOJllK9csTkn7xC9eEkFL0hIKJDEad24JlNInQUqd1+Ni+4G6+Aez7m5pbY/bXy4TGuJ/Uzzyv4oLSrhGv8BmD2dyyt2pmtrOSRch7Istdsk5TJiDn96wwS8e0zMRTLHIM4q5Mnzf5gxEVUMGCn+XlfMjCZM6xfh0YYVrOBnQf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JEVBwAeWFUWXMjhjwa1Zw5SU5K6EN22eE4RbhbSGsOhMF3Yy523OjgiZTeGfkTpUjH/ayeINhlVOmdDf8R+hlULPTgHZtTI043lh0Hv5/9T65wz/T/rcSJ3CLjQeWzop7TN4E7Uk1ZUVzd5fE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6127e6f2-a361-449d-471f-08db950c4dbd X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2023 17:00:28.5940 (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: 3LWLMoZ0eeUWD5WnsyOgJ/QYUBMFaZ2XUzE/oN8ZuJE5HoDmr7Q2u06AUglyw9/dOXaqahkcPM/8JYrdkAMhXg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB4939 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-04_17,2023-08-03_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 phishscore=0 bulkscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308040151 X-Proofpoint-GUID: xS_U-pDC2ZxjaOzu5KYktNiTOmdHJga7 X-Proofpoint-ORIG-GUID: xS_U-pDC2ZxjaOzu5KYktNiTOmdHJga7 X-Stat-Signature: 93gxhti9do6enkj7his4rxah5uy5prjc X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 45EAE4003F X-Rspam-User: X-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r+ZHsQDffo+6ZWiRaHLw+iow9/ihJEnv0BucXvTYlHWCDTzkiGGkEWJqX4LyNSpNXm0N+/fE4q08KGKxmo4gYYH7klS7VOEvQl7gf9UM7mipmqjD+RiYgRNAeoUyHUTi7/HdMcbxG3A1QZmIZqBJt2gTj7Be5DEE6tgsX58qCdpESMKKUuUpEttLvTkKNF2KFsHz0eCEnrgXseFA82aZl652vj1/5gVyRuLMNja/6UoZL/qj3XB8ehnPkmd3yn288V2GOHPRVVe+EIVTuKadI6BXQ/ra9mFiqmNfzNuja59WDEK6isVT+OnPxnsen0g4NIf8ST13caVi5C12pUBb9ZhGC+oy3uZQQNiBdSyvXRzaZ9I= 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: All calls to mas_adopt_children() currently pass the parent as the node in the maple state. Allow for the parent pointer that is passed in to be used instead. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index cf41e0dbb87b..8e94f5495a97 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1702,7 +1702,7 @@ static inline void mas_adopt_children(struct ma_state *mas, struct maple_enode *parent) { enum maple_type type = mte_node_type(parent); - struct maple_node *node = mas_mn(mas); + struct maple_node *node = mte_to_node(parent); void __rcu **slots = ma_slots(node, type); unsigned long *pivots = ma_pivots(node, type); struct maple_enode *child; From patchwork Fri Aug 4 16:59:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13342121 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 EDC37C04A6A for ; Fri, 4 Aug 2023 17:00:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 865DC6B007D; Fri, 4 Aug 2023 13:00:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7EF836B007E; Fri, 4 Aug 2023 13:00:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5A4E36B0080; Fri, 4 Aug 2023 13:00:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 436EA6B007D for ; Fri, 4 Aug 2023 13:00:55 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 89FFD415A1 for ; Fri, 4 Aug 2023 17:00:53 +0000 (UTC) X-FDA: 81087036786.24.8CF0C5C Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf11.hostedemail.com (Postfix) with ESMTP id C098640063 for ; Fri, 4 Aug 2023 17:00:45 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="siBp/O0f"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=z6ILSysO; spf=pass (imf11.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.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=1691168447; 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=m65lrO2qFmAh9M4Ry8wuMUS7xfZox23yZiJJhAn8EW0=; b=NNVOhO7RHIj+NHmEbwy1je5sUCLIOuuPjXM20KLLp4EaJuiuwXKaijELJ5Qh0a57hytHOW Z2SFuPpL/0IuCNqlObmx9SgwZFJZ1DeJ0nZtcTrMNexMkhRPEpyIbuAs/EgH+9+HtNnbnL BN8Sjw11/SGm/aItUFW9aZR0KeBel5Y= ARC-Authentication-Results: i=2; imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="siBp/O0f"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=z6ILSysO; spf=pass (imf11.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.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=1691168447; a=rsa-sha256; cv=pass; b=ibG8NNEM8iV/8+cVZnUggGJM7F8cZvWCPGK4fMkMHB0fHEeRWL+fMBf5Qicl84efKsXe9O Y5VU1DYdBVGa3dfm1ksVsXPdAIy0m3pccdzuDGSpR2PDC0R9++bIDnmc0yLLschMcK21ic XOGhxJOq3hPNGd1hW5PfW317bNSwX/w= Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 374EiDn7002929; Fri, 4 Aug 2023 17:00:37 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=m65lrO2qFmAh9M4Ry8wuMUS7xfZox23yZiJJhAn8EW0=; b=siBp/O0fpVZ2ngoPKQvky8N6TfJNdNd0d0bNRxBMTMpcqha367GYghbNyg62RooCDG+k y1WN2uYBCm1gqmRZ1R/MGpSD0Ddei0tGySv9EjM98KJOsB/LaZ59O7b6AbUT60KYc6Vq eu2TsbclXyh+RclgYSPckfG2WBpyZbpPfQ0MDKwqtq9/orJX1CP3fpRVqwQ+9zf84NGc w/TX4D139fFYTxUX5RzeTvmRPBm1JQ5G9Bgjku7eumHcBKHjz0eeCt37WX0GPMv9ncEz UfgQxqNGcXJ6eJTTpc5LBQqPXZh16Dm9+zt1PVbQndJqWH/FiKnSfn5DR8DpeeMR6tHe OQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3s4spcc9w7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 04 Aug 2023 17:00:36 +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 374FOjaY011606; Fri, 4 Aug 2023 17:00:36 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2107.outbound.protection.outlook.com [104.47.70.107]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3s8m2s3hxt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 04 Aug 2023 17:00:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gOxgs4DzR+mhVvgUcO4Z+11Xh6M4rSo7H2+u+aEvxnqRqNvbHxAiwnLEB1/euAXvRG0T1dSB0KePgSoxRGh6Kry88ZmNu95cM7zFbxfsprEIvG7H0NP1IoEhM4nwqVch3mvCu8Okexi5KaaKeMHjMrP/NjZT8ZHg7X/H7llP9O6D5RQxEYK+aPlkucQdioDWPqqC2TEtz+uIIct8qbciRABo/dstwj6W6gQWoYQuixF/hqLJK71mV6Mw2Qiozk1ySs5Sej63YFrLZXl3npIy0SJnuHC50XyZn2y36pIVNfldYSPToEVmx/tTGqNANIXK9fbPvLmGSmFtO4cEI+JzCg== 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=m65lrO2qFmAh9M4Ry8wuMUS7xfZox23yZiJJhAn8EW0=; b=YsSuwzH9Qo4oIUwOHj5DguCzJdZXe8K/PfoIeQGa2XivRpaTWqbfHtfI4IFIGvATtBlHdQLVq2sEN2dyG+Am4HjY5D9g9dr1fJBRegcM5sIJ/fzXp0ef61FumuWPAu8lL8ZBYwlKnr9FwqU5OzIfpYMGAF0cxiuMIDNr8eUlfnmddXgSNXzdhLpzbmRV+ABqBxsisO23X89DvC3A8jhntpN2pf/8rE3kX1Nr8TTLDpbiTPl5Qb5PJWUsZrV2tXfXPCOl9oak4oppw2okh8Fe3iLIv40pvZq58pq2Mw/4mmHzyH0T/q/tf+ytJdSBUqmReAQBzupDBGSUHktJ2OvFfA== 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=m65lrO2qFmAh9M4Ry8wuMUS7xfZox23yZiJJhAn8EW0=; b=z6ILSysOieTbcmXsux5cQ+XPQyTNy8ux7XmrL5p+gIXz40gItzlezt0zNk7mjLigx1nWUyem08tCxb7GfP9VIeQ05cCL4I59bzbWgKQjJLo2sXcdSF150j9IBJQ+qXGcDQQeOPrFFidn/hR4e/tnlnkLt9dfeindWM1B0VYF7EM= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CH0PR10MB4939.namprd10.prod.outlook.com (2603:10b6:610:c0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.21; Fri, 4 Aug 2023 17:00:32 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::26d3:6f41:6415:8c35]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::26d3:6f41:6415:8c35%3]) with mapi id 15.20.6631.046; Fri, 4 Aug 2023 17:00:32 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Paul E . McKenney" , Suren Baghdasaryan , Matthew Wilcox , "Liam R. Howlett" Subject: [PATCH 6/6] maple_tree: Replace data before marking dead in split and spanning store Date: Fri, 4 Aug 2023 12:59:51 -0400 Message-Id: <20230804165951.2661157-7-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230804165951.2661157-1-Liam.Howlett@oracle.com> References: <20230804165951.2661157-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0166.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:ac::27) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|CH0PR10MB4939:EE_ X-MS-Office365-Filtering-Correlation-Id: ff35facf-918c-4829-5544-08db950c5081 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A/xJAayClsC2SomTNEBlCZ6rh/mmvUD8BsxpAqzrQhJ1ajxd7um82zAQuLr99R03k8xIlEnrylyG3piJZ916BF2EYYqRl0EADqHH0LPBmwpC67ilp1tOhA/OJug+9+BjY/xYGxnBzw9HadbglAHkerx3HoWLSA24eudeHkfzJzwnpnRql6wIftAgO2jK9bzIP/HMUxu0wDjoWBTzZIu3KJfw6FfDJCC55Args7ClHR7PkaxW2mnLZH8tPt1WIs1WKLQxO0e7Vvgdxlk8vLodebMn+RnxcnEvlrZ8aXpTU6lpicbXObbEmRYCUb+j5Ofx9NiHpT/iC5hcWxFBLVHOZ5m/o6F+CVR+7vSc1kvcFG1fEtLpCiIvwEOp7kxczzL6uO/6CBxHRv4zkuBxEY9M2oCAbDez/HVmJSCeY7jG0udwXjAN63/yUNWufMR/Q41S08ky344ULTexKflffNGIskqqgIfXXDm8fnp21wfdyWAptWFZE0Oh75pcoz3JODdnY58akyDN83qwBmQiWM8hH2XBfOrxcBoKXdq7f00E3M584SPWVeEEdYJ/MVJIgd4F 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)(366004)(396003)(39860400002)(346002)(376002)(136003)(186006)(451199021)(1800799003)(6666004)(6486002)(6512007)(86362001)(6506007)(26005)(1076003)(107886003)(36756003)(2616005)(83380400001)(38100700002)(5660300002)(41300700001)(8936002)(8676002)(4326008)(6916009)(66476007)(2906002)(66556008)(66946007)(316002)(30864003)(478600001)(54906003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: drUee/OZjF9XdWStFvLeBlAphd/ZnNA5NcJrrcPSSDsMsRNAkjtZgcoIpJQNV0CwNHWm37PrzZLYqrlNnZ4sWuhdmhPg3RAx4hhaE4p/oSgRkix60e4xSrCmFibbsSuJQc/xcOIq95dL9c+OcwqL5cXUU8zEAxTmErNZpwefIUucpKMdKcKA5HDpNZuVf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YBV/250XHXctXjKqbxiwYrBgwWJAiOEOEA6sIcHY4UTdwlD5DZUNJcC1jT3ohLxNyBZ94syNy7gHMalpdyNiNKwAy10OGzWGZ9cXtyPL1kNawcT8bujAIJOtUaMAtsW3TexLoWS3iRmANKQkK5ceF/xYXxIKYaauy+8UmvivMqKz6rQ5BqXy5QUg3lHRW7GGv0xoydKnhtG/n7TwE2kBWvzirxB0F1uTtVKaQa46xgTB1FSOHChlaMnrCPjowB2qxyS2FeOHi30oVjO00jgybs3ciVIdSl89UsqlsIOMoQA2Ge/4RNfmxHtfVJCBsElcUcWJmhal0XAS5GO536xLHwaeWzFHnb5KkH0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff35facf-918c-4829-5544-08db950c5081 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2023 17:00:32.8119 (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: HmoyJepjIlIaW4bXerUYLblY1dN9U4QGscerk4AGClSNE/hXudPAH7yRRXd1yMGekDXyL619z4QiPDSU6Dubzw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB4939 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-04_16,2023-08-03_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 phishscore=0 mlxscore=0 spamscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308040151 X-Proof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g5045NRpLw76tFlgm91prytmMIb1MdHbumhgqqHnRBzVLGE2Lyc6URGhFRE0BODlaIULrrCDjYm+aIHFZTg1g71ii4dAY+axyMkHvOeqZOlSR98+nWj9 o7PBLrzi 9ycO+FHj3eYoItnCIDCEMzp3NU/JrIq2quUcvPMakYlIyK/ZAr1rZIsGKoN/4XCFkL8ouM6G1+i2bQW2jYqMWY3cnzBNpsAjoyjKktghObQcxo5zUyzoGexxyFpnkzevq1h56fZiuq83qKiLzmC+jjDixGhB9LdfnmWD5/baTIAxmSeAK58sb1uv1AB0LF7zEnhXMYtk5XDjJ/eh7hKwpTLTm1OTh4qC/h+4Acjjd8PU14BdeqcRa2792fVkcr/91oxxklGPQINxvZTGD8ciSWTQuaxh5Q2gdFBgQTHLdi8mrmPSRHIGMEx8CGU350Cx/PBshCg8etT3xWVX15X0NDXTU7NPM4DmHRFg9pdCK9oBFeDBVls4auF30ruZUnlor+W/vtdsovG0GevP2Xm2awHWg+pGW56vhW+zFg1HqVN3dDmU= 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: Reorder the operations for split and spanning stores so that new data is placed in the tree prior to marking the old data as dead. This will limit re-walks on dead data to just once instead of a retry loop. The order of operations is as follows: Create the new data, put the new data in place, mark the top node of the old data as dead. Then repair parent links in the reused nodes through all levels of the tree, following the new nodes downwards. Finally walk the top dead node looking for nodes that are no longer used, or subtrees that should be destroyed (marked dead throughout then freed), follow the partially used nodes downwards to discover other dead nodes and subtrees. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 493 ++++++++++++++++------------------------------- 1 file changed, 168 insertions(+), 325 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 8e94f5495a97..ffb9d15bd815 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -982,27 +982,9 @@ static inline void mat_add(struct ma_topiary *mat, mat->tail = dead_enode; } -static void mte_destroy_walk(struct maple_enode *, struct maple_tree *); -static inline void mas_free(struct ma_state *mas, struct maple_enode *used); - -/* - * mas_mat_free() - Free all nodes in a dead list. - * @mas - the maple state - * @mat - the ma_topiary linked list of dead nodes to free. - * - * Free walk a dead list. - */ -static void mas_mat_free(struct ma_state *mas, struct ma_topiary *mat) -{ - struct maple_enode *next; - - while (mat->head) { - next = mte_to_mat(mat->head)->next; - mas_free(mas, mat->head); - mat->head = next; - } -} - +static void mt_free_walk(struct rcu_head *head); +static void mt_destroy_walk(struct maple_enode *enode, struct maple_tree *mt, + bool free); /* * mas_mat_destroy() - Free all nodes and subtrees in a dead list. * @mas - the maple state @@ -1013,10 +995,15 @@ static void mas_mat_free(struct ma_state *mas, struct ma_topiary *mat) static void mas_mat_destroy(struct ma_state *mas, struct ma_topiary *mat) { struct maple_enode *next; + struct maple_node *node; + bool in_rcu = mt_in_rcu(mas->tree); while (mat->head) { next = mte_to_mat(mat->head)->next; - mte_destroy_walk(mat->head, mat->mtree); + node = mte_to_node(mat->head); + mt_destroy_walk(mat->head, mas->tree, !in_rcu); + if (in_rcu) + call_rcu(&node->rcu, mt_free_walk); mat->head = next; } } @@ -1759,11 +1746,11 @@ static inline void mas_replace_node(struct ma_state *mas, } /* - * mas_new_child() - Find the new child of a node. - * @mas: the maple state + * mas_find_child() - Find a child who has the parent @mas->node. + * @mas: the maple state with the parent. * @child: the maple state to store the child. */ -static inline bool mas_new_child(struct ma_state *mas, struct ma_state *child) +static inline bool mas_find_child(struct ma_state *mas, struct ma_state *child) __must_hold(mas->tree->ma_lock) { enum maple_type mt; @@ -2065,56 +2052,6 @@ static inline void mab_mas_cp(struct maple_big_node *b_node, } } -/* - * mas_descend_adopt() - Descend through a sub-tree and adopt children. - * @mas: the maple state with the maple encoded node of the sub-tree. - * - * Descend through a sub-tree and adopt children who do not have the correct - * parents set. Follow the parents which have the correct parents as they are - * the new entries which need to be followed to find other incorrectly set - * parents. - */ -static inline void mas_descend_adopt(struct ma_state *mas) -{ - struct ma_state list[3], next[3]; - int i, n; - - /* - * At each level there may be up to 3 correct parent pointers which indicates - * the new nodes which need to be walked to find any new nodes at a lower level. - */ - - for (i = 0; i < 3; i++) { - list[i] = *mas; - list[i].offset = 0; - next[i].offset = 0; - } - next[0] = *mas; - - while (!mte_is_leaf(list[0].node)) { - n = 0; - for (i = 0; i < 3; i++) { - if (mas_is_none(&list[i])) - continue; - - if (i && list[i-1].node == list[i].node) - continue; - - while ((n < 3) && (mas_new_child(&list[i], &next[n]))) - n++; - - mas_adopt_children(&list[i], list[i].node); - } - - while (n < 3) - next[n++].node = MAS_NONE; - - /* descend by setting the list to the children */ - for (i = 0; i < 3; i++) - list[i] = next[i]; - } -} - /* * mas_bulk_rebalance() - Rebalance the end of a tree after a bulk insert. * @mas: The maple state @@ -2304,98 +2241,6 @@ static inline void mas_wr_node_walk(struct ma_wr_state *wr_mas) wr_mas->offset_end = mas->offset = offset; } -/* - * mas_topiary_range() - Add a range of slots to the topiary. - * @mas: The maple state - * @destroy: The topiary to add the slots (usually destroy) - * @start: The starting slot inclusively - * @end: The end slot inclusively - */ -static inline void mas_topiary_range(struct ma_state *mas, - struct ma_topiary *destroy, unsigned char start, unsigned char end) -{ - void __rcu **slots; - unsigned char offset; - - MAS_BUG_ON(mas, mte_is_leaf(mas->node)); - - slots = ma_slots(mas_mn(mas), mte_node_type(mas->node)); - for (offset = start; offset <= end; offset++) { - struct maple_enode *enode = mas_slot_locked(mas, slots, offset); - - if (mte_dead_node(enode)) - continue; - - mat_add(destroy, enode); - } -} - -/* - * mast_topiary() - Add the portions of the tree to the removal list; either to - * be freed or discarded (destroy walk). - * @mast: The maple_subtree_state. - */ -static inline void mast_topiary(struct maple_subtree_state *mast) -{ - MA_WR_STATE(wr_mas, mast->orig_l, NULL); - unsigned char r_start, r_end; - unsigned char l_start, l_end; - void __rcu **l_slots, **r_slots; - - wr_mas.type = mte_node_type(mast->orig_l->node); - mast->orig_l->index = mast->orig_l->last; - mas_wr_node_walk(&wr_mas); - l_start = mast->orig_l->offset + 1; - l_end = mas_data_end(mast->orig_l); - r_start = 0; - r_end = mast->orig_r->offset; - - if (r_end) - r_end--; - - l_slots = ma_slots(mas_mn(mast->orig_l), - mte_node_type(mast->orig_l->node)); - - r_slots = ma_slots(mas_mn(mast->orig_r), - mte_node_type(mast->orig_r->node)); - - if ((l_start < l_end) && - mte_dead_node(mas_slot_locked(mast->orig_l, l_slots, l_start))) { - l_start++; - } - - if (mte_dead_node(mas_slot_locked(mast->orig_r, r_slots, r_end))) { - if (r_end) - r_end--; - } - - if ((l_start > r_end) && (mast->orig_l->node == mast->orig_r->node)) - return; - - /* At the node where left and right sides meet, add the parts between */ - if (mast->orig_l->node == mast->orig_r->node) { - return mas_topiary_range(mast->orig_l, mast->destroy, - l_start, r_end); - } - - /* mast->orig_r is different and consumed. */ - if (mte_is_leaf(mast->orig_r->node)) - return; - - if (mte_dead_node(mas_slot_locked(mast->orig_l, l_slots, l_end))) - l_end--; - - - if (l_start <= l_end) - mas_topiary_range(mast->orig_l, mast->destroy, l_start, l_end); - - if (mte_dead_node(mas_slot_locked(mast->orig_r, r_slots, r_start))) - r_start++; - - if (r_start <= r_end) - mas_topiary_range(mast->orig_r, mast->destroy, 0, r_end); -} - /* * mast_rebalance_next() - Rebalance against the next node * @mast: The maple subtree state @@ -2431,7 +2276,7 @@ static inline void mast_rebalance_prev(struct maple_subtree_state *mast) /* * mast_spanning_rebalance() - Rebalance nodes with nearest neighbour favouring * the node to the right. Checking the nodes to the right then the left at each - * level upwards until root is reached. Free and destroy as needed. + * level upwards until root is reached. * Data is copied into the @mast->bn. * @mast: The maple_subtree_state. */ @@ -2440,8 +2285,6 @@ bool mast_spanning_rebalance(struct maple_subtree_state *mast) { struct ma_state r_tmp = *mast->orig_r; struct ma_state l_tmp = *mast->orig_l; - struct maple_enode *ancestor = NULL; - unsigned char start, end; unsigned char depth = 0; r_tmp = *mast->orig_r; @@ -2450,87 +2293,25 @@ bool mast_spanning_rebalance(struct maple_subtree_state *mast) mas_ascend(mast->orig_r); mas_ascend(mast->orig_l); depth++; - if (!ancestor && - (mast->orig_r->node == mast->orig_l->node)) { - ancestor = mast->orig_r->node; - end = mast->orig_r->offset - 1; - start = mast->orig_l->offset + 1; - } - if (mast->orig_r->offset < mas_data_end(mast->orig_r)) { - if (!ancestor) { - ancestor = mast->orig_r->node; - start = 0; - } - mast->orig_r->offset++; do { mas_descend(mast->orig_r); mast->orig_r->offset = 0; - depth--; - } while (depth); + } while (--depth); mast_rebalance_next(mast); - do { - unsigned char l_off = 0; - struct maple_enode *child = r_tmp.node; - - mas_ascend(&r_tmp); - if (ancestor == r_tmp.node) - l_off = start; - - if (r_tmp.offset) - r_tmp.offset--; - - if (l_off < r_tmp.offset) - mas_topiary_range(&r_tmp, mast->destroy, - l_off, r_tmp.offset); - - if (l_tmp.node != child) - mat_add(mast->free, child); - - } while (r_tmp.node != ancestor); - *mast->orig_l = l_tmp; return true; - } else if (mast->orig_l->offset != 0) { - if (!ancestor) { - ancestor = mast->orig_l->node; - end = mas_data_end(mast->orig_l); - } - mast->orig_l->offset--; do { mas_descend(mast->orig_l); mast->orig_l->offset = mas_data_end(mast->orig_l); - depth--; - } while (depth); + } while (--depth); mast_rebalance_prev(mast); - do { - unsigned char r_off; - struct maple_enode *child = l_tmp.node; - - mas_ascend(&l_tmp); - if (ancestor == l_tmp.node) - r_off = end; - else - r_off = mas_data_end(&l_tmp); - - if (l_tmp.offset < r_off) - l_tmp.offset++; - - if (l_tmp.offset < r_off) - mas_topiary_range(&l_tmp, mast->destroy, - l_tmp.offset, r_off); - - if (r_tmp.node != child) - mat_add(mast->free, child); - - } while (l_tmp.node != ancestor); - *mast->orig_r = r_tmp; return true; } @@ -2542,36 +2323,24 @@ bool mast_spanning_rebalance(struct maple_subtree_state *mast) } /* - * mast_ascend_free() - Add current original maple state nodes to the free list - * and ascend. + * mast_ascend() - Ascend the original left and right maple states. * @mast: the maple subtree state. * - * Ascend the original left and right sides and add the previous nodes to the - * free list. Set the slots to point to the correct location in the new nodes. + * Ascend the original left and right sides. Set the offsets to point to the + * data already in the new tree (@mast->l and @mast->r). */ -static inline void -mast_ascend_free(struct maple_subtree_state *mast) +static inline void mast_ascend(struct maple_subtree_state *mast) { MA_WR_STATE(wr_mas, mast->orig_r, NULL); - struct maple_enode *left = mast->orig_l->node; - struct maple_enode *right = mast->orig_r->node; - mas_ascend(mast->orig_l); mas_ascend(mast->orig_r); - mat_add(mast->free, left); - - if (left != right) - mat_add(mast->free, right); mast->orig_r->offset = 0; mast->orig_r->index = mast->r->max; /* last should be larger than or equal to index */ if (mast->orig_r->last < mast->orig_r->index) mast->orig_r->last = mast->orig_r->index; - /* - * The node may not contain the value so set slot to ensure all - * of the nodes contents are freed or destroyed. - */ + wr_mas.type = mte_node_type(mast->orig_r->node); mas_wr_node_walk(&wr_mas); /* Set up the left side of things */ @@ -2750,66 +2519,152 @@ static inline void mast_set_split_parents(struct maple_subtree_state *mast, } /* - * mas_wmb_replace() - Write memory barrier and replace - * @mas: The maple state - * @free: the maple topiary list of nodes to free - * @destroy: The maple topiary list of nodes to destroy (walk and free) + * mas_topiary_node() - Dispose of a singe node + * @mas: The maple state for pushing nodes + * @enode: The encoded maple node + * @in_rcu: If the tree is in rcu mode * - * Updates gap as necessary. + * The node will either be RCU freed or pushed back on the maple state. */ -static inline void mas_wmb_replace(struct ma_state *mas, - struct ma_topiary *free, - struct ma_topiary *destroy) +static inline void mas_topiary_node(struct ma_state *mas, + struct maple_enode *enode, bool in_rcu) { - struct maple_enode *old_enode; + struct maple_node *tmp; - if (mte_is_root(mas->node)) { - old_enode = mas_root_locked(mas); - } else { - unsigned char offset = mte_parent_slot(mas->node); - void __rcu **slots = ma_slots(mte_parent(mas->node), - mas_parent_type(mas, mas->node)); + if (enode == MAS_NONE) + return; - old_enode = mas_slot_locked(mas, slots, offset); - } + tmp = mte_to_node(enode); + mte_set_node_dead(enode); + if (in_rcu) + ma_free_rcu(tmp); + else + mas_push_node(mas, tmp); +} - /* Insert the new data in the tree */ +/* + * mas_topiary_replace() - Replace the data with new data, then repair the + * parent links within the new tree. Iterate over the dead sub-tree and collect + * the dead subtrees and topiary the nodes that are no longer of use. + * + * The new tree will have up to three children with the correct parent. Keep + * track of the new entries as they need to be followed to find the next level + * of new entries. + * + * The old tree will have up to three children with the old parent. Keep track + * of the old entries as they may have more nodes below replaced. Nodes within + * [index, last] are dead subtrees, others need to be freed and followed. + * + * @mas: The maple state pointing at the new data + * @old_enode: The maple encoded node being replaced + * + */ +static inline void mas_topiary_replace(struct ma_state *mas, + struct maple_enode *old_enode) +{ + struct ma_state tmp[3], tmp_next[3]; + MA_TOPIARY(subtrees, mas->tree); + bool in_rcu; + int i, n; + + /* Place data in tree & then mark node as old */ mas_put_in_tree(mas, old_enode); - if (!mte_is_leaf(mas->node)) - mas_descend_adopt(mas); + /* Update the parent pointers in the tree */ + tmp[0] = *mas; + tmp[0].offset = 0; + tmp[1].node = MAS_NONE; + tmp[2].node = MAS_NONE; + while (!mte_is_leaf(tmp[0].node)) { + n = 0; + for (i = 0; i < 3; i++) { + if (mas_is_none(&tmp[i])) + continue; + + while (n < 3) { + if (!mas_find_child(&tmp[i], &tmp_next[n])) + break; + n++; + } + + mas_adopt_children(&tmp[i], tmp[i].node); + } - mas_mat_free(mas, free); + if (MAS_WARN_ON(mas, n == 0)) + break; - if (destroy) - mas_mat_destroy(mas, destroy); + while (n < 3) + tmp_next[n++].node = MAS_NONE; - if (mte_is_leaf(mas->node)) - return; + for (i = 0; i < 3; i++) + tmp[i] = tmp_next[i]; + } - mas_update_gap(mas); + /* Collect the old nodes that need to be discarded */ + if (mte_is_leaf(old_enode)) + return mas_free(mas, old_enode); + + tmp[0] = *mas; + tmp[0].offset = 0; + tmp[0].node = old_enode; + tmp[1].node = MAS_NONE; + tmp[2].node = MAS_NONE; + in_rcu = mt_in_rcu(mas->tree); + do { + n = 0; + for (i = 0; i < 3; i++) { + if (mas_is_none(&tmp[i])) + continue; + + while (n < 3) { + if (!mas_find_child(&tmp[i], &tmp_next[n])) + break; + + if ((tmp_next[n].min >= tmp_next->index) && + (tmp_next[n].max <= tmp_next->last)) { + mat_add(&subtrees, tmp_next[n].node); + tmp_next[n].node = MAS_NONE; + } else { + n++; + } + } + } + + if (MAS_WARN_ON(mas, n == 0)) + break; + + while (n < 3) + tmp_next[n++].node = MAS_NONE; + + for (i = 0; i < 3; i++) { + mas_topiary_node(mas, tmp[i].node, in_rcu); + tmp[i] = tmp_next[i]; + } + } while (!mte_is_leaf(tmp[0].node)); + + for (i = 0; i < 3; i++) + mas_topiary_node(mas, tmp[i].node, in_rcu); + + mas_mat_destroy(mas, &subtrees); } /* - * mast_new_root() - Set a new tree root during subtree creation - * @mast: The maple subtree state + * mas_wmb_replace() - Write memory barrier and replace * @mas: The maple state + * @old: The old maple encoded node that is being replaced. + * + * Updates gap as necessary. */ -static inline void mast_new_root(struct maple_subtree_state *mast, - struct ma_state *mas) +static inline void mas_wmb_replace(struct ma_state *mas, + struct maple_enode *old_enode) { - mas_mn(mast->l)->parent = ma_parent_ptr(mas_tree_parent(mas)); - if (!mte_dead_node(mast->orig_l->node) && - !mte_is_root(mast->orig_l->node)) { - do { - mast_ascend_free(mast); - mast_topiary(mast); - } while (!mte_is_root(mast->orig_l->node)); - } - if ((mast->orig_l->node != mas->node) && - (mast->l->depth > mas_mt_height(mas))) { - mat_add(mast->free, mas->node); - } + /* Insert the new data in the tree */ + mas_topiary_replace(mas, old_enode); + + if (mte_is_leaf(mas->node)) + return; + + mas_update_gap(mas); } /* @@ -2995,12 +2850,11 @@ static int mas_spanning_rebalance(struct ma_state *mas, unsigned char split, mid_split; unsigned char slot = 0; struct maple_enode *left = NULL, *middle = NULL, *right = NULL; + struct maple_enode *old_enode; MA_STATE(l_mas, mas->tree, mas->index, mas->index); MA_STATE(r_mas, mas->tree, mas->index, mas->last); MA_STATE(m_mas, mas->tree, mas->index, mas->index); - MA_TOPIARY(free, mas->tree); - MA_TOPIARY(destroy, mas->tree); /* * The tree needs to be rebalanced and leaves need to be kept at the same level. @@ -3009,8 +2863,6 @@ static int mas_spanning_rebalance(struct ma_state *mas, mast->l = &l_mas; mast->m = &m_mas; mast->r = &r_mas; - mast->free = &free; - mast->destroy = &destroy; l_mas.node = r_mas.node = m_mas.node = MAS_NONE; /* Check if this is not root and has sufficient data. */ @@ -3018,7 +2870,7 @@ static int mas_spanning_rebalance(struct ma_state *mas, unlikely(mast->bn->b_end <= mt_min_slots[mast->bn->type])) mast_spanning_rebalance(mast); - mast->orig_l->depth = 0; + l_mas.depth = 0; /* * Each level of the tree is examined and balanced, pushing data to the left or @@ -3029,7 +2881,7 @@ static int mas_spanning_rebalance(struct ma_state *mas, * original tree and the partially new tree. To remedy the parent pointers in * the old tree, the new data is swapped into the active tree and a walk down * the tree is performed and the parent pointers are updated. - * See mas_descend_adopt() for more information.. + * See mas_topiary_replace() for more information. */ while (count--) { mast->bn->b_end--; @@ -3046,13 +2898,13 @@ static int mas_spanning_rebalance(struct ma_state *mas, */ memset(mast->bn, 0, sizeof(struct maple_big_node)); mast->bn->type = mte_node_type(left); - mast->orig_l->depth++; + l_mas.depth++; /* Root already stored in l->node. */ if (mas_is_root_limits(mast->l)) goto new_root; - mast_ascend_free(mast); + mast_ascend(mast); mast_combine_cp_left(mast); l_mas.offset = mast->bn->b_end; mab_set_b_end(mast->bn, &l_mas, left); @@ -3061,7 +2913,6 @@ static int mas_spanning_rebalance(struct ma_state *mas, /* Copy anything necessary out of the right node. */ mast_combine_cp_right(mast); - mast_topiary(mast); mast->orig_l->last = mast->orig_l->max; if (mast_sufficient(mast)) @@ -3083,7 +2934,7 @@ static int mas_spanning_rebalance(struct ma_state *mas, l_mas.node = mt_mk_node(ma_mnode_ptr(mas_pop_node(mas)), mte_node_type(mast->orig_l->node)); - mast->orig_l->depth++; + l_mas.depth++; mab_mas_cp(mast->bn, 0, mt_slots[mast->bn->type] - 1, &l_mas, true); mas_set_parent(mas, left, l_mas.node, slot); if (middle) @@ -3094,23 +2945,20 @@ static int mas_spanning_rebalance(struct ma_state *mas, if (mas_is_root_limits(mast->l)) { new_root: - mast_new_root(mast, mas); + mas_mn(mast->l)->parent = ma_parent_ptr(mas_tree_parent(mas)); + while (!mte_is_root(mast->orig_l->node)) + mast_ascend(mast); } else { mas_mn(&l_mas)->parent = mas_mn(mast->orig_l)->parent; } - if (!mte_dead_node(mast->orig_l->node)) - mat_add(&free, mast->orig_l->node); - - mas->depth = mast->orig_l->depth; - *mast->orig_l = l_mas; - mte_set_node_dead(mas->node); - - /* Set up mas for insertion. */ - mast->orig_l->depth = mas->depth; - mast->orig_l->alloc = mas->alloc; - *mas = *mast->orig_l; - mas_wmb_replace(mas, &free, &destroy); + old_enode = mast->orig_l->node; + mas->depth = l_mas.depth; + mas->node = l_mas.node; + mas->min = l_mas.min; + mas->max = l_mas.max; + mas->offset = l_mas.offset; + mas_wmb_replace(mas, old_enode); mtree_range_walk(mas); return mast->bn->b_end; } @@ -3341,7 +3189,6 @@ static inline void mast_fill_bnode(struct maple_subtree_state *mast, unsigned char skip) { bool cp = true; - struct maple_enode *old = mas->node; unsigned char split; memset(mast->bn->gap, 0, sizeof(unsigned long) * ARRAY_SIZE(mast->bn->gap)); @@ -3353,7 +3200,6 @@ static inline void mast_fill_bnode(struct maple_subtree_state *mast, cp = false; } else { mas_ascend(mas); - mat_add(mast->free, old); mas->offset = mte_parent_slot(mas->node); } @@ -3457,13 +3303,11 @@ static inline bool mas_push_data(struct ma_state *mas, int height, split = mt_slots[mast->bn->type] - 2; if (left) { /* Switch mas to prev node */ - mat_add(mast->free, mas->node); *mas = tmp_mas; /* Start using mast->l for the left side. */ tmp_mas.node = mast->l->node; *mast->l = tmp_mas; } else { - mat_add(mast->free, tmp_mas.node); tmp_mas.node = mast->r->node; *mast->r = tmp_mas; split = slot_total - split; @@ -3490,6 +3334,7 @@ static int mas_split(struct ma_state *mas, struct maple_big_node *b_node) struct maple_subtree_state mast; int height = 0; unsigned char mid_split, split = 0; + struct maple_enode *old; /* * Splitting is handled differently from any other B-tree; the Maple @@ -3512,7 +3357,6 @@ static int mas_split(struct ma_state *mas, struct maple_big_node *b_node) MA_STATE(r_mas, mas->tree, mas->index, mas->last); MA_STATE(prev_l_mas, mas->tree, mas->index, mas->last); MA_STATE(prev_r_mas, mas->tree, mas->index, mas->last); - MA_TOPIARY(mat, mas->tree); trace_ma_op(__func__, mas); mas->depth = mas_mt_height(mas); @@ -3525,7 +3369,6 @@ static int mas_split(struct ma_state *mas, struct maple_big_node *b_node) mast.r = &r_mas; mast.orig_l = &prev_l_mas; mast.orig_r = &prev_r_mas; - mast.free = &mat; mast.bn = b_node; while (height++ <= mas->depth) { @@ -3565,9 +3408,9 @@ static int mas_split(struct ma_state *mas, struct maple_big_node *b_node) } /* Set the original node as dead */ - mat_add(mast.free, mas->node); + old = mas->node; mas->node = l_mas.node; - mas_wmb_replace(mas, mast.free, NULL); + mas_wmb_replace(mas, old); mtree_range_walk(mas); return 1; } @@ -3903,6 +3746,7 @@ static inline void *mtree_lookup_walk(struct ma_state *mas) return NULL; } +static void mte_destroy_walk(struct maple_enode *, struct maple_tree *); /* * mas_new_root() - Create a new root node that only contains the entry passed * in. @@ -3969,7 +3813,6 @@ static inline int mas_wr_spanning_store(struct ma_wr_state *wr_mas) /* Left and Right side of spanning store */ MA_STATE(l_mas, NULL, 0, 0); MA_STATE(r_mas, NULL, 0, 0); - MA_WR_STATE(r_wr_mas, &r_mas, wr_mas->entry); MA_WR_STATE(l_wr_mas, &l_mas, wr_mas->entry);