From patchwork Wed Nov 1 17:16:18 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: 13442923 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 34050C4332F for ; Wed, 1 Nov 2023 17:16:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C383E900005; Wed, 1 Nov 2023 13:16:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BE6918D0001; Wed, 1 Nov 2023 13:16:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A6132900005; Wed, 1 Nov 2023 13:16:47 -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 928408D0001 for ; Wed, 1 Nov 2023 13:16:47 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 6515C1A07B5 for ; Wed, 1 Nov 2023 17:16:47 +0000 (UTC) X-FDA: 81410040054.16.EFD8EDC Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf10.hostedemail.com (Postfix) with ESMTP id E909FC001C for ; Wed, 1 Nov 2023 17:16:42 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=EiENbQFH; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=LbllPnf+; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf10.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=1698859003; a=rsa-sha256; cv=pass; b=dCzrTPoe1yNipgOrCvdSLbiTbnfVlLbHA6Dw25CBH6PfDTlm29HGuM/DH1SCNan//vC85X 4tPetHnGNg/8h17x7THMKSKoIm6MmujGRJBlnbA7l2T88dodBgALvz3xwys0Lg1sTeX8L4 SaXI9GZ1eMHwx1O2+D3cIW/sD9dIOMo= ARC-Authentication-Results: i=2; imf10.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=EiENbQFH; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=LbllPnf+; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf10.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=1698859003; 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=KfrZaW0K5c8cXVE5iHHCWDIvF9HlDZH10tB2zeapSQo=; b=kFCmWkvF0zfEECyfhX71hvpmAMZYX1H7V57oQIOCzlU7sBupcoOksfhLzawPnT/Me8b62L M44qFidFSfXrsy34PLoSh/Lz1Qeohd371Bos+TrU14KgD0JXB3qd0uUjaOsNkBn/QjjEuj 36HrrBTWiFmcXYtQn+KlZH9WPtK7n7s= 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 3A1GYoW1011191; Wed, 1 Nov 2023 17:16:41 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=KfrZaW0K5c8cXVE5iHHCWDIvF9HlDZH10tB2zeapSQo=; b=EiENbQFHa5daXGAmmIcKNpIrhIEhs/g0BK/cyk17cEWdQAQQx16NwQxoE3L1yxla62zt Ixhrxe+xtlus/m7mzf2MO0uenFK6hfGxXQncA88QRweKWXL2uVhc3vd56TrDOOZZdSnz ZEUb/fCIkY530ZHZljfJtAm0TKolleMLvTqxwOxUXsQKWp7y0wCHDfXE3n9lFuv+hk99 /kAHikcPuELOqGdJQGWS1LwCwsIevoXx91iwMkW7Q+LhPGJB782eVh+HIqRbd6oH5gW/ /3pmLZUPdz7TAFaXhySuw3+Au+03zF3WAWZIJbD+krJvo6kl0PxKEvaE3zUqcU6h3Qx1 jQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u0s7byxs9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:41 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3A1Gj6B8022465; Wed, 1 Nov 2023 17:16:40 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2041.outbound.protection.outlook.com [104.47.74.41]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3u0rr7br6g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cOnmiLg6SBv7I2bjS68SmHZsAxmcxJaUE+faqYDk55NVCibpjvL41eAHzfIRcaqFlPpdkjqJDIYf1mD7qC1Or4flDYx6q3MfjoBJy0ZpjEfFZslp7+fzfoTH2ea0pd6lU7QKNVj9HZIr9kP64HFUrYEAszobg+Kn6fB6Vtkykb0yev+As3+oNNrpnqSOI5OTc+2Hg5YZNBFECx4hGr0q6bhDmf/N7AA8dtFz+9Ts8zFQIyAnSmnx4+3OEn+n3ytYez5l6RzoQZztqYyYqBKFKTXkb9UAF9czWAXdtinxCIi0fdNj1VM+t4TpIO3sY+78dNpqvQk5yC7Hcm2yDLYULg== 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=KfrZaW0K5c8cXVE5iHHCWDIvF9HlDZH10tB2zeapSQo=; b=KNfbCYo1Su/a4I9ImM79aJm7CiUo4pjciTonEdnB5WszxHPXPsUL5gPUVTorEuqg9AajvbUYWBoP7628/iDiplU321UKJTKGqR9P8Rh/H+zlwkY3SLnm3T9B1H7x5A7wiw/FZns9WEfWV45Biq1cseoet1BGChfFk/4Nwpnam+A9ieMis7RUPbBH1kEhAfoqk3fYWXaO38LSWcMPNWwzhFsPwXM9YJPx+8JnxQUf+dic6wjmHxiNnaxMDKMMR67wvt8bSwYRU2V2zAIN4SlygQOkvRvVOTh2XrS+V4gyiDK6b37LYyhW8zIT2uRYmB/xF5dqAzOUxOlQufzDhV7yEg== 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=KfrZaW0K5c8cXVE5iHHCWDIvF9HlDZH10tB2zeapSQo=; b=LbllPnf+323ewMHHKhHf/cF8qPDDK8XwNLuhlRmjHKVb5jaqmjikZvLf9Gn4timt+vfjJNi5dp8tyoZmsOYE2huyPhH/xgYzWyp7y/u5UbjKUx7AQNq7LdPgqFAzM7/8p3fEmxplwIOD54eIfq/GFAyQfJFj27dcWCXimLoSAtw= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SA1PR10MB7684.namprd10.prod.outlook.com (2603:10b6:806:38e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.31; Wed, 1 Nov 2023 17:16:38 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa%4]) with mapi id 15.20.6907.025; Wed, 1 Nov 2023 17:16:38 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Liam R. Howlett" Subject: [PATCH 01/12] maple_tree: Remove unnecessary default labels from switch statements Date: Wed, 1 Nov 2023 13:16:18 -0400 Message-Id: <20231101171629.3612299-2-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231101171629.3612299-1-Liam.Howlett@oracle.com> References: <20231101171629.3612299-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0489.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10c::8) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|SA1PR10MB7684:EE_ X-MS-Office365-Filtering-Correlation-Id: 614ced25-77f2-4876-8f82-08dbdafe4ef5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N7P3zcZiMYevt1Roq58q6IEM41IBw0yt/o4rnnwT7w1Q21qsAiofzbrQXj+n+ji+IgiEsBuUkTRNBofYJDduzH06tJ9oErjWEB+h8xl+mfvGx5wZV8OYJzPL3Nzl00vyQCer4QAOtVN5dLGGxpg1JHJwPZhB2RMvQJmxG6fsupIvCaMLhwRicu3li8+veb0EYEsoo7BUQMFLiX+44HTrxlGtmR4BNfI+gdr7h4AECcpiByHOzKjNBM1YhazRX67/11SrmFqjaNp/hfBfr6/Dx9b3oPkUmV3t84CNq5zL8An+kYIehDy9qX7duIjZJsaizcRZ1bQRMVHnNrxNnExMGmZmqYCJbqhOA/oA+0w2BSyYO5T6KbrcRCqsvuz1E3vz3CUxhNoTwa+Eh/MA5kmi6rqTmR8eD9rAhBsGxoww38OP/VwW+DInALMReb+Mxd2/s95bayFxTHOBIDKM5NAQuts6HmIlm888xf0kLOA1XuizlX/wYvsiR0icAfE8ldBPVjGqhEJ5ZvQV2giB+AsuXAIppHHDos2HrjeyEljGs6TCptA9Khm6iCgDScrnW/IXrVb60bB/NEn/YRWEs3Jf2Z2T6OcR1iYI/HW4RF93r/uJjAzJg02l4VOwF2x/TFWa 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:(13230031)(346002)(136003)(376002)(366004)(396003)(39860400002)(230922051799003)(230273577357003)(230173577357003)(186009)(451199024)(1800799009)(64100799003)(6486002)(8936002)(2906002)(4326008)(41300700001)(8676002)(5660300002)(6666004)(6506007)(66476007)(107886003)(83380400001)(1076003)(2616005)(36756003)(26005)(6512007)(38100700002)(316002)(86362001)(478600001)(66556008)(6916009)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tTsnPDae89Ck8qV2QyptLvn6NBkZKIwR47CtPOzE6mZDqJ9+clsu4K6fo6JU/YaLMlQZdS9/Pfz16IESVpDNreNuWuhB7/ytvBoKf5lrbprAV6ewH1r97cI689/gqwJobjk1JRzrLsA+qBHL8CdP1nKTtl2JC5Y+mcEtQhy1bbpt40OE6btBdN/vpAoUjnID2bkEBmiKlTs72yVeAWiUDqgK77zoDXCLLd+u7urvjY2cSm7HPMA0agEFDdR7ycBGNPRDAs1NmgNzxDlltvSItuXXrd3Nc3q+xZguea4Ipr3vGHcNPnwUptrVMkH6YRI2xdZ6dAZdCx28QV68mxsgR3LT46NBfsvuqbrANTGaw3klYzz0riUv8bsCb4lT5YiuPUTLKo/O7cYnYDdORloF5RacdqGhlDKdw6dP4f4DSeO/Sz6hzD/lOfi8IAnpHOzJOp2hbNBLWPGq40aBvIjt+IMtMSMiD2WmRemi8ygGyuGqYuhXt3rzwY4YzTXByvEM4TtrEvqM9yt/N8WjQdtE8FaPEyBeKDFXurdIM/OfnGd11VwGOj/bnbjTLP0fLutdMZJDtmO3M8hYH5XIXhg+b7Lm3VFqHxHOaKgyN747domINZXZRuMG+lP9SS+K5+SUEc3f3KyLyJ8y8SK6+e8hhtp/ehZO9zSTKpiksN7ozCAqEuOQj+dKIf828mU5N2TKYMb66KfR9gd05JZ3GjZ2UUei5rytTGAPgL54plOfAjUQS2i1P90oATnHV+J7PVy3BqR2bUzsTl2O7a3rGT+ziyNEXIdLpTllyfwMisk4WXRFlWHOttERmDHBFrh2g+K9lXwSakZNbGa6G9H60/97/vtuiPGtl9Lr1CexAEMfw+htcZ3q3pa4+IVlRgiMaRbT3CnweWHb/fuYv2X8A+81kcbq4GfON91tCRr1/P8UMlzKC6nnXFD6J2fEagj2208jkV9fgg5/u1vfhGmyDLTOuZEdxS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GrcygVVQX+fzMeOwvtOYJk+NUpkvsk/Fpjqg6S9jEM3aYzBok5hC3WpsMfXpKB34GyfluxMmtX1aZRvLCmofY8fn4zu/y4r6t863dJnDd5WxwcQKhTGs/Wc3IfbnJgWn2W/7qQTMaF/hcuMdKy0NSDTj2MIvXRrQ+RRtc2uwyJAsr0+VLdciAPbMkL6EVT1C/F48g4dpy8xc7fUq+mYT6/rOfOO6AQEnMAA2ksa7lcdRSRFoHwtNTM6thu0t1M1uVjsm+Aar8EwIp2uyvZJkhz0xn7mXlqTQjtJZqX0HUxyOUgeBQJxTNsaz4I8WCOIACXVFJxRNs+GR7ov83uwK/ALNzqwP+eOsPkgbd6UAQI4kyP4epccvAUhUxMDtSAUv7chGE5OdOLglBFvU/kTCpQFKo3N+Kr8i2wJll42b8Oc8NKaP/J+PP2D4CEbhRTuHw4wOOrenG2KbJkXZ+ezW+6wsrKG9uVGGjLWPgyRNBweQ6+FZKbGeNNVY6cbT1AZdmUlBDx70YMCaQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 614ced25-77f2-4876-8f82-08dbdafe4ef5 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2023 17:16:38.5042 (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: f3//2Va5STVN/IMTXo6jgruSv9KYKu9Qa8T6TFL0XE4dcdT/q9m4ANhEpHjyC5coLLovgS0zu6YpaTQDq5SCJA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB7684 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-01_15,2023-11-01_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311010134 X-Proofpoint-GUID: fW9RmoQstYFRFIXapQza5PZkMIZ7nbxl X-Proofpoint-ORIG-GUID: fW9RmoQstYFRFIXapQza5PZkMIZ7nbxl X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: E909FC001C X-Stat-Signature: pfch9139uzhpmeqjx61kn3ja8qmq5qj4 X-HE-Tag: 1698859002-994304 X-HE-Meta: U2FsdGVkX19338vw6bGKGKUxYlwP6UCnIuvi6dh6YmDL76G9JTZ0460Zpe+KYvyTShMYOZCChRI2hrMaIKFFz9cHi2RtnVmnsMM4kw49Kf/43weikCBZDuIOHW6cSk0S35WRDXmBuISraqNpKl0dgGaXHmVn9SQ9RfusrWsdcd61iG1t55UmeeDyGEeCNet1WswOgcjeG8tEWCEAZysRqR2ZfOpzb/TOw3OyUlAb+PCDS7r+R4apaQmL9xCFV5xqAI3zd4PmpaAyM55sK9vLvRnnoyGpFDF3UtLd9WHaZsFlyJifA1z8g93yJ4UyAn2yfBNj68XysePTAZ70z6xlowZt3W7ZcOPJcj3rS7scajMztgiVRDCshTQMVkBEMvhRxsT00rh/YC2iBCGPMSKLdbi6T9zqFxOAP+58LuzmWg85yPOmNTXQuDTqwQ+GubfBQj+IFHc/TfDf7FF8Ls7HQBp67tZJxQ+7iTKjC7T56fROyC6udJRsLYGPBQdCb0BXDgpcWxm3sia8GdpH3AcCSC44rKdGcS30/9fFBqQEORiXfIku3Wy81L0SWXDnIPvNJLvnhOTh/dW5jK14/c6IYBCDfuxuJmgQgLo97AmEjZFI1rSBTQyYYLhPeH9NiAIOZvTPNT8WM3zXc6/dT63saJOxBaLu7C09ObEwnnHZB1vOy8zJJDhUSXfG8XHnxitqPq2Qvl5zsdcoN0PFzl547YqremrnxQfsiPS2zlSW2QO0WLBd+FI09i17un0Nf0RWAepxxbpsgxMBGjR5b5EC136jvreErBV4jOIH2Ac6ZkAua5GBDHjkRrzRXewcK5sLfFzRzp3bO6deBPd+6jLdCceyn37646Iq+8fQmWfi4v3CeYgPGn45gMn9sPNcWqgcq7q4+CJdyuCiv3jz8yDk7fKGUEaB9vFLkNK3V9kQ9TB/PUu24CzqnUtQN7mGUngyb8Gk2mRJAh3nHyTP2xy vyKhG8PK UktUVrhjQIu1a/UMZRLLY3YLaJv7anf/WgEADjsrQy+0K31jsVCAoCAXTuRH3IINmvHnYxAfDE+8mnZX5tb2IF4xSqzZY4V+CMvRdt/W8eb09aL+5OrgROh+m0+6ZVOmh1AEIN0IzpaDx3jLYzf3iEywcIPGLI4y+Re/cVVsJ1/z/Rt9IZjjXl7IuZT21Q7kenyFtix7Ywu1uzRwETyv+vdnHchQ9Mn/Eeytw+GXjfNB+QAsM4mBYr068jIH2ll0LWwPmo1jqY0omua0bph4Kjay/sTSfz25sQmJJ7cQfXC7JzZCc4qaouTn3MDzMFb9OoIobJWvfSsVbOoNa5q8py2xrpgqYhMPPxDMtGtTuEvYQwgGoWtD+lJJywVuVihWxCpJJs8BBxT3W/T8NaOzep/JWK41Qv6v97v3/0BAqPqgDXJ27moc5zU0/rotgNjbGw8197NP0WNZt1Mv4NqNEQvOQFHk+OJZihqKx X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Removing the default types from the switch statements will cause compile warnings on missing cases. Suggested-by: Andrew Morton Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 0e00a84e8e8f..0fcbfa7e9942 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -759,7 +759,6 @@ static inline void mte_set_pivot(struct maple_enode *mn, unsigned char piv, BUG_ON(piv >= mt_pivots[type]); switch (type) { - default: case maple_range_64: case maple_leaf_64: node->mr64.pivot[piv] = val; @@ -783,7 +782,6 @@ static inline void mte_set_pivot(struct maple_enode *mn, unsigned char piv, static inline void __rcu **ma_slots(struct maple_node *mn, enum maple_type mt) { switch (mt) { - default: case maple_arange_64: return mn->ma64.slot; case maple_range_64: @@ -792,6 +790,8 @@ static inline void __rcu **ma_slots(struct maple_node *mn, enum maple_type mt) case maple_dense: return mn->slot; } + + return NULL; } static inline bool mt_write_locked(const struct maple_tree *mt) @@ -6718,7 +6718,6 @@ static void mt_dump_range(unsigned long min, unsigned long max, else pr_info("%.*s%lx-%lx: ", depth * 2, spaces, min, max); break; - default: case mt_dump_dec: if (min == max) pr_info("%.*s%lu: ", depth * 2, spaces, min); @@ -6758,7 +6757,6 @@ static void mt_dump_range64(const struct maple_tree *mt, void *entry, 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]); } @@ -6788,7 +6786,6 @@ static void mt_dump_range64(const struct maple_tree *mt, void *entry, pr_err("node %p last (%lx) > max (%lx) at pivot %d!\n", node, last, max, i); break; - default: case mt_dump_dec: pr_err("node %p last (%lu) > max (%lu) at pivot %d!\n", node, last, max, i); @@ -6813,7 +6810,6 @@ static void mt_dump_arange64(const struct maple_tree *mt, void *entry, case mt_dump_hex: pr_cont("%lx ", node->gap[i]); break; - default: case mt_dump_dec: pr_cont("%lu ", node->gap[i]); } @@ -6824,7 +6820,6 @@ static void mt_dump_arange64(const struct maple_tree *mt, void *entry, 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]); } From patchwork Wed Nov 1 17:16:19 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: 13442924 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 92B34C4167D for ; Wed, 1 Nov 2023 17:16:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 421A68D0001; Wed, 1 Nov 2023 13:16:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D079900006; Wed, 1 Nov 2023 13:16:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 222F88D0050; Wed, 1 Nov 2023 13:16:48 -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 142658D0001 for ; Wed, 1 Nov 2023 13:16:48 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id DABF9A06AF for ; Wed, 1 Nov 2023 17:16:47 +0000 (UTC) X-FDA: 81410040054.06.EB63C97 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf19.hostedemail.com (Postfix) with ESMTP id 8851A1A000B for ; Wed, 1 Nov 2023 17:16:44 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=UEyaQArx; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=TYRpq4i7; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf19.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=1698859004; 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=Zarp750TVlHsFqy+aCF+76v+a9/pzTdUI61HbGsIja4=; b=0ahw9xfdAJp1JfUCsyNd+MEM0zXLbTVwA0GqAlfRuf1jJc/hK6m4I0yOefpsaXFRrdawtE LZzKHVMH8/xqzsHx8IKyG4rRY4y0mrcSx1hB92LiJa8E2CWtp4MYDrhSN145CB4W+cgeQI S4bIl/alETGHG8UX5VWxRVAh2muS9dA= ARC-Authentication-Results: i=2; imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=UEyaQArx; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=TYRpq4i7; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf19.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=1698859004; a=rsa-sha256; cv=pass; b=jjPBycfYSvqJWnXEzCpp9zALrvH/Rd0036RzYdEWh3e7JZ/EyFE8tTH/kDBTx2q/5909BL sCfDddZFgvI3BgmU2pqQHZT2ulnKMoylfV0kZLFqGPqx1fpt2K+gkC4AEhGnglcWkD417k 4OAD2/buu0rMqnnkXGlzNk/7+cRPfkQ= 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 3A1GYoW2011191; Wed, 1 Nov 2023 17:16:43 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=Zarp750TVlHsFqy+aCF+76v+a9/pzTdUI61HbGsIja4=; b=UEyaQArxB7hm37RvfLE46QbTpvSxcylvJ0YEv4OkY3vGhQh8Ltd1Ej0kKdQKEX9Dd1pf YbxXYSqw4XFW53Nr8v0KxsI6dobtlPz2H5xSB7lXeMejBBTDZ7yL3LZUxMB7jP9HL6PO 63gts7JbGw/NPQuSdY3KhdtJzwD1+cDKr229AAFTuYIVmKPjdlAD66LmCuxHC3/9Ol7/ KWMYlYAX/tZr3kqL/JzKQ7D+WvqpfYjBqvX8oAmSa0VHZQhHzpw59vevhbTnITxMrYmM QSIp3Cv/p1fLtt3fpnwjsApEl0wgpmC7TXNOmONwpDpX9p3mwBm/8yPGFPIsruAOpJ4l 8w== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u0s7byxsb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:43 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3A1GVSup022547; Wed, 1 Nov 2023 17:16:41 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2040.outbound.protection.outlook.com [104.47.74.40]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3u0rr7br7h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dIKRmP3L0a8xZ7b/FxmEYvoo+BrMADv9PPEA6+UHm2isFGFn+7ZPPDOmr4GGCs0qhxzi8ExsZAp14ur7OQsBIEFnxVLGDna3jMxA5JJKLjU/ePk1EY9zJe+TgJvVj0RzNh4bXIsM4WEewRc2YZo8kNXMGnd9/9reP/0G7m8oCCRom21iLa1DoTQmJVswjzVC/qCr7TkW972bRJM0Tz/vmJ8zL4EedYzMf4O7KQnkQNU3YHhcKaragVSCO1HGJLfGxomevkoZtoDG5uUhlRZAyJR63T1rpMxPTBUEdmAj8iQM/5jw1RNr/nXMoSVdoknM0oUhMikcjN70392cJJYtYA== 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=Zarp750TVlHsFqy+aCF+76v+a9/pzTdUI61HbGsIja4=; b=ob0UGcc0wJhBZekAGCcDh196PzVErzpyIW19TvzT+N1E0PD7RgOSRFWXci4MwVOY+dGc0rDWR2EHMX5l92rLqWqdts9pQVG2khe2idWVrVZCCEoQcsd2AA2jaBiZvftMy+kI3z3qRKVSiDOid/zOLWLNCMsZRYjqe/4KjHhxJSWDRzI7Xb8QD6rU3YSVNJjxGX0KBojkVCe25oRkNH6PpZ76PReXpggmDpVNB1Da4LCXSPqW6m+ZFD0sJAQM/Pl/43pKysP7TG7djKSjciZxFKvB025aWIPjlFoA0yMYky16vXv+zFO/s8s+Toyf0yWqcTgUkCXKfeCKtdCQ8XINZQ== 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=Zarp750TVlHsFqy+aCF+76v+a9/pzTdUI61HbGsIja4=; b=TYRpq4i74w6HtiNcDY1SNWB9gZKLJZihUrQTBd2ZnfFQO/la+71rkvBbUr99uojiFfhrJsppi46TeYwTeea1Guo3CEKKeA2Y2znCyhmH/LEMPO8l4pOAfAOoAKU0V3QFeAC4fjkUhpn45KLpd2HxPDvz7MbB90Le75FQWCvC9RU= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SA1PR10MB7684.namprd10.prod.outlook.com (2603:10b6:806:38e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.31; Wed, 1 Nov 2023 17:16:40 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa%4]) with mapi id 15.20.6907.025; Wed, 1 Nov 2023 17:16:40 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Liam R. Howlett" Subject: [PATCH 02/12] maple_tree: Make mas_erase() more robust Date: Wed, 1 Nov 2023 13:16:19 -0400 Message-Id: <20231101171629.3612299-3-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231101171629.3612299-1-Liam.Howlett@oracle.com> References: <20231101171629.3612299-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0500.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10c::29) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|SA1PR10MB7684:EE_ X-MS-Office365-Filtering-Correlation-Id: ad6d2a9c-9aa2-4d0c-bdea-08dbdafe5007 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ash5OAdfhWSD8TYTWpzY4xjYjpqv6fuRKQXkhr02udmvMSv0XUNLqSJe0nwtvxcfB/9JFXzjEeURNpNRzgRDvubE/PzisPGRfRAgH/cCGGEUNHHQ3JNXhOLjplI7D4A0nK/i0eoHzvK3ztVYFXE/MkeEFmBUnGxaTgVNEPybnVwHx0mwrxxZR1RLVCq6FO8Qvlg1PgNEKA4uA0W1SgZW94DGM76+ia2c2mNjc5ad1qADubwI5EVnU/cpiKimOglA7qlBf6VUlu64F81y+wUV9Sh8XX9Sbdeyw9zTPC0IK+X885esAuJ8vP6P+nvxuc2+bkJ96XaoinqxL0ERA/Ig4k6ea6iaZxMZp3DXV5fQ0oAUEp2jOjXTyC4nqXuQHq9Bm4FZFzk3MJCwlOx5qxPAaEfE1jLblQd5Ra7nOhD50SMDcyLEUcGU5FE6883G0FPd4MPHX5c2cV1JAkzLwjvhuDVp++0vVWmEtkjDl39v6lBGJCDzWt/NvoJpv1pyKeOFB9x8Y2x3tuf7xcJebAv0ZD1gnyMxmEaBh3boVv9GlFk+N9vUO1YIR7qcVsK0PSVk 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:(13230031)(346002)(136003)(376002)(366004)(396003)(39860400002)(230922051799003)(186009)(451199024)(1800799009)(64100799003)(6486002)(8936002)(2906002)(4326008)(41300700001)(4744005)(8676002)(5660300002)(66899024)(6666004)(6506007)(66476007)(107886003)(83380400001)(1076003)(2616005)(36756003)(26005)(6512007)(38100700002)(316002)(86362001)(478600001)(66556008)(6916009)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-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QzK3vX4C3EFJXzoiI9RYRW+dyXCnTcj26z+4J3sDhGtUpPb+zQGHYBK4RCG6pp26uj7DC+EqKMwsdFsrx1zGC7fDzIRUu/wNoQh3HhkUkQYVpOQah8utMtPmcEprdQHWjTyHdMPjon4bg1XPdDABBAm5H4CqJbPNAvZuDlVsRxJhQ/LgIpWacRzQI722SbW5DTD+nFieREpn/yoX7sdIjdXX/bsv4Oei5rwVMO2sOeBUWS12Rvl3kekQOLIj+zSWHdIxWwseawA6/ZZ8Ui1FSUSTtrOgPjOMmBeDLPHxmPP7Ctr7wk4t8LX7M6N9uHcc/nyu2KSBHHgBHoTA3VXzgbeom7pX74QCUmr8LDrLpv8hRbqOBCUbnEtRQ5tEYo2TRIflVEz6fbnrdSaSxNkitQqQKPher9VNMnB5Udi7BA81L4j5usV4bONeA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ad6d2a9c-9aa2-4d0c-bdea-08dbdafe5007 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2023 17:16:40.3679 (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: bO8vUXqp8Y60B+ZwWLUA7WHgON74z6jcPj4u3gOmBUuir5MIlFYeRIPhgX2dJz8m9TUqSLgSHwWO6se0tiBDZw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB7684 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-01_15,2023-11-01_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311010134 X-Proofpoint-GUID: 6kGqw8JWo8JFCm603ROyXiBMqoodNANf X-Proofpoint-ORIG-GUID: 6kGqw8JWo8JFCm603ROyXiBMqoodNANf X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 8851A1A000B X-Stat-Signature: opw6gkjgi3tg3j457wj5xagwghbmrgze X-HE-Tag: 1698859004-527125 X-HE-Meta: U2FsdGVkX1/vpfdmRiDDzVhOtuEOEh3VbzM+prbjCTok6ZAEuE3jaTwLEs52KLCkooSVeNtdZc0CoAm/gsEREkzDvtOl9rW4WDqyeYbjDodUciOUG8tCDdHgXp8JnJkHkQIYXSgQo7EeJjT8b/F0Cq5Mk7MgMQ+UPTNOCfvazLWAh6uxYDJHcK7OtFDeuwOrOgRUwACKgX+7xN4GFZ+qJ2o1ug+3zipCcijvTDRyUndlmiHKH1UfxYnWxY5HAsL0O5IMCwHRXepcSyrByy1xoinjbG2/+wnPRMm/YVwZ85hJnvB9SO1UMRyFUK6742FPTHX20XQTiz32XRzWVKkd4sjjKrgfb9JuPhZNU5UiA8/6fwFMyYMkXiqI7hKpKZTpe43qNTGupRU4mutz8vpHhKQN8FOQhkUg5195KpAggCyv9V1Qd0JLgU4CM67m408IxCIS8StCqxk0o4Ufwj8orBzgIPhhHpiTKkxIvaNHyEwFMrscgiE9plbc7FKloL1STeVcPp/t/tnla9q8gRPmi9jCK03lPVjKGj1v/bF7Ih70kEfzTbIgRkRYGJrlx1CZZ8Kn9QAZ/BCHwPablLSzb7KZAFYMs3Nw9hQJceijN1FE6tiExHcdngxoKRgN5qInWX6F1Db+SkoBD0YCDgdLyYmKE3NMTmIm8Ir+fCquGVQZudZH9KWlJkDmbmAIBaz9RXxEdXZllPJT2A+Gr8a2uMYBY3Y/6cWdI/S3QdGq047vFFRCHGEUEZC5oFWgUt3GMFLDDeAeEcN+Gl5pjunOtKojMIvX5gLq/xq4/zCqpWZqUQ/7O1Ff18h4m+Vi0h0k2/J2sDr2Mixbvbq7Z886Z28PglS5l86HxJiMg4YraWT6nHNwsUPzVtK4FA+thAeT0g3HJPtBSyZV4C7AB1F4mRdGCCsiBsvz8nzI+GSZhVQaDZyZDDr4tfFS7AuNqQwu9cxfDlI0cv3LfTXGsUw /vBPSV63 scGH672dnRXFJeSmrc9OoUwqxk1wu1/cPUBHjNUAwCwltqzz+qU3zQQW1MpTumUiN2pgfwvPsaPidIHUfZH0N1vo3V9yJRjoLViI9g+A7GyC5tsbvGQxXyDbDyn/ufsFL3zLB5wrsoylm/iIIlT7VNPCAr0S7P3VGB+fLijthPVkQMZ20EaUmYzOOEFFLjsk0glXADKUoZKJrSRJpTBmsCUGI8RHTQdWM+csOBAMdWfqltlye5LpxQCmLBqa6452bNG8stbJS5AVaRmdFwNulmloHeqIIAR1kd7ZXzUjVLiJrUE/4QvxP5I1OJZapzFNQHuo+S8vf+18Zsp7F3kcm4Bu0rqQLCQCUoy9XNnXS/V/iyYLBjan5MCp7bfsDLg03JQmMGRjCd6svB8bLAEp4rpySAf9A2S4fh4uhbLzbRZrVeNKcPf8Axvc26ILhwN6zL1B6zhKq/pB+sBzQIrZL1p7l1a4qwEsY+bUS 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: List-Subscribe: List-Unsubscribe: mas_erase() may not deal correctly with all maple states. Make the function more robust by ensuring the state is in one of the two acceptable states. 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 0fcbfa7e9942..b6b2d7031cae 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -6161,7 +6161,7 @@ void *mas_erase(struct ma_state *mas) void *entry; MA_WR_STATE(wr_mas, mas, NULL); - if (mas_is_none(mas) || mas_is_paused(mas)) + if (!mas_is_active(mas) || !mas_is_start(mas)) mas->node = MAS_START; /* Retry unnecessary when holding the write lock. */ From patchwork Wed Nov 1 17:16:20 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: 13442925 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 50524C4332F for ; Wed, 1 Nov 2023 17:16:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E0C65900007; Wed, 1 Nov 2023 13:16:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D6DE1900006; Wed, 1 Nov 2023 13:16:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B4C89900007; Wed, 1 Nov 2023 13:16:51 -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 A4593900006 for ; Wed, 1 Nov 2023 13:16:51 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7319E140330 for ; Wed, 1 Nov 2023 17:16:51 +0000 (UTC) X-FDA: 81410040222.23.F2526E7 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf02.hostedemail.com (Postfix) with ESMTP id D851180009 for ; Wed, 1 Nov 2023 17:16:46 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=NwSo2f6A; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tWgUJ8US; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf02.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=1698859007; 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=ktpTDecE9FlsB63AOPLwZ5bzAUL9RNQcS2o96pSyoYQ=; b=kSaHrUkzvdwv87YPLSIxM32UlWqFDxDY53B9PQFtXo1cz2l4XzMiC1/4LOC0eg5VjQg9Dn Gta3+C6CLTeBkf0l0PMQKzJvxhi9IOhkC+RU3vIlsPy8FSNEvMub4P31zxFQSuPWaLaXn2 5RDhFdR8Xf3ri8V4QdDQtB9unM25JeY= ARC-Authentication-Results: i=2; imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=NwSo2f6A; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tWgUJ8US; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf02.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=1698859007; a=rsa-sha256; cv=pass; b=p3W4c0AIdFpxQnLZVe4P9/W6zrDZDV7Fyi8rUTlMn7+qMdc2cZcNTj1vbLg3w9BvuNsYaN WsAEogKiT2EBKQFaoHKrCXLH6eo6JZLHDISxL+NpiJAQqsmEzVjYpADtF+WDIOrR7pHipv ksGXw2hP8Vhl0JyGleI3vc00BMZGD5I= Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A1GYiEF004982; Wed, 1 Nov 2023 17:16:45 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=ktpTDecE9FlsB63AOPLwZ5bzAUL9RNQcS2o96pSyoYQ=; b=NwSo2f6AxF6YGSIDMM7DRZfh+nE3ekwdBrK878F6QrJNtS6Z7MfAA1LTl9KuEgGpVa5F aPmnkuFJHYbPZaf4K0u6AwlkbWQtCIOx7qgkPYwrHTSVFHos0133lR2rCXapcS2DW0B3 d2qj42i47mNQoY+ZD4V+IcMTOSmp/ifvT/K3nGL5zcqKwVthX/KXkJS/9nQIHV6OOVw2 DX/dCF/+dAuV03IjuMCYQJ+ZwtbBtBctEcDV7s2MRpfUhfb7c8CkhGmkf+7PlUILbujV Y6J0ie8wB86i1D73usf1irPsgB1bMp6YRrFsvtPANo74uix6lSV/DbVe6TjdYvve+SK/ AQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u0tuufuec-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:45 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3A1Fkqbi020283; Wed, 1 Nov 2023 17:16:44 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2040.outbound.protection.outlook.com [104.47.74.40]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3u0rr7d2he-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aTSmxZ1wezIDuQMC4YJOmia8ibsmjoVhf1flU/C4WKEYnGn6M2NJhYr9sb3XzgbsSJ0UarKjT36xpE4AT6FI93ktgYjXFA7O1NQqKVafwq5/oZlNydR31LKKFeRycl0U5cx6HCPUDAYHZ2vermAEKfFVWREeoOIwWHdV2YRCAc/EqnqbPaDdSZfy/M6RLbxFnpPvchdAb4mlKCw+nMptUvtwK+db0603+vbwQljls9Jul2BzPdCZ/TXoPuUIoaR6AiLe3c/MVkWbCWcfOOINCPVJblJ2QvRSnLqazTvRvtU4jP6/aYWciTy6oGeYrHZSmwf8TZqdG6VAysC4BUCL5Q== 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=ktpTDecE9FlsB63AOPLwZ5bzAUL9RNQcS2o96pSyoYQ=; b=cbS4bvU/CvQfpM41uH0d/mrWf/KCVxDsGyMIvpklDj5UXlAs7le7txJxY8Smme0alt+gPwhuWqRURceDjKAwfuWxdCHG+s403+QFZer/6FJCw3KWhhkriZBUMgijjQNjSg673rUet8TFZXI4AOgmMGRXXGeBWxizSzSUu6yVY9lLkntzWdX2qW8FluHbCIeUo8DQevyekKox/F5jeyJ1l67rrHzURrbzxP5KeXq3epg+S7eX+lgDpD2sGNx7VBCxSg6hLVDQG1QK4ABe8YIaR/Rcy3zTAhnutUfr7IToDLFY4x3Z3a/gRfNs0AXXk0GLGn7tZkWxnFH26mXW5V4ozw== 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=ktpTDecE9FlsB63AOPLwZ5bzAUL9RNQcS2o96pSyoYQ=; b=tWgUJ8USGKikxg5C0v4OjzwGdraTwbD0WRBSKoydV5IILcwfzDnZuJwdgfAY3G7LafHPAJaRkXc/qb76CzF5hVB/MRu9NqVcF7HqkC4NTfkHKIR/Q7IfOQGvBpTqgpsVkru8nf6tOK/wpWBGTAnUhv3+kLGAPAvGeut4wfmpT6s= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SA1PR10MB7684.namprd10.prod.outlook.com (2603:10b6:806:38e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.31; Wed, 1 Nov 2023 17:16:42 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa%4]) with mapi id 15.20.6907.025; Wed, 1 Nov 2023 17:16:41 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Liam R. Howlett" Subject: [PATCH 03/12] maple_tree: Move debug check to __mas_set_range() Date: Wed, 1 Nov 2023 13:16:20 -0400 Message-Id: <20231101171629.3612299-4-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231101171629.3612299-1-Liam.Howlett@oracle.com> References: <20231101171629.3612299-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: BN8PR03CA0026.namprd03.prod.outlook.com (2603:10b6:408:94::39) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|SA1PR10MB7684:EE_ X-MS-Office365-Filtering-Correlation-Id: b4cc36ce-a02b-474d-14f1-08dbdafe5102 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FXEZamgLMUhvIjV8YO5Qf/U4Kq4f78SXE/gmA767sdPskoyOyRmGWrgsDyCdPw75YAh+EO2yA6tUiUc9HM3BRxzzfuyXK5RHk0kliXgq8B2hwd6/P69R5MdlDzdU3MnaITlg2yfFYb/P+z0ioLG+LiGcZAqq/riIa3BOJosT4R7S46defUNKVsFsvpzPIrvg1e0FrIvqrj5GI6F8AWRx3NaeEGKU0QCS5oJ7mc48Abm/dgNIj3kxmZos5c9sez1amaUQIIERdcLzE4c09aRjiCDY1nObFUiY9Dowisfet5bCV5Z1svUDCu/CjNP+cbWlaRV1ken0gT7Jw/YBhHTsTsmkW81D1qxKuH+L1tUdpoJrSOorSm7qs+e2DMO9wDud2LW+y3e0DFmlIfwUgrNfEQ53SJsk+2OTeJPlRfHnPEkwSNQ2oGQVKZCxhLa7F4mXO27vlPzOWP1DBYVox2PL0AtiyZxEM8kI5PtU66UMYTHIUoGlm/W5hO0aeW05g6eaZ1Uz5UdY6PT8puwIXMbVSQzQ2lMhXWVsOWciX58JjO3HZgJ25ZVtW788AN3Tq623 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:(13230031)(346002)(136003)(376002)(366004)(396003)(39860400002)(230922051799003)(186009)(451199024)(1800799009)(64100799003)(6486002)(8936002)(2906002)(4326008)(30864003)(41300700001)(8676002)(5660300002)(6666004)(6506007)(66476007)(107886003)(83380400001)(1076003)(2616005)(36756003)(26005)(6512007)(38100700002)(316002)(86362001)(478600001)(66556008)(6916009)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: quMaYY/SpaQ6kUGMCKOc++jKHJoM64r3opYjjFHP3wmPj95yejkuMbJMNPlDKVKHurGEI9pS9EXlkYsQSoGJTER96f3yEEHXl6Mp6+czNMZNjyvTLz+RshHChCgmdhtq0kqmHE4TSAlbn7vG17DUsG+eleQhE00MtZHQA3Wj64Ddu2VmCZ19S2dPmadXtpjCPnEfLLUJOpb0dShIEw8qg5XuYaW15Y4nfsqFk/0CZIgpekMk3TdDbjF6wJl/ljustRhOiLNnkaZw/eS6nsA5/9KnegT0TtMm7HW931Ev6pLUtWtOQFl9U5qqqqOeOqyVmQyQf659btY84SqVymY9f1gV0l+zREwxz1fDD7ZmOFVxvdZ2zwr0LKU+SXu0yfFjAZoaCygjH9Oz1xhZTTkP1yWThjogbZtxsn62k5+1BJbnqzJoijE6rJnjSeMC77vF3q3ktAmxOeyOlZdsnyodMvLjaLkwJDnwngpFVbGAOaEM9K9ninWK9aU9IUTiXXhi8ZgqG2O883x+EvKFjlQzsyGg4+z3XWVu9t/gP4FBeA6WAB87k4BQ5l/huoXCMqDF2mSlDaq44RoDzVjOVGg+2KUtwxDhel+5NvmMW2kOD1v6hPdaHpuE4ekdzLAyEKw0AJQ5oSYu9ZC3vOcov+O/TToaIjRZzykLU97uLXVlFho01vVVYpUQ7TQbSceJkDKtsIq+2reY9PUBbUM4pk+ssEDsjVjYl/ZCxLDOAP9eCscfyf9gskVn/ROJmF0SpUYWycspq62Xm4VSJGWRhTkVCI99d9mFVp2ANNYUHGPQPIrw4SaN052iIi+FxMoxx71GMt0ljH6p8JtrXrGyHNB+DBGYvHj+XAWGuMT4hiKPxzHfELS164GEPD2qMZhvopoSDupYnNrA8NQ+FN7mv+aYgfKsdf6+093yOsj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HD8UZYGWqlx/gTKZN7+rzFYDCuGpNWbPnL6zzN8g3UDl9G0+auQ1YVr2CaJE4FmVA/1hLXNBScCM1Soor56ez1YJ6FAf8LR4TswzGaxZ8oh9Ajyxc3daSgR/+CmwcUHHD3kNyOeImm/eYolSorcdNT5TScMmo3df8dciSl0jPVeiQ9nliw7F7zu1zFdOgy6zs9i6d92Qo25hXHNP/oIMzISthFiu/mHrsoLQYqaiQNUzorbZbuSycx6/lhWCe4uRXbDVSUH+VSIe7aEUaoDwPO5b+NHk5W6fJ1k/4IbWsJmVh+Q87O8j9ICcJ5qSzpCYCvQWQJWfsjWfi6JZlh+GEv+NI3mJvLLE/VBMifkR0wRfntRMmERRYJA8biHTrZ5+sd+ZHiJq7qtuky/3F/Si8y05WqqP39tLPbC9RfXzyOOiVPAr/hY9f+IzPnsnyO4bdWvJI5zZ6xmc8RKSqqDnEqaAhMMoi6/QcOKT8I9ptOPt1+KxhxvoqHZkCT/oPEcQ3Zwiskw3jbYRRMquP9yvvf0gWy08CgC124BsV6v7i2CjhRsqaGm6HOc43AIoGgSfSaQR3Q== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b4cc36ce-a02b-474d-14f1-08dbdafe5102 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2023 17:16:41.9615 (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: CiHvr5U6cHN3f3Iu+13P5lDFA2v+EDTpqCwWXQfAyydPxFzmEyuZlp8sDd+/Ut5WZsvJAuehzYIUHwhddL8Gwg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB7684 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-01_15,2023-11-01_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 mlxscore=0 spamscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311010134 X-Proofpoint-GUID: 0pb6tihkiWLkoY-370fgnTK9Do1fCDoh X-Proofpoint-ORIG-GUID: 0pb6tihkiWLkoY-370fgnTK9Do1fCDoh X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: D851180009 X-Stat-Signature: z4xfumyggxaukho6gxend3irbibmc9db X-Rspam-User: X-HE-Tag: 1698859006-444869 X-HE-Meta: U2FsdGVkX1+RJc5TY8fY3QHMTnWRyUpnlJHJSzA8fm2EoR7D3NUApQZsRXJZBQXvcQxX7KH0k26rihOEdx79feFe4xLVoWomJ5XOynEUtMGJla6wwk9JB4GDZM8Bbm4EwHFb9g0V5X1GsKpPUTo4zzHuNgz/mt3zNuSKQwZiJemXN9ZrPngyIUfSTB3NIkD1ThcabOM8JW5zqvPhtCDrxuW8JZfwsYlAKNfXpcB42NkOxfzb43iIBa14MeOMEHujppkbvauDETJ8137JW3kC/JIO1/xfGjJUSY7/gUIsJD/NFXyE9rZMstiqwVWh/+dyfDgXHbuIiH8lEa4aGW1tFWDmXrB37qHp2uFSraVDeuweFTratP6aUwASazeL2AFjFadnJulpGW3LukTwpT8xEton3BoI16vGJK7EtDRGQikz00Mj1G2aAEgC9/P8hOT5SLSn1zDu2A9cWJmt8ZlnPyG56fBp6JRY2bjrnOtkw/VbuxYwAH7Xw/Z3QF83wHpwkgkfLMwgjGyHEb6JfaygFEjHO98Tapxx5QB+QfpOaZTh56uMmpS4dcQj87mg7uQAc358gtM2siwNxfFgUDzXSb1AErVENL4bk6/F1/nMGrR8tC03tuajHE1/oKYKR7cWdEdacIGX7HdlBEUSXtr31+djLIzmVNY9yfYEZUurrM4Fi8kk4qa/e9p3cyzj1eTgU+wHqZuhE+0PLPB7OxOVD3EfQ9Vo2ruRK0jB9nfyp7owGcO59fJIEyHCFjdkIDIgtz5yPyXVsMezxg51EZeGJfC3YCU2ruhB2THthc+1sHZQP94kdi4+I25eHqqtK0HT+Fv3kVg5Tv6VR9T34bI2VOQIpY6bI1XcmY2S05w1n2ctjyqecVkQo261fl0BKC5lmZ6WDZ5L6YFVDtJZwMsGdM41YKrZHTQ2mXy3ToYKAQtc+susJ3AvauHWL4fE38KOpdoiTkEwGOZxELyOSa1 UewZ9Soz IeH37kAmFCn1Kx0y3aWRMUwm4NaBenqcGgyGfI7DXkV9Deur+c3wYRm/E3ygiiNL2KvtamnBJJHpGzohjJubSOE9X/YFrzODabrsxVYgfUdFF4Zf1mJW1dvir+e1faH184d2Xfxoh/L5GoBzk2AKwkZydscKGj7MaPlrUaQhb1vCOi3tXvC/ktnbBHbvYDYbrZjpq7M7EI5fctxcVvFOy6mjR2MQgNULDA9XImPoWwtsOTX2Ez2GhXrwJ/RHUXObUHJupmjmCMHp58XAXpU/qxBmtjjI3qImLEI+i0dJhSZuKupeHM642AdjH7NnMrXkoyhvnmwviwT/2Zx2h+oMdEJ5DKsWF6quVcjAGXY8+oWEkFPMtFzdLs9RAjxsbiq4fvrn4kFFtD8Ej7b0ZvawXsDqU10wIDtSjgdUAmtI2VLZyLtg1xjN1GxRlsfR/qbHCZhqe6dbR0c5ghQU= 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: List-Subscribe: List-Unsubscribe: __mas_set_range() was created to shortcut resetting the maple state and a debug check was added to the caller (the vma iterator) to ensure the internal maple state remains safe to use. Move the debug check from the vma iterator into the maple tree itself so other users do not incorrectly use the advanced maple state modification. Fallout from this change include a large amount of debug setup needed to be moved to earlier in the header, and the maple_tree.h radix-tree test code needed to move the inclusion of the header to after the atomic define. None of those changes have functional changes. Signed-off-by: Liam R. Howlett --- include/linux/maple_tree.h | 255 ++++++++++---------- mm/internal.h | 2 - tools/testing/radix-tree/linux/maple_tree.h | 2 +- 3 files changed, 130 insertions(+), 129 deletions(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index d01e850b570f..82a6bf5fa969 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -550,6 +550,131 @@ static inline void mas_reset(struct ma_state *mas) */ #define mas_for_each(__mas, __entry, __max) \ while (((__entry) = mas_find((__mas), (__max))) != NULL) + +#ifdef CONFIG_DEBUG_MAPLE_TREE +enum mt_dump_format { + mt_dump_dec, + mt_dump_hex, +}; + +extern atomic_t maple_tree_tests_run; +extern atomic_t maple_tree_tests_passed; + +void mt_dump(const struct maple_tree *mt, enum mt_dump_format format); +void mas_dump(const struct ma_state *mas); +void mas_wr_dump(const struct ma_wr_state *wr_mas); +void mt_validate(struct maple_tree *mt); +void mt_cache_shrink(void); +#define MT_BUG_ON(__tree, __x) do { \ + atomic_inc(&maple_tree_tests_run); \ + if (__x) { \ + pr_info("BUG at %s:%d (%u)\n", \ + __func__, __LINE__, __x); \ + mt_dump(__tree, mt_dump_hex); \ + pr_info("Pass: %u Run:%u\n", \ + atomic_read(&maple_tree_tests_passed), \ + atomic_read(&maple_tree_tests_run)); \ + dump_stack(); \ + } else { \ + atomic_inc(&maple_tree_tests_passed); \ + } \ +} while (0) + +#define MAS_BUG_ON(__mas, __x) do { \ + atomic_inc(&maple_tree_tests_run); \ + if (__x) { \ + pr_info("BUG at %s:%d (%u)\n", \ + __func__, __LINE__, __x); \ + mas_dump(__mas); \ + mt_dump((__mas)->tree, mt_dump_hex); \ + pr_info("Pass: %u Run:%u\n", \ + atomic_read(&maple_tree_tests_passed), \ + atomic_read(&maple_tree_tests_run)); \ + dump_stack(); \ + } else { \ + atomic_inc(&maple_tree_tests_passed); \ + } \ +} while (0) + +#define MAS_WR_BUG_ON(__wrmas, __x) do { \ + atomic_inc(&maple_tree_tests_run); \ + if (__x) { \ + pr_info("BUG at %s:%d (%u)\n", \ + __func__, __LINE__, __x); \ + mas_wr_dump(__wrmas); \ + mas_dump((__wrmas)->mas); \ + mt_dump((__wrmas)->mas->tree, mt_dump_hex); \ + pr_info("Pass: %u Run:%u\n", \ + atomic_read(&maple_tree_tests_passed), \ + atomic_read(&maple_tree_tests_run)); \ + dump_stack(); \ + } else { \ + atomic_inc(&maple_tree_tests_passed); \ + } \ +} while (0) + +#define MT_WARN_ON(__tree, __x) ({ \ + int ret = !!(__x); \ + atomic_inc(&maple_tree_tests_run); \ + if (ret) { \ + pr_info("WARN at %s:%d (%u)\n", \ + __func__, __LINE__, __x); \ + mt_dump(__tree, mt_dump_hex); \ + pr_info("Pass: %u Run:%u\n", \ + atomic_read(&maple_tree_tests_passed), \ + atomic_read(&maple_tree_tests_run)); \ + dump_stack(); \ + } else { \ + atomic_inc(&maple_tree_tests_passed); \ + } \ + unlikely(ret); \ +}) + +#define MAS_WARN_ON(__mas, __x) ({ \ + int ret = !!(__x); \ + atomic_inc(&maple_tree_tests_run); \ + if (ret) { \ + pr_info("WARN at %s:%d (%u)\n", \ + __func__, __LINE__, __x); \ + mas_dump(__mas); \ + mt_dump((__mas)->tree, mt_dump_hex); \ + pr_info("Pass: %u Run:%u\n", \ + atomic_read(&maple_tree_tests_passed), \ + atomic_read(&maple_tree_tests_run)); \ + dump_stack(); \ + } else { \ + atomic_inc(&maple_tree_tests_passed); \ + } \ + unlikely(ret); \ +}) + +#define MAS_WR_WARN_ON(__wrmas, __x) ({ \ + int ret = !!(__x); \ + atomic_inc(&maple_tree_tests_run); \ + if (ret) { \ + pr_info("WARN at %s:%d (%u)\n", \ + __func__, __LINE__, __x); \ + mas_wr_dump(__wrmas); \ + mas_dump((__wrmas)->mas); \ + mt_dump((__wrmas)->mas->tree, mt_dump_hex); \ + pr_info("Pass: %u Run:%u\n", \ + atomic_read(&maple_tree_tests_passed), \ + atomic_read(&maple_tree_tests_run)); \ + dump_stack(); \ + } else { \ + atomic_inc(&maple_tree_tests_passed); \ + } \ + unlikely(ret); \ +}) +#else +#define MT_BUG_ON(__tree, __x) BUG_ON(__x) +#define MAS_BUG_ON(__mas, __x) BUG_ON(__x) +#define MAS_WR_BUG_ON(__mas, __x) BUG_ON(__x) +#define MT_WARN_ON(__tree, __x) WARN_ON(__x) +#define MAS_WARN_ON(__mas, __x) WARN_ON(__x) +#define MAS_WR_WARN_ON(__mas, __x) WARN_ON(__x) +#endif /* CONFIG_DEBUG_MAPLE_TREE */ + /** * __mas_set_range() - Set up Maple Tree operation state to a sub-range of the * current location. @@ -563,6 +688,9 @@ static inline void mas_reset(struct ma_state *mas) static inline void __mas_set_range(struct ma_state *mas, unsigned long start, unsigned long last) { + /* Ensure the range starts within the current slot */ + MAS_WARN_ON(mas, mas_is_active(mas) && + (mas->index > start || mas->last < start)); mas->index = start; mas->last = last; } @@ -580,8 +708,8 @@ static inline void __mas_set_range(struct ma_state *mas, unsigned long start, static inline void mas_set_range(struct ma_state *mas, unsigned long start, unsigned long last) { - __mas_set_range(mas, start, last); mas->node = MAS_START; + __mas_set_range(mas, start, last); } /** @@ -706,129 +834,4 @@ void *mt_next(struct maple_tree *mt, unsigned long index, unsigned long max); for (__entry = mt_find(__tree, &(__index), __max); \ __entry; __entry = mt_find_after(__tree, &(__index), __max)) - -#ifdef CONFIG_DEBUG_MAPLE_TREE -enum mt_dump_format { - mt_dump_dec, - mt_dump_hex, -}; - -extern atomic_t maple_tree_tests_run; -extern atomic_t maple_tree_tests_passed; - -void mt_dump(const struct maple_tree *mt, enum mt_dump_format format); -void mas_dump(const struct ma_state *mas); -void mas_wr_dump(const struct ma_wr_state *wr_mas); -void mt_validate(struct maple_tree *mt); -void mt_cache_shrink(void); -#define MT_BUG_ON(__tree, __x) do { \ - atomic_inc(&maple_tree_tests_run); \ - if (__x) { \ - pr_info("BUG at %s:%d (%u)\n", \ - __func__, __LINE__, __x); \ - mt_dump(__tree, mt_dump_hex); \ - pr_info("Pass: %u Run:%u\n", \ - atomic_read(&maple_tree_tests_passed), \ - atomic_read(&maple_tree_tests_run)); \ - dump_stack(); \ - } else { \ - atomic_inc(&maple_tree_tests_passed); \ - } \ -} while (0) - -#define MAS_BUG_ON(__mas, __x) do { \ - atomic_inc(&maple_tree_tests_run); \ - if (__x) { \ - pr_info("BUG at %s:%d (%u)\n", \ - __func__, __LINE__, __x); \ - mas_dump(__mas); \ - mt_dump((__mas)->tree, mt_dump_hex); \ - pr_info("Pass: %u Run:%u\n", \ - atomic_read(&maple_tree_tests_passed), \ - atomic_read(&maple_tree_tests_run)); \ - dump_stack(); \ - } else { \ - atomic_inc(&maple_tree_tests_passed); \ - } \ -} while (0) - -#define MAS_WR_BUG_ON(__wrmas, __x) do { \ - atomic_inc(&maple_tree_tests_run); \ - if (__x) { \ - pr_info("BUG at %s:%d (%u)\n", \ - __func__, __LINE__, __x); \ - mas_wr_dump(__wrmas); \ - mas_dump((__wrmas)->mas); \ - mt_dump((__wrmas)->mas->tree, mt_dump_hex); \ - pr_info("Pass: %u Run:%u\n", \ - atomic_read(&maple_tree_tests_passed), \ - atomic_read(&maple_tree_tests_run)); \ - dump_stack(); \ - } else { \ - atomic_inc(&maple_tree_tests_passed); \ - } \ -} while (0) - -#define MT_WARN_ON(__tree, __x) ({ \ - int ret = !!(__x); \ - atomic_inc(&maple_tree_tests_run); \ - if (ret) { \ - pr_info("WARN at %s:%d (%u)\n", \ - __func__, __LINE__, __x); \ - mt_dump(__tree, mt_dump_hex); \ - pr_info("Pass: %u Run:%u\n", \ - atomic_read(&maple_tree_tests_passed), \ - atomic_read(&maple_tree_tests_run)); \ - dump_stack(); \ - } else { \ - atomic_inc(&maple_tree_tests_passed); \ - } \ - unlikely(ret); \ -}) - -#define MAS_WARN_ON(__mas, __x) ({ \ - int ret = !!(__x); \ - atomic_inc(&maple_tree_tests_run); \ - if (ret) { \ - pr_info("WARN at %s:%d (%u)\n", \ - __func__, __LINE__, __x); \ - mas_dump(__mas); \ - mt_dump((__mas)->tree, mt_dump_hex); \ - pr_info("Pass: %u Run:%u\n", \ - atomic_read(&maple_tree_tests_passed), \ - atomic_read(&maple_tree_tests_run)); \ - dump_stack(); \ - } else { \ - atomic_inc(&maple_tree_tests_passed); \ - } \ - unlikely(ret); \ -}) - -#define MAS_WR_WARN_ON(__wrmas, __x) ({ \ - int ret = !!(__x); \ - atomic_inc(&maple_tree_tests_run); \ - if (ret) { \ - pr_info("WARN at %s:%d (%u)\n", \ - __func__, __LINE__, __x); \ - mas_wr_dump(__wrmas); \ - mas_dump((__wrmas)->mas); \ - mt_dump((__wrmas)->mas->tree, mt_dump_hex); \ - pr_info("Pass: %u Run:%u\n", \ - atomic_read(&maple_tree_tests_passed), \ - atomic_read(&maple_tree_tests_run)); \ - dump_stack(); \ - } else { \ - atomic_inc(&maple_tree_tests_passed); \ - } \ - unlikely(ret); \ -}) -#else -#define MT_BUG_ON(__tree, __x) BUG_ON(__x) -#define MAS_BUG_ON(__mas, __x) BUG_ON(__x) -#define MAS_WR_BUG_ON(__mas, __x) BUG_ON(__x) -#define MT_WARN_ON(__tree, __x) WARN_ON(__x) -#define MAS_WARN_ON(__mas, __x) WARN_ON(__x) -#define MAS_WR_WARN_ON(__mas, __x) WARN_ON(__x) -#endif /* CONFIG_DEBUG_MAPLE_TREE */ - #endif /*_LINUX_MAPLE_TREE_H */ diff --git a/mm/internal.h b/mm/internal.h index 30cf724ddbce..812ba03224f8 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1063,8 +1063,6 @@ static inline bool vma_soft_dirty_enabled(struct vm_area_struct *vma) static inline void vma_iter_config(struct vma_iterator *vmi, unsigned long index, unsigned long last) { - MAS_BUG_ON(&vmi->mas, vmi->mas.node != MAS_START && - (vmi->mas.index > index || vmi->mas.last < index)); __mas_set_range(&vmi->mas, index, last - 1); } diff --git a/tools/testing/radix-tree/linux/maple_tree.h b/tools/testing/radix-tree/linux/maple_tree.h index 7d8d1f445b89..06c89bdcc515 100644 --- a/tools/testing/radix-tree/linux/maple_tree.h +++ b/tools/testing/radix-tree/linux/maple_tree.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0+ */ #define atomic_t int32_t -#include "../../../../include/linux/maple_tree.h" #define atomic_inc(x) uatomic_inc(x) #define atomic_read(x) uatomic_read(x) #define atomic_set(x, y) do {} while (0) #define U8_MAX UCHAR_MAX +#include "../../../../include/linux/maple_tree.h" From patchwork Wed Nov 1 17:16:21 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: 13442929 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 41187C4332F for ; Wed, 1 Nov 2023 17:17:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A6EC590000B; Wed, 1 Nov 2023 13:16:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 99E9C900006; Wed, 1 Nov 2023 13:16:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7A31C90000B; Wed, 1 Nov 2023 13:16:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 64023900006 for ; Wed, 1 Nov 2023 13:16:59 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 417891203AE for ; Wed, 1 Nov 2023 17:16:59 +0000 (UTC) X-FDA: 81410040558.10.B6F3388 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf01.hostedemail.com (Postfix) with ESMTP id E09E640019 for ; Wed, 1 Nov 2023 17:16:55 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=efZZ+jRG; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=vSupVR1a; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf01.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698859016; 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=GppQa1H4TowesdFoPRcn8EFhDFYYl23KeTE3xWcJ3uc=; b=31hbkzEkzNEzTK3cBJyNrcDD/XlIMK8ISccOV6HeyaMuV6aDOw+UkraKbWPun+jhWQH7qE Rcgf/KGYjjWmBQZqDTHsfYVPpXiG6jWJ3gZsVe402FK2P8EXvbJakEVhWWMdLloAdmSwcV fSgpMXi4mn/Dwifm5xvdBFZmSn48WT0= ARC-Authentication-Results: i=2; imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=efZZ+jRG; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=vSupVR1a; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf01.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1698859016; a=rsa-sha256; cv=pass; b=vyfTkkRFEFpFbag/FBeKKtu3cjzgbSiJ1jEX1jwTL1gO7WtKKmroi9LP3cF44Qcx2VYVWA iWhDpXjaCqYFEmjZZxzdXMohglqNcefVlDGxwyvGz7/Pao6o/xFGd4GfAkYiQNkyUC+iMj javMqyxX34BGE1nIPN2dRoV6z8Jkdm0= Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A1GXnJB019136; Wed, 1 Nov 2023 17:16:55 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=GppQa1H4TowesdFoPRcn8EFhDFYYl23KeTE3xWcJ3uc=; b=efZZ+jRGASHXkPJwurZ/HYtSQKCdMBfdedhp/aSj+VsBqilZszgX0mSrwX8Afcq5M0kJ sTwhLtbEOxwGTgJGRCTQk2XBibpIp0gxHE+za4v5AAXLw28BCv3yo3HTg7d1Imm1FifZ ACSH7sYy+Fvi6+GUVyivP2f5NSP5JR75DuoS/d9jxBQ6+ZA8lbCaw0+yconeKfTTuL29 bAuW+qQKdXrlMjKAaVhAXCThsLMKiNTEVnMUfzLFgpug7DqHekM0sCQ9oLAWB/flVKVD edKaQkA1FzSqhulk5JQnkkwUKK8u3AZCixGzwU6gLt9PHNT5/lYqYeG3++YLI+J0bMwg 8g== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u0swtr1wp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:54 +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 3A1H5Ckf009234; Wed, 1 Nov 2023 17:16:47 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2168.outbound.protection.outlook.com [104.47.56.168]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3u14x774p5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OK4AHXw9AggqvpKvPLlEg5xs6oR6GxP8GTF965lY76D3svoe6Q2QyjJHEcQEKIUwkqKuJj3bbY+pdYI27FmwDXHrAQPegVq3WtgmQvJ9Jkf6pAneq48DLUEJBhRE8NSmKERForLdEhmR/c3PxqspWOzh3kSVhT3qPpBd95WDD+xgVhFF1qK8BF4sKK4/6ULFrZfG+CtkokDPyms2zHSKNSRgvzefrZnGG+4n/l/Gg2PETTnIow+bM9YNMxwpf1KuXoYmgYIr/z5Cw4WmXbNYFuB+vPqTcptztrtKHmyVzoWlyB0dpH2EIN1ELxXn8c94AqKeP4Z1F5+ssCD/RWc/iA== 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=GppQa1H4TowesdFoPRcn8EFhDFYYl23KeTE3xWcJ3uc=; b=Uz8PQwvK0gW7ahuR8bagpL94AhZ03888+X/02UOYfKrmRsYTPRhsctYrc1EzeWOvQzX3T5tt4PaLGWmuVHu+lwF6NW+Naqao4Nuj3Nbj8iN9jBVcjzxeO8oFyXi9w1NyolxyZBofWp3bMl9SVbMiZzoSWqnPTz2+DPG+DGaiVljo8MoxjzChQYhxYDEWHTq3rtA9EgMhI7s6jREVv+OPwE6XVM3lAp+yXOunA9mOBEyWxiyv49MsI7MC3Pm1mQOB2hpeK8/gZbb/9s3k9CWtpxvLxukHugtFkd3cFVOAvTDXCAPZ7seWdHVuJPCXCsSE+bM8QUpOV6KGlefISAB/ew== 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=GppQa1H4TowesdFoPRcn8EFhDFYYl23KeTE3xWcJ3uc=; b=vSupVR1aB5N0A95O1o6ZzWdrq+ty6niuYblzud9NVnzNr4D4653/x0SAEHhJYKUIuhlviM1E+YauRU82ZJTG3pzSYc6aLu/K4GWLlaGr6PvXKfXbvWeCNVPrGLOqRnkw/hZArjUPAgfJxS4O4e9qOes1Qg1TKXX+By+mbvo5bHA= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SA1PR10MB7684.namprd10.prod.outlook.com (2603:10b6:806:38e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.31; Wed, 1 Nov 2023 17:16:44 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa%4]) with mapi id 15.20.6907.025; Wed, 1 Nov 2023 17:16:44 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Liam R. Howlett" Subject: [PATCH 04/12] maple_tree: Add end of node tracking to the maple state Date: Wed, 1 Nov 2023 13:16:21 -0400 Message-Id: <20231101171629.3612299-5-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231101171629.3612299-1-Liam.Howlett@oracle.com> References: <20231101171629.3612299-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: BN8PR03CA0026.namprd03.prod.outlook.com (2603:10b6:408:94::39) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|SA1PR10MB7684:EE_ X-MS-Office365-Filtering-Correlation-Id: 71ed4287-7ff8-486f-ddfe-08dbdafe524f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MrDd7fmwzac8mXivfV8S16sN03O2Zwec5peKmvtWTYszXtIKsyFkCRM3XYLsspzz5V35EztuyoRZGQIp0SvqCTvtC9pMjdWfXcRedPmRJazGHR+GeqYnKnJxAVhLJPK6Acfn7EdRTyOJ7pPKJeiyMbXj1xbAic/VmXFRp/fieRPv/Jxu6gjqCp9jtyIiMdSKFdmlt2iqtNyD1e/4ENQI81eU8CdA1OJbCmDQfqQ2zzSMfEtHkh5qeifSzyJEbZRItovOE+vAbIAkWYE4Cg8eSMOVTP8/pdVA15oLl2r9OIkmGN6cMTQ7QyChUcLqwzjRXrL6vSCFmPW9I0l0GIfZ1j3yHe2mpmOeJ/S8BlP/D6ymWSg2ff/pAE5qMhdVF16elignVq0LjD2p8eVgbpykwPj2RV4S0bFprvYFyN/XZTpKzstBveNhO0CugX9b/6UP0YNDacJRDvfCUSkIxejS3+dWmidmCbb2UdAHYETcLcd+kai2+MUEeoqxMVgGKo6qK2HtQO6bCQ7Dz+gDSq+Cj6OqpwlMhD0G5xdvK7wNjWoldxCHk4JzP8DCGY534dib 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:(13230031)(346002)(136003)(376002)(366004)(396003)(39860400002)(230922051799003)(186009)(451199024)(1800799009)(64100799003)(6486002)(8936002)(2906002)(4326008)(41300700001)(8676002)(5660300002)(6666004)(6506007)(66476007)(107886003)(83380400001)(1076003)(2616005)(36756003)(26005)(6512007)(38100700002)(316002)(86362001)(478600001)(66556008)(6916009)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3DDvnOln5hNmnwKU3+A+10lx9Acr9SkUCED+92Ae6lDnq0+2gVMzqUB6WM7lYLU4UzgzdxiB2SRwIbQaGkwAbZX7EIBrItGzC26NjXW5tMt4J+pA39HaZBsgyfgtaZ8zzW5PbtUVJJQsISN6So5ajcdnLkmy+VV5BOJeVz3szg0qpXdY+BrV0pKUl15qRyAJaUN9NGJJdeczH7R7xZRNBxuRZ0LoPDmxZ3Tv7y68DNJyLAIMs3CUO1o30UOTjTIk0G71DB+mKkqyMRHzZXaAVVumfVeHBaeaQqbVeD+OghJ7mvesmPbCc4+dljjbew9ikIT271cEKFt3VKoyt8EVbe6c34f7T0C8j5j7x47ZPnvUrraQXqTZl1Zi1IRs8l5Vlnx0JE9lvQynO+bbcWmBYrdgrB035wREWWRLScjLBBqEIrWqGIRrviuPcwSNF/rVF5KUnIwY5dTmNvRBPVKXJlf9RJRr9+hXynlDVzwoP6XFiAMxnmiPvWE8gP7zCAocvTqmByrRsMjyke9ssD8wpx8Ua1MLR0BMg/npRb3nMKYAkatnPCq4zZoon51QW6S7uCWJ2T93Vm4FVnQjT/5OH3HJgUvDuekCXPWpiNcxyT2N5Z7wfryXTBN0MJcGZulATzlOz14KzDN2XZ3r1qo5rBq/tPUdjj1g0uuoYlVuTmu1jYQMt1yCtvN1J5UPzdKCRiS5azNTb54cpDu9CgcSm6mNqlf6Rw0O5/jBpQz5kfW1IZnjFVF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1o+yrqc6fvrGpW41w9ZWYkpfhAsCAkit95NM17Z4MfW2xa6NS1tLqkgBdasS8Pw3H82ZqP9t2H6IDr2CYXnzDxEuyYtTdxrfDX64Mbls2EC1T3tmW689cIFZ8Yu5zBOS4crJF+i28kadkc2mQ3ehPSUuLu8iFj5zLKuGgy9lTtVf53dXJHKkrWQLPYkfOfq4jgqcl14i6z6B3NGblIeZD91M7LF45lN+d5gg37S6OsqucrZ/kJNMjrRNFCpP7+qLIpiV1aWeIjqx6pSJ9Xhn1dPBI3LO7mbv3NUVx5WvQW1ioKc2CehuhyDhkmPMXHB+x2t+i+yn7+3J9jG8fTqsr6FngP86vT1kXZtQ8xELzg32x+ha99cJSoguy4cpJRp7xZ2yfTULf8xsVTAvx2ybkvAR2qwtwX5qjmvqH0YgwHSAjV2cQ4vu1N+4N44i01AUkUd0hb6Jkzjht/evv8nS7uUVllB6SWrAeFQLmn1Jfs1blrro4oEGgrKTSZZCFegoRBwQMNCjyd6+IZTxqnAqZ1a76z/rYutd++GFz3uSVroNXCCSUDIGg4zSSAyD6oWBPjs6EdA8X3rmaZnt3DwsWRB+4MUxjAgheUaXRzEdzwBWnR0FStnWgy2guo985ir++JjCswnQFhIK7m2mpsDC+heEjmXWS2omtewYUXkm6QSZYJuoz6IANfgdPeJTXSlCX5VM9C0bNqAzsxHZbsTE6U3WrILLhavQaF/UiKhONhMd3JHkJUg7oOH1Bg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 71ed4287-7ff8-486f-ddfe-08dbdafe524f X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2023 17:16:44.1757 (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: c2tsotqjw+udSt2YPS2WJbP+P1VNo3+C/XU2J1jnp5Q2Vmi/quRdgM8gJQ/mYFzpkVlZiJbFWHdD56AA/jOayg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB7684 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-01_15,2023-11-01_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311010134 X-Proofpoint-ORIG-GUID: -ueVWP9Ovf6FeZr49UWmsVYrr3cKZniZ X-Proofpoint-GUID: -ueVWP9Ovf6FeZr49UWmsVYrr3cKZniZ X-Rspamd-Queue-Id: E09E640019 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: 7ukiu3619hmkuyteztqnfd1cb9w7ypr6 X-HE-Tag: 1698859015-501565 X-HE-Meta: U2FsdGVkX18EgESWZFNAtK4mXy3IEIeUFPzhsQ6T+A642QpxoFBDO5iuzMMZq1Enm25CSLcd/pgdpXjDZ6F3HLsN4M2XllpNJxPjGzDYS3lAOQQwrdLR4oDLORDZvN7RVC/AgcZF2II7UG4q3UpdqO6I+TLarlqPlWn8HzPD7OSVLHm2xidCrKKrg4zb7futrkFM+Fiy22StD+jOOcdeBi6VsAIgu+f+kGi7oV01rNccsrc06Rw9xDJifQKpgjCPa8fg4c8p40fNvsqDiVnOeqEQfqkzTAH7p7dYpjT76rGgYg/o0BQ52FWaGbbGcsRYdg3ATUsA7W+i8Q71MfXwkYv7Vk/9ScizJNDsuEojHuFQKZg+vjj7KXa8hBMi81fZL7b8qEdROwsUUs3zQHJGw97VQL5BXZIKFAC3vNDKCC3VjOP0a1NR5u/YPklGY2sz2lFg8cNfrXC3Ex2TVYH5uLMmJKE5ans6sqyjM0BU3K/kR82q2N2DGUiL1tJstWbp+3UUvnl/jdkzruPlyhLouhRbv8sC6X44DGiZIJuoFrqjP0WVYG5ofFMQaBvMKnU3d6si0Oqa7f/2SFPSjCxe4BRv3vwkzO2X8rs5b1LD9fAEPzgNv2AsD5YAZEKus/d+f+qtU9TnayNFZr8fS8T8szxgZLx1mKiLJW6N3IEt+Xh2AIoxDh+3EQccN++EqVx0b+IZP2BhHn/H2GnJdNMxSPMGn0J2ylbFYFqF+nbwk+jjamoaBi9Gi9Ncv2MvYsc23O0Hf5OM0FMnD+f4/eiwT4BA00tPt2ELMt05kUwQtkNjhg+WQ4gTqHnrTr2uoNrrtnsmmx0rip/EiNoceAOtJtFouT39k1x0dQa1V+AkxUHjfq22pwRZquYuUtIQfsIzYUmCMhJpt/fLFME9mfbPG0xUXPPcxyzOR0vggOZfOQdAKamx96ProfDovK61ahl9luDh3EO3s/5q8M3TA8K n3q9BGt3 JHwbENGEO8JXPBeQSMyaeeo8gGB/qdikV9wx9znBWSI4arOrePKauVazaiXynYOA/YLqFuXt9FvJ1KSNG7b1OhUJ7tR2+QyeBUvn7M2x4MMC2i+gRNGT/A9pDRlyFcrVp1Q6rDqrc8MIUnbaNngMc+ufy9fpA81yPhsH5EdnW324CpsdWUqQw5j832me5fEiTcU7dJgu+TG9YxGELExkjCcA+eL++5gqJTL9ffCnWgVQok7MfClSbvcLqFGOBWhXxGms7aOyzCJhK2fABHyeOFdvIJmpGaNdaCI80s0YE246d4L6zBn7ggJSau64M14Z+1IBWJLQgPjtWDCdDFRu27YE4533ZB8PYWTlEl9uw/XH8FxCV1U7NKHhEitI4aESVvDELCf6DHZZhNy9M+g1bqjowF1b/lWTaxkLdOdezucIvJNNpWJPcQjTwjcgp+uCOLlI4TQfaW4T1PBI= 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: List-Subscribe: List-Unsubscribe: Analysis of the mas_for_each() iteration showed that there is a significant time spent finding the end of a node. This time can be greatly reduced if the end of the node is cached in the maple state. Care must be taken to update & invalidate as necessary. Signed-off-by: Liam R. Howlett --- include/linux/maple_tree.h | 1 + lib/maple_tree.c | 7 +++++++ tools/testing/radix-tree/maple.c | 1 + 3 files changed, 9 insertions(+) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index 82a6bf5fa969..97a6adedb376 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -388,6 +388,7 @@ struct ma_state { unsigned char depth; /* depth of tree descent during write */ unsigned char offset; unsigned char mas_flags; + unsigned char end; /* The end of the node */ }; struct ma_wr_state { diff --git a/lib/maple_tree.c b/lib/maple_tree.c index b6b2d7031cae..6634594c770a 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2829,6 +2829,7 @@ static inline void *mtree_range_walk(struct ma_state *mas) goto dead_node; } while (!ma_is_leaf(type)); + mas->end = end; mas->offset = offset; mas->index = min; mas->last = max; @@ -3495,6 +3496,7 @@ static noinline_for_kasan int mas_commit_b_node(struct ma_wr_state *wr_mas, mas_replace_node(wr_mas->mas, old_enode); reuse_node: mas_update_gap(wr_mas->mas); + wr_mas->mas->end = b_end; return 1; } @@ -3998,6 +4000,7 @@ static inline bool mas_wr_node_store(struct ma_wr_state *wr_mas, } trace_ma_write(__func__, mas, 0, wr_mas->entry); mas_update_gap(mas); + mas->end = new_end; return true; } @@ -4178,6 +4181,7 @@ static inline bool mas_wr_append(struct ma_wr_state *wr_mas, if (!wr_mas->content || !wr_mas->entry) mas_update_gap(mas); + mas->end = new_end; trace_ma_write(__func__, mas, new_end, wr_mas->entry); return true; } @@ -4416,6 +4420,7 @@ static inline int mas_prev_node(struct ma_state *mas, unsigned long min) if (unlikely(mte_dead_node(mas->node))) return 1; + mas->end = mas->offset; return 0; no_entry: @@ -5062,6 +5067,7 @@ int mas_empty_area(struct ma_state *mas, unsigned long min, if (mas->index < min) mas->index = min; mas->last = mas->index + size - 1; + mas->end = mas_data_end(mas); return 0; } EXPORT_SYMBOL_GPL(mas_empty_area); @@ -5122,6 +5128,7 @@ int mas_empty_area_rev(struct ma_state *mas, unsigned long min, mas->last = max; mas->index = mas->last - size + 1; + mas->end = mas_data_end(mas); return 0; } EXPORT_SYMBOL_GPL(mas_empty_area_rev); diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index e5da1cad70ba..cb4e4a7cc7f5 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -945,6 +945,7 @@ static inline bool mas_tree_walk(struct ma_state *mas, unsigned long *range_min, goto retry; } + mas->end = mas_data_end(mas); return ret; not_found: From patchwork Wed Nov 1 17:16:22 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: 13442926 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 ADD3AC4167B for ; Wed, 1 Nov 2023 17:16:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3F9AA900008; Wed, 1 Nov 2023 13:16:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 35B0A900006; Wed, 1 Nov 2023 13:16:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 160BB900008; Wed, 1 Nov 2023 13:16:53 -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 07667900006 for ; Wed, 1 Nov 2023 13:16:53 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id DAE97808FF for ; Wed, 1 Nov 2023 17:16:52 +0000 (UTC) X-FDA: 81410040264.07.905B403 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf29.hostedemail.com (Postfix) with ESMTP id 83F1112002B for ; Wed, 1 Nov 2023 17:16:49 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=K9y7BguL; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=g7fKOE7b; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf29.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=1698859009; 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=ZdX1fiC+1NdK24ymn8z7XPYiVF/UCpV2tVDYA6xfIto=; b=i5YqkKEh4R0gQcJFIw8NxE8XOq64+5gAARN1tmbIhuQ1Wj054gkW2hz86zr/B5pBbHSFfe DbXGUTohmP4WMxXn0OWExosOTRIpa+8MDW+kt36ZPLtDxk5XN69X+7Rg09LIWbl6YjCaKp begZVeNm8uRkeM3Enj3lXPbonZg8BtM= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1698859009; a=rsa-sha256; cv=pass; b=3NzIJQM5QOPNtD8Ch2Mh4oR6oWTFOvnc+3B2d+J4Uqz3RQBriakT3OE+tp1Lhy1qe6yyKz Th1QJOCp7gie0TjK4t92eRTT3ERXafThbqAUKSK7JHcZv1e1mIKIOUO6gAYJGA7b0HOPRR LFdpg+UPbb3gBzAIh9r7p/EJ1GpNKHA= ARC-Authentication-Results: i=2; imf29.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=K9y7BguL; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=g7fKOE7b; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf29.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 3A1GXuud011814; Wed, 1 Nov 2023 17:16:48 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=ZdX1fiC+1NdK24ymn8z7XPYiVF/UCpV2tVDYA6xfIto=; b=K9y7BguLRYf34FIlFl0ACzpwqi9cDKA8BYISk/Gf6eAF3vHKMnUDK1BuPgVpA4s5Po39 qqvp+nzhfhB4fM8XLne0zD+UK4jxz81E07DYAimYmA4rId5YMH9qczNsGUaZqMOrHh8j pTxSa7ZmwEU1ZvsdsDeuvY37DXJgIul53vGnVGm2BxK9NRSsrarXHNVhEFwnJOhwInvM M0i1bv6BCxGZK8akmyMVlabadcPOV9fEvje98LdzHwurSRUKNF/moSSU+KzWTruB1hPS 8LZjW05yrlcHYKKUByoeAFbWc4BLllhGMpNKb0N9Ch5dKZMl/7tv+JwkQPsvfSJFEPXk wA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u0s34044s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:48 +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 3A1H5Ckg009234; Wed, 1 Nov 2023 17:16:47 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2168.outbound.protection.outlook.com [104.47.56.168]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3u14x774p5-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M7fOPkDASTfcIWU9UTZkBkoP5sS5t18Z7nKIgxD1KDhHaiLf2Ws1ag2d1d2caCNBgDuCvog0EaG+ciL8bEnY2OMRvggWf1ByvyFykSuVbNtdonPCKIH8P5eM4r/KcbSQ44MEgXPCJQUE7G3DzXgB/kgq8pcfd+B3t1heiMqshNQ7329BikLuAaE7gu7rX7+vj3ydifgJhwxg5VerDngpthctqFfRiEZm+I7oRNy/MAHDXIMtJ3LCAtlSXFdMketZg6CaMlcaGp2mB6gKYr+b161UdQdri8ThV5gInpiJ9A8zQBKYQQNwDyREezsGA2tMkgY+7i4/3F/2iAWp28QdGg== 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=ZdX1fiC+1NdK24ymn8z7XPYiVF/UCpV2tVDYA6xfIto=; b=N+HQUiVWYPAstSDF5Fv0T2nd1o2Fuq+U2zTNBJdxlKfeTtgHzVkPKPlEGwAkuz6nHPAjoEGQSriigH/hGjDgn0VmzushpRTvIG0/MbyVzdhawyTNqTV2u+YeEXvGx3FpFoYNc5r4kfdoThOZCFCOL8ZyIK3rCCRa8QmHQUqqMlvhAoVO68a1UI4giIKWIZ1/2YUbfDuPmpkHfrfFODMRhdYJ1+YQghAhYdrGfkfgL0r48uS1JaNfjRHbNOO8YjNPHsE3zd7isW/pXhYEPZMUaDIzII4vmBq6ziablCrM3CZXpgHzSA9VVbvvAHhoWQUdmGxgJkgx9+Ie8LSWxnjxng== 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=ZdX1fiC+1NdK24ymn8z7XPYiVF/UCpV2tVDYA6xfIto=; b=g7fKOE7bqoPYD4ITPQWae9Z9heMpt1Nw1zcMgiC8MwgLhGAdkFsoRrf9lqqJMc5VKYbvD8wjS29BK7yrMhKgr6aRWvwKODdmNJ6QgnSpVvUwokI8aSdWwFXFPJLm6qEkMJFyOnDcQjos6764PMgR8CJRimAv05Nn5ZD/aZLHNPk= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SA1PR10MB7684.namprd10.prod.outlook.com (2603:10b6:806:38e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.31; Wed, 1 Nov 2023 17:16:45 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa%4]) with mapi id 15.20.6907.025; Wed, 1 Nov 2023 17:16:45 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Liam R. Howlett" Subject: [PATCH 05/12] maple_tree: Use cached node end in mas_next() Date: Wed, 1 Nov 2023 13:16:22 -0400 Message-Id: <20231101171629.3612299-6-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231101171629.3612299-1-Liam.Howlett@oracle.com> References: <20231101171629.3612299-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: BN9PR03CA0392.namprd03.prod.outlook.com (2603:10b6:408:111::7) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|SA1PR10MB7684:EE_ X-MS-Office365-Filtering-Correlation-Id: c94c6aab-21f4-4c57-4930-08dbdafe533e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ym4aotpP6DWrCOOgPuQYgI957Xd/wFni7oC14PZ2HkZB01vOnUR+qYZaWwYcfW1CWWgjk1Fpn+7WIh73ZdMxolQgStMngqeobzUW3bLVbojndVkYmvvhmaaYzIUX4bOn1Z0iqRjMO6jKLMWpvB1OD1qO8I1a3NpoL6KBfskUq/HGTEydmKtaydRvy41+ADpGt2QMP6r/shJVds+WJj/jXt7O4grQecaVr977e+qYjMCMLkOHvpZTm0l7K4J+LmG52K3JGDKzSHQ8wDIQtj7dvYwjvefp8wAqeGG0gk1hmlmSwhPGisqssmboEEBbjNdQtLJS042RHy8BdwldMAFnbEO58kxJQxL0hCnml5rrCGg8iT1PHqKR2fzPL56lqz40MH1lJRlMP4g+zBWpgqs2gq6nUdYRy1jVBeBmTFNuJ4GWDOJ3/FT1ReHnkmXqD0WekpfEF0U8sarTiO1jFqlNMW/3WnUnTj9ayenI6L/NLZXOZQMTYui8qq8OrkzKaXsKHrNXV9XdPjL4pZWYpzObrPI1XSGoGyKDorvdW2gjE0Khfb28OrljJDjCjBx5OhN+ 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:(13230031)(346002)(136003)(376002)(366004)(396003)(39860400002)(230922051799003)(186009)(451199024)(1800799009)(64100799003)(6486002)(8936002)(2906002)(4326008)(41300700001)(8676002)(5660300002)(6666004)(6506007)(66476007)(107886003)(83380400001)(1076003)(2616005)(36756003)(26005)(6512007)(38100700002)(316002)(86362001)(478600001)(66556008)(6916009)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Eu/Kulx13QZCHna/ZocWqr+/wOIjyO7FKtpRu31+70h0SQkdkliRb9CXRXmkZdltzc28Bs7WYYpKVvSTwHF12QMOsPB2yGMDRPzSW6aBDiAz/6CFWzZcDYCN7RJOOBjDJDLZpju5sjUbqpWmIoJsvkKgU45FTASaKxxKyoIWeBMh5EU301byydia5JXkUR1pOpraLGxa4wOLCVemtVyDVCQnAAyiyN1GWXqrCWtGAe4p/f4FWp52JpC0qcmoOWTbumvAT127oi2tsCQdv6OnNS4xnYmlv7MKqrTpLLUKVT8tRR5QwxvbEr7VLVs5PwLRNd5BBgaxSCRgLmsY8oGCOxAJzl85i1YVpvaBHSmI7syEzT31z53T97JUrOsrnimrF70flET6ToLs4BPkkcxUNi47XStHSFMPgkBNFnFl1/QeN+8Wq24SACgbQButQLCr+8t9lX1usbrXMWhdi66Snrkfp2qHWiM43dQzpdbJdK18gYo1H2sUHsd7SSa1a0tqU0+GDrpat1I//or0JbXyTw/PHcUl2cNkOwPD2sHKKVM7aHIC7Yc6RuQXt4KGMScS808bQW0RIv+mphUZZgaIyxm+fQ2rxWuqAmlnc5BavKg+mn/nq5V3DFi9ybJN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TK4ie2UN5QUuEVeO4RuUtoJyyft4rkXkTOEWIQ+qL6bCRrNBxPkXuszNmhYDrTZi/sMvFHDTPAjt1BRtLwPdOZlh3B3Lsr6V9L6/oP//5oA60Q9Ex9G2DRb5fManz22xeMAvtXyk+BY0iTNvmFNMxbTu0DTPMQw5NTIWyrUvlNSNBKqF+wXRK1/FbZzbw06PCPaOgN+Q+XQUpuY9hyk1YhhYDZVNdQ+O+T5obdK8NWofg8spB+T8q9mBf0HXq9wXOoiSWvdXS/8LIADm3+A+kpq2WXj8gDvAzWkbN9HmLyUEvQXfIf+9UExyhFsAbGlhIAUDp7YP3f/LdU5R8DotMRuIJuE6ycUH76sn2XYi/iopqm1EDfx5vYlFFwtZd4iRMdvUaKT44X0yMrCIBZuc7bYYiODHW/9qAx9cnm2nHpG0BR4kSA7mSz5b+6iDItoBAMxW2TE5ekSs5uwJdN0gYmFF5D2H6H26L5gZbhekJYw5mnNhjl/jlP00mXlBZj6akN+v5C3gkrUi5MgcoZ55lJMUTVfff4MqImLDTNR23LWx+e01ZzrvvBdBuf9tqsXXEI6+rdEdqtffHr/l81+gsfbrjpRP4PjiOAzMBHEtaa4A7UbMazRjQ4AnwPnL4hc9FDqm/aUfoFYsUN3IpWv2Bp/RmqEhkDaegu3FHnI7ajPG7cua5ghc4fXi0tPtZvh09DqVH2tHSeK96oBrBIYt5mbx8P1bMrMOkqURH/hj4TadIo+xqpoC4972GJPm/Dl7brLgPY+9VZaf4sq2kAsjtXacRLHaB1m02C58UFITMK8NCKmOi75bZA+JgW+WLGl6nhJeIhbXX4+UKkWjlZC5VENn3ohfKoc6wK3iWC8eAIp5ZN8ZD1/7GL2r75O2SdbJkRBPmaXMK5f7e2A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c94c6aab-21f4-4c57-4930-08dbdafe533e X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2023 17:16:45.6887 (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: bSKPAcg4SdN3Lz+AFJB9B+KwjsTN7BC8hRzUdA9u8hI9Aaf7js09m4uWg8mxSjOdAWujRwuP4h9Hgvp2t44cjQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB7684 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-01_15,2023-11-01_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311010134 X-Proofpoint-GUID: LYREdPvwMBxsH7qpOZXLM-2NRLbw3hzV X-Proofpoint-ORIG-GUID: LYREdPvwMBxsH7qpOZXLM-2NRLbw3hzV X-Stat-Signature: eebuig7amuz7r74goc1zfrcwdj9z3dfe X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 83F1112002B X-Rspam-User: X-HE-Tag: 1698859009-955318 X-HE-Meta: U2FsdGVkX19ko+VpX69ef+5MxwEolSHibUBPaDeXhkCbvBbCaDndZwDTFZXMl9pIZQL/40oaNKi6CwADUpCXxDQdFzcLFIjkXby2kxd4oPQd+P1c3L3uALt17HDjsQfPayLWZGawv4R8C0YfCh237GBPG52oAgxmWWopkJ+zTOmiHsvpil6lSh6J9Zjc7FrINbTj0lX+KahoPkPJc6wAPIFiYTFDkx2rvO8da+nrI4V+uXF/ameOlzZdH9jYDTh4m7Lddr0b1V11DrXeg6MtZouSMOLTXC7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mouM/zlaWPfTg818VbgpaAruySJE458qd4VEhvqWjfHZJFjEdX8No+SUQV01v1JJc0QNG+9/+GzWlCB/EyqxzLPLbryWMh4mau8QgMJXT2Szrta5OkX27haLX20VN5hAJK6FkC8uhriw== 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: List-Subscribe: List-Unsubscribe: When looking for the next entry, don't recalculate the node end as it is now tracked in the maple state. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 6634594c770a..6c0ed71844e6 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4527,6 +4527,7 @@ static inline int mas_next_node(struct ma_state *mas, struct maple_node *node, unsigned long min; unsigned long *pivots; struct maple_enode *enode; + struct maple_node *tmp; int level = 0; unsigned char node_end; enum maple_type mt; @@ -4579,6 +4580,10 @@ static inline int mas_next_node(struct ma_state *mas, struct maple_node *node, pivots = ma_pivots(node, mt); mas->max = mas_safe_pivot(mas, pivots, mas->offset, mt); + tmp = mte_to_node(enode); + mt = mte_node_type(enode); + pivots = ma_pivots(tmp, mt); + mas->end = ma_data_end(tmp, mt, pivots, mas->max); if (unlikely(ma_dead_node(node))) return 1; @@ -4613,7 +4618,6 @@ static void *mas_next_slot(struct ma_state *mas, unsigned long max, bool empty, unsigned long pivot; enum maple_type type; struct maple_node *node; - unsigned char data_end; unsigned long save_point = mas->last; void *entry; @@ -4621,12 +4625,11 @@ static void *mas_next_slot(struct ma_state *mas, unsigned long max, bool empty, node = mas_mn(mas); type = mte_node_type(mas->node); pivots = ma_pivots(node, type); - data_end = ma_data_end(node, type, pivots, mas->max); if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) goto retry; if (mas->max >= max) { - if (likely(mas->offset < data_end)) + if (likely(mas->offset < mas->end)) pivot = pivots[mas->offset]; else goto overflow; @@ -4638,11 +4641,11 @@ static void *mas_next_slot(struct ma_state *mas, unsigned long max, bool empty, goto overflow; } - if (likely(mas->offset < data_end)) { + if (likely(mas->offset < mas->end)) { mas->index = pivots[mas->offset] + 1; again: mas->offset++; - if (likely(mas->offset < data_end)) + if (likely(mas->offset < mas->end)) mas->last = pivots[mas->offset]; else mas->last = mas->max; @@ -4679,7 +4682,6 @@ static void *mas_next_slot(struct ma_state *mas, unsigned long max, bool empty, goto overflow; mas->index = mas->last + 1; - /* Node cannot end on NULL, so it's safe to short-cut here */ goto again; } From patchwork Wed Nov 1 17:16:23 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: 13442927 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 32931C4332F for ; Wed, 1 Nov 2023 17:16:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 02A72900009; Wed, 1 Nov 2023 13:16:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EF4D6900006; Wed, 1 Nov 2023 13:16:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D234C900009; Wed, 1 Nov 2023 13:16:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id BFE30900006 for ; Wed, 1 Nov 2023 13:16:55 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id A28F5A054B for ; Wed, 1 Nov 2023 17:16:55 +0000 (UTC) X-FDA: 81410040390.29.B3C46DD Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf16.hostedemail.com (Postfix) with ESMTP id 31164180024 for ; Wed, 1 Nov 2023 17:16:51 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=1TX0YGJ1; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=f5r6XDo2; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf16.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=1698859012; 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=PGGPZkBfMPqaWIX7oee9bFsdlqDpITkuaeredf/Tkiw=; b=m43GiEn4t4egC5SgkxEFpnlStdBcXdcwZ5ibN6zjdGKjWsk+hr2zgRX55NYbIcRHMvSjUK eyzUXvqSMpP5OM0dzC9hujOkObHuqPWnIpLc3Gr+vyVvYqRn1QlW3nz/qUe4h93NxzJl/Z gMPcIfN91yDjJuw975AQLnJ7zUpKAPA= ARC-Authentication-Results: i=2; imf16.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=1TX0YGJ1; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=f5r6XDo2; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf16.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=1698859012; a=rsa-sha256; cv=pass; b=gEp2nSh76k4H8aEa2IpKdCmhe0EVhuP0D27iGl963ED6gwRMfu12qeYKQVtjLfFGBkTeiH +WDTEJZeQG4MXcKqcLuPuoYr8bQ+Uo23DMSkMQmfO5kaReqsD3UdTHb6WQ2wDs+f085hql Hw1T4DF8NflNYPF11oGEkpFB14Q+roQ= 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 3A1GYns2011163; Wed, 1 Nov 2023 17:16:51 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=PGGPZkBfMPqaWIX7oee9bFsdlqDpITkuaeredf/Tkiw=; b=1TX0YGJ19cS9gAV7JLeK8O+ojrKh3obyy9HNvbYh+UXY0fnFG8LmfNVPAAaa424q5l6W GluZ0tDpsFjNMm7dJGLUntrPOY6g5nqMeTLTyelzkail+vAUCbuijuupCuIOyBEzjFhM fBe9y71kpdNjWiEp9OWO+9DmTxvnNeFEFyhfZSEO7BW0K+oKcVaeUrzjJdTw+CfqA0kC /SuBE/YafHDpq1OcpXo2MUYUJDuwpvgN3hPkSdPhCxgEmXDBPTrvy2esA4ePvoRraNSh KPGd96MOqUhYBI5V1bmjmemnAnJ5sfokFw9/AUqtnLAB7uFg48ZfLp6cXyaYmp1Mj000 yg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u0s7byxsr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:50 +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 3A1GcOVj009098; Wed, 1 Nov 2023 17:16:49 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2041.outbound.protection.outlook.com [104.47.74.41]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3u14x774r4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CRjH4H0MQXlYfz6KiwezedaHElh5eyhkHhRmQzEoXP3/WdBLjLqZp0AVZamE2aHsjLxm3Lkcp0ekgw1dYuBMAFpEdph6GSvQ9aXoh86iFTWGQ2WgLbOsgw4ouwvR+CJItbbTA5XqF6q9Uz6fhGiHQIKjNqHaodtwZAP3hB9Ir9NITjbO19y5VwJg4sBdip7qMSW5MkszqFBAZafBh9OpMQePq8RCkbXLx1TpijJlwmsxxPtgAvynGNLuhZvMJM3ulbXCsY/gO0AjziUBn6k3IDk6aJ5NyUsuIGNStz06E55gqNLry8vHJhXfH+vx1zrFd92k4HvOH9cnLGYikWTUdg== 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=PGGPZkBfMPqaWIX7oee9bFsdlqDpITkuaeredf/Tkiw=; b=aPLPaFkPnnZ26QFd4WS6s7fiET3Xwm4aLiVUn8DVzOOldH4YYrg2WvuOc/HIN0v6XaYAnmfJ7Q4jfwdSwozYR7fU1fSS7GJeV103kCDxlwgX4MXeC5nuG1QqwHBGNTOnhczvjULZTawQn9LcAsDrGS+krOzsJbftYB+roDgXoMHAJvMphuhrsTboW+9N9Jwqfc/5OwHgrXzd1dtprvo21p8/m/fWMCTQHXHzdzNQw7h8thbLB3AzgZt+DK59z5rfp468B+KfGML71W4eZeymzXGsmopAjsgn02RbeGu1w8OLbt6V53d9qK0NapMHbtsQDPLo4FtGlfsYljOqACjhzw== 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=PGGPZkBfMPqaWIX7oee9bFsdlqDpITkuaeredf/Tkiw=; b=f5r6XDo2J0hyyQHK5eKe6yK15OjZr01HqY3c/TIDVLzYd8nH4WWhHIlHIRZ7094op8WXtAsCGJHJIYMGgwBIikajay0NinTQz0Mo3B6JTUP1TjZ64fSSdP46rYilQ2CbsXE3Xj9tb6Sz0DHxASEByjkxr7YBv9XRY/wRZ/uOK/A= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SA1PR10MB7684.namprd10.prod.outlook.com (2603:10b6:806:38e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.31; Wed, 1 Nov 2023 17:16:47 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa%4]) with mapi id 15.20.6907.025; Wed, 1 Nov 2023 17:16:47 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Liam R. Howlett" Subject: [PATCH 06/12] maple_tree: Use cached node end in mas_destroy() Date: Wed, 1 Nov 2023 13:16:23 -0400 Message-Id: <20231101171629.3612299-7-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231101171629.3612299-1-Liam.Howlett@oracle.com> References: <20231101171629.3612299-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: BN0PR04CA0079.namprd04.prod.outlook.com (2603:10b6:408:ea::24) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|SA1PR10MB7684:EE_ X-MS-Office365-Filtering-Correlation-Id: dc0e28b0-6446-476e-13fd-08dbdafe546d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nq8A6KRba6T69BpOqoX+hlTilwNVkkhr0lCCHwr8NtB3w2OtQ21gofI8Bwur5sJYNHA1ckNfvYWBKDOB408UrAPQdPTLijrx8D1kaH78IVne5F//XWf1JAa7JCzuoJvXqKc5wkD8yopBcJbwl6JqQ7mEKYN/wBq1t+w8pHog5Me9Epyl2oc8i0ZncIiNOCX8yLzEabgTeqD0rkHhN6HyF1ZFd5OTR7I1ddvR7Iv5RP8dMcVVpu13wW0r6hW3K2+kaRzFq22dRqJs3tm8m2+z/IivDruszqNXHClDzXzhaQCLZWIeLByce/+aNxEsZ9xaF/HsrD9hebZLmSPX2QAut2F7cu72OZxQ6vLvc16+3+PSKMZj+naUk7I1ouk4gVLoD1gBoGENvjuFxE8jk26x203X7GXMQf1TZo9KWLsQWPwc9upaq2lrNrJVYarwjA80NFiRPrdyWHWVkSaYRNnHX9rt9MvOLWKmOxs4zsJhrjoLGwXIhz1NL6R1QdoJ2WtrmwzN3uSiuVlf5OjwwlXlzlDdSMLfZFiAmz+G6CM3OWTmKmpQRdESmSnWTgUGESz4 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:(13230031)(346002)(136003)(376002)(366004)(396003)(39860400002)(230922051799003)(186009)(451199024)(1800799009)(64100799003)(6486002)(8936002)(2906002)(4326008)(41300700001)(4744005)(8676002)(5660300002)(6666004)(6506007)(66476007)(107886003)(83380400001)(1076003)(2616005)(36756003)(26005)(6512007)(38100700002)(316002)(86362001)(478600001)(66556008)(6916009)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BQzenmx95BFYs975kRJa1uM6niclkXNjMHRC8gvCJRyRtB50OoE7Or5iI19GQhM8MOI2KXt2tA7BOoBtYCoTPduCC5Ei304aY0A4UFOmlilneYHOrpNwLWSrrNJkjP1HfqI8eR0+njj0bCDM5X9e7uxfQJx0c3QC5+IpfERbVIbe/xZUllev1z6XGdhDwhQO8V1fEn+qhk6Slc/J5lTahcYwgvdAtZUC5hKWwkK2U4YqG4j0zxVvZICQ2LY9/xjksXnj9+A3QvEDWrdQXe+yg8VNLf6IMwC0b1PBBJrFDL1KC8Ge6qYn4EqFQeihyDPN/rMA4h06z4/juvVMF0Ogz3sKTnxquL+XpAFxnuiT7aF/nh/lftQlsBHg1C635UKEptxhnnBScu2M+MWYFJIwjDE5tCvWZ/ktqSoc/v1imgqFjkxB+j14HZnIr97+0LGTJ75dL0hGXbRbXjct5zs+J/UlRVghuA5ZtRTW/D/CM62ASOFsZgX+Tv9yZCPpKLt43/z5Rl4fMEjdW4Q+7rW2LVlQ1UzUH47suQq07OXhdVBYmAY8gY2RcvKNZOS7hrfd/l4WaLGD5X5Y/XwHXKuoAQ+rnyZ9TMqkP+GGJoZ0PIByr9dDbGCJud7iJmDfKong5//eNGdSaQmzh84NvA+yLuCKdZ+SUe38/9d7RrWUYERFMXXfldCcgs8wPaLv9R+O8PpTdC3iWkQjJmauG3z3PcVx3BGS+Nph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MpK8R5CW2zwxUrk8CzR+m2sSZ64vAXHcGxCcJYbb+qArOgR43p7IBT4rraKkcPWLM8hzq1Sl8IuvRB8qNcZEJtrJOG+ZAW5M15W38UKZIaRBiCFqmhThESE4fMhNNZy+RaIjD1Vhb/0jDHuJPf6pzwN52CkNhWrta9/Xz0pit9THiejfJW8g5nEiqTUO5rYlgv9AH/7Q2qMV35QekOYGECpEyoG/UDP0yoSEwFcU7wjmrUHdYoE94/NmoEN3lZrDgBnbECuIId2dwZ+beASqw6U9FYxOBFl6bOfudTCdAArdqCrT8pQHy0NP5Bj2Hi6RN6RPQ5L9H9zr+CdfLUt7hstDGp1ucvhitc6jySeriohlJRXDUITIYLLlSaccYjkhvi12NG+sI5lEWoGb95QMZUjPXEtf+2agnQDmobvJhYNBbIfy0lGqWFzApMuuy3PfOuf3XkqulCcOP8sRB1m00GnFmicMUr41n1vK7drV6UfQiSTrvg+IURWRDlBF8Axkge9jXmDRkAE8UfE60vEiJcUaja7sIYJBQRu8XnzVra5/rWKuPZvi76IRksdE3zuWM66+DUZvR6gOm5N6kEI7/vkrFu1q3TzV+HYuDZ6CFAKPaxwyO4bTtQ3tv3fR15c1qyE3LYnom6PsWyNwwL55GQrSwTpgYiKLBBS0glSR2sd1YXbZY8g+Q7T6Z5In6EwdzotAjyioqPbiQo51MAqdi/3vQII+kr3z8UapUSNupu7orRc6UO8sfJYrYL7bRcrwZWH5VU4hsiojULKlEHuX3Qdg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc0e28b0-6446-476e-13fd-08dbdafe546d X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2023 17:16:47.6930 (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: O830QPufJ3oZTCM+dMM/AxhvmZFurR/nQTrQ8UaYFlBRiSMDiyvLNkoPwA7D1PJ4rvlkwsHOqS2q4GHW2w+EUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB7684 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-01_15,2023-11-01_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311010134 X-Proofpoint-GUID: ilc13ZvevpcGSjdUY-FN-7EzN-sd1Hlq X-Proofpoint-ORIG-GUID: ilc13ZvevpcGSjdUY-FN-7EzN-sd1Hlq X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 31164180024 X-Stat-Signature: gfgqoqjc7z7osd31jcr1wuowyspjuyrb X-Rspam-User: X-HE-Tag: 1698859011-536197 X-HE-Meta: U2FsdGVkX1+mn4yRio5MrAEB6VOGzpysdggM12S4NqQuudeEpY2BNHybaM6g8WQ2/zsNRvonQkaT/mfIih5X87zuV5WC8U/mDRN4mwemGSYtni/kyBEnKx2Ja5LOUPkXZssIgkdlB5SjvqadI+K2JcpnpvkKhPMjKgY2ljTyMeATHa1G5t+SaYXYROqLYUUSJ0uGGDDU+kftDoVXs6Xn9SzCF0h4M8SIg5loEWpDylZB5/f0kCDXgveOVNFlUr48bJfEiyWK+K5cyo811BNfWRfuS7L7OXZNWnAQnaQHrNvHBYUYOYjlXah/S5v7NWfDZ3nQTV7/5/LnPO/HdCbAyOTlYVF/V322ztxM2feL0tzaTRGiR1Mm02wswa2wHdUEnvzYgrXCNi2bEDLt7b+8kahZkCRj5Kun0cUPv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kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: The node end is set during the walk, so use the resulting end instead of re-fetching it. 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 6c0ed71844e6..36ccb0ef9e69 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5564,7 +5564,7 @@ void mas_destroy(struct ma_state *mas) mas_start(mas); mtree_range_walk(mas); - end = mas_data_end(mas) + 1; + end = mas->end + 1; if (end < mt_min_slot_count(mas->node) - 1) mas_destroy_rebalance(mas, end); From patchwork Wed Nov 1 17:16:24 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: 13442928 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 77DA8C4167B for ; Wed, 1 Nov 2023 17:16:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 709EA90000A; Wed, 1 Nov 2023 13:16:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 69005900006; Wed, 1 Nov 2023 13:16:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 46E4090000A; Wed, 1 Nov 2023 13:16:58 -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 31737900006 for ; Wed, 1 Nov 2023 13:16:58 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id BBBC1160CCD for ; Wed, 1 Nov 2023 17:16:57 +0000 (UTC) X-FDA: 81410040474.26.8CEB9B2 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf09.hostedemail.com (Postfix) with ESMTP id 604CF140022 for ; Wed, 1 Nov 2023 17:16:54 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="l/b3ZAYk"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Gg1BqwJK; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf09.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698859014; 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=mG9RlDDmqoAmtnbXoAb5zAW9QwFYUfKiAAAiAkf8akQ=; b=zYOixTj/7ZZH2lUrWcup6RDqbnEw3sup1cfGNbJC6SnP3Y76373hs/JFqNgPF2ggu5MxCi EsJd5SsdcAuiF1uta5M9g5xQSMIUsVgTSwSE8ylxQb6qK6NGlbJhuihrqRaF32KPyC4Jww tT9vdMJ+QNiL0QvAF+6LyJd+r/lemww= ARC-Authentication-Results: i=2; imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="l/b3ZAYk"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Gg1BqwJK; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf09.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1698859014; a=rsa-sha256; cv=pass; b=xAPQZqsI53c6DjQwgM2M7KJMg1tZVXLHvipQtuzjSPZLziYTPX0EekLuUrzhGUW86nJN4n 2wAAHnU+P5TDYEdChXfMJYgU8w1BL5YLQ1DJoQN3RFyan0/wJ/vLQ3sLuUaqn9/MVwi6qx rWTRlIpmbBgn51C6VGovRYYTHCI6UWU= Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A1GXn3K019139; Wed, 1 Nov 2023 17:16:53 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=mG9RlDDmqoAmtnbXoAb5zAW9QwFYUfKiAAAiAkf8akQ=; b=l/b3ZAYkHX9ilV5xXm9dslofKmKuRUaAM7khgS1NUR+jx9gtHBhAOAZkLPZFoIY65HMv xtc6XRspHNGcSPIopEtB/a1fjuMY1AyI/xnyyEXjrd5xGk6edinSpQO3IBJ6L3WMMu2P 9S2onmxDXmkCoOxTSkmB4Y43K11dhi0EThaBZH27kLnhWx12BNYw0aPdifnKmnZeoxrP E5P60HzzoiFMe4FudIQc9qI40wIp44g9cybh4fVE3TT31mcv8esxsU8aKWyGjYdwukKI uIDxJm8R2UXNdrZKfutW68kcxrwrqLu+JZfvB3MtHo6I7EejR563iiD3PcdgcOTPmjca 1A== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u0swtr1wr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:53 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3A1H2fU9020060; Wed, 1 Nov 2023 17:16:52 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2041.outbound.protection.outlook.com [104.47.74.41]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3u0rr7d2qe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WwV3J6fFURQv3kWTtLpbcn1fzOpNr79URc3wxHyI01tPeHAA/neCRAwX4rAiTUyQepPtBohJf7IK6Hpzanihsxnab7Tbfh9Kljz/AcKNojfOYWJTnQm++1R77Rbgu8im5eZ72E7QJP3Utc50nJNRKrnhfFcBeqDCtmGJc3ORET+7wYTa0OhgaZadftl4d/QZcgPZrIEvoD1pZ1UtfrnUbBLSfigNXuFztza1+ko2mgz0pkAdw2C6HSk3LSLqoPu9rcGgu46t+AQc/uujMvFDs8KuZolEMvyuaXYEg0U1GaGutBO6d8YG3Ar5jekNzZmZRYO8C2gVYNVqbw45SRZpXA== 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=mG9RlDDmqoAmtnbXoAb5zAW9QwFYUfKiAAAiAkf8akQ=; b=iaWFPdaeDZ72UwuUgshco6+My1hQfcPkN1rTHejhsh84A/d7ouzhnvyh6XJHC47cCkMoSUYQ1V7WLQNYELuG2IFy1smkIvjm66/zvJlWqfcPyKgF+sJVsffZi4OWfg5kHuRejncGThe0zhJrlzK6FPg5hNclmA+i30N9/sWGvD31uzpiHWVSLPwuWemj66vr25Bd23+q+mwY2EIxVw+AL/mK3DqcgNekBaFuBhdmW8P9I3DL1iQOJJHFN8vU9Ody1NTBbUknKrlKm2Z5Pz+v/UOGnrR0NPAkdIUenLAqZJmNBqWL+uW3vfA8t5e6VRvK4pSm1X1oj8A5MdnaJ1mrmw== 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=mG9RlDDmqoAmtnbXoAb5zAW9QwFYUfKiAAAiAkf8akQ=; b=Gg1BqwJK42y2zlmtYrl0D3wGfWChy7m/OGuGbBQ9vnggvX11e1r8480g+rF4z7bGFplfJLtsIiryTq056E3+Qq7t477yssCQ7r37QFlQEspxY8h15XxM6BLPqlQ+dE6hpj1Z7M76z9qqDxk2HRzVkK22CIjdF4XpGlkT3r88RI4= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SA1PR10MB7684.namprd10.prod.outlook.com (2603:10b6:806:38e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.31; Wed, 1 Nov 2023 17:16:49 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa%4]) with mapi id 15.20.6907.025; Wed, 1 Nov 2023 17:16:49 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Liam R. Howlett" Subject: [PATCH 07/12] maple_tree: Clean up inlines for some functions Date: Wed, 1 Nov 2023 13:16:24 -0400 Message-Id: <20231101171629.3612299-8-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231101171629.3612299-1-Liam.Howlett@oracle.com> References: <20231101171629.3612299-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: BN9PR03CA0130.namprd03.prod.outlook.com (2603:10b6:408:fe::15) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|SA1PR10MB7684:EE_ X-MS-Office365-Filtering-Correlation-Id: 481a19ee-66e1-4e67-56b8-08dbdafe5573 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ObeHqltP0d7FKVHLgPAzm4nRHaO7tgTa063vEhO7SghgK5EHw7vwsDgUKiDMIDG+b75h07ifajTX3ycjdI0fJ1CbLvZm9hEltIgeSIdXHEBd9AIg3BR9G09aUKAmfB2cvxdb7Gp4r4Q4AnkQdLnvb0bjydfwYMZ2KF0tizW1tmiB7VIsbelqx6hBFu7qy5f3cXvk2p3gd3nXlSakIAQwJ7cTFBGUJSjML8eIzSBcir2mQifCwR/91eO0yAib7YYGFpwjmPqqSfCd0Mh4pO6emmuTL/4HdlmMiLGqkRt/x0GMPlwKeuFSGEpg74HfCh5hl8W5PIoaN+zCx+E9jKdQyQzavpGpQkdqnXyd7cc0+vJeHertiyKO1GuI+en23qJ7UstUxoCqKhvu7BI0SlYXdBwSY+3NKCu9Vhb2B3bVXvAL0QA55qGZQXlEfjMWFpscWh7yd7bfKkMMf09LuhRPkQ9z9kRwdIMTOoireGM0NaolOuRjTkabhZVMJkNFQL1Tyv33Ru+K4vh3T3/P+osy1XzuC+pVNS5orfw2oGRJEgzYT1uA8wMtKAaGmo0WrnCBnOkVcKsPfYz67gr8Pqh3Dp2d8oRHPr1+pWXY3QRp0zNyJoqbZf5v3ahpCV/luusf 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:(13230031)(346002)(136003)(376002)(366004)(396003)(39860400002)(230922051799003)(230273577357003)(230173577357003)(186009)(451199024)(1800799009)(64100799003)(6486002)(8936002)(2906002)(4326008)(30864003)(41300700001)(8676002)(5660300002)(6666004)(6506007)(66476007)(107886003)(83380400001)(1076003)(2616005)(36756003)(26005)(6512007)(38100700002)(316002)(86362001)(478600001)(66556008)(6916009)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LuBYKW78iJBpWW2yEdxKhfl5ms1F4t/xAskO5H74muZRaSFlq80AZKWPMBvIhoetqx8TcAmTTFuWx+vAN23BCxWW0Kuo0VXLFxlZBQIsdxSXtNVLitNfEOU2ZWD9owqK27pCE6ZE5ROY9+FmKEj6JrEA28D9T5cdNW2QX5EvujDv/Freyaen15zLXL7eRV67jho42XHI2iNpcsKVoR4tw0EoWJBidfBVg6oDEXmmarmsaN5b1bSEkWym+fckBPBIak9cVmAJZLdbktqQQp7wPyHKJOaJUAZi9Vc6tOiSIyQKm8r53OshDyT2ZXfiDfscqm+2WOQ7yfQ1XCPjo+65qFFtZAYizUfbhBqxhrB5O+m7bKzOnKXUvTa5y60EAOLXCcNv/sX/sbaMmij3ZCh+fAPQcFe101RqwCo8U8X+v+RSBHp9s7RqUIdTfyJLm2g+Ij0Y5jWwtLVstwQo7oocMyXi5QbtzohRpGgaUpXiNHClcnOHZ+1IUua9+NS6KIHBRiOtBea8SuzZCBlJharNH+7XDVq+XnhlhghDY1l1HE/+7N5g6Fh570mEEQY3xG1JyKj15FApJkmLE/An+3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change-AntiSpam-ExternalHop-MessageData-0: 0U89Pn7/UyTyXE+KYTr1gPIB7M1QjxHb0IfuVrtfcx6wq9NmlPRXAa74USpXifLnMjOjUUJVt829hzE519YU/d5UNxHkVSRTBfvmyMqFhoD9MTNxeohXopUVsvKbIjCpPwMSbo83nHYDPEGqKFACEzCvIC2d4202G/gu4yGHtpZcJ00LnQrRNH3b0x6q9TPc5xceqaxufeVuncPh3O4DrF8hKcH2lXd0w5dVoTRoTCAWArk5DxnEDuUKcb5KS0taMxLm/f/m1Sqq70fMjzrt5QfWWcLcPZfOpI7ihXWNrcm1v4MLXOm4CIuxIc5uG9wa9eeGsL2z5O2Ucl3vYyMAVfPH7ZrtVrhYnvco13MCM86ikLxjloecLmNhnAamtmam/KASbxTjCkpJrVSzv/FrZGcnanQh+GjI3dRvTPZAYykFJsDtFpdDFV6UXgbzCwj8fQLNJEcGY7PWTGDti46xa4wC6R9K0sUljskg2uq99K+h9jO0LDBfaSVwnuIJ8kCoCMvkGt5eF+ecWfkWpgsAzoK/+CNnOprgowAnB8wpz6xjQguQocW0wBO1rTFXVqEc25EuBXvhvyuNY5OgRD+w2ThL/k/Ep3PbjL+v97z1O4+fkF5VDCQ6tDAdRiXymrV89uoTobr5pVDoiWEnFf1niAt8nTAXONO0B4AHf3f8JXNKn17NTZADr/YA9JzR7I2oTUDm22ROBHY8bROtz16k/76R74IByuS/81pMpjm9e/RqS2zL0EuESidUgg68C1jFkcozD1FboQvThCd1/tmoJxNZNpHuqwVbaRDX0vDbPpWuW4ZcjzvgOBAUe8EyMoZWTLi/YXIXUbwTzNBOxyDv/iSBi+ojbIvKYBTXYcMGu7+Uhhx2H3EzCnU8qJ1jC5+HwnNnRtEuKN0HREB/JG4ObA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 481a19ee-66e1-4e67-56b8-08dbdafe5573 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2023 17:16:49.5275 (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: bzYgESSNWDiLsLM07XEKPipKuy496MeksDohawh0xiUmSDMT8yrmrCWlaH/A+BCvJNV0x8bLxbubEycAzSXUhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB7684 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-01_15,2023-11-01_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 mlxscore=0 spamscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311010134 X-Proofpoint-ORIG-GUID: o_YMmhNlkT80PWcdjswQDHY1xiVRpgd7 X-Proofpoint-GUID: o_YMmhNlkT80PWcdjswQDHY1xiVRpgd7 X-Rspamd-Queue-Id: 604CF140022 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: paqns36hcksj1wdisytc7tz1hkixtq7h X-HE-Tag: 1698859014-627949 X-HE-Meta: U2FsdGVkX1+LfPN4gc4TR1y99FaLr9k6o2lYEF/tvaL1uOjvb8erwHW/wNQ40bX/ttvg9Qeq9lFT3koGrvibAg+jACHrT/V4ZLLPKyelMS9s1/bXZjO103VuvnSzocWAblRrAdApJIhDnvSrr+TzyyxsnXhJebfSShW3DIxnD6lRT4/sJmW9M0FZSNVfAnlZCzH8H89YuSsRxs9lrOhu3OkWZm3hpRhBy9A23R1xWt/Q6zWhQVBiFtCRIeQyipHJpyDgGvTeENfElFejF6w/vFo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vMWU4hXmtZnsPHKi+x38RiVQC95GT7KITzEfT5Zj/qVfxqZWnZISAMqhO/5V9A9wXhgMU= 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: List-Subscribe: List-Unsubscribe: There are a few functions which were inlined but are somewhat too large to inline, so remove the inline key word. There are also several very small functions which are used in critical code sections which gcc was not inlining, so make this more strict and use __always_line for these functions. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 78 ++++++++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 36ccb0ef9e69..5c4ab10ded3d 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -205,23 +205,24 @@ static unsigned int mas_mt_height(struct ma_state *mas) return mt_height(mas->tree); } -static inline enum maple_type mte_node_type(const struct maple_enode *entry) +static __always_inline enum maple_type mte_node_type( + const struct maple_enode *entry) { return ((unsigned long)entry >> MAPLE_NODE_TYPE_SHIFT) & MAPLE_NODE_TYPE_MASK; } -static inline bool ma_is_dense(const enum maple_type type) +static __always_inline bool ma_is_dense(const enum maple_type type) { return type < maple_leaf_64; } -static inline bool ma_is_leaf(const enum maple_type type) +static __always_inline bool ma_is_leaf(const enum maple_type type) { return type < maple_range_64; } -static inline bool mte_is_leaf(const struct maple_enode *entry) +static __always_inline bool mte_is_leaf(const struct maple_enode *entry) { return ma_is_leaf(mte_node_type(entry)); } @@ -230,7 +231,7 @@ static inline bool mte_is_leaf(const struct maple_enode *entry) * We also reserve values with the bottom two bits set to '10' which are * below 4096 */ -static inline bool mt_is_reserved(const void *entry) +static __always_inline bool mt_is_reserved(const void *entry) { return ((unsigned long)entry < MAPLE_RESERVED_RANGE) && xa_is_internal(entry); @@ -283,7 +284,8 @@ static inline bool mas_searchable(struct ma_state *mas) return true; } -static inline struct maple_node *mte_to_node(const struct maple_enode *entry) +static __always_inline struct maple_node *mte_to_node( + const struct maple_enode *entry) { return (struct maple_node *)((unsigned long)entry & ~MAPLE_NODE_MASK); } @@ -360,12 +362,12 @@ static inline bool mte_has_null(const struct maple_enode *node) return (unsigned long)node & MAPLE_ENODE_NULL; } -static inline bool ma_is_root(struct maple_node *node) +static __always_inline bool ma_is_root(struct maple_node *node) { return ((unsigned long)node->parent & MA_ROOT_PARENT); } -static inline bool mte_is_root(const struct maple_enode *node) +static __always_inline bool mte_is_root(const struct maple_enode *node) { return ma_is_root(mte_to_node(node)); } @@ -375,7 +377,7 @@ static inline bool mas_is_root_limits(const struct ma_state *mas) return !mas->min && mas->max == ULONG_MAX; } -static inline bool mt_is_alloc(struct maple_tree *mt) +static __always_inline bool mt_is_alloc(struct maple_tree *mt) { return (mt->ma_flags & MT_FLAGS_ALLOC_RANGE); } @@ -514,11 +516,12 @@ void mas_set_parent(struct ma_state *mas, struct maple_enode *enode, * * Return: The slot in the parent node where @enode resides. */ -static inline unsigned int mte_parent_slot(const struct maple_enode *enode) +static __always_inline +unsigned int mte_parent_slot(const struct maple_enode *enode) { unsigned long val = (unsigned long)mte_to_node(enode)->parent; - if (val & MA_ROOT_PARENT) + if (unlikely(val & MA_ROOT_PARENT)) return 0; /* @@ -534,7 +537,8 @@ static inline unsigned int mte_parent_slot(const struct maple_enode *enode) * * Return: The parent maple node. */ -static inline struct maple_node *mte_parent(const struct maple_enode *enode) +static __always_inline +struct maple_node *mte_parent(const struct maple_enode *enode) { return (void *)((unsigned long) (mte_to_node(enode)->parent) & ~MAPLE_NODE_MASK); @@ -546,7 +550,7 @@ static inline struct maple_node *mte_parent(const struct maple_enode *enode) * * Return: true if dead, false otherwise. */ -static inline bool ma_dead_node(const struct maple_node *node) +static __always_inline bool ma_dead_node(const struct maple_node *node) { struct maple_node *parent; @@ -562,7 +566,7 @@ static inline bool ma_dead_node(const struct maple_node *node) * * Return: true if dead, false otherwise. */ -static inline bool mte_dead_node(const struct maple_enode *enode) +static __always_inline bool mte_dead_node(const struct maple_enode *enode) { struct maple_node *parent, *node; @@ -718,7 +722,7 @@ static inline unsigned long mas_pivot(struct ma_state *mas, unsigned char piv) * Return: The pivot at @piv within the limit of the @pivots array, @mas->max * otherwise. */ -static inline unsigned long +static __always_inline unsigned long mas_safe_pivot(const struct ma_state *mas, unsigned long *pivots, unsigned char piv, enum maple_type type) { @@ -800,20 +804,20 @@ static inline bool mt_write_locked(const struct maple_tree *mt) lockdep_is_held(&mt->ma_lock); } -static inline bool mt_locked(const struct maple_tree *mt) +static __always_inline bool mt_locked(const struct maple_tree *mt) { return mt_external_lock(mt) ? mt_lock_is_held(mt) : lockdep_is_held(&mt->ma_lock); } -static inline void *mt_slot(const struct maple_tree *mt, +static __always_inline void *mt_slot(const struct maple_tree *mt, void __rcu **slots, unsigned char offset) { return rcu_dereference_check(slots[offset], mt_locked(mt)); } -static inline void *mt_slot_locked(struct maple_tree *mt, void __rcu **slots, - unsigned char offset) +static __always_inline void *mt_slot_locked(struct maple_tree *mt, + void __rcu **slots, unsigned char offset) { return rcu_dereference_protected(slots[offset], mt_write_locked(mt)); } @@ -825,8 +829,8 @@ static inline void *mt_slot_locked(struct maple_tree *mt, void __rcu **slots, * * Return: The entry stored in @slots at the @offset. */ -static inline void *mas_slot_locked(struct ma_state *mas, void __rcu **slots, - unsigned char offset) +static __always_inline void *mas_slot_locked(struct ma_state *mas, + void __rcu **slots, unsigned char offset) { return mt_slot_locked(mas->tree, slots, offset); } @@ -839,8 +843,8 @@ static inline void *mas_slot_locked(struct ma_state *mas, void __rcu **slots, * * Return: The entry stored in @slots at the @offset */ -static inline void *mas_slot(struct ma_state *mas, void __rcu **slots, - unsigned char offset) +static __always_inline void *mas_slot(struct ma_state *mas, void __rcu **slots, + unsigned char offset) { return mt_slot(mas->tree, slots, offset); } @@ -851,7 +855,7 @@ static inline void *mas_slot(struct ma_state *mas, void __rcu **slots, * * Return: The pointer to the root of the tree */ -static inline void *mas_root(struct ma_state *mas) +static __always_inline void *mas_root(struct ma_state *mas) { return rcu_dereference_check(mas->tree->ma_root, mt_locked(mas->tree)); } @@ -1425,10 +1429,8 @@ static inline struct maple_enode *mas_start(struct ma_state *mas) * Uses metadata to find the end of the data when possible. * Return: The zero indexed last slot with data (may be null). */ -static inline unsigned char ma_data_end(struct maple_node *node, - enum maple_type type, - unsigned long *pivots, - unsigned long max) +static __always_inline unsigned char ma_data_end(struct maple_node *node, + enum maple_type type, unsigned long *pivots, unsigned long max) { unsigned char offset; @@ -4332,7 +4334,7 @@ static inline void *mas_insert(struct ma_state *mas, void *entry) } -static inline void mas_rewalk(struct ma_state *mas, unsigned long index) +static __always_inline void mas_rewalk(struct ma_state *mas, unsigned long index) { retry: mas_set(mas, index); @@ -4341,7 +4343,7 @@ static inline void mas_rewalk(struct ma_state *mas, unsigned long index) goto retry; } -static inline bool mas_rewalk_if_dead(struct ma_state *mas, +static __always_inline bool mas_rewalk_if_dead(struct ma_state *mas, struct maple_node *node, const unsigned long index) { if (unlikely(ma_dead_node(node))) { @@ -4360,7 +4362,7 @@ static inline bool mas_rewalk_if_dead(struct ma_state *mas, * The prev node value will be mas->node[mas->offset] or MAS_NONE. * Return: 1 if the node is dead, 0 otherwise. */ -static inline int mas_prev_node(struct ma_state *mas, unsigned long min) +static int mas_prev_node(struct ma_state *mas, unsigned long min) { enum maple_type mt; int offset, level; @@ -4521,8 +4523,8 @@ static void *mas_prev_slot(struct ma_state *mas, unsigned long min, bool empty, * The next value will be mas->node[mas->offset] or MAS_NONE. * Return: 1 on dead node, 0 otherwise. */ -static inline int mas_next_node(struct ma_state *mas, struct maple_node *node, - unsigned long max) +static int mas_next_node(struct ma_state *mas, struct maple_node *node, + unsigned long max) { unsigned long min; unsigned long *pivots; @@ -5652,7 +5654,7 @@ int mas_expected_entries(struct ma_state *mas, unsigned long nr_entries) } EXPORT_SYMBOL_GPL(mas_expected_entries); -static inline bool mas_next_setup(struct ma_state *mas, unsigned long max, +static bool mas_next_setup(struct ma_state *mas, unsigned long max, void **entry) { bool was_none = mas_is_none(mas); @@ -5768,8 +5770,7 @@ void *mt_next(struct maple_tree *mt, unsigned long index, unsigned long max) } EXPORT_SYMBOL_GPL(mt_next); -static inline bool mas_prev_setup(struct ma_state *mas, unsigned long min, - void **entry) +static bool mas_prev_setup(struct ma_state *mas, unsigned long min, void **entry) { if (unlikely(mas->index <= min)) { mas->node = MAS_UNDERFLOW; @@ -5918,8 +5919,7 @@ EXPORT_SYMBOL_GPL(mas_pause); * * Returns: True if entry is the answer, false otherwise. */ -static inline bool mas_find_setup(struct ma_state *mas, unsigned long max, - void **entry) +static __always_inline bool mas_find_setup(struct ma_state *mas, unsigned long max, void **entry) { if (mas_is_active(mas)) { if (mas->last < max) @@ -6035,7 +6035,7 @@ EXPORT_SYMBOL_GPL(mas_find_range); * * Returns: True if entry is the answer, false otherwise. */ -static inline bool mas_find_rev_setup(struct ma_state *mas, unsigned long min, +static bool mas_find_rev_setup(struct ma_state *mas, unsigned long min, void **entry) { if (mas_is_active(mas)) { From patchwork Wed Nov 1 17:16:25 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: 13442931 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 CC0FAC0018A for ; Wed, 1 Nov 2023 17:17:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0C71B90000C; Wed, 1 Nov 2023 13:17:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0774B900006; Wed, 1 Nov 2023 13:17:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C5DF190000C; Wed, 1 Nov 2023 13:17:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id ABD94900006 for ; Wed, 1 Nov 2023 13:17:01 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 745F51CB70E for ; Wed, 1 Nov 2023 17:17:01 +0000 (UTC) X-FDA: 81410040642.13.3B8A40C Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf25.hostedemail.com (Postfix) with ESMTP id BB0DEA0018 for ; Wed, 1 Nov 2023 17:16:57 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=2tmTGx9V; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=KHc9gk47; spf=pass (imf25.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=1698859018; 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=iUuMeVyiSM8cgrYenfJCqLYrjI5fIrOBba65Y8avBwo=; b=DWWLUK8SC5ofBt1hD/twC8JLJKPQsF8+jbDHh14yOgvSNRrc8F7afhxFDQJoDWiqrljBGQ KS5T36nYK+KneXL37xwNjq2QilAin3tTau6iFRT6hfPMn3nkRCWgsY1E9gvSYXY+UtNN7k ohOrLaQingqYDisMGM7mV6FVAUr/ruU= ARC-Authentication-Results: i=2; imf25.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=2tmTGx9V; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=KHc9gk47; spf=pass (imf25.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=1698859018; a=rsa-sha256; cv=pass; b=qBiI60CGfrpCtCeI1poITDzwChFHT+RypB5IRWgt3qLwdLjQqtSC5cQBgAqpyjChUH9YiP ptQxEDSINDd7ho19VqqI0D766qLboIoMykWBYWnDNoD3B3TAPCUEag8WXTIcLqfOrdcaYv uOuLlZ2Cikly5bOmRKJirc9V2I0bOp0= Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A1GYeTB004737; Wed, 1 Nov 2023 17:16:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=iUuMeVyiSM8cgrYenfJCqLYrjI5fIrOBba65Y8avBwo=; b=2tmTGx9V7dGKGbN9dKJkisvwZXX2zClMvhY7XdoWQKgTshasGeAz3kaoHKGQlhgtPx1u 0ViCpa+75ApAFX4TfVgPqVJKi41L04AK5RvVnZ1sDMnjpQLHxPc7J3dawtnOJMi/RQln V9X2On6xEIWsv2/LqrRNkdvQobe3St1/t/2+Up418Pt7GdNR6pAOrt2grJp+q7L/8KtX bz/lSxq0cQPyV/zhqe3FF5fqQ2OU35gKlPA5fV3YgXzF1dfNVA/KvrgO1mgNj+6Wr1w8 3uNJ7DesJ4s+8/q9pN7FGL1vziIy28flUdTfzK3lhflETiRvjvjeE7fuVi1vqg5dgD6p Pg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u0tuufuex-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:56 +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 3A1H7nw7038146; Wed, 1 Nov 2023 17:16:54 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2041.outbound.protection.outlook.com [104.47.74.41]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3u0rrdjy1h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qtr2j8DsO5n9AgmwqF/yn2fM08KLjmbLgC/A5F2uzpur1Nl40zeJ9dCFe4iYqE+fTxN2xzEahRHUjdo2siTKgz+jhkew5cJKRkt0SnUyf/3teyvcsI4SZhu3kcVz2q0o4EhjpCSmf7xi1xQA0R8qS2e6gLt0WpMYd9uXBsMb3gUHjE1bvHSJ2pdjLIlU/zhM1YiLtSH3cSudnlI8h7YlavAOQt9SxbFqK24Ub1PRgZoJAitVH/HAgWO/hCA76bkE6HcUt1m2pjQV0VPGmFj8IdSmUu1VrUtLFxnijo+HoV+xxMMG3/ino84fZ9qbkZdz78kG4oR6/jlbdcfWznMKLg== 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=iUuMeVyiSM8cgrYenfJCqLYrjI5fIrOBba65Y8avBwo=; b=HUca+udS8RS1V0szcwIDHyNTKx2/nT7udVduGkgRPLqU4DZCiJYkQheqt+Om1XtIu64xaRciPISmt5c/2X2B+h6bQHYF3sqds0eHltwqWnIRakVBTgAhUtuaaFuASzJgnmvBpadLbx+LbdciwpfxMIrIyxUj515Ly5TAWdhKm/pgyOvE0pa10LGrnDDjf18Ur3iSXiXPey9zOjIsLYmZumFxuU1jKW9kNhGTZ0BDKw6aIyz9cvZq5h1bI0Lcft2euI1f8+YOBem3pv4Lfclw4pW2ijJuj0OGS40tcV2zSd/IDVNjtC1aicSduQYlbHOLZQcCdDrq7CZ6+Uu9ewQcMA== 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=iUuMeVyiSM8cgrYenfJCqLYrjI5fIrOBba65Y8avBwo=; b=KHc9gk478rQ73Ejx0JxswbJhOykQkqjwd7VnzCDEKH6wYY1g46ubL9RWWBg7V97lr4E8dQtnNFyDlgyPaV3yMegqAVMqe+R/MLMWdc6k+doRYKx1Aad8LUDs2jB8AO75wsy5bqMQc+Lxs71qx0P7jR+JhjOaNgQILqawqCOKpnM= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SA1PR10MB7684.namprd10.prod.outlook.com (2603:10b6:806:38e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.31; Wed, 1 Nov 2023 17:16:51 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa%4]) with mapi id 15.20.6907.025; Wed, 1 Nov 2023 17:16:51 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Liam R. Howlett" Subject: [PATCH 08/12] maple_tree: Separate ma_state node from status. Date: Wed, 1 Nov 2023 13:16:25 -0400 Message-Id: <20231101171629.3612299-9-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231101171629.3612299-1-Liam.Howlett@oracle.com> References: <20231101171629.3612299-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: BN9PR03CA0132.namprd03.prod.outlook.com (2603:10b6:408:fe::17) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|SA1PR10MB7684:EE_ X-MS-Office365-Filtering-Correlation-Id: 74c6a70d-1038-4b46-bee8-08dbdafe569f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f9CRoJwu6dlmHlpm1CWFGCBofO2sK8Uid7iraQAaafDEYwiCiyjMHFT6+lqhBx4qr5GLZMrpBy1iTqQxrcj8Ow+H6K51pRqrboHtgISuS3y7gGMoFnx10upiJZTVXyR+H+8a4R3INVw8jdW4Fnn9yXs25HjytzaMjXqqvU6ydVVgXJW2GOpFZAkc65ZAgL2bGbOPad7JnJttubY+NCDsxoF/4L04lPskaq1eJ1NnnynWw3x2yhkUo3tdFDdce0xwW+pBZ7txKDxc3UyVIxvCSAZv8vCG3JdigIF43/USSid7EvjzU6yvKXeQWYix1ZokDD0dqrTD9/M8TJobXewrZEsvKNadA6YH1f6LtJ13MFLfwio/0NaTZOyH8xHDA76pRBakyQlx6L7S+OesGKQ7Zbq16CRaFH5gzjSGMCVKzilNJ0hITQ1GPLOvpA7WPx4agFg1b96/cvx5LxfqHVE5jChKU10dUv7JlGMRuPQcuSewRYKwAybAsgvRsWDftbkDR9/oe/ejGKXEF7hGCg6/FSRvtNjX0TORVScK2qmTOmoChspoouwZrU+Hz81j6a8i 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:(13230031)(346002)(136003)(376002)(366004)(396003)(39860400002)(230922051799003)(186009)(451199024)(1800799009)(64100799003)(6486002)(8936002)(2906002)(4326008)(30864003)(41300700001)(8676002)(5660300002)(6666004)(6506007)(66476007)(107886003)(83380400001)(1076003)(2616005)(36756003)(26005)(6512007)(38100700002)(316002)(86362001)(478600001)(66556008)(6916009)(66946007)(579004)(559001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: g09pnp2kLGAK9uBNFvq78UNSUIIeTlNk/OAX84Zlyvv1L6KJRjgTBY4ZAqFKsa+ICdmEn/+1fV28VVCH+a+5aTsYAekxgzSEjxceEAbyBAFII2O7Lt7BaSmgPAMs1c0R/9PCicuvI9IPykFQFVCDmGo0qQ4CaGsjz68oVgaINBZYNx10ATerRLYbo+J5bBAViXKjn3f4xNgl9yO6WaNQxtdsNh6Or7wiFCGlluejqpx7sNONz02il+qBBXhX7lW7z92cKZGux6zGY0ZJe9XZzhhXYe6gblno15702rgAOKnhIm4hM4BRHR3H83hKW5zFfd9EiZbrjNRoVIrMtJ4+6nFLmehLwNk0Sqnc8Lk+q/vu0ExEiGO8a+02klp7UxGrKFRLXcwhGKbYM70ETql87n0gCB40JeukAZHGJRwMsWCbF7gXCceYOEeP13Ghg5aZyMInc209vnkNzpYIiP6BjmOtiFcUg+46/lndyC1V5np9amW+7EKb9qlBNCAwnZ3hvMCiB7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== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 5RSrrUU4uy2YTCjxYP+UUjjq18cQN37+ilcb34NgBobo4tmqiwqUu2rjVV4Gz1ARRfJORkMkIfyUFrh3ivMwNxBgbT1TS6DhAv37zbukmwIi+YV5ba619fs7LF5GsqV1hZ7lHim9+ym+D2LN33XX6amGSLjbIlwgp+Lt9G3A0ybZ2+QeFOzIZbv/qxWn/XR45ZvWt3oiJ0SbYPozkhiGoB+pW4sERIT7+uQuGPGC4iDH35zoIVlHNjy3XYX6TK8geqjmvClznQzUYWTG5ls37tj/svItx8Yvki4gSTfbWqwhPeXOEnFJ5MraPRfjsXRoZZr3Hr7xeeR99+UeVwbKo3G5TCe0TxCyZhNSUsvzXZcRiIXNSEWSKt6gMRm+CHFSm+oSfnweD1YOQwYk4+Yj9oizVUzeR1NxRTKiz8Gvp/xlPQ6Vu54rWbnCxPpnsN0nvoIkJ3CBB6qov+glyx4NU80Z+CoIRoG8ZHOIXRGzuxEBJSGT46U5IHY7+bkUoHCO5NSY2H2N/KhHB1Hqj/YXlKxk5+amZYQhzkDINVPxXE3sI7Sgj1WHbs2NRK7F8La0OuQ0zowQqtB80otdulz+MZnwBPeop1l6SNrlZb2o/ZFqPbKSnLZpaWlPoNrb8hALQPJsVhJVFkYG89g67OXkgR8lgfeVHra+ocjzDvRoMgQwPHWd66ispKsCsRswFQ3325fk6TFCI3lxlwROJtikgyR9u4U6GNpvgDjwMpNtxdZ3f0UMO6odDoBNi2q3B+ioZe9SpZph2K8p3bLvB6/6FkH/RPVtPM2RC3qd/yeD/XMVDoHTQVr1hmhAcq/E20sLKSOqaZUfzHHfIpEOXMV/63GTZIZprEqvjg4RMXn3ZTb5CBcSO++I+jWoCwKx1WkyPEEU7nRSqvWTCSzOX0ILhA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74c6a70d-1038-4b46-bee8-08dbdafe569f X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2023 17:16:51.4795 (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: 7Y2tBS/Lazmz56PN0/TDobJEfDJ0RBH6Haq7G14NRRo8NuhbPeu/x4Jsl/FJ9PWlmN+qL+vX3czJGUFIOGK/hQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB7684 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-01_15,2023-11-01_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 bulkscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311010134 X-Proofpoint-GUID: MEUG7Yg0TZEvfVWMcvefqNqG6U647Wxe X-Proofpoint-ORIG-GUID: MEUG7Yg0TZEvfVWMcvefqNqG6U647Wxe X-Rspamd-Queue-Id: BB0DEA0018 X-Rspam-User: X-Stat-Signature: ntic9knqhb7wxa3caogotpieg98o5cek X-Rspamd-Server: rspam01 X-HE-Tag: 1698859017-93779 X-HE-Meta: U2FsdGVkX1/jrT7QYs+OhrwQl3t+oTVOcmPHTg4uYTcESPtsvHZAc0i9oG5UqnWr9wk5xvYp4gXCQ0LHjH8y5o09QNcyM5Nyxth3ggrTeLBwvM4tHrqFnMZvNsvK/c/tbZ60D0R8/zjIUjPbCsA5mHu/ACsvBST+CDcgcE9fAepEQ85Gl/4vMBK4g8Cj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6lBxUsTKnDItNLQL/U1o9SjNLN9K5K/+AEL3tm9CjQD5Z7DV0FNnV6C4dx5Zj5Ax3qVR/Oj3J99Lc9IJqZWllJd7LMW1bVkEWVVeJ0Vcgq7C2Yu94fauJGaetuOZHR/TAh7jKOv2vvsSpCcPH03GFo8mogY= 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: List-Subscribe: List-Unsubscribe: The maple tree node is overloaded to keep status as well as the active node. This, unfortunately, results in a re-walk on underflow or overflow. Since the maple state has room, the status can be placed in its own enum in the structure. Once an underflow/overflow is detected, certain modes can restore the status to active and others may need to re-walk just that one node to see the entry. The status being an enum has the benefit of detecting unhandled status in switch statements. Signed-off-by: Liam R. Howlett --- include/linux/maple_tree.h | 87 ++++--- include/linux/mm_types.h | 3 +- lib/maple_tree.c | 425 ++++++++++++++++++------------- lib/test_maple_tree.c | 180 ++++++------- mm/internal.h | 8 +- tools/testing/radix-tree/maple.c | 22 +- 6 files changed, 415 insertions(+), 310 deletions(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index 97a6adedb376..e3789b63388a 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -344,6 +344,36 @@ static inline bool mtree_empty(const struct maple_tree *mt) /* Advanced API */ +/* + * Maple State Status + * ma_active means the maple state is pointing to a node and offset and can + * continue operating on the tree. + * ma_start means we have not searched the tree. + * ma_root means we have searched the tree and the entry we found lives in + * the root of the tree (ie it has index 0, length 1 and is the only entry in + * the tree). + * ma_none means we have searched the tree and there is no node in the + * tree for this entry. For example, we searched for index 1 in an empty + * tree. Or we have a tree which points to a full leaf node and we + * searched for an entry which is larger than can be contained in that + * leaf node. + * ma_pause means the data within the maple state may be stale, restart the + * operation + * ma_overflow means the search has reached the upper limit of the search + * ma_underflow means the search has reached the lower limit of the search + * ma_error means there was an error, check the node for the error number. + */ +enum maple_status { + ma_active, + ma_start, + ma_root, + ma_none, + ma_pause, + ma_overflow, + ma_underflow, + ma_error, +}; + /* * The maple state is defined in the struct ma_state and is used to keep track * of information during operations, and even between operations when using the @@ -376,6 +406,13 @@ static inline bool mtree_empty(const struct maple_tree *mt) * When returning a value the maple state index and last respectively contain * the start and end of the range for the entry. Ranges are inclusive in the * Maple Tree. + * + * The status of the state is used to determine how the next action should treat + * the state. For instance, if the status is ma_start then the next action + * should start at the root of the tree and walk down. If the status is + * ma_pause then the node may be stale data and should be discarded. If the + * status is ma_overflow, then the last action hit the upper limit. + * */ struct ma_state { struct maple_tree *tree; /* The tree we're operating in */ @@ -385,6 +422,7 @@ struct ma_state { unsigned long min; /* The minimum index of this node - implied pivot min */ unsigned long max; /* The maximum index of this node - implied pivot max */ struct maple_alloc *alloc; /* Allocated nodes for this operation */ + enum maple_status status; /* The status of the state (active, start, none, etc) */ unsigned char depth; /* depth of tree descent during write */ unsigned char offset; unsigned char mas_flags; @@ -409,28 +447,12 @@ struct ma_wr_state { #define mas_lock(mas) spin_lock(&((mas)->tree->ma_lock)) #define mas_unlock(mas) spin_unlock(&((mas)->tree->ma_lock)) - /* * Special values for ma_state.node. - * MAS_START means we have not searched the tree. - * MAS_ROOT means we have searched the tree and the entry we found lives in - * the root of the tree (ie it has index 0, length 1 and is the only entry in - * the tree). - * MAS_NONE means we have searched the tree and there is no node in the - * tree for this entry. For example, we searched for index 1 in an empty - * tree. Or we have a tree which points to a full leaf node and we - * searched for an entry which is larger than can be contained in that - * leaf node. * MA_ERROR represents an errno. After dropping the lock and attempting * to resolve the error, the walk would have to be restarted from the * top of the tree as the tree may have been modified. */ -#define MAS_START ((struct maple_enode *)1UL) -#define MAS_ROOT ((struct maple_enode *)5UL) -#define MAS_NONE ((struct maple_enode *)9UL) -#define MAS_PAUSE ((struct maple_enode *)17UL) -#define MAS_OVERFLOW ((struct maple_enode *)33UL) -#define MAS_UNDERFLOW ((struct maple_enode *)65UL) #define MA_ERROR(err) \ ((struct maple_enode *)(((unsigned long)err << 2) | 2UL)) @@ -439,7 +461,8 @@ struct ma_wr_state { .tree = mt, \ .index = first, \ .last = end, \ - .node = MAS_START, \ + .node = NULL, \ + .status = ma_start, \ .min = 0, \ .max = ULONG_MAX, \ .alloc = NULL, \ @@ -470,7 +493,6 @@ void *mas_find_range(struct ma_state *mas, unsigned long max); void *mas_find_rev(struct ma_state *mas, unsigned long min); void *mas_find_range_rev(struct ma_state *mas, unsigned long max); int mas_preallocate(struct ma_state *mas, void *entry, gfp_t gfp); -bool mas_is_err(struct ma_state *mas); bool mas_nomem(struct ma_state *mas, gfp_t gfp); void mas_pause(struct ma_state *mas); @@ -499,28 +521,18 @@ static inline void mas_init(struct ma_state *mas, struct maple_tree *tree, mas->tree = tree; mas->index = mas->last = addr; mas->max = ULONG_MAX; - mas->node = MAS_START; + mas->status = ma_start; + mas->node = NULL; } -/* Checks if a mas has not found anything */ -static inline bool mas_is_none(const struct ma_state *mas) -{ - return mas->node == MAS_NONE; -} - -/* Checks if a mas has been paused */ -static inline bool mas_is_paused(const struct ma_state *mas) +static inline bool mas_is_active(struct ma_state *mas) { - return mas->node == MAS_PAUSE; + return mas->status == ma_active; } -/* Check if the mas is pointing to a node or not */ -static inline bool mas_is_active(struct ma_state *mas) +static inline bool mas_is_err(struct ma_state *mas) { - if ((unsigned long)mas->node >= MAPLE_RESERVED_RANGE) - return true; - - return false; + return mas->status == ma_error; } /** @@ -533,9 +545,10 @@ static inline bool mas_is_active(struct ma_state *mas) * * Context: Any context. */ -static inline void mas_reset(struct ma_state *mas) +static __always_inline void mas_reset(struct ma_state *mas) { - mas->node = MAS_START; + mas->status = ma_start; + mas->node = NULL; } /** @@ -709,7 +722,7 @@ static inline void __mas_set_range(struct ma_state *mas, unsigned long start, static inline void mas_set_range(struct ma_state *mas, unsigned long start, unsigned long last) { - mas->node = MAS_START; + mas_reset(mas); __mas_set_range(mas, start, last); } diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 36c5b43999e6..59de72d8bff8 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -1014,7 +1014,8 @@ struct vma_iterator { .mas = { \ .tree = &(__mm)->mm_mt, \ .index = __addr, \ - .node = MAS_START, \ + .node = NULL, \ + .status = ma_start, \ }, \ } diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 5c4ab10ded3d..fa66c0c031d5 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -237,40 +237,40 @@ static __always_inline bool mt_is_reserved(const void *entry) xa_is_internal(entry); } -static inline void mas_set_err(struct ma_state *mas, long err) +static __always_inline void mas_set_err(struct ma_state *mas, long err) { mas->node = MA_ERROR(err); + mas->status = ma_error; } -static inline bool mas_is_ptr(const struct ma_state *mas) +static __always_inline bool mas_is_ptr(const struct ma_state *mas) { - return mas->node == MAS_ROOT; + return mas->status == ma_root; } -static inline bool mas_is_start(const struct ma_state *mas) +static __always_inline bool mas_is_start(const struct ma_state *mas) { - return mas->node == MAS_START; + return mas->status == ma_start; } -bool mas_is_err(struct ma_state *mas) +static __always_inline bool mas_is_none(const struct ma_state *mas) { - return xa_is_err(mas->node); + return mas->status == ma_none; } -static __always_inline bool mas_is_overflow(struct ma_state *mas) +static __always_inline bool mas_is_paused(const struct ma_state *mas) { - if (unlikely(mas->node == MAS_OVERFLOW)) - return true; - - return false; + return mas->status == ma_pause; } -static __always_inline bool mas_is_underflow(struct ma_state *mas) +static __always_inline bool mas_is_overflow(struct ma_state *mas) { - if (unlikely(mas->node == MAS_UNDERFLOW)) - return true; + return mas->status == ma_overflow; +} - return false; +static inline bool mas_is_underflow(struct ma_state *mas) +{ + return mas->status == ma_underflow; } static inline bool mas_searchable(struct ma_state *mas) @@ -1262,6 +1262,7 @@ static inline void mas_alloc_nodes(struct ma_state *mas, gfp_t gfp) if (mas->mas_flags & MA_STATE_PREALLOC) { if (allocated) return; + BUG_ON(!allocated); WARN_ON(!allocated); } @@ -1367,14 +1368,14 @@ static void mas_node_count(struct ma_state *mas, int count) * mas_start() - Sets up maple state for operations. * @mas: The maple state. * - * If mas->node == MAS_START, then set the min, max and depth to + * If mas->status == mas_start, then set the min, max and depth to * defaults. * * Return: - * - If mas->node is an error or not MAS_START, return NULL. - * - If it's an empty tree: NULL & mas->node == MAS_NONE - * - If it's a single entry: The entry & mas->node == MAS_ROOT - * - If it's a tree: NULL & mas->node == safe root node. + * - If mas->node is an error or not mas_start, return NULL. + * - If it's an empty tree: NULL & mas->status == ma_none + * - If it's a single entry: The entry & mas->status == mas_root + * - If it's a tree: NULL & mas->status == safe root node. */ static inline struct maple_enode *mas_start(struct ma_state *mas) { @@ -1390,6 +1391,7 @@ static inline struct maple_enode *mas_start(struct ma_state *mas) /* Tree with nodes */ if (likely(xa_is_node(root))) { mas->depth = 1; + mas->status = ma_active; mas->node = mte_safe_root(root); mas->offset = 0; if (mte_dead_node(mas->node)) @@ -1400,13 +1402,14 @@ static inline struct maple_enode *mas_start(struct ma_state *mas) /* empty tree */ if (unlikely(!root)) { - mas->node = MAS_NONE; + mas->node = NULL; + mas->status = ma_none; mas->offset = MAPLE_NODE_SLOTS; return NULL; } /* Single entry tree */ - mas->node = MAS_ROOT; + mas->status = ma_root; mas->offset = MAPLE_NODE_SLOTS; /* Single entry tree. */ @@ -2220,12 +2223,16 @@ static inline bool mas_next_sibling(struct ma_state *mas) * * Return: @enode or MAS_NONE */ -static inline struct maple_enode *mte_node_or_none(struct maple_enode *enode) +static inline void mas_node_or_none(struct ma_state *mas, + struct maple_enode *enode) { - if (enode) - return enode; - - return ma_enode_ptr(MAS_NONE); + if (enode) { + mas->node = enode; + mas->status = ma_active; + } else { + mas->node = NULL; + mas->status = ma_none; + } } /* @@ -2545,13 +2552,15 @@ static inline void mast_set_split_parents(struct maple_subtree_state *mast, * The node will either be RCU freed or pushed back on the maple state. */ static inline void mas_topiary_node(struct ma_state *mas, - struct maple_enode *enode, bool in_rcu) + struct ma_state *tmp_mas, bool in_rcu) { struct maple_node *tmp; + struct maple_enode *enode; - if (enode == MAS_NONE) + if (mas_is_none(tmp_mas)) return; + enode = tmp_mas->node; tmp = mte_to_node(enode); mte_set_node_dead(enode); if (in_rcu) @@ -2591,8 +2600,8 @@ static inline void mas_topiary_replace(struct ma_state *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; + tmp[1].status = ma_none; + tmp[2].status = ma_none; while (!mte_is_leaf(tmp[0].node)) { n = 0; for (i = 0; i < 3; i++) { @@ -2612,7 +2621,7 @@ static inline void mas_topiary_replace(struct ma_state *mas, break; while (n < 3) - tmp_next[n++].node = MAS_NONE; + tmp_next[n++].status = ma_none; for (i = 0; i < 3; i++) tmp[i] = tmp_next[i]; @@ -2625,8 +2634,8 @@ static inline void mas_topiary_replace(struct ma_state *mas, tmp[0] = *mas; tmp[0].offset = 0; tmp[0].node = old_enode; - tmp[1].node = MAS_NONE; - tmp[2].node = MAS_NONE; + tmp[1].status = ma_none; + tmp[2].status = ma_none; in_rcu = mt_in_rcu(mas->tree); do { n = 0; @@ -2641,7 +2650,7 @@ static inline void mas_topiary_replace(struct ma_state *mas, 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; + tmp_next[n].status = ma_none; } else { n++; } @@ -2652,16 +2661,16 @@ static inline void mas_topiary_replace(struct ma_state *mas, break; while (n < 3) - tmp_next[n++].node = MAS_NONE; + tmp_next[n++].status = ma_none; for (i = 0; i < 3; i++) { - mas_topiary_node(mas, tmp[i].node, in_rcu); + mas_topiary_node(mas, &tmp[i], 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_topiary_node(mas, &tmp[i], in_rcu); mas_mat_destroy(mas, &subtrees); } @@ -2700,9 +2709,9 @@ static inline void mast_cp_to_nodes(struct maple_subtree_state *mast, { bool new_lmax = true; - mast->l->node = mte_node_or_none(left); - mast->m->node = mte_node_or_none(middle); - mast->r->node = mte_node_or_none(right); + mas_node_or_none(mast->l, left); + mas_node_or_none(mast->m, middle); + mas_node_or_none(mast->r, right); mast->l->min = mast->orig_l->min; if (split == mast->bn->b_end) { @@ -2882,7 +2891,7 @@ static int mas_spanning_rebalance(struct ma_state *mas, mast->l = &l_mas; mast->m = &m_mas; mast->r = &r_mas; - l_mas.node = r_mas.node = m_mas.node = MAS_NONE; + l_mas.status = r_mas.status = m_mas.status = ma_none; /* Check if this is not root and has sufficient data. */ if (((mast->orig_l->min != 0) || (mast->orig_r->max != ULONG_MAX)) && @@ -3409,7 +3418,6 @@ static int mas_split(struct ma_state *mas, struct maple_big_node *b_node) /* Try to push left. */ if (mas_push_data(mas, height, &mast, true)) break; - /* Try to push right. */ if (mas_push_data(mas, height, &mast, false)) break; @@ -3525,6 +3533,7 @@ static inline int mas_root_expand(struct ma_state *mas, void *entry) slots = ma_slots(node, type); node->parent = ma_parent_ptr(mas_tree_parent(mas)); mas->node = mt_mk_node(node, type); + mas->status = ma_active; if (mas->index) { if (contents) { @@ -3557,7 +3566,7 @@ static inline void mas_store_root(struct ma_state *mas, void *entry) mas_root_expand(mas, entry); else { rcu_assign_pointer(mas->tree->ma_root, entry); - mas->node = MAS_START; + mas->status = ma_start; } } @@ -3789,7 +3798,7 @@ static inline int mas_new_root(struct ma_state *mas, void *entry) mas->depth = 0; mas_set_height(mas); rcu_assign_pointer(mas->tree->ma_root, entry); - mas->node = MAS_START; + mas->status = ma_start; goto done; } @@ -3802,6 +3811,7 @@ static inline int mas_new_root(struct ma_state *mas, void *entry) slots = ma_slots(node, type); node->parent = ma_parent_ptr(mas_tree_parent(mas)); mas->node = mt_mk_node(node, type); + mas->status = ma_active; rcu_assign_pointer(slots[0], entry); pivots[0] = mas->last; mas->depth = 1; @@ -4429,7 +4439,7 @@ static int mas_prev_node(struct ma_state *mas, unsigned long min) if (unlikely(ma_dead_node(node))) return 1; - mas->node = MAS_NONE; + mas->status = ma_underflow; return 0; } @@ -4443,8 +4453,7 @@ static int mas_prev_node(struct ma_state *mas, unsigned long min) * * Return: The entry in the previous slot which is possibly NULL */ -static void *mas_prev_slot(struct ma_state *mas, unsigned long min, bool empty, - bool set_underflow) +static void *mas_prev_slot(struct ma_state *mas, unsigned long min, bool empty) { void *entry; void __rcu **slots; @@ -4482,8 +4491,8 @@ static void *mas_prev_slot(struct ma_state *mas, unsigned long min, bool empty, goto retry; } - if (mas_is_none(mas)) - goto underflow; + if (WARN_ON_ONCE(mas_is_underflow(mas))) + return NULL; mas->last = mas->max; node = mas_mn(mas); @@ -4497,12 +4506,15 @@ static void *mas_prev_slot(struct ma_state *mas, unsigned long min, bool empty, if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) goto retry; + if (mas->index <= min) + mas->status = ma_underflow; + if (likely(entry)) return entry; if (!empty) { - if (mas->index <= min) - goto underflow; + if (mas_is_underflow(mas)) + return NULL; goto again; } @@ -4510,8 +4522,7 @@ static void *mas_prev_slot(struct ma_state *mas, unsigned long min, bool empty, return entry; underflow: - if (set_underflow) - mas->node = MAS_UNDERFLOW; + mas->status = ma_underflow; return NULL; } @@ -4520,7 +4531,8 @@ static void *mas_prev_slot(struct ma_state *mas, unsigned long min, bool empty, * @mas: The maple state * @max: The maximum pivot value to check. * - * The next value will be mas->node[mas->offset] or MAS_NONE. + * The next value will be mas->node[mas->offset] or the status will have + * overflowed. * Return: 1 on dead node, 0 otherwise. */ static int mas_next_node(struct ma_state *mas, struct maple_node *node, @@ -4536,13 +4548,13 @@ static int mas_next_node(struct ma_state *mas, struct maple_node *node, void __rcu **slots; if (mas->max >= max) - goto no_entry; + goto overflow; min = mas->max + 1; level = 0; do { if (ma_is_root(node)) - goto no_entry; + goto overflow; /* Walk up. */ if (unlikely(mas_ascend(mas))) @@ -4593,11 +4605,11 @@ static int mas_next_node(struct ma_state *mas, struct maple_node *node, mas->min = min; return 0; -no_entry: +overflow: if (unlikely(ma_dead_node(node))) return 1; - mas->node = MAS_NONE; + mas->status = ma_overflow; return 0; } @@ -4612,8 +4624,7 @@ static int mas_next_node(struct ma_state *mas, struct maple_node *node, * * Return: The entry in the next slot which is possibly NULL */ -static void *mas_next_slot(struct ma_state *mas, unsigned long max, bool empty, - bool set_overflow) +static void *mas_next_slot(struct ma_state *mas, unsigned long max, bool empty) { void __rcu **slots; unsigned long *pivots; @@ -4634,13 +4645,15 @@ static void *mas_next_slot(struct ma_state *mas, unsigned long max, bool empty, if (likely(mas->offset < mas->end)) pivot = pivots[mas->offset]; else - goto overflow; + pivot = mas->max; if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) goto retry; - if (pivot >= max) - goto overflow; + if (pivot >= max) { + mas->status = ma_overflow; + return NULL; + } } if (likely(mas->offset < mas->end)) { @@ -4657,11 +4670,8 @@ static void *mas_next_slot(struct ma_state *mas, unsigned long max, bool empty, goto retry; } - if (WARN_ON_ONCE(mas_is_none(mas))) { - mas->node = MAS_OVERFLOW; + if (WARN_ON_ONCE(mas_is_overflow(mas))) return NULL; - goto overflow; - } mas->offset = 0; mas->index = mas->min; @@ -4679,20 +4689,18 @@ static void *mas_next_slot(struct ma_state *mas, unsigned long max, bool empty, if (entry) return entry; + if (!empty) { - if (mas->last >= max) - goto overflow; + if (mas->last >= max) { + mas->status = ma_overflow; + return NULL; + } mas->index = mas->last + 1; goto again; } return entry; - -overflow: - if (set_overflow) - mas->node = MAS_OVERFLOW; - return NULL; } /* @@ -4711,11 +4719,11 @@ static void *mas_next_slot(struct ma_state *mas, unsigned long max, bool empty, static inline void *mas_next_entry(struct ma_state *mas, unsigned long limit) { if (mas->last >= limit) { - mas->node = MAS_OVERFLOW; + mas->status = ma_overflow; return NULL; } - return mas_next_slot(mas, limit, false, true); + return mas_next_slot(mas, limit, false); } /* @@ -4883,7 +4891,7 @@ static inline bool mas_anode_descend(struct ma_state *mas, unsigned long size) * @mas: The maple state. * * mas->index and mas->last will be set to the range if there is a value. If - * mas->node is MAS_NONE, reset to MAS_START. + * mas->node is MAS_NONE, reset to mas_start * * Return: the entry at the location or %NULL. */ @@ -4892,7 +4900,7 @@ void *mas_walk(struct ma_state *mas) void *entry; if (!mas_is_active(mas) || !mas_is_start(mas)) - mas->node = MAS_START; + mas->status = ma_start; retry: entry = mas_state_walk(mas); if (mas_is_start(mas)) { @@ -4908,7 +4916,7 @@ void *mas_walk(struct ma_state *mas) mas->index = 1; mas->last = ULONG_MAX; - mas->node = MAS_NONE; + mas->status = ma_none; return NULL; } @@ -5660,27 +5668,40 @@ static bool mas_next_setup(struct ma_state *mas, unsigned long max, bool was_none = mas_is_none(mas); if (unlikely(mas->last >= max)) { - mas->node = MAS_OVERFLOW; + mas->status = ma_overflow; return true; } - if (mas_is_active(mas)) + switch (mas->status) { + case ma_active: return false; - - if (mas_is_none(mas) || mas_is_paused(mas)) { - mas->node = MAS_START; - } else if (mas_is_overflow(mas)) { + case ma_none: + fallthrough; + case ma_pause: + mas->status = ma_start; + fallthrough; + case ma_start: + mas_walk(mas); /* Retries on dead nodes handled by mas_walk */ + break; + case ma_overflow: /* Overflowed before, but the max changed */ - mas->node = MAS_START; - } else if (mas_is_underflow(mas)) { - mas->node = MAS_START; + mas->status = ma_active; + break; + case ma_underflow: + /* The user expects the mas to be one before where it is */ + mas->status = ma_active; *entry = mas_walk(mas); if (*entry) return true; + break; + case ma_root: + break; + case ma_error: + return true; } - if (mas_is_start(mas)) - *entry = mas_walk(mas); /* Retries on dead nodes handled by mas_walk */ + if (likely(mas_is_active(mas))) /* Fast path */ + return false; if (mas_is_ptr(mas)) { *entry = NULL; @@ -5690,7 +5711,7 @@ static bool mas_next_setup(struct ma_state *mas, unsigned long max, } mas->index = 1; mas->last = ULONG_MAX; - mas->node = MAS_NONE; + mas->status = ma_none; return true; } @@ -5719,7 +5740,7 @@ void *mas_next(struct ma_state *mas, unsigned long max) return entry; /* Retries on dead nodes handled by mas_next_slot */ - return mas_next_slot(mas, max, false, true); + return mas_next_slot(mas, max, false); } EXPORT_SYMBOL_GPL(mas_next); @@ -5742,7 +5763,7 @@ void *mas_next_range(struct ma_state *mas, unsigned long max) return entry; /* Retries on dead nodes handled by mas_next_slot */ - return mas_next_slot(mas, max, true, true); + return mas_next_slot(mas, max, true); } EXPORT_SYMBOL_GPL(mas_next_range); @@ -5773,33 +5794,45 @@ EXPORT_SYMBOL_GPL(mt_next); static bool mas_prev_setup(struct ma_state *mas, unsigned long min, void **entry) { if (unlikely(mas->index <= min)) { - mas->node = MAS_UNDERFLOW; + mas->status = ma_underflow; return true; } - if (mas_is_active(mas)) + switch (mas->status) { + case ma_active: return false; - - if (mas_is_overflow(mas)) { - mas->node = MAS_START; + case ma_start: + break; + case ma_none: + fallthrough; + case ma_pause: + mas->status = ma_start; + break; + case ma_underflow: + /* underflowed before but the min changed */ + mas->status = ma_active; + break; + case ma_overflow: + /* User expects mas to be one after where it is */ + mas->status = ma_active; *entry = mas_walk(mas); if (*entry) return true; - } - - if (mas_is_none(mas) || mas_is_paused(mas)) { - mas->node = MAS_START; - } else if (mas_is_underflow(mas)) { - /* underflowed before but the min changed */ - mas->node = MAS_START; + break; + case ma_root: + break; + case ma_error: + return true; } if (mas_is_start(mas)) mas_walk(mas); if (unlikely(mas_is_ptr(mas))) { - if (!mas->index) - goto none; + if (!mas->index) { + mas->status = ma_none; + return true; + } mas->index = mas->last = 0; *entry = mas_root(mas); return true; @@ -5809,7 +5842,7 @@ static bool mas_prev_setup(struct ma_state *mas, unsigned long min, void **entry if (mas->index) { /* Walked to out-of-range pointer? */ mas->index = mas->last = 0; - mas->node = MAS_ROOT; + mas->status = ma_root; *entry = mas_root(mas); return true; } @@ -5817,10 +5850,6 @@ static bool mas_prev_setup(struct ma_state *mas, unsigned long min, void **entry } return false; - -none: - mas->node = MAS_NONE; - return true; } /** @@ -5841,7 +5870,7 @@ void *mas_prev(struct ma_state *mas, unsigned long min) if (mas_prev_setup(mas, min, &entry)) return entry; - return mas_prev_slot(mas, min, false, true); + return mas_prev_slot(mas, min, false); } EXPORT_SYMBOL_GPL(mas_prev); @@ -5864,7 +5893,7 @@ void *mas_prev_range(struct ma_state *mas, unsigned long min) if (mas_prev_setup(mas, min, &entry)) return entry; - return mas_prev_slot(mas, min, true, true); + return mas_prev_slot(mas, min, true); } EXPORT_SYMBOL_GPL(mas_prev_range); @@ -5907,7 +5936,8 @@ EXPORT_SYMBOL_GPL(mt_prev); */ void mas_pause(struct ma_state *mas) { - mas->node = MAS_PAUSE; + mas->status = ma_pause; + mas->node = NULL; } EXPORT_SYMBOL_GPL(mas_pause); @@ -5921,32 +5951,52 @@ EXPORT_SYMBOL_GPL(mas_pause); */ static __always_inline bool mas_find_setup(struct ma_state *mas, unsigned long max, void **entry) { - if (mas_is_active(mas)) { + switch (mas->status) { + case ma_active: if (mas->last < max) return false; - return true; - } - - if (mas_is_paused(mas)) { + case ma_start: + break; + case ma_pause: if (unlikely(mas->last >= max)) return true; mas->index = ++mas->last; - mas->node = MAS_START; - } else if (mas_is_none(mas)) { + mas->status = ma_start; + break; + case ma_none: if (unlikely(mas->last >= max)) return true; mas->index = mas->last; - mas->node = MAS_START; - } else if (mas_is_overflow(mas) || mas_is_underflow(mas)) { - if (mas->index > max) { - mas->node = MAS_OVERFLOW; + mas->status = ma_start; + break; + case ma_underflow: + /* mas is pointing at entry before unable to go lower */ + if (unlikely(mas->index >= max)) { + mas->status = ma_overflow; return true; } - mas->node = MAS_START; + mas->status = ma_active; + *entry = mas_walk(mas); + if (*entry) + return true; + break; + case ma_overflow: + if (unlikely(mas->last >= max)) + return true; + + mas->status = ma_active; + *entry = mas_walk(mas); + if (*entry) + return true; + break; + case ma_root: + break; + case ma_error: + return true; } if (mas_is_start(mas)) { @@ -5973,7 +6023,7 @@ static __always_inline bool mas_find_setup(struct ma_state *mas, unsigned long m return false; ptr_out_of_range: - mas->node = MAS_NONE; + mas->status = ma_none; mas->index = 1; mas->last = ULONG_MAX; return true; @@ -5999,7 +6049,10 @@ void *mas_find(struct ma_state *mas, unsigned long max) return entry; /* Retries on dead nodes handled by mas_next_slot */ - return mas_next_slot(mas, max, false, false); + entry = mas_next_slot(mas, max, false); + /* Ignore overflow */ + mas->status = ma_active; + return entry; } EXPORT_SYMBOL_GPL(mas_find); @@ -6023,7 +6076,7 @@ void *mas_find_range(struct ma_state *mas, unsigned long max) return entry; /* Retries on dead nodes handled by mas_next_slot */ - return mas_next_slot(mas, max, true, false); + return mas_next_slot(mas, max, true); } EXPORT_SYMBOL_GPL(mas_find_range); @@ -6038,33 +6091,45 @@ EXPORT_SYMBOL_GPL(mas_find_range); static bool mas_find_rev_setup(struct ma_state *mas, unsigned long min, void **entry) { - if (mas_is_active(mas)) { - if (mas->index > min) - return false; - return true; - } - - if (mas_is_paused(mas)) { + switch (mas->status) { + case ma_active: + goto active; + case ma_start: + break; + case ma_pause: if (unlikely(mas->index <= min)) { - mas->node = MAS_NONE; + mas->status = ma_underflow; return true; } - mas->node = MAS_START; mas->last = --mas->index; - } else if (mas_is_none(mas)) { + mas->status = ma_start; + break; + case ma_none: if (mas->index <= min) goto none; mas->last = mas->index; - mas->node = MAS_START; - } else if (mas_is_underflow(mas) || mas_is_overflow(mas)) { - if (mas->last <= min) { - mas->node = MAS_UNDERFLOW; + mas->status = ma_start; + break; + case ma_overflow: /* user expects the mas to be one after where it is */ + if (unlikely(mas->index <= min)) { + mas->status = ma_underflow; return true; } - mas->node = MAS_START; + mas->status = ma_active; + break; + case ma_underflow: /* user expects the mas to be one before where it is */ + if (unlikely(mas->index <= min)) + return true; + + mas->status = ma_active; + break; + case ma_root: + break; + case ma_error: + return true; } if (mas_is_start(mas)) { @@ -6087,19 +6152,20 @@ static bool mas_find_rev_setup(struct ma_state *mas, unsigned long min, * previous location is 0. */ mas->last = mas->index = 0; - mas->node = MAS_ROOT; + mas->status = ma_root; *entry = mas_root(mas); return true; } } +active: if (mas->index < min) return true; return false; none: - mas->node = MAS_NONE; + mas->status = ma_none; return true; } @@ -6124,7 +6190,7 @@ void *mas_find_rev(struct ma_state *mas, unsigned long min) return entry; /* Retries on dead nodes handled by mas_prev_slot */ - return mas_prev_slot(mas, min, false, false); + return mas_prev_slot(mas, min, false); } EXPORT_SYMBOL_GPL(mas_find_rev); @@ -6150,7 +6216,7 @@ void *mas_find_range_rev(struct ma_state *mas, unsigned long min) return entry; /* Retries on dead nodes handled by mas_prev_slot */ - return mas_prev_slot(mas, min, true, false); + return mas_prev_slot(mas, min, true); } EXPORT_SYMBOL_GPL(mas_find_range_rev); @@ -6171,7 +6237,7 @@ void *mas_erase(struct ma_state *mas) MA_WR_STATE(wr_mas, mas, NULL); if (!mas_is_active(mas) || !mas_is_start(mas)) - mas->node = MAS_START; + mas->status = ma_start; /* Retry unnecessary when holding the write lock. */ entry = mas_state_walk(mas); @@ -6216,7 +6282,7 @@ bool mas_nomem(struct ma_state *mas, gfp_t gfp) if (!mas_allocated(mas)) return false; - mas->node = MAS_START; + mas->status = ma_start; return true; } @@ -6687,11 +6753,11 @@ static inline struct maple_enode *mas_get_slot(struct ma_state *mas, static void mas_dfs_postorder(struct ma_state *mas, unsigned long max) { - struct maple_enode *p = MAS_NONE, *mn = mas->node; + struct maple_enode *p, *mn = mas->node; unsigned long p_min, p_max; mas_next_node(mas, mas_mn(mas), max); - if (!mas_is_none(mas)) + if (!mas_is_overflow(mas)) return; if (mte_is_root(mn)) @@ -6704,7 +6770,7 @@ static void mas_dfs_postorder(struct ma_state *mas, unsigned long max) p_min = mas->min; p_max = mas->max; mas_prev_node(mas, 0); - } while (!mas_is_none(mas)); + } while (!mas_is_underflow(mas)); mas->node = p; mas->max = p_max; @@ -7159,7 +7225,7 @@ static void mt_validate_nulls(struct maple_tree *mt) MA_STATE(mas, mt, 0, 0); mas_start(&mas); - if (mas_is_none(&mas) || (mas.node == MAS_ROOT)) + if (mas_is_none(&mas) || (mas_is_ptr(&mas))) return; while (!mte_is_leaf(mas.node)) @@ -7176,7 +7242,7 @@ static void mt_validate_nulls(struct maple_tree *mt) last = entry; if (offset == mas_data_end(&mas)) { mas_next_node(&mas, mas_mn(&mas), ULONG_MAX); - if (mas_is_none(&mas)) + if (mas_is_overflow(&mas)) return; offset = 0; slots = ma_slots(mte_to_node(mas.node), @@ -7185,7 +7251,7 @@ static void mt_validate_nulls(struct maple_tree *mt) offset++; } - } while (!mas_is_none(&mas)); + } while (!mas_is_overflow(&mas)); } /* @@ -7206,7 +7272,7 @@ void mt_validate(struct maple_tree *mt) while (!mte_is_leaf(mas.node)) mas_descend(&mas); - while (!mas_is_none(&mas)) { + while (!mas_is_overflow(&mas)) { MAS_WARN_ON(&mas, mte_dead_node(mas.node)); end = mas_data_end(&mas); if (MAS_WARN_ON(&mas, (end < mt_min_slot_count(mas.node)) && @@ -7231,16 +7297,35 @@ EXPORT_SYMBOL_GPL(mt_validate); void mas_dump(const struct ma_state *mas) { pr_err("MAS: tree=%p enode=%p ", mas->tree, mas->node); - if (mas_is_none(mas)) - pr_err("(MAS_NONE) "); - else if (mas_is_ptr(mas)) - pr_err("(MAS_ROOT) "); - else if (mas_is_start(mas)) - pr_err("(MAS_START) "); - else if (mas_is_paused(mas)) - pr_err("(MAS_PAUSED) "); - - pr_err("[%u] index=%lx last=%lx\n", mas->offset, mas->index, mas->last); + switch (mas->status) { + case ma_active: + pr_err("(ma_active)"); + break; + case ma_none: + pr_err("(ma_none)"); + break; + case ma_root: + pr_err("(ma_root)"); + break; + case ma_start: + pr_err("(ma_start) "); + break; + case ma_pause: + pr_err("(ma_pause) "); + break; + case ma_overflow: + pr_err("(ma_overflow) "); + break; + case ma_underflow: + pr_err("(ma_underflow) "); + break; + case ma_error: + pr_err("(ma_error) "); + break; + } + + pr_err("[%u/%u] index=%lx last=%lx\n", mas->offset, mas->end, + mas->index, mas->last); pr_err(" min=%lx max=%lx alloc=%p, depth=%u, flags=%x\n", mas->min, mas->max, mas->alloc, mas->depth, mas->mas_flags); if (mas->index > mas->last) diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index 06959165e2f9..b82c02f15380 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -53,6 +53,11 @@ atomic_t maple_tree_tests_passed; #else #define cond_resched() do {} while (0) #endif + +#define mas_is_none(x) ((x)->status == ma_none) +#define mas_is_overflow(x) ((x)->status == ma_overflow) +#define mas_is_underflow(x) ((x)->status == ma_underflow) + static int __init mtree_insert_index(struct maple_tree *mt, unsigned long index, gfp_t gfp) { @@ -581,7 +586,7 @@ static noinline void __init check_find(struct maple_tree *mt) MT_BUG_ON(mt, last != mas.last); - mas.node = MAS_NONE; + mas.status = ma_none; mas.index = ULONG_MAX; mas.last = ULONG_MAX; entry2 = mas_prev(&mas, 0); @@ -2166,7 +2171,7 @@ static noinline void __init next_prev_test(struct maple_tree *mt) MT_BUG_ON(mt, val != NULL); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != 5); - MT_BUG_ON(mt, mas.node != MAS_UNDERFLOW); + MT_BUG_ON(mt, !mas_is_underflow(&mas)); mas.index = 0; mas.last = 5; @@ -3026,10 +3031,6 @@ static noinline void __init check_empty_area_fill(struct maple_tree *mt) * DNE active active range of NULL */ -#define mas_active(x) (((x).node != MAS_ROOT) && \ - ((x).node != MAS_START) && \ - ((x).node != MAS_PAUSE) && \ - ((x).node != MAS_NONE)) static noinline void __init check_state_handling(struct maple_tree *mt) { MA_STATE(mas, mt, 0, 0); @@ -3044,7 +3045,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) /* prev: Start -> underflow*/ entry = mas_prev(&mas, 0); MT_BUG_ON(mt, entry != NULL); - MT_BUG_ON(mt, mas.node != MAS_UNDERFLOW); + MT_BUG_ON(mt, mas.status != ma_underflow); /* prev: Start -> root */ mas_set(&mas, 10); @@ -3052,7 +3053,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != 0); - MT_BUG_ON(mt, mas.node != MAS_ROOT); + MT_BUG_ON(mt, mas.status != ma_root); /* prev: pause -> root */ mas_set(&mas, 10); @@ -3061,7 +3062,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != 0); - MT_BUG_ON(mt, mas.node != MAS_ROOT); + MT_BUG_ON(mt, mas.status != ma_root); /* next: start -> none */ mas_set(&mas, 0); @@ -3069,7 +3070,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, mas.index != 1); MT_BUG_ON(mt, mas.last != ULONG_MAX); MT_BUG_ON(mt, entry != NULL); - MT_BUG_ON(mt, mas.node != MAS_NONE); + MT_BUG_ON(mt, mas.status != ma_none); /* next: start -> none*/ mas_set(&mas, 10); @@ -3077,7 +3078,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, mas.index != 1); MT_BUG_ON(mt, mas.last != ULONG_MAX); MT_BUG_ON(mt, entry != NULL); - MT_BUG_ON(mt, mas.node != MAS_NONE); + MT_BUG_ON(mt, mas.status != ma_none); /* find: start -> root */ mas_set(&mas, 0); @@ -3085,21 +3086,21 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != 0); - MT_BUG_ON(mt, mas.node != MAS_ROOT); + MT_BUG_ON(mt, mas.status != ma_root); /* find: root -> none */ entry = mas_find(&mas, ULONG_MAX); MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 1); MT_BUG_ON(mt, mas.last != ULONG_MAX); - MT_BUG_ON(mt, mas.node != MAS_NONE); + MT_BUG_ON(mt, mas.status != ma_none); /* find: none -> none */ entry = mas_find(&mas, ULONG_MAX); MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 1); MT_BUG_ON(mt, mas.last != ULONG_MAX); - MT_BUG_ON(mt, mas.node != MAS_NONE); + MT_BUG_ON(mt, mas.status != ma_none); /* find: start -> none */ mas_set(&mas, 10); @@ -3107,14 +3108,14 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 1); MT_BUG_ON(mt, mas.last != ULONG_MAX); - MT_BUG_ON(mt, mas.node != MAS_NONE); + MT_BUG_ON(mt, mas.status != ma_none); /* find_rev: none -> root */ entry = mas_find_rev(&mas, 0); MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != 0); - MT_BUG_ON(mt, mas.node != MAS_ROOT); + MT_BUG_ON(mt, mas.status != ma_root); /* find_rev: start -> root */ mas_set(&mas, 0); @@ -3122,21 +3123,21 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != 0); - MT_BUG_ON(mt, mas.node != MAS_ROOT); + MT_BUG_ON(mt, mas.status != ma_root); /* find_rev: root -> none */ entry = mas_find_rev(&mas, 0); MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != 0); - MT_BUG_ON(mt, mas.node != MAS_NONE); + MT_BUG_ON(mt, mas.status != ma_none); /* find_rev: none -> none */ entry = mas_find_rev(&mas, 0); MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != 0); - MT_BUG_ON(mt, mas.node != MAS_NONE); + MT_BUG_ON(mt, mas.status != ma_none); /* find_rev: start -> root */ mas_set(&mas, 10); @@ -3144,7 +3145,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != 0); - MT_BUG_ON(mt, mas.node != MAS_ROOT); + MT_BUG_ON(mt, mas.status != ma_root); /* walk: start -> none */ mas_set(&mas, 10); @@ -3152,7 +3153,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 1); MT_BUG_ON(mt, mas.last != ULONG_MAX); - MT_BUG_ON(mt, mas.node != MAS_NONE); + MT_BUG_ON(mt, mas.status != ma_none); /* walk: pause -> none*/ mas_set(&mas, 10); @@ -3161,7 +3162,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 1); MT_BUG_ON(mt, mas.last != ULONG_MAX); - MT_BUG_ON(mt, mas.node != MAS_NONE); + MT_BUG_ON(mt, mas.status != ma_none); /* walk: none -> none */ mas.index = mas.last = 10; @@ -3169,14 +3170,14 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 1); MT_BUG_ON(mt, mas.last != ULONG_MAX); - MT_BUG_ON(mt, mas.node != MAS_NONE); + MT_BUG_ON(mt, mas.status != ma_none); /* walk: none -> none */ entry = mas_walk(&mas); MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 1); MT_BUG_ON(mt, mas.last != ULONG_MAX); - MT_BUG_ON(mt, mas.node != MAS_NONE); + MT_BUG_ON(mt, mas.status != ma_none); /* walk: start -> root */ mas_set(&mas, 0); @@ -3184,7 +3185,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != 0); - MT_BUG_ON(mt, mas.node != MAS_ROOT); + MT_BUG_ON(mt, mas.status != ma_root); /* walk: pause -> root */ mas_set(&mas, 0); @@ -3193,22 +3194,22 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != 0); - MT_BUG_ON(mt, mas.node != MAS_ROOT); + MT_BUG_ON(mt, mas.status != ma_root); /* walk: none -> root */ - mas.node = MAS_NONE; + mas.status = ma_none; entry = mas_walk(&mas); MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != 0); - MT_BUG_ON(mt, mas.node != MAS_ROOT); + MT_BUG_ON(mt, mas.status != ma_root); /* walk: root -> root */ entry = mas_walk(&mas); MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != 0); - MT_BUG_ON(mt, mas.node != MAS_ROOT); + MT_BUG_ON(mt, mas.status != ma_root); /* walk: root -> none */ mas_set(&mas, 10); @@ -3216,7 +3217,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 1); MT_BUG_ON(mt, mas.last != ULONG_MAX); - MT_BUG_ON(mt, mas.node != MAS_NONE); + MT_BUG_ON(mt, mas.status != ma_none); /* walk: none -> root */ mas.index = mas.last = 0; @@ -3224,7 +3225,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != 0); - MT_BUG_ON(mt, mas.node != MAS_ROOT); + MT_BUG_ON(mt, mas.status != ma_root); mas_unlock(&mas); @@ -3242,7 +3243,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0x1000); MT_BUG_ON(mt, mas.last != 0x1500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* next: pause ->active */ mas_set(&mas, 0); @@ -3251,126 +3252,127 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0x1000); MT_BUG_ON(mt, mas.last != 0x1500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* next: none ->active */ mas.index = mas.last = 0; mas.offset = 0; - mas.node = MAS_NONE; + mas.status = ma_none; entry = mas_next(&mas, ULONG_MAX); MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0x1000); MT_BUG_ON(mt, mas.last != 0x1500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* next:active ->active */ entry = mas_next(&mas, ULONG_MAX); MT_BUG_ON(mt, entry != ptr2); MT_BUG_ON(mt, mas.index != 0x2000); MT_BUG_ON(mt, mas.last != 0x2500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); - /* next:active -> active beyond data */ + /* next:active -> overflow (limit reached) beyond data */ entry = mas_next(&mas, 0x2999); MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 0x2501); MT_BUG_ON(mt, mas.last != 0x2fff); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_overflow(&mas)); - /* Continue after last range ends after max */ + /* next:overflow -> active (limit changed) */ entry = mas_next(&mas, ULONG_MAX); MT_BUG_ON(mt, entry != ptr3); MT_BUG_ON(mt, mas.index != 0x3000); MT_BUG_ON(mt, mas.last != 0x3500); - MT_BUG_ON(mt, !mas_active(mas)); - - /* next:active -> active continued */ - entry = mas_next(&mas, ULONG_MAX); - MT_BUG_ON(mt, entry != NULL); - MT_BUG_ON(mt, mas.index != 0x3501); - MT_BUG_ON(mt, mas.last != ULONG_MAX); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); - /* next:active -> overflow */ + /* next:active -> overflow (limit reached) */ entry = mas_next(&mas, ULONG_MAX); MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 0x3501); MT_BUG_ON(mt, mas.last != ULONG_MAX); - MT_BUG_ON(mt, mas.node != MAS_OVERFLOW); + MT_BUG_ON(mt, !mas_is_overflow(&mas)); /* next:overflow -> overflow */ entry = mas_next(&mas, ULONG_MAX); MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 0x3501); MT_BUG_ON(mt, mas.last != ULONG_MAX); - MT_BUG_ON(mt, mas.node != MAS_OVERFLOW); + MT_BUG_ON(mt, !mas_is_overflow(&mas)); /* prev:overflow -> active */ entry = mas_prev(&mas, 0); MT_BUG_ON(mt, entry != ptr3); MT_BUG_ON(mt, mas.index != 0x3000); MT_BUG_ON(mt, mas.last != 0x3500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* next: none -> active, skip value at location */ mas_set(&mas, 0); entry = mas_next(&mas, ULONG_MAX); - mas.node = MAS_NONE; + mas.status = ma_none; mas.offset = 0; entry = mas_next(&mas, ULONG_MAX); MT_BUG_ON(mt, entry != ptr2); MT_BUG_ON(mt, mas.index != 0x2000); MT_BUG_ON(mt, mas.last != 0x2500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* prev:active ->active */ entry = mas_prev(&mas, 0); MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0x1000); MT_BUG_ON(mt, mas.last != 0x1500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); - /* prev:active -> active spanning end range */ + /* prev:active -> underflow (span limit) */ + mas_next(&mas, ULONG_MAX); + entry = mas_prev(&mas, 0x1200); + MT_BUG_ON(mt, entry != ptr); + MT_BUG_ON(mt, mas.index != 0x1000); + MT_BUG_ON(mt, mas.last != 0x1500); + MT_BUG_ON(mt, !mas_is_underflow(&mas)); + + /* prev:underflow -> underflow (lower limit) spanning end range */ entry = mas_prev(&mas, 0x0100); MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != 0x0FFF); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_underflow(&mas)); - /* prev:active -> underflow */ + /* prev:underflow -> underflow */ entry = mas_prev(&mas, 0); MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != 0x0FFF); - MT_BUG_ON(mt, mas.node != MAS_UNDERFLOW); + MT_BUG_ON(mt, !mas_is_underflow(&mas)); /* prev:underflow -> underflow */ entry = mas_prev(&mas, 0); MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != 0x0FFF); - MT_BUG_ON(mt, mas.node != MAS_UNDERFLOW); + MT_BUG_ON(mt, !mas_is_underflow(&mas)); /* next:underflow -> active */ entry = mas_next(&mas, ULONG_MAX); MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0x1000); MT_BUG_ON(mt, mas.last != 0x1500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* prev:first value -> underflow */ entry = mas_prev(&mas, 0x1000); MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 0x1000); MT_BUG_ON(mt, mas.last != 0x1500); - MT_BUG_ON(mt, mas.node != MAS_UNDERFLOW); + MT_BUG_ON(mt, !mas_is_underflow(&mas)); /* find:underflow -> first value */ entry = mas_find(&mas, ULONG_MAX); MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0x1000); MT_BUG_ON(mt, mas.last != 0x1500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* prev: pause ->active */ mas_set(&mas, 0x3600); @@ -3381,21 +3383,21 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr2); MT_BUG_ON(mt, mas.index != 0x2000); MT_BUG_ON(mt, mas.last != 0x2500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); - /* prev:active -> active spanning min */ + /* prev:active -> underflow spanning min */ entry = mas_prev(&mas, 0x1600); MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 0x1501); MT_BUG_ON(mt, mas.last != 0x1FFF); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_underflow(&mas)); /* prev: active ->active, continue */ entry = mas_prev(&mas, 0); MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0x1000); MT_BUG_ON(mt, mas.last != 0x1500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* find: start ->active */ mas_set(&mas, 0); @@ -3403,7 +3405,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0x1000); MT_BUG_ON(mt, mas.last != 0x1500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* find: pause ->active */ mas_set(&mas, 0); @@ -3412,7 +3414,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0x1000); MT_BUG_ON(mt, mas.last != 0x1500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* find: start ->active on value */; mas_set(&mas, 1200); @@ -3420,14 +3422,14 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0x1000); MT_BUG_ON(mt, mas.last != 0x1500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* find:active ->active */ entry = mas_find(&mas, ULONG_MAX); MT_BUG_ON(mt, entry != ptr2); MT_BUG_ON(mt, mas.index != 0x2000); MT_BUG_ON(mt, mas.last != 0x2500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* find:active -> active (NULL)*/ @@ -3435,35 +3437,35 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 0x2501); MT_BUG_ON(mt, mas.last != 0x2FFF); - MT_BUG_ON(mt, !mas_active(mas)); + MAS_BUG_ON(&mas, !mas_is_active(&mas)); /* find: overflow ->active */ entry = mas_find(&mas, 0x5000); MT_BUG_ON(mt, entry != ptr3); MT_BUG_ON(mt, mas.index != 0x3000); MT_BUG_ON(mt, mas.last != 0x3500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* find:active -> active (NULL) end*/ entry = mas_find(&mas, ULONG_MAX); MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 0x3501); MT_BUG_ON(mt, mas.last != ULONG_MAX); - MT_BUG_ON(mt, !mas_active(mas)); + MAS_BUG_ON(&mas, !mas_is_active(&mas)); /* find_rev: active (END) ->active */ entry = mas_find_rev(&mas, 0); MT_BUG_ON(mt, entry != ptr3); MT_BUG_ON(mt, mas.index != 0x3000); MT_BUG_ON(mt, mas.last != 0x3500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* find_rev:active ->active */ entry = mas_find_rev(&mas, 0); MT_BUG_ON(mt, entry != ptr2); MT_BUG_ON(mt, mas.index != 0x2000); MT_BUG_ON(mt, mas.last != 0x2500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* find_rev: pause ->active */ mas_pause(&mas); @@ -3471,14 +3473,14 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0x1000); MT_BUG_ON(mt, mas.last != 0x1500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); - /* find_rev:active -> active */ + /* find_rev:active -> underflow */ entry = mas_find_rev(&mas, 0); MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != 0x0FFF); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_underflow(&mas)); /* find_rev: start ->active */ mas_set(&mas, 0x1200); @@ -3486,7 +3488,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0x1000); MT_BUG_ON(mt, mas.last != 0x1500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* mas_walk start ->active */ mas_set(&mas, 0x1200); @@ -3494,7 +3496,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0x1000); MT_BUG_ON(mt, mas.last != 0x1500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* mas_walk start ->active */ mas_set(&mas, 0x1600); @@ -3502,7 +3504,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 0x1501); MT_BUG_ON(mt, mas.last != 0x1fff); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* mas_walk pause ->active */ mas_set(&mas, 0x1200); @@ -3511,7 +3513,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0x1000); MT_BUG_ON(mt, mas.last != 0x1500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* mas_walk pause -> active */ mas_set(&mas, 0x1600); @@ -3520,25 +3522,25 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 0x1501); MT_BUG_ON(mt, mas.last != 0x1fff); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* mas_walk none -> active */ mas_set(&mas, 0x1200); - mas.node = MAS_NONE; + mas.status = ma_none; entry = mas_walk(&mas); MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0x1000); MT_BUG_ON(mt, mas.last != 0x1500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* mas_walk none -> active */ mas_set(&mas, 0x1600); - mas.node = MAS_NONE; + mas.status = ma_none; entry = mas_walk(&mas); MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 0x1501); MT_BUG_ON(mt, mas.last != 0x1fff); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* mas_walk active -> active */ mas.index = 0x1200; @@ -3548,7 +3550,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0x1000); MT_BUG_ON(mt, mas.last != 0x1500); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* mas_walk active -> active */ mas.index = 0x1600; @@ -3557,7 +3559,7 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != NULL); MT_BUG_ON(mt, mas.index != 0x1501); MT_BUG_ON(mt, mas.last != 0x1fff); - MT_BUG_ON(mt, !mas_active(mas)); + MT_BUG_ON(mt, !mas_is_active(&mas)); mas_unlock(&mas); } diff --git a/mm/internal.h b/mm/internal.h index 812ba03224f8..db97bf5833ae 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1102,13 +1102,13 @@ static inline void vma_iter_store(struct vma_iterator *vmi, { #if defined(CONFIG_DEBUG_VM_MAPLE_TREE) - if (MAS_WARN_ON(&vmi->mas, vmi->mas.node != MAS_START && + if (MAS_WARN_ON(&vmi->mas, vmi->mas.status != ma_start && vmi->mas.index > vma->vm_start)) { pr_warn("%lx > %lx\n store vma %lx-%lx\n into slot %lx-%lx\n", vmi->mas.index, vma->vm_start, vma->vm_start, vma->vm_end, vmi->mas.index, vmi->mas.last); } - if (MAS_WARN_ON(&vmi->mas, vmi->mas.node != MAS_START && + if (MAS_WARN_ON(&vmi->mas, vmi->mas.status != ma_start && vmi->mas.last < vma->vm_start)) { pr_warn("%lx < %lx\nstore vma %lx-%lx\ninto slot %lx-%lx\n", vmi->mas.last, vma->vm_start, vma->vm_start, vma->vm_end, @@ -1116,7 +1116,7 @@ static inline void vma_iter_store(struct vma_iterator *vmi, } #endif - if (vmi->mas.node != MAS_START && + if (vmi->mas.status != ma_start && ((vmi->mas.index > vma->vm_start) || (vmi->mas.last < vma->vm_start))) vma_iter_invalidate(vmi); @@ -1127,7 +1127,7 @@ static inline void vma_iter_store(struct vma_iterator *vmi, static inline int vma_iter_store_gfp(struct vma_iterator *vmi, struct vm_area_struct *vma, gfp_t gfp) { - if (vmi->mas.node != MAS_START && + if (vmi->mas.status != ma_start && ((vmi->mas.index > vma->vm_start) || (vmi->mas.last < vma->vm_start))) vma_iter_invalidate(vmi); diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index cb4e4a7cc7f5..57964aec2122 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -118,6 +118,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) MT_BUG_ON(mt, mas.alloc == NULL); MT_BUG_ON(mt, mas.alloc->slot[0] == NULL); mas_push_node(&mas, mn); + mas_reset(&mas); mas_nomem(&mas, GFP_KERNEL); /* free */ mtree_unlock(mt); @@ -141,7 +142,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) mn->parent = ma_parent_ptr(mn); ma_free_rcu(mn); - mas.node = MAS_START; + mas.status = ma_start; mas_nomem(&mas, GFP_KERNEL); /* Allocate 3 nodes, will fail. */ mas_node_count(&mas, 3); @@ -158,6 +159,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) /* Ensure we counted 3. */ MT_BUG_ON(mt, mas_allocated(&mas) != 3); /* Free. */ + mas_reset(&mas); mas_nomem(&mas, GFP_KERNEL); /* Set allocation request to 1. */ @@ -272,6 +274,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) ma_free_rcu(mn); MT_BUG_ON(mt, mas_allocated(&mas) != i - j - 1); } + mas_reset(&mas); MT_BUG_ON(mt, mas_nomem(&mas, GFP_KERNEL)); } @@ -294,6 +297,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) smn = smn->slot[0]; /* next. */ } MT_BUG_ON(mt, mas_allocated(&mas) != total); + mas_reset(&mas); mas_nomem(&mas, GFP_KERNEL); /* Free. */ MT_BUG_ON(mt, mas_allocated(&mas) != 0); @@ -441,7 +445,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) mas.node = MA_ERROR(-ENOMEM); mas_node_count(&mas, 10); /* Request */ mas_nomem(&mas, GFP_KERNEL); /* Fill request */ - mas.node = MAS_START; + mas.status = ma_start; MT_BUG_ON(mt, mas_allocated(&mas) != 10); mas_destroy(&mas); @@ -452,7 +456,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) mas.node = MA_ERROR(-ENOMEM); mas_node_count(&mas, 10 + MAPLE_ALLOC_SLOTS - 1); /* Request */ mas_nomem(&mas, GFP_KERNEL); /* Fill request */ - mas.node = MAS_START; + mas.status = ma_start; MT_BUG_ON(mt, mas_allocated(&mas) != 10 + MAPLE_ALLOC_SLOTS - 1); mas_destroy(&mas); @@ -941,7 +945,7 @@ static inline bool mas_tree_walk(struct ma_state *mas, unsigned long *range_min, ret = mas_descend_walk(mas, range_min, range_max); if (unlikely(mte_dead_node(mas->node))) { - mas->node = MAS_START; + mas->status = ma_start; goto retry; } @@ -961,10 +965,10 @@ static inline void *mas_range_load(struct ma_state *mas, unsigned long index = mas->index; if (mas_is_none(mas) || mas_is_paused(mas)) - mas->node = MAS_START; + mas->status = ma_start; retry: if (mas_tree_walk(mas, range_min, range_max)) - if (unlikely(mas->node == MAS_ROOT)) + if (unlikely(mas->status == ma_root)) return mas_root(mas); if (likely(mas->offset != MAPLE_NODE_SLOTS)) @@ -35337,7 +35341,7 @@ static void mas_dfs_preorder(struct ma_state *mas) unsigned char end, slot = 0; unsigned long *pivots; - if (mas->node == MAS_START) { + if (mas->status == ma_start) { mas_start(mas); return; } @@ -35374,7 +35378,7 @@ static void mas_dfs_preorder(struct ma_state *mas) return; done: - mas->node = MAS_NONE; + mas->status = ma_none; } @@ -35833,7 +35837,7 @@ static noinline void __init check_nomem(struct maple_tree *mt) mas_store(&ms, &ms); /* insert 1 -> &ms, fails. */ MT_BUG_ON(mt, ms.node != MA_ERROR(-ENOMEM)); mas_nomem(&ms, GFP_KERNEL); /* Node allocated in here. */ - MT_BUG_ON(mt, ms.node != MAS_START); + MT_BUG_ON(mt, ms.status != ma_start); mtree_unlock(mt); MT_BUG_ON(mt, mtree_insert(mt, 2, mt, GFP_KERNEL) != 0); mtree_lock(mt); From patchwork Wed Nov 1 17:16:26 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: 13442930 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 E3E61C4167B for ; Wed, 1 Nov 2023 17:17:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 66E4F900006; Wed, 1 Nov 2023 13:17:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5F2D390000D; Wed, 1 Nov 2023 13:17:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 41FCA900006; Wed, 1 Nov 2023 13:17:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 2678690000D for ; Wed, 1 Nov 2023 13:17:02 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id B8A9E160D1D for ; Wed, 1 Nov 2023 17:17:01 +0000 (UTC) X-FDA: 81410040642.07.2971BB6 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf01.hostedemail.com (Postfix) with ESMTP id 13D534000A for ; Wed, 1 Nov 2023 17:16:57 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=ALKgumDZ; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Ft7CJ6FN; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf01.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=1698859018; 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=A558WsTvaSU/K3Z1XzDFTtaSK5lZeV05+s0FwlRXb0s=; b=rZngxxZJXVXJnf5t0B3+U3RyXA5sMyFl8YMDd/2Zxi4gyvChY1mXkK7DoElh5vDhfTi50c PIFOYBVhMFIYFqqHRLFRMYEgB9nWG1s13tlft2P3CZAy460HxA0gTvF1U3MtDV0aUBJPDs vy6EuQHGnr+kdKjROMfvEWBA0vfhJxw= ARC-Authentication-Results: i=2; imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=ALKgumDZ; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Ft7CJ6FN; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf01.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=1698859018; a=rsa-sha256; cv=pass; b=XFEhtncGsJroCT98w/dtEDJ31GrZjWdrPRQoAFbDgzObaA8HoKFyDaleuq9mmSUFtXtxut aHNllY/JXUx9umCB6bfl1K4lHPNpzC4udVnCkfPcVOr1xOegKggX1EtiOuOzLH6HdFtNQM eL/DB460zQu1TI5gLpPQty4PNmHRhSM= 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 3A1GYoW8011191; Wed, 1 Nov 2023 17:16:57 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=A558WsTvaSU/K3Z1XzDFTtaSK5lZeV05+s0FwlRXb0s=; b=ALKgumDZdCPaQjMDSod/IYZXZlc1vp1WymG6pzMNUSrteOouACiVtWtLV+zFnPDO0Rvn t6yzjocqNuqNz/RtnWitux6ulxYdqlf08qwTbUyaMhaWeB1c68BPvVG8+ArxBO6tVwps 4iN8jada9laqvOiWpN4gTg7B6//3huYTgW/vhgKiPAYtHhxSXoz+DRhnmor0MicQTy18 OOFwD6x5l1qulhao74Z20TAv682M9KJ17KOcirLgatyPUf2kIS7RT0GUB9sT3lmO6EWG 3A72jCKdB8ONmUGTxqx7DKf3nlEwlSfZihR6ZwMGt+qMIV7G8YrFBCs1CdrqmOw/HkL6 tw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u0s7byxt5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:56 +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 3A1H7nw8038146; Wed, 1 Nov 2023 17:16:55 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2041.outbound.protection.outlook.com [104.47.74.41]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3u0rrdjy1h-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ogyQi3POz2j2rzZSFeQkBljvVRBglBJMi44OyytWZC7PCRan56AI3nH/Z74RTk16TLSnhFwwH8MHcGlpgcflL+SzVdUS3RXM4wa38msrtlObthdS1iiUC0NSUwRCh7TRjK1IOPvX9Xyeim8x8O054kWgi1ob887gKaJihHAFycKwC+2rD9k6GfEXkvzd+QCBxemweGeq+aDun/AVgYOd/lC2UmlJ+cdcp8ZBQnR0MGVlFmdLNqlpymBwQMkfbpu3KEAgmR39OOu9JkmjwFeAYAKKEfZvoPQyGLA3RtdiGy1jMWg6/BCoeXQwfdpPwpmL0q0BiPJ7ghL95a3s/llE5A== 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=A558WsTvaSU/K3Z1XzDFTtaSK5lZeV05+s0FwlRXb0s=; b=IDCCN1hXbb0o8xSfKH3YU+LXVgKaYSGnbzyISaUD3mzwc6fhW1weaXtDEW/wzjkBCKO9ksKK01dvCcflGfEkp24dGNF64xQ43x1JiRdSOLRf4wWi3q/qgcn6ZBb6XTL9Ol3H04kyqliVQ90yQYX6BPpLl/cB0pv6tfTo3Q8dHudb8qITivaLQaSrAfdqYFt/HGXBA4RBF7y9wUNDDEeW7L7jsEMJOcztcPFLwb3t7N6C8PRI48oM+RRMbEH0ke6HN8wm8CZ9at2iCfmdIt+GcpuuzLznUnnDSDqdWP8iwKtMDweI8ShgQtLrIQtg2U35A6UMlmy7fOceEcnXXnucAg== 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=A558WsTvaSU/K3Z1XzDFTtaSK5lZeV05+s0FwlRXb0s=; b=Ft7CJ6FN6nF7DxO+tGFJylSMnS5haQLh5Q5mk/KLb/61HHBD5YOfAXzQL5iWpDSZDpgry/ePICjc16kwurc4bshCYbxJwce23zDwuvjb0+5x+BqvUol04owbbuG7zST0Sn3raKChrWhWqNUjzhVttu7NyGmlRqFhL3VGoyhvsvE= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SA1PR10MB7684.namprd10.prod.outlook.com (2603:10b6:806:38e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.31; Wed, 1 Nov 2023 17:16:53 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa%4]) with mapi id 15.20.6907.025; Wed, 1 Nov 2023 17:16:53 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Liam R. Howlett" Subject: [PATCH 09/12] maple_tree: Remove mas_searchable() Date: Wed, 1 Nov 2023 13:16:26 -0400 Message-Id: <20231101171629.3612299-10-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231101171629.3612299-1-Liam.Howlett@oracle.com> References: <20231101171629.3612299-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: BN9P222CA0004.NAMP222.PROD.OUTLOOK.COM (2603:10b6:408:10c::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_|SA1PR10MB7684:EE_ X-MS-Office365-Filtering-Correlation-Id: 76c7f1d8-3963-4aa6-8824-08dbdafe57ed X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f0jjbXudFquoMbRadOyC/J62O2th39I8EcC6m8byJfe7mxDcbU6sIcPY21sKgVbAVsbCpO9D7T7WEfLy4HXnGPtNsr3n819q48T/IU2rV0kcbsVuJcjX66SrGOSBeHAckvLd9hJ43QV9naJT9gIG7oX525YtAojY2nzZpbpeKndpWSOH7/bMPCEb/Mx5kJDuIwzm2ENwzNAo+cHruBeYzageB5IkQ4TnhKkSj6JfAxMCav1XQIawDkq/OB4KYfsYiLVEMSA1Kzh98QvkYDXjXTX9HgDFkloWmlQ3HGyECkezm8u9MvrSmHhnyF5F7qjzvCnL7lXoQKqYYAHdT27sPEB3bFmwmdVIcFYiLELnoIrbwKzhqcalwJRMGouJTOZrMJ40Dqh/UCl3WPnKFST0iNcGtzE+323TTEkHvIQC8UeFrKn3Ea3RKJ+34MOJRa34eWkdbBsCa/uThTJdT9pc2iSpqV9p7BND+YagRPvknrR6aRwZGgY6jsXyKasCy8hUU5JI+tF8M8bwxU0rs2kir39rcjGopkc1yyJG6vMsFtejLr5fCzaOeuaRu5eBStSo 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:(13230031)(346002)(136003)(376002)(366004)(396003)(39860400002)(230922051799003)(186009)(451199024)(1800799009)(64100799003)(6486002)(8936002)(2906002)(4326008)(41300700001)(8676002)(5660300002)(6666004)(6506007)(66476007)(107886003)(83380400001)(1076003)(2616005)(36756003)(26005)(6512007)(38100700002)(316002)(86362001)(478600001)(66556008)(6916009)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: p2EB5fAuVCDp2DmqzHZ6tTUNoT0cQIrPXmRdIer8mN2Gb7TzrfzWaDjlBJgcqJf1nnArx7AaqR7OX/8Al80tc2ngiwlLa/2iGHLE08GGsFoD+39My8UFo464dbJjpbX8cqhlB/JIJZyKk7t3a2BhysQrXSJtls44vf1Cbs8X/MF0m4OZuwvzItW5pCbY9Ew6oP8OyLiEaXhnUi8Tw252XiR/hkGPB9dq+U0lt/MG/r4grE6GJFQYF98ASBS10QfQyPBKNFhDgt4B5pQnIqafwgA1Hp6e3ZS0jxBuumx/dEiJ6YKwOqNgN+wWEMLuBTmR483iP26HwEeQem63km8abfOuo/BATebMtQldzdVjnZWPGOGRysjnUVrl7TSX0wtSS+TtF/Mw4Ir6ZM5Miuj8LHmsmcGadYVlJ/X60u7ZvpGAtywQSoZqlWnOsgJfYZyqUV+GONO7eQzGjzXIsFGYQZX+up4WgYWZwCYmD5GYshq82Q8/qcfhW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fqSy456d3YDUzy8f8KEk5jUsHZtDIUl3mY/oOQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: +Iaf1Is1sIMGr4Ipdh/DEKAo4oqBS2w5zn8wdR113jogGDQN6l8NrAXaOXuRERX2VWnIj+cYhVMva10iHFdWu30COr+tBmdF9NpIm+PvIldPSTZz1HwXSxFYYn0nUMafUflmD5o998ZcIHNHXELxBwYcW/AD/yGw6sBmbBY8H7+p25VRzJaOxqobCes3fn8ZxlW7UkMRi0utkC+U0XUHIiQ7/1FawNyqMJ1X4FR9ctiIm2Uhpyvv9dQxbNenp+v0IJI/NE8sKD86xWMSPBn+5kEj3qRrx2oC2rOI+15l5k5Ctw4tBzmpPtJaIFhYlgfG15HHUGsYcTN3eZNNS10x1y3TN1WWfxlhI7W+dpUzeqm0dT2M/PC96O8hdBqTLsSMyroVuJVxaKUcLp26wOzubsYZPT5ggOFDcwF2Lp/kujlKx4qAuWRYurhciM2z4Y8InpolETpGPoy2EoY6h86r8+l4WpspMZgNzrTgMZ0SfaOtkYnTU5BhoVjaKtuNv7ivOVNzxmyKACyK0VW+XS7Ek/QLevSJSP09tWvCB8pX86xq4PnHGFGIn2mylzxTdfkNHcRFECC3CHDy0q1S598m3esQCGEF3myCENcLskZJBC0Vo+boL4Vz4cpTx7eIyWOT24T5xrUcKqLfCU+sp5yyTvW92EoRjue806WZFM6o3KrQchBCUR5eccNvYlLPFkzskUcNz9LeCldxePJG8bxy45tNqxThULKh7hZ+RI+Txeqs2aMAa1D/DEqOOmo9F615HQ2tv5DUvCPPTtCnrsYy19cPqsZj7/yImIrTc5YFr5ieV1xdX+BwpFhpoQQMhLeL9UzjEFKXu3WhkvO7qG3c9dG1eCxexOn1rUnT9G1xmytF1fT9RDkt8F5V6rJQfB1tiJROdVFiKX+m4u7rDY/pxQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 76c7f1d8-3963-4aa6-8824-08dbdafe57ed X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2023 17:16:53.5812 (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: KzlXSaweo1sJQvLwTyhauETbc9eqTxM/E+6kUekm+TV9g8wc3NEtScj+ZFj04+X6ooH/UoQDr0JxkNSVwjMJhQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB7684 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-01_15,2023-11-01_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 bulkscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311010134 X-Proofpoint-GUID: dtgsV7P-lI0VJJp83ZvP2tdniHwb7bHd X-Proofpoint-ORIG-GUID: dtgsV7P-lI0VJJp83ZvP2tdniHwb7bHd X-Rspam-User: X-Stat-Signature: c97uu8n7y45fpg35t43a1q6e47o9tt9s X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 13D534000A X-HE-Tag: 1698859017-527459 X-HE-Meta: U2FsdGVkX19owx07hEkf38tmuE9VPz5euW1HEYpJA8jdo9m4MRT5i0s2v7OfJXEPD8CMw9eIAx8jff17uJYvWNrO5Bp1oIr9P+W32HC0wnAxaR3r8sQmwkkYt3o8flHu9F4SdnNQq/XgoFP8Ntx8Qu443zScmLxyzYwHAvtFkm1OiSnkCFcbY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vZza61LBgr/SMLxsVqZGA/EhNwGcoVe+FHo/BNr3Ge6c4swrEl45O48KXwHqG+6czXDHeuonPAe9Y3oluPJSy33pD9vcBz81N8jTuoUEFshtzYWDq1gvpzXQaB2DC1A12a9A9pO9GHQwx4yb4AdLBnHHXValvff/n2jJJgd7M8xdVwwIIc/2lkc+W0nzx0pPDzto= 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: List-Subscribe: List-Unsubscribe: Now that the status of the maple state is outside of the node, the mas_searchable() function can be dropped for easier open-coding of what is going on. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 66 ++++++++------------------------ tools/testing/radix-tree/maple.c | 4 +- 2 files changed, 19 insertions(+), 51 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index fa66c0c031d5..7518b3031b2b 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -273,17 +273,6 @@ static inline bool mas_is_underflow(struct ma_state *mas) return mas->status == ma_underflow; } -static inline bool mas_searchable(struct ma_state *mas) -{ - if (mas_is_none(mas)) - return false; - - if (mas_is_ptr(mas)) - return false; - - return true; -} - static __always_inline struct maple_node *mte_to_node( const struct maple_enode *entry) { @@ -6010,12 +5999,11 @@ static __always_inline bool mas_find_setup(struct ma_state *mas, unsigned long m } - if (unlikely(!mas_searchable(mas))) { - if (unlikely(mas_is_ptr(mas))) - goto ptr_out_of_range; + if (unlikely(mas_is_ptr(mas))) + goto ptr_out_of_range; + if (unlikely(mas_is_none(mas))) return true; - } if (mas->index == max) return true; @@ -6142,20 +6130,18 @@ static bool mas_find_rev_setup(struct ma_state *mas, unsigned long min, return true; } - if (unlikely(!mas_searchable(mas))) { - if (mas_is_ptr(mas)) - goto none; + if (unlikely(mas_is_ptr(mas))) + goto none; - if (mas_is_none(mas)) { - /* - * Walked to the location, and there was nothing so the - * previous location is 0. - */ - mas->last = mas->index = 0; - mas->status = ma_root; - *entry = mas_root(mas); - return true; - } + if (unlikely(mas_is_none(mas))) { + /* + * Walked to the location, and there was nothing so the previous + * location is 0. + */ + mas->last = mas->index = 0; + mas->status = ma_root; + *entry = mas_root(mas); + return true; } active: @@ -6613,7 +6599,7 @@ void *mt_find(struct maple_tree *mt, unsigned long *index, unsigned long max) if (entry) goto unlock; - while (mas_searchable(&mas) && (mas.last < max)) { + while (mas_is_active(&mas) && (mas.last < max)) { entry = mas_next_entry(&mas, max); if (likely(entry && !xa_is_zero(entry))) break; @@ -6695,26 +6681,6 @@ unsigned int mt_nr_allocated(void) return kmem_cache_nr_allocated(maple_node_cache); } -/* - * mas_dead_node() - Check if the maple state is pointing to a dead node. - * @mas: The maple state - * @index: The index to restore in @mas. - * - * Used in test code. - * Return: 1 if @mas has been reset to MAS_START, 0 otherwise. - */ -static inline int mas_dead_node(struct ma_state *mas, unsigned long index) -{ - if (unlikely(!mas_searchable(mas) || mas_is_start(mas))) - return 0; - - if (likely(!mte_dead_node(mas->node))) - return 0; - - mas_rewalk(mas, index); - return 1; -} - void mt_cache_shrink(void) { } @@ -7266,7 +7232,7 @@ void mt_validate(struct maple_tree *mt) MA_STATE(mas, mt, 0, 0); rcu_read_lock(); mas_start(&mas); - if (!mas_searchable(&mas)) + if (!mas_is_active(&mas)) goto done; while (!mte_is_leaf(mas.node)) diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index 57964aec2122..182f4e4d9967 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -974,8 +974,10 @@ static inline void *mas_range_load(struct ma_state *mas, if (likely(mas->offset != MAPLE_NODE_SLOTS)) entry = mas_get_slot(mas, mas->offset); - if (mas_dead_node(mas, index)) + if (mas_is_active(mas) && mte_dead_node(mas->node)) { + mas_set(mas, index); goto retry; + } return entry; } From patchwork Wed Nov 1 17:16:27 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: 13442932 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 2E6ACC4332F for ; Wed, 1 Nov 2023 17:17:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D996690000E; Wed, 1 Nov 2023 13:17:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D220490000D; Wed, 1 Nov 2023 13:17:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B4D0490000E; Wed, 1 Nov 2023 13:17:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 9E64D90000D for ; Wed, 1 Nov 2023 13:17:03 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 76E9414024F for ; Wed, 1 Nov 2023 17:17:03 +0000 (UTC) X-FDA: 81410040726.14.BFFD0DE Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf18.hostedemail.com (Postfix) with ESMTP id EEDE81C000E for ; Wed, 1 Nov 2023 17:16:59 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=wSAP3S5q; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=PJeXBIdc; spf=pass (imf18.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=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=1698859020; 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=1dAm2IY6S76iRSV2OMRaShLmUy/paB5xYnsJIyEkzYs=; b=llRY1m/AQoOq/G6L65bGqbAK/LWU4XmyPQ3cwAhPmfpgaIx97/lH0G0cQ2psMjn1lSJB22 iDwMeOOsAGoLhwntWLZgmPt5ZBP7ANHZMa9xV1yGF1drcD2LRmgAyoXhH/fvH4QbVIOA/y KgXrECRovVUgeBbAVZwmsKCI3nRBydk= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1698859020; a=rsa-sha256; cv=pass; b=KjuOsPpB95nTBr1dabRXm1MDUJjSUjkFLHREpVuzfZF00kiahhuumRgV4VFfOr33AaYNeX VOOy03TmXe7o9e1H5TLT3aeOLIcwShHtsotFonuxLk4rZXa5KUyWJeMd7gZXUQvPxIGup9 Wi7MFYvJZmKYXi/12585F3uWa8NWhTw= ARC-Authentication-Results: i=2; imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=wSAP3S5q; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=PJeXBIdc; spf=pass (imf18.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") 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 3A1GYm0O015703; Wed, 1 Nov 2023 17:16:58 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=1dAm2IY6S76iRSV2OMRaShLmUy/paB5xYnsJIyEkzYs=; b=wSAP3S5qbr1v4xMrT0Q2Cxsti2cRl2niYlb2C5Zc5DrsjDeODzuFi5oEBp45hekpvrxX I5cujvElo8hKAgNh+cmeO5aqsPeEt6pOfY3ih7iGmWZsl4xI0QDyf3KMFsT/7jR+XRfQ b3TU5wyaTvZJKdPtW3j/E6QBi8O43SqVsl77h7W7JAtDw6vN9FNS4qUOrqDS6aXuvW/1 9gdMorIGCQbM7FLl55d0BPPspTNPCbmorMr/KVZSnAPLwrywq1C+W3d+HmkkBi0PUgtK RslWSs+8W3eIWPv+rD2Cf8JbGotyOnc4GTBgO97un6WnS1Iy5VI0BenztEiEF8U6JPom mA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u0rw27wmr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:58 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3A1FoQ7d020069; Wed, 1 Nov 2023 17:16:57 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2041.outbound.protection.outlook.com [104.47.74.41]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3u0rr7d2va-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uwcrp9j/P5ly5AsSO9D+R6X4Xhw6yUNUTXxoXrKjlbkwbX3v+sVvzZik0pmAMICHm9nT8QtfUQsNi0YYCjqcE91waE2xcYj/2M9S/gHoPqYHwYgMMTIOE+G8XzA0ElX3RGXYDOkXfT/tB3pKgt6JjI5nsnAAarUDp0HYgFnpcf0XhJKNX3HyFFdYvYPQGlNRj+RkjDNlpR+1FzlQ4LJE71FVEH1/MDoWq8qI3n8FEg58J9GoyToVgoWgCBFGgC+HD/eESo8FCieiL9V5tDURP4FyBforP2YDdpJ8FaHni7zhXAyNaA47I57bEG5mUq4XR6GgQuNw5qeqj5VSzce6og== 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=1dAm2IY6S76iRSV2OMRaShLmUy/paB5xYnsJIyEkzYs=; b=X9F+RPn9QbmMyrlkWEMwp1ExgsaV7ghFwadJxA7ODe2/NWi9VJzaw1k2RX2byPdtdabQjDyhVliBCg2cSqJGpA5meBZRdAH5Dqe6LLQQX1XMH+0FAzt90qCUvpznjPwxs8bFSHorweO5gtF+onxyV0CwjZHYgc2s/F8iD3/CSeftM5zzEgyLhB100QPtzxHH17QH0tgPTUl3+3MncTT9hc95QQSQKperUepdB7NRTPe5mwx2WN4Q8Ss0MyBUwZ1PuNBpsBFkvhogWNFIgjnP8Rq95AcQ5r4xKHauvYnQlS1cp4/u4LvjLXKXok6D1u7EeNEYMK6zfCoDi1fbIbeKaw== 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=1dAm2IY6S76iRSV2OMRaShLmUy/paB5xYnsJIyEkzYs=; b=PJeXBIdcUuk52b/CgX/FvvjglaBilZ4Il78+z8UNkP1zQvaLVxOXoGJm1UMhd64CYY0HWlyMa+DR9YB3sjJhtDFYwNNadIxnJCoMOvoAvFgg+wvLRta+2GopTaxZGB6E2/vS+ByjAhcmRLvjWiNNKmEjU8aVu5/HvPbfdjb7I3Q= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SA1PR10MB7684.namprd10.prod.outlook.com (2603:10b6:806:38e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.31; Wed, 1 Nov 2023 17:16:55 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa%4]) with mapi id 15.20.6907.025; Wed, 1 Nov 2023 17:16:55 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Liam R. Howlett" Subject: [PATCH 10/12] maple_tree: Use maple state end for write operations Date: Wed, 1 Nov 2023 13:16:27 -0400 Message-Id: <20231101171629.3612299-11-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231101171629.3612299-1-Liam.Howlett@oracle.com> References: <20231101171629.3612299-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: BN8PR04CA0025.namprd04.prod.outlook.com (2603:10b6:408:70::38) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|SA1PR10MB7684:EE_ X-MS-Office365-Filtering-Correlation-Id: 7382250e-056c-40de-8f8c-08dbdafe58f8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ty7oezMiHR9l7bj5Plgi1NLy3omI52Tsb5YyzfLa5zNR+1LU4A46STSpSq3S922hj1Y/Zqi2Tzf8QspDbgerp3mWACmWpsfplVWXb4Gs3LlqbI5RPvuOrjCb2PxtIW7oDpuQ8ORcBNzVMTdGsoZC8ZkVf3MV3kFLDhoRbZDz/shhN8g7uEQHjXvI6vAQg+yA4zdit7Nib4MFnkZEkBWpbY2AReqPUf9K6xw2dXpgzwQ7kO4CbX1R/HLORhBY2SeXjWFQyFH2BXRm3e9KR8ivLNwvramSx7OzBaVI4qgeIMGuVS4J6nyYJfriyrVHuGFfYALd7Hr/Y74tDolpKvHNA8aP7dCraw7nonpjFDQJhZ5rMcbEEY/lYi0guMLTSSjKGn34JuC6GmQX0zZm+9cj8HtYdAU+dbZqAvx2EM+gtHZB5+W/o2+taOmKT3rAIkQKw2rGm+TdfPp1Uq3UpfWClq/EH8fNNjzjZZ5WI+3W5tggzziIbl9surlhUd4fKv5n9FJoYguLBJOJ2ayQF4GcGg6C9zEl7ISCmr4iEbjtY1mN7Iill6ZILAIdiG/tETnS 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:(13230031)(346002)(136003)(376002)(366004)(396003)(39860400002)(230922051799003)(186009)(451199024)(1800799009)(64100799003)(6486002)(8936002)(2906002)(4326008)(41300700001)(8676002)(5660300002)(6666004)(6506007)(66476007)(107886003)(83380400001)(1076003)(2616005)(36756003)(26005)(6512007)(38100700002)(316002)(86362001)(478600001)(66556008)(6916009)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PG0Kg0oqrWS6y0MINncurvE4Jcp/gKmOwT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apSlrlujSVP5b77MaGrFcggCvznt3SMUi5Y7GWfJSuJVmCnhGy99EudegXZsGNGurIPXOuz8P4gXVCueWTSPZX9ARuAZ9egkudviu/9zECYL49e/Mtnc9cdNW2g/ambTsXuNnOGfgMLkI03q6WaajoX1ztl4qcMScvwPzPHim47mQEUgDHbjaUZWy62LOqSCoqjo5lwGuxoVbWTQz1dkhMNyYr51H336Su4EuByH4XLEO3CPqbGKE0FT9Z+sgAjHXBFF3b0iPUmHDUYb07wDxuBUQLqyeROPgSIwvd8NWUD59YenOJiuwRt9a52FV/EcA+3DZ3LT+LAIPb05rXFW8t3pcX2kvkxAD1BcRpo+RNMkJ7hmLe69mYFYY/lzAlbNbJgGi1WTmD8OA3g/Ua2wHd3i9oQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7382250e-056c-40de-8f8c-08dbdafe58f8 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2023 17:16:55.3241 (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: aQMUkBYL5gXsY+dL7NZ7ROASKaWPO+Tg884iXpUuQSu4xagfFOHOLqURQ4pQ5hxJ4iaPsIin4mQec37zOijVYg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB7684 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-01_15,2023-11-01_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 mlxscore=0 spamscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311010134 X-Proofpoint-GUID: BAgncjolK9pHNsyI42CSEnr1fJU4w6pM X-Proofpoint-ORIG-GUID: BAgncjolK9pHNsyI42CSEnr1fJU4w6pM X-Rspamd-Queue-Id: EEDE81C000E X-Rspam-User: X-Stat-Signature: i55pu7sx8tgts4fr1u7nttmktjafhmng X-Rspamd-Server: rspam03 X-HE-Tag: 1698859019-939861 X-HE-Meta: U2FsdGVkX1/rdIKisB6azkiB6JZbNx1zmLBeCtEKR53TnR7TfgZ1pQ0T3ZXfKlcTHAQW2QPh1CmkR4f2Rs3JPAozXlLlbca2yVNNCD1JASOqmKLibVii3Jk5q4vBLX7inyDUrI2np+T2T0OgoUUQPeD/oqTJhgdq3BX9M7EUat78CUmx+AIvXeHMrVGHPb+4z5pexJOpcKPv1CXl36g0Iqu0gcx0D2S6qvm6RJep5TXEoOQc3SuvnvJKhTZzg2sVBk1kNxcs+2eMMXkM3L9dyBi1fQQ+J5oEn/N6RvkIh7pQoLp8mof1iWEIw7+83vbKcndX1fR1iqAg8O8VdawmYj59IoCLa/+dR53CdzYSzxtTMKPcM3vxy1g6fCp6iDrr47fKyaeRFqdYWwntG1ai26eFL7cGVeIY8Jqxow1TW/qwBfPefV54RoF+XqhlVkvzJ9LkGSxZVpwOghtNWOgKYmc7Tzd/EtypgJu8uW/MCplbpGTvxYBJskI41cJdYZetmzszUczBjdlyQn0mm2gaKtymq6S+N6GWDTVgXRWo5lbtLyt+PfCkO/uHeUSR987G0XNL+hn5eTNdM5Ix2132D0bmH/a/vgkl2KJI3vxEa+lEK7K/RkI/Y2Jnw0/Esf1BP7JsaYB/LYG0LNi39ucWO6gsee5uyhxvWjDdK30BsTwuSgS8GTu7e4A4PG0DU4lB5m8/C4KPLRwMpXOt4yXvfMLl0n8R6h5UXzwK1MLGDhkSanw1PBxuhTnia+mPmSfVOsqGCGq9FRiRjE14rQuwmzrq5X6VaidQx/RRBtGVKFjqou1+8uR+qY1YxqrydaX0YcClWnf4l7Uu7VFAmn2OsgsrFlEND2+EQqYBDXTu0sBXiLvWf4eJXupHkc1YS2Yt4Cjtr3bHAXcx+ABXJ7kfJIz1fa5nUhzHzdoLaYJAH48JZgwE+tvfkupoS3CCPxhiM1oM1vLSSKCSzsC/UC1 85llXbQu 9LQV0t/OJJGnlBdj9i2B07xgAqA1wobDtFuSHwF6ZKNxlYYnObdlGXaKnq6qqTzQchBpCWlpTTDtTeYvf9PtdmR9W4gDKLwfS9vDRHiEKUXj/Y6FRDqkm4Y7OKP8TlVCvkgI1sri+sEUHzAdt0VRaNbK1x6kJM39OvJPdGo8IuaBJwq1fTBN1Un8txYQUYT4o1ujIJSfUJgk7v6UQ/lEQcBNxVL779oAocE8PVLiLmoBHlbskL24ulnu9WFvpF7jj3142H1eD7tPTuUpN9THns0kJZAJHTMCPW5MC3/oJ86vySwjz8EX9K0ZAbRzYTzw8u70Kg57Z2eBofXFXmSMHaFFtYetWmLPpUrKmRZqaxIC0jhpBNiZWf43SJAi5Y9Ndh6k/uEDzUkaNXU2IAVvUSlIEttfk6a6SPlWfTDrkqQS4/7xhQI4+4ZLgI2pLmmrl+M8F8r1wkNVTH/k= 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: List-Subscribe: List-Unsubscribe: ma_wr_state was previously tracking the end of the node for writing. Since the implementation of the ma_state end tracking, this is duplicated work. This patch removes the maple write state tracking of the end of the node and uses the maple state end instead. Signed-off-by: Liam R. Howlett --- include/linux/maple_tree.h | 1 - lib/maple_tree.c | 46 ++++++++++++++++++++------------------ 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index e3789b63388a..31ec1859e135 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -436,7 +436,6 @@ struct ma_wr_state { unsigned long r_max; /* range max */ enum maple_type type; /* mas->node type */ unsigned char offset_end; /* The offset where the write ends */ - unsigned char node_end; /* mas->node end */ unsigned long *pivots; /* mas->node->pivots pointer */ unsigned long end_piv; /* The pivot at the offset end */ void __rcu **slots; /* mas->node->slots pointer */ diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 7518b3031b2b..e45734676471 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2146,11 +2146,11 @@ static noinline_for_kasan void mas_store_b_node(struct ma_wr_state *wr_mas, } slot = offset_end + 1; - if (slot > wr_mas->node_end) + if (slot > mas->end) goto b_end; /* Copy end data to the end of the node. */ - mas_mab_cp(mas, slot, wr_mas->node_end + 1, b_node, ++b_end); + mas_mab_cp(mas, slot, mas->end + 1, b_node, ++b_end); b_node->b_end--; return; @@ -2243,8 +2243,8 @@ static inline void mas_wr_node_walk(struct ma_wr_state *wr_mas) wr_mas->node = mas_mn(wr_mas->mas); wr_mas->pivots = ma_pivots(wr_mas->node, wr_mas->type); - count = wr_mas->node_end = ma_data_end(wr_mas->node, wr_mas->type, - wr_mas->pivots, mas->max); + count = mas->end = ma_data_end(wr_mas->node, wr_mas->type, + wr_mas->pivots, mas->max); offset = mas->offset; while (offset < count && mas->index > wr_mas->pivots[offset]) @@ -3894,10 +3894,10 @@ static inline int mas_wr_spanning_store(struct ma_wr_state *wr_mas) memset(&b_node, 0, sizeof(struct maple_big_node)); /* Copy l_mas and store the value in b_node. */ - mas_store_b_node(&l_wr_mas, &b_node, l_wr_mas.node_end); + mas_store_b_node(&l_wr_mas, &b_node, l_mas.end); /* Copy r_mas into b_node. */ - if (r_mas.offset <= r_wr_mas.node_end) - mas_mab_cp(&r_mas, r_mas.offset, r_wr_mas.node_end, + if (r_mas.offset <= r_mas.end) + mas_mab_cp(&r_mas, r_mas.offset, r_mas.end, &b_node, b_node.b_end + 1); else b_node.b_end++; @@ -3939,7 +3939,7 @@ static inline bool mas_wr_node_store(struct ma_wr_state *wr_mas, if (mas->last == wr_mas->end_piv) offset_end++; /* don't copy this offset */ else if (unlikely(wr_mas->r_max == ULONG_MAX)) - mas_bulk_rebalance(mas, wr_mas->node_end, wr_mas->type); + mas_bulk_rebalance(mas, mas->end, wr_mas->type); /* set up node. */ if (in_rcu) { @@ -3975,12 +3975,12 @@ static inline bool mas_wr_node_store(struct ma_wr_state *wr_mas, * this range wrote to the end of the node or it overwrote the rest of * the data */ - if (offset_end > wr_mas->node_end) + if (offset_end > mas->end) goto done; dst_offset = mas->offset + 1; /* Copy to the end of node if necessary. */ - copy_size = wr_mas->node_end - offset_end + 1; + copy_size = mas->end - offset_end + 1; memcpy(dst_slots + dst_offset, wr_mas->slots + offset_end, sizeof(void *) * copy_size); memcpy(dst_pivots + dst_offset, wr_mas->pivots + offset_end, @@ -4067,10 +4067,10 @@ static inline void mas_wr_extend_null(struct ma_wr_state *wr_mas) } else { /* Check next slot(s) if we are overwriting the end */ if ((mas->last == wr_mas->end_piv) && - (wr_mas->node_end != wr_mas->offset_end) && + (mas->end != wr_mas->offset_end) && !wr_mas->slots[wr_mas->offset_end + 1]) { wr_mas->offset_end++; - if (wr_mas->offset_end == wr_mas->node_end) + if (wr_mas->offset_end == mas->end) mas->last = mas->max; else mas->last = wr_mas->pivots[wr_mas->offset_end]; @@ -4095,11 +4095,11 @@ static inline void mas_wr_extend_null(struct ma_wr_state *wr_mas) static inline void mas_wr_end_piv(struct ma_wr_state *wr_mas) { - while ((wr_mas->offset_end < wr_mas->node_end) && + while ((wr_mas->offset_end < wr_mas->mas->end) && (wr_mas->mas->last > wr_mas->pivots[wr_mas->offset_end])) wr_mas->offset_end++; - if (wr_mas->offset_end < wr_mas->node_end) + if (wr_mas->offset_end < wr_mas->mas->end) wr_mas->end_piv = wr_mas->pivots[wr_mas->offset_end]; else wr_mas->end_piv = wr_mas->mas->max; @@ -4111,7 +4111,7 @@ static inline void mas_wr_end_piv(struct ma_wr_state *wr_mas) static inline unsigned char mas_wr_new_end(struct ma_wr_state *wr_mas) { struct ma_state *mas = wr_mas->mas; - unsigned char new_end = wr_mas->node_end + 2; + unsigned char new_end = mas->end + 2; new_end -= wr_mas->offset_end - mas->offset; if (wr_mas->r_min == mas->index) @@ -4145,10 +4145,10 @@ static inline bool mas_wr_append(struct ma_wr_state *wr_mas, if (mt_in_rcu(mas->tree)) return false; - if (mas->offset != wr_mas->node_end) + if (mas->offset != mas->end) return false; - end = wr_mas->node_end; + end = mas->end; if (mas->offset != end) return false; @@ -4200,7 +4200,7 @@ static void mas_wr_bnode(struct ma_wr_state *wr_mas) trace_ma_write(__func__, wr_mas->mas, 0, wr_mas->entry); memset(&b_node, 0, sizeof(struct maple_big_node)); mas_store_b_node(wr_mas, &b_node, wr_mas->offset_end); - mas_commit_b_node(wr_mas, &b_node, wr_mas->node_end); + mas_commit_b_node(wr_mas, &b_node, wr_mas->mas->end); } static inline void mas_wr_modify(struct ma_wr_state *wr_mas) @@ -4228,7 +4228,7 @@ static inline void mas_wr_modify(struct ma_wr_state *wr_mas) if (mas_wr_append(wr_mas, new_end)) return; - if (new_end == wr_mas->node_end && mas_wr_slot_store(wr_mas)) + if (new_end == mas->end && mas_wr_slot_store(wr_mas)) return; if (mas_wr_node_store(wr_mas, new_end)) @@ -5032,6 +5032,7 @@ int mas_empty_area(struct ma_state *mas, unsigned long min, unsigned char offset; unsigned long *pivots; enum maple_type mt; + struct maple_node *node; if (min > max) return -EINVAL; @@ -5062,13 +5063,14 @@ int mas_empty_area(struct ma_state *mas, unsigned long min, if (unlikely(offset == MAPLE_NODE_SLOTS)) return -EBUSY; + node = mas_mn(mas); mt = mte_node_type(mas->node); - pivots = ma_pivots(mas_mn(mas), mt); + pivots = ma_pivots(node, mt); min = mas_safe_min(mas, pivots, offset); if (mas->index < min) mas->index = min; mas->last = mas->index + size - 1; - mas->end = mas_data_end(mas); + mas->end = ma_data_end(node, mt, pivots, mas->max); return 0; } EXPORT_SYMBOL_GPL(mas_empty_area); @@ -7304,7 +7306,7 @@ void mas_wr_dump(const struct ma_wr_state *wr_mas) pr_err("WR_MAS: node=%p r_min=%lx r_max=%lx\n", wr_mas->node, wr_mas->r_min, wr_mas->r_max); pr_err(" type=%u off_end=%u, node_end=%u, end_piv=%lx\n", - wr_mas->type, wr_mas->offset_end, wr_mas->node_end, + wr_mas->type, wr_mas->offset_end, wr_mas->mas->end, wr_mas->end_piv); } EXPORT_SYMBOL_GPL(mas_wr_dump); From patchwork Wed Nov 1 17:16:28 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: 13442933 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 467F5C4332F for ; Wed, 1 Nov 2023 17:17:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AD9C290000F; Wed, 1 Nov 2023 13:17:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A61F290000D; Wed, 1 Nov 2023 13:17:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8B6DB90000F; Wed, 1 Nov 2023 13:17:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 6CFB990000D for ; Wed, 1 Nov 2023 13:17:04 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 1CD8E80984 for ; Wed, 1 Nov 2023 17:17:04 +0000 (UTC) X-FDA: 81410040768.09.ADD86B7 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf22.hostedemail.com (Postfix) with ESMTP id 95DB6C002C for ; Wed, 1 Nov 2023 17:17:00 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=r8aotf2A; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=zi4+U8vR; spf=pass (imf22.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=1698859020; a=rsa-sha256; cv=pass; b=3PL0O2ECcGCmJnEfnmWWZi5rx3nQMeBK5PujF5oqpCyWixdVsE7CH1NN5ncPeUQCjjcHfY SPSYA4pF+A0Y2wYjlTSI17TKWUpKK2uurUqEtT4C34nRBdTG2t6dC1zBliAzrNPfKaiigx 1I01OgMvJv2wY+8OTeeL+CYdEZyW40A= ARC-Authentication-Results: i=2; imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=r8aotf2A; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=zi4+U8vR; spf=pass (imf22.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=1698859020; 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=8whd+Yd1cxMelqwjjNgyGUih5bjRsfAE6RJPlfXanJc=; b=pnLQ44+VotqmwLHnsFs2M9TJR3Jzxo27SvB3HQyUllzSXkKhYdBYNO9f/U514Xeoo6v1TZ DLcY1mwhTd1z/foWWZsRzUoI4BvRVIJo215eqW95uEdbM1qE8v0TxQOsQq4ysel9YScNVX nWIh1JkfPSGp/uk1Rn1E13lWmv1N7n8= Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A1GYaNG002351; Wed, 1 Nov 2023 17:16:59 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=8whd+Yd1cxMelqwjjNgyGUih5bjRsfAE6RJPlfXanJc=; b=r8aotf2A+mXWwlbNrUk5jpTRUsfQdJdeF/PFpwq0cd7RzyE8szX7GokMEMQ0Uspq7+va g9U+m+FumN66wiUL/9PObYQCxcQZZy7sumNVU/3Rsac0atcLypmjrjqpGdzIZSq30V28 K3HEsy7sklTsakLQjDQ/GCFqrc3JGHwSoD/QQ8CyRGLmUaTl9VW9KoS6UHA+20SRukKm 8NUS+HLExzHfEQVjsnaaGpyLFNqbA4TFvKvv27k2b2UltWVGhdPI/OWWhIVsAHfQyQI3 i1+qFn5yNQlbip3S1OUsN/X45DR1EVKhfR/4h9QzHm1XU14K3BE2KSOtVQ0IY87VDibI pw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u0t6b7t71-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:59 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3A1FoQ7g020069; Wed, 1 Nov 2023 17:16:58 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2041.outbound.protection.outlook.com [104.47.74.41]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3u0rr7d2va-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MNaKs1yfDXN8GagrQVRbEaigKaYZHJkGYvp69Jo0K1XvZKpCoUD78fVeuIGsPoJWn07W6YE08ZDFGFGdDwSRQVyxsyDmnfUXGAyXL+mmR5qAgLfaQffoVCmJhs9Nn7vgoByibvXFzeESjBARLSGZJE9yV2AtPtt8eokdf6ins7lWuWtchzsfTiAMJQYakQw+Vr6LhgDbgbkXQGWhNd9ssdVAgUXgF1kmxY0TgYqbMwTnQvaMYSoHH1R7ki39/bQKMaDoFL8fPZUCZKBp18OdDd/pSnpj+JYxGq3cHn4FNGU58wzvwYZabKZV/L8xpKRDEAtwazKho9UsVk6JqeAccQ== 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=8whd+Yd1cxMelqwjjNgyGUih5bjRsfAE6RJPlfXanJc=; b=oMLg7T/REVgfdH8Zb9qMXJBcQUYfSZQxM00wHZ5PEbm/layE62XGlZ51T/nzKgwIaFhFGsYGDUIJTx0uZu+z5uOYKbGxB/jYbiNqrbPgrzqr1zYZu8KD72pvUjIotsvjK52XIb04BxhkKVqO7kZYgv+Ga9T0XTzef7BSoOdlXkq1lWsd2HDhJkNTy6J8wXWjQbVukDe3w4ao8JXYV7tlqNp+gtWZWx6jINvTqyDwT617g/xZTL/nZwP4VvMcHOE9N0gzSV9ZYf0YLur3ZDYJ+V+1s/s+WZHc4Lqf6Yb9pCYFOr9iOFBm/oPP+bVkwPbnyKkBD8ql9o1B/RxgLFByqA== 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=8whd+Yd1cxMelqwjjNgyGUih5bjRsfAE6RJPlfXanJc=; b=zi4+U8vRnKFEzVEg4NA4dIC1BWBjO+Rbj0DV7Y0EFQ131WOiVOGrVR6mhpLCvaq1jxInmT6lucUPA9v4hhI0xUX/bSsDpPO+OQyDT89l6mOMMUjs/pS+3LztF1MRpCC+rJp7oYHV66xOw0DQ//XQEA03R1ivQn7p64bc3QZsRyE= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SA1PR10MB7684.namprd10.prod.outlook.com (2603:10b6:806:38e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.31; Wed, 1 Nov 2023 17:16:56 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa%4]) with mapi id 15.20.6907.025; Wed, 1 Nov 2023 17:16:56 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Liam R. Howlett" Subject: [PATCH 11/12] maple_tree: Don't find node end in mtree_lookup_walk() Date: Wed, 1 Nov 2023 13:16:28 -0400 Message-Id: <20231101171629.3612299-12-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231101171629.3612299-1-Liam.Howlett@oracle.com> References: <20231101171629.3612299-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: BN8PR12CA0015.namprd12.prod.outlook.com (2603:10b6:408:60::28) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|SA1PR10MB7684:EE_ X-MS-Office365-Filtering-Correlation-Id: 4876f74d-3778-4315-fac2-08dbdafe59e6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mqQiRW+Ly42Q53O924nK1IrJdMf/uo6xNj2BY0FXaz7eWbDcgcVGqU/ndOhpS32fkFDbFPwRujETddQkDughz08x1y8gL900U4Z1MPbs4S55X0HRHe3cuWQ8JOBgvtwXx+VQZn3LUAsaEXTge8rGXcYHc1zql5CxXMLgtY2rjyJx2YzToGkvSv7R6sxE7QleEdSGFIclNtUD+DFP3lJAgen/HADrqmgEq/5i3+NWojAwuM69pkSE/nWyH9Yt52M2DvBei3fkMaTCtklqSSaYZGsA+CWB0KWi+f20kcuYjWSW3oaMXuvSfMW19OrDYmOImcAbyYU0Xs33a7kn5SFkWGprBm3na1Z3w5la8b9zxrZh52V1ZAgMxlCrJ/0XjJrJ7AZX8xcL/0QMJdguOhb86ejT/Ai0om2w1heob8PDqBvuoIIsy9woWQJQazapgIHkkzV0bfwTsiymhiVsO1wlqoLL/RaZrI5Zoa12wRbJy6vy2wud9Uk7Dy1L8CnPL5tzEdA3xT4k50OJ8w41xltyloGXmrj7klyN27G/7eCtQlk0g+SilWOjTSeSY3fG8G3B 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:(13230031)(346002)(136003)(376002)(366004)(396003)(39860400002)(230922051799003)(186009)(451199024)(1800799009)(64100799003)(6486002)(8936002)(2906002)(4326008)(41300700001)(8676002)(5660300002)(6666004)(6506007)(66476007)(107886003)(83380400001)(1076003)(2616005)(36756003)(26005)(6512007)(38100700002)(316002)(86362001)(478600001)(66556008)(6916009)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zw03HPwY1tnNqKmawLRoO3KebHZf0fEBO88WlQbH2FN9/vCeaLmLQBrLjWyANw14QWIxDvGrTc9YQRMzsD19qrNpeMc6uWIUU8T6RyiDAUI45MdivWjdPilj+pqm6+2nOq83N7qorRKkz/Eo2O1rGYuOcfTzzq0nhEdZ2lysXS9jescHzS81IDI+hVnSk3CZApAtq/rmK90h+YwqjdiYPvkCXOJ0rSk0ufwl9ol7Iess5z+hvqYKVe7qpmOFVFck1uTtp9N2CRX1Ci1Qz2sTO/hyHyqgXtzq7bWdBHFk4CtaxisUHOhq/DH0HaAqZ8Zq/d03Z00fKb4+UC1CHp4uwPyOSH++z2VGtQVIy7p8wRl2OK9L2tHiOkQqkkrGVdvCWNIo+BvJLnB7Ir4CRU/sZttxLSCgj2f8k7wLIDs79ApQBZNp//+dXuH7SXDo0++pM4YL6E3Yg3fr7EjJe115R2+PkyA+A6j80XaKtLO678N9caS43wsvz3JSExN3L9NLgQaLgevp9rmxybT9Hfw5FVUoJo681gXDKRPZll/9uzdt7cn299H8+VJICmSGdKPiFNJishb7l5zqfir78Xs6GZvycjQWsGirFjKrA5rxjIL3pskEn1Rec7WuTHK92J4BfQcTmsBAgKnhr85KLCkbyxKpPjqNsCh9yNQwQv1/Iq+tmGppQTq9iMZCp8QR0aeGDDWyYMK/hUFOGpNTTEMMbBFLLEInZUfRR9ygP0FfQ2seSELhikddvQYZ8jA2UYxcXiVpvsazfyDM//4oqms4WyROyT3JVvUmTSeRcAaIi1AqJbyYC0YE2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W/dmUhwT3sq++wU/diJa2agPXYxZItm9fQYxf1vlfp4skGAC0is703GxAYIH9J9USQOCN73yZcKCNptsFYjp2FISekEdO8e8qVb0HOSkduicV7cJYRzkhL5WRSbwN25WFhF7akqkesEyEDRJZ9a64Y5eHi1slrrBgaCrCOgjo4BN6YbXjNZvn5M0PB9G8b3uVPXSSkXFLXlFyq0b5jh5YhkywvbhPHGc4enMW/xpSAH03oaa3jzD3vj7tCdvVgTmwPqJy1qN/Zx7WTcUkQ6TvXqktJTmyRqNevglIQaQhNv6gOpa81hvDcX4Ek2IJVXEGNgfBndZrBBoR0hRvI3RjACgp5v7jwW/iuBKP9O6NVlOgKZrVhm5oxhSPMABHP5DGvPkgn7S74ojZdl7/TW66XQJEL4OFg6Pn7Dme+ouDiO1E0uW6kJJvAyj3CGrteOBcY5DhYnECYVefSlQocpit509KfbswR18IOraP1M/Je2g5brgf9vuYYj+gntYziIIK0BQmsVs8CLl1UB/TxPesmvIZtY5M1+C8yFK5N1aW/xOt0UnWHc9R5lTIpRABUfyoqvYMwsBX3t5ZpCxU7nvQy8K6NvdL8aJSdsG14lNkSnyC5tqt+KSvKCmmGQ+8r1LsX1YSq0XDZOKHBFEAAEmZDdjrZ0QBoV/2dahAvZtR284y5a7ZkLqDq/yZDp+T3zfJ+9w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4876f74d-3778-4315-fac2-08dbdafe59e6 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2023 17:16:56.8727 (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: zAoH8iucL29OvpAjFYvlzDlJ3ItlcNW68PzoKoLUr7ESiK+hW47ANY58Xka6SiGK2Um4vuhSgSNW3IKbK818oA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB7684 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-01_15,2023-11-01_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 mlxscore=0 spamscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311010134 X-Proofpoint-GUID: Xfg-W5ZBtaBmw_FkDP_lhgHJkXzsx5s3 X-Proofpoint-ORIG-GUID: Xfg-W5ZBtaBmw_FkDP_lhgHJkXzsx5s3 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 95DB6C002C X-Stat-Signature: 4owepizmb4as516mqirawwc7q97yim4t X-Rspam-User: X-HE-Tag: 1698859020-810634 X-HE-Meta: U2FsdGVkX1+Dw+xBOz6yeVKm/ybSRZBKpz6WAE0C3Nr814YmB2Qjx2Th4rygh0M7n0M+xKC253Sek38S304u5yaKLR5gvowxBzJSif9L3TOYZEJFGQneeDt8UeYTXcW6IFvIWBkib3nvbN08u8VxxTfY/3cV6biOp0bcu4xWnNG9K+WThXNfvz94ceJOtEpT1evFRr+dr4CCvbK0tIuYhVjjhd2ho9NfeMygnadkPAZWu8hR7/hTh9rpAoxg3STFr9LzYlVvvn4AqG9pvSQgDt8JYPRZgaeQmYdtnNjkDdQZzZ6hO5vbRzYIYDOtvquMWQXPALKRNGV3hM+rIha+n0BepAthIpNLbfgDea65JYkFKGPasgRrepTkQO1sksuElVrZjP+cmmPX5MeIszfaptS21azUo5p57+Ls3tPbhFLcqqkzCT+irZe93wK+wNFrIKGUsHxKq/DGSHbtfV28/dQ9zZ0nN0Lt6pDb30Y+bUnlHKSq363YoB/LEQz7Dqtsc0ZxTsh4bG2uf4+8qjO/CeH9OO9NFDKLKUHCcHlNVJDCQu79KKHaI8QSTKCXFJbkwPT2w52NrhH2P7sd9oLSh+vEGECbZuviRFbPTN72EZ+uobm0IZsy6XIXBN5dHitEA8spDn92+AsTd3nlSJWdWKfxV2FmFBjY+ftEnt1tSS656FjABOB8RVv07uZkDkdfwZEsbgdDoV1B8HQ3k+neq45j57sGSEo1Co8nOH7CcYvPVU+4cXYrsseFg+UL4eeTX4Vt0KDTFYjJuu7It6C+bMZ3LCM6LESjiyArHvDLqIA/vvAa3uWgwoynFR0xvGXrZ7FRqWb85pSyYImdMJg0CV+udqNWpqrvorZdUTp4vA5fCUlpE+ODXGuBlsK4gONjH7CRmRyRyIYW0XahnMqWTipblKqxq4ppVMEkHFwZLXoHoJMHB35MIo7Sb52qSnAc59XE25rghT3VYOfbAL5 aI+FMsDe 1yQapTJsB2tparlZ35GUAmIkCwsOdnQI4oKSluRwtZ3mWVzl91VSuFKL6kZaTJpYLhee0JiEOsrpDsfqBumjnQAfY2RvPolNq+lcp2/s+FbtNXmxS9Z6DHjLkaH42EfAHKQgZPiJn0PwBqhQ/jneS+ZfSlkxH+aPa6pIAf7m+spf8mK6aNeH5Minkxuuf7tjf7NYIKknRfABoGoe4dmuMc58ftwhLS9VM2jQIQuAzhCKeyj3Dl9vmnrSnTl8FceZV8kr5ZjLhnCmUNDXmFxGxuphUvwGdmxlzQQ6rS+Kn3Mi5oB2gAAgabNz8D9JHU4Q0RJXmbh3FsICLs6DcLDICNnEoGaNLb1wZ1kZRO329z/mtI1ufx9xwNLlQzx60D5cCsYdmTTXEHqw8zeK+DLc/IHqvBSJS9s5kqIpKwejXS6Kt4NKbKM6qCKEGChEyhOBTexCcJ9mbLyB6IFs= 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: List-Subscribe: List-Unsubscribe: Since the pivot being set is now reliable, the optimized loop no longer needs to find the node end. The redundant check for a dead node can also be avoided as there is no danger of using the wrong pivot since the results will be thrown out in the case of a dead node by the later check. This patch also adds a benchmark test for the function to the maple tree test framework. The benchmark shows an average increase performance of 5.98% over 3 runs with this commit. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 12 +++--------- lib/test_maple_tree.c | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index e45734676471..a91adaf17306 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3732,23 +3732,17 @@ static inline void *mtree_lookup_walk(struct ma_state *mas) enum maple_type type; void __rcu **slots; unsigned char end; - unsigned long max; next = mas->node; - max = ULONG_MAX; do { - offset = 0; node = mte_to_node(next); type = mte_node_type(next); pivots = ma_pivots(node, type); - end = ma_data_end(node, type, pivots, max); - if (unlikely(ma_dead_node(node))) - goto dead_node; + end = mt_pivots[type]; + offset = 0; do { - if (pivots[offset] >= mas->index) { - max = pivots[offset]; + if (pivots[offset] >= mas->index) break; - } } while (++offset < end); slots = ma_slots(node, type); diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index b82c02f15380..d36dc64a93e4 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -42,6 +42,7 @@ atomic_t maple_tree_tests_passed; /* #define BENCH_NODE_STORE */ /* #define BENCH_AWALK */ /* #define BENCH_WALK */ +/* #define BENCH_LOAD */ /* #define BENCH_MT_FOR_EACH */ /* #define BENCH_FORK */ /* #define BENCH_MAS_FOR_EACH */ @@ -1753,6 +1754,19 @@ static noinline void __init bench_walk(struct maple_tree *mt) } #endif +#if defined(BENCH_LOAD) +static noinline void __init bench_load(struct maple_tree *mt) +{ + int i, max = 2500, count = 550000000; + + for (i = 0; i < max; i += 10) + mtree_store_range(mt, i, i + 5, xa_mk_value(i), GFP_KERNEL); + + for (i = 0; i < count; i++) + mtree_load(mt, 1470); +} +#endif + #if defined(BENCH_MT_FOR_EACH) static noinline void __init bench_mt_for_each(struct maple_tree *mt) { @@ -3606,6 +3620,13 @@ static int __init maple_tree_seed(void) mtree_destroy(&tree); goto skip; #endif +#if defined(BENCH_LOAD) +#define BENCH + mt_init_flags(&tree, MT_FLAGS_ALLOC_RANGE); + bench_load(&tree); + mtree_destroy(&tree); + goto skip; +#endif #if defined(BENCH_FORK) #define BENCH mt_init_flags(&tree, MT_FLAGS_ALLOC_RANGE); From patchwork Wed Nov 1 17:16:29 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: 13442934 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 2B6A0C4167B for ; Wed, 1 Nov 2023 17:17:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EA9AC900010; Wed, 1 Nov 2023 13:17:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E5A9E90000D; Wed, 1 Nov 2023 13:17:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C5D99900010; Wed, 1 Nov 2023 13:17:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id B0C8B90000D for ; Wed, 1 Nov 2023 13:17:06 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 75BDE1A0999 for ; Wed, 1 Nov 2023 17:17:06 +0000 (UTC) X-FDA: 81410040852.08.BD31DDA Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf02.hostedemail.com (Postfix) with ESMTP id ED9428002F for ; Wed, 1 Nov 2023 17:17:02 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=R+X7MlK4; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Pnoxu13P; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf02.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=1698859023; 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=wPkuNnzWbEknTyqX5DrTTcv2VdbvwaVi2fFPE+7DsDE=; b=d+4bNk+T9uYyZHtjLYLcbxeJGvpmIV9rYiB/btGuyaMYTwlruhRD/A9JQllEsZdTI5H8Xi 8WraRmbM+ynrPP+ZPFnAcg9Zs79CII3krQg1yoqpnjbN9+pQD+vPVXPgjnoBuP9uHqrv2B EGlbVB12QDWi8CjetmUQzOtxdT62cZY= ARC-Authentication-Results: i=2; imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=R+X7MlK4; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Pnoxu13P; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf02.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=1698859023; a=rsa-sha256; cv=pass; b=HItccCXQ56+Kcoj1LxqzoWw7Z/Jn6BL9ZfnXbyCou9poXLFP3RLtVCh+dZ8B6CBirPxrGe li6SX8AKyXSTMU9DzDzH8yaxIpFr8xMbI17BMvC2RTdQ1Y8UInCwM1Elg4VVm72JhfA6SR j0zAJwdONpSt++7Dq+cpEA2qGr1YZDM= 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 3A1GYcQc015613; Wed, 1 Nov 2023 17:17:02 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=wPkuNnzWbEknTyqX5DrTTcv2VdbvwaVi2fFPE+7DsDE=; b=R+X7MlK40GrHXrusLviZhWeyAczFzxE69r1C4cSnpb6cTh+xdk4ryLhperaHyMk8z3h3 xK/hUDSQDNmj0npi3ucGzL6JUX66c89sPL7YUPQNN1qzFb2yFB89Vxj5gmuyqM0lNZCP /+ZjtlKjbqibZas9pXs+nVxgLL8jCvlU4kkKpX5SQTnbVQsqzPctLTEk1ydsgZY/6eLi zkillnaFXwwwu+bXkvikDGDkFpkP36k29UnRmOTIH6LDhMnpzy6brutTwBp6xROsBjYo V5ESGF/5ejoHH8WX2YKZuCeMHfMUUJmxGfyGkDV2odqx9dhdEi+s8I5duwX5h1ySIODk HQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u0rw27wn2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:17:01 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3A1H3fsG020090; Wed, 1 Nov 2023 17:17:01 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2040.outbound.protection.outlook.com [104.47.74.40]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3u0rr7d316-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:17:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L4/s7ybPAYU03lUny17pYiKcbLfIAnY3KD4mFNASsf5kPjjigSEHp510W96zhLEdk0lz0muxakwKSmzBS2B74q9iT1Ow4SjsibfHm91O4aqOYo+rfZgj9xNCM2MjR57XpqmbharfMOAF8UJM4kunY2LGU0JqGHoBcGMs09HlIp3NkAL5iKNdlmDtp9PDpM3yKxkeuLTRq4JN0+lfueWvRKkd5VnguihMkCJ8STFivXQBhFUE8qH2Q9Ct/YPitXhTW+pWfZBM3Yzm/HstYy2f04IkuAT8DHXIlbtDseMl6UuPE2YmEz7U0XlUoJajKA6znhGYJMq/bqx5eSEhS+qp3w== 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=wPkuNnzWbEknTyqX5DrTTcv2VdbvwaVi2fFPE+7DsDE=; b=jHKk6j/GIvh0EzzkdwTPA+lzQVg1v2L6h8tys7ZNI0V1HCPAKlG/JYKoKVbGiudDTM48woE1XTI3yphBStDePeYZXnyeSVbTCs5mFspmd0xuiHlIoJjT4FcZbriF546AJOhv7+nJtkbcTTDI399YPfO340hNkunbD5JEr7HKAAK+GEbtVxREDq58P4yNHaYFs6IOIyJexFIlMk4ZLSDn7ps+XaHag1nSr2WSJJJqZF3HqGx2l2sYbsBDEO+5EGvdDN2Xey+/vG6IqbyDrYdYYjV4RyvNk8hxzda2fAPLUkZdIZyleOQJpa7kWTA4HrwuC4pQvigvwOg94+jqBjZgWw== 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=wPkuNnzWbEknTyqX5DrTTcv2VdbvwaVi2fFPE+7DsDE=; b=Pnoxu13Pq3oEeEBHXzCaNIIW5Vjn8bAeXIh3D1kmVG18GnQsQdRE+wTozLU7abWpZsoj2Ebfv+VAYWngxOXlywtU3bS61PSBElxSNmd+tn9VjJIryawfaYVRhKpdxqU5bPFwpWtHG5jiSmOEErCK1C17cHVTJE1mTwVNfAUAAPk= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SA1PR10MB7684.namprd10.prod.outlook.com (2603:10b6:806:38e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.31; Wed, 1 Nov 2023 17:16:58 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa%4]) with mapi id 15.20.6907.025; Wed, 1 Nov 2023 17:16:58 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Liam R. Howlett" Subject: [PATCH 12/12] maple_tree: mtree_range_walk() clean up Date: Wed, 1 Nov 2023 13:16:29 -0400 Message-Id: <20231101171629.3612299-13-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231101171629.3612299-1-Liam.Howlett@oracle.com> References: <20231101171629.3612299-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0045.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:fe::13) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|SA1PR10MB7684:EE_ X-MS-Office365-Filtering-Correlation-Id: 6c144100-b373-410c-021f-08dbdafe5af2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lzwoaleFNLEd9kkVtOdkTWraLBCC5g/oKD3lmoQEIgcPXOjI4jYARjqwBSJ1fCxIdwoXJbJ7Qhnv2/g4W1I9wcFfYK87345mH0gOA6v8VM0F3D2ilvnBC51drYaUqGEXQU6biels3HVjBUpk7M2Mb4xihmCjiPhf6WaolwdbpW//pTYM2LlOXwpi8XLxxSb+sG76reBQ/oRABFvbz+WFQ0QgkN597Zd/6Wwh9k9bjSYyrJA68v3e6U8fzPS6VFYNs1K3gu8TO/Tgw3naVKQDqZ8dV01V+23DTGXZpjzu2QqyZPZfRdmHS1WmdkY4xVzze9o30z8p5CEnMJ7Hjp288VOK/s1ADfRgU/Qh/a3TTEtAHIxU+G4FIg83NM4HLto9MAD5GkdO4b+qJpVrEUVK+RBCkWBbduAUZhBqCrcB0FRFIm96PBJVUg4bJyBiXWjgTAnMFngGhaVjIF0gVRQ2W675pmcNLs/vxv7j7iWFgNwf67eHBwMcjPar3n71b2aFSc2S0FIkqXUqk1kYqxQ1x+AadSJNSGvkMFks3y9vWML2aUlnsO9bSG5ndp9rfFTt 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:(13230031)(346002)(136003)(376002)(366004)(396003)(39860400002)(230922051799003)(186009)(451199024)(1800799009)(64100799003)(6486002)(8936002)(2906002)(4326008)(41300700001)(8676002)(5660300002)(6666004)(6506007)(66476007)(107886003)(83380400001)(1076003)(2616005)(36756003)(26005)(6512007)(38100700002)(316002)(86362001)(478600001)(66556008)(6916009)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pahLqxWCI099x1hySxQEzARJBOF3YJBY9Eg4udVhr3tZTyRZ7aMFr8dxcQoqlIcy6z8SV/O0XC5wtNRxYYTyBbl2OtMiZAGN1vn8/W56kxBasbZd+O2l591d0wB+ZBmCFuKucJoVPu4/KP9VvfDg249Vq70LPrFRiZGrzGURNCo6ov6VE0Fb4wwFjayXf8ofd+ge3ASatD4b623BNKky7UtWQX2j9u/8TUH7SFMkvr2Se+LS26P4UhQMBu3mwnuNN5txoo+EwePO3Sulux+PXLD/ivHxExHAeZtOd+jVhejIOrE12LHFgGXWfuSFT7lhB8JsFhF0mxjBsxe6dYj0D81pfq9hEOV9zJKfx/ZF+S1lmInCbhIAUHPdpKz6DGQTMjLmZvkzbhu/7gfLBnK6zLxLACndPWykJdChWjQkuA4QtNP7acW9kdUARSUQ1UK7h/tk1IzPMnA3YQXgjtl6YTj5RkX0ZnUbKyujunhDGGb2aAn2YjwwQ8D9YDnmJ0YdOMhH0pHkSErgOocgwSfF5gXZ0IlImfa3U7o/xqS1OS7I4DwoGCFK2GeIYSh1gagdT/cAE2JZBTtJGygBtGoiyoBdVaJtsCPyFy051pYmkufOwYt3e0p4AgEM3v3HUuoe0xWAiX/OIdksS8mHHKLWipFHTQ2C/qlPt7C3C+ansoPxsuMysiSecSDJzc6INR7zeBjjsG0JqDTL3paimAQJq5njDUHQA4wUoMKy85nXOnvtRgEpGURhfaAW3BMNIED6a9MDo9SsBKniCGJeig2CLVCrpuxjcr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dtLz/5s9jWdqamrrq63KZIXdFBJMmTTkU6l4rmJTcLORD3y3RfrL1lf6BYyi70Le9guTDVKtPnZaglrycoywYNpsMbGHoOYG4UaPx0PRioRFF5/F9aGE6QJ2bqfK/N83pFs7MDKH3YtvWxZx2qQFJvPK1KwvxINm88OnGh3axfrcw0+96NgSv7SgXrBmZW29D+N0FsaozO8mlWgsmjXiDoatjnPDHdHvrYblpR/Inkg+poyv5RuZW15xaXaXP/k30KtHqDTGJacPK+anSctRciBmQx8O4i7CvOcuIahevCkbW85J3iNXEU2c259s3OroocHS1wCpJO4mRX8YAxLdVCzxTd9bN2qJlHYZg6pGtCLJqptnHCRZuFrQhiGXpnCKRvz/eV/nNAH/MlK06PlSGf+/TJeHEcUwr9dUGowNO5YnWiGyO99zhlDg9M14U1LSvDuhifGQn4tB9rrtuSWff6bDMi6HX7baHctR4GmemvoOQgnv+G3AwIao7j5ZOVuHHbYYdch1g4liUbtTeQKtcXsyoZvWsTLuPqBwykCrbgG8edcvvC861ZLK0xKi9A7BRFw1EZuy4i1xrJTU1XgOn4myR8f08IIxuxQR++eM4HIoZXUqqKCnxuYPqICCj2GxajsH+jCYAnoQPQFXb6dnvpa97jFbjfsa//ekzg4aqSM31A8konjYKAQYVmoGzqGMdGvRLQnE91mGk403LyaY0lIwAR5HanRGk6ozxuKuLLHHtAeJKyw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6c144100-b373-410c-021f-08dbdafe5af2 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2023 17:16:58.6094 (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: j5apUjXyESkK1DlG1QfIpUB3sHERjOIH9+onRmiJczK3Um/Zqsse7shYD83XKg8ZioFu2dg7YAhpD7owyBVO5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB7684 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-01_15,2023-11-01_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 mlxscore=0 spamscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311010134 X-Proofpoint-GUID: Pd4JlmodrTGVuawo9VVTCDlHxG0dvDp- X-Proofpoint-ORIG-GUID: Pd4JlmodrTGVuawo9VVTCDlHxG0dvDp- X-Rspamd-Queue-Id: ED9428002F X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: nw9dsxss34r8qo16zadksiekdwuf7sj4 X-HE-Tag: 1698859022-580453 X-HE-Meta: U2FsdGVkX18UgUMdycyKZ8KB1kTGlVs6dkix1iM97UG8q2f8jvcbTMpKzjgcLHteAf/ZcFnQJlwFUej8LQ5cmK1Sn1gg6KXTOgu+h2mYXeHYzOvxnTrgCo2juKLk2gp9HqWU5gDGUdR2IQ7mt2i1z/WwgO0dA0dRdUaDff6GIHLh4FzrKpuWkweDkMgxQ/xRgAQI0fYZfS9umlghwTF00cU+mwcWKKvQC7JViHHFFopEnuMmypHromyRLXH6F+2vOnGQWNhxlqEG3cyik2Uorg3gra5w4DJazoHOh0FyLZLUWlz8GiXNcsT8OmB5FBHn77blp22EeSG8KR8J0dHLsb6WsODG2LhscACHWAhoQlpJ28uqOJzq2jdMgSL2KYmtw56GBdkqLQ9gAh/ek8YZnI4cBvwe1Oo9yLApks6eOSvaQwJmvSzlHhJ12sFs22nA/BPTt3DjYrub/lkwt+uY9bQ5AXvjKc6OuiRkc0fm3BrmnNqizU3Dsl3FY8YiGuYede6IkMFO9Xq19AXngucjMAk0lok2E9tJkmE5TjlRHCGZhXUtW/dGVXsJw7DKSWG0oLBw/jtrQsAugcuHRERsqcT7mtYeYU8UtTKZhBBGx1DIvUaP6U+49pKguHo5ySxq3Osopzy/ZZSdwWmXE3vNvqpzvb1DF5Ur6mM+Fn/LbRftM/yNKKbMfip2yvsDXjN3BkSV3nQfWf7K5nEUoPlFpTREI+rHUU53XKxOf+cyvN8FwW+H0+yWGxinxHggXJyc9FLHzfLICWUXzH5v6q0U83t7BEE/Lm2188OWNVCAARJkd3rKAlkujh9RoohS5CMMQNkzducuNJwE2i+0s6DCbrYvsoyRQ/2+Cj9EegiH/BASWrE9gLqlzH2++FseJJxbT8TwmnGp8rv4Bqjjpf0e314iIZuUs3cSsloNu0ATCd7mOSE2cQVQpSZHg6KYqi1AGJJY/sF4ADMtaZIqeFh UvW3ECkr RIIuzS6QkRZ8lD6PIK/8Kv5mi5k9tob7uV2TUz+zWLtMW/ssNWJGGZxC0Q49E7CXySK+s1j88FNJkovwtx6QInGHNwhAJnPVNAtjBuG+o3PdDi0m7OrOkBfff/00Oi2keg/9aNHVWPq0y5lkDsLJ94aJmy4a0N5AULisqL5iRHfE2MkmDS/C59A0mqILROr+YjDavs/bNr4vp2iNbbmEoJ+FO94fxSQnDMKolKJzyFCL5ubSYYIM1GrMfYj9WMWHTmnV5A8MnRD9Sp5Ht8r+rwn7ISGg/K3CXSYOMF3XmyxbLiMPek8xRYBJj9jEEVtYndVN/Dsj6tKbYGt5ICh+vqb1GWUXZXbs9uyBCOcxpSWWYo+x43G3Hxie8NrWUfpzOPaEIV9EXb5GW99tnc1mingOfed5vw3v12t5CIkLzdJTOlJQLfGHYhzR9DBmZ8c+jrJ4dXGv6LnCT0X8= 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: List-Subscribe: List-Unsubscribe: mtree_range_walk() needed to be updated to avoid checking if there was a pivot value. On closer examination, the code could avoid setting min or max in certain scenarios. The commit removes the extra check for pivot[offset] before setting max and only sets max when necessary. It also only sets min if it is necessary by checking offset 0 prior to the loop (as it has always done). The commit also drops a dead node check since the end of the node will return the array size when the last slot is occupied (by a potential reuse in a dead node). The data will be discarded later if the node is marked dead. Benchmarking these changes results in an increase in performance of 5.45% using the BENCH_WALK in the maple tree test code. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index a91adaf17306..56cc8278260f 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2796,32 +2796,29 @@ static inline void *mtree_range_walk(struct ma_state *mas) min = mas->min; max = mas->max; do { - offset = 0; last = next; node = mte_to_node(next); type = mte_node_type(next); pivots = ma_pivots(node, type); end = ma_data_end(node, type, pivots, max); - if (unlikely(ma_dead_node(node))) - goto dead_node; - - if (pivots[offset] >= mas->index) { - prev_max = max; - prev_min = min; - max = pivots[offset]; + prev_min = min; + prev_max = max; + if (pivots[0] >= mas->index) { + offset = 0; + max = pivots[0]; goto next; } - do { + offset = 1; + while (offset < end) { + if (pivots[offset] >= mas->index) { + max = pivots[offset]; + break; + } offset++; - } while ((offset < end) && (pivots[offset] < mas->index)); + } - prev_min = min; min = pivots[offset - 1] + 1; - prev_max = max; - if (likely(offset < end && pivots[offset])) - max = pivots[offset]; - next: slots = ma_slots(node, type); next = mt_slot(mas->tree, slots, offset);