From patchwork Thu May 18 14:55:10 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: 13246935 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 11CC0C7EE25 for ; Thu, 18 May 2023 14:56:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C885C90000B; Thu, 18 May 2023 10:56:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C603F900003; Thu, 18 May 2023 10:56:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A8A8D90000B; Thu, 18 May 2023 10:56:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 9AAA2900003 for ; Thu, 18 May 2023 10:56:15 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 7A15E16084F for ; Thu, 18 May 2023 14:56:15 +0000 (UTC) X-FDA: 80803676310.27.A06BC04 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf15.hostedemail.com (Postfix) with ESMTP id DC0D6A000F for ; Thu, 18 May 2023 14:56:11 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=tUSgWHxp; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=K1BWzRg7; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf15.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-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421772; a=rsa-sha256; cv=pass; b=6hXn06uvlPuqvnS2GfvyL2IPI6wclOOAp3vWrSKTPOClCxlN93qXqkzuQ44PuJV05doIsu HyTRLSPKl/5SzFFUikn3fXkNkoDw8inOYAvSjF0b5joMm8kpw1Quif2LEuN2EuvgnQeY1n 0StQi9DCPHTV9iAp1YL6y3eFuMu0zlI= ARC-Authentication-Results: i=2; imf15.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=tUSgWHxp; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=K1BWzRg7; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf15.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=1684421772; 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=FZc89H8cc3jCASthTOjGzkEfMxavJWu8DLVc2e6ZxQ0=; b=rdkU0ysrSSW4GM15qCHBiJcPw9GrP4SkQ2i15QzsgytH7z69E8v/dSmK89NGcq1cXpvRPq FyM+xhyrlN/Sp5HLGEzeZvNNKa3KbZO8ckKoCVngZEndl+AdjODYdVzxbwdOAwcSPSvv8G t1XWdvfqYmn6I5TrxUuLy+pFtHH8uIE= 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 34I6Ir7f012413; Thu, 18 May 2023 14:55: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=FZc89H8cc3jCASthTOjGzkEfMxavJWu8DLVc2e6ZxQ0=; b=tUSgWHxp5dOcpVKMLY+NBufRXIHQulwLgrXU5O9hIUIJSDUIOakObWh5+NoQNYyupPml 8cUtspTFSMTulBIjk6jFoMXL1MSLUat6r/8EFqpmOlOQUHsPF24gngKlL8Z46HPDKfRf eKONDH2RFKx5oNQRUrEwW1v3S2dHRXqlBmc7FJ0Ozh1Ko1NRAd3e//rL5Rrk5f/7WkH8 4wQpgC1S8QGiOeJLuUufBrNkrRjfzTIArN3VmktGK2t1O0Wtoz09V97bAOccKGuc3zqd 0NMpkZJZO7Dbe06NYXw/ja6ehQ1uEFVOziUWJLK/7TNuhYd0mKeQDdUoHSJLf48114Tj Xw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qmxwpjr85-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:55:53 +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 34IE8DIw004253; Thu, 18 May 2023 14:55:53 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2105.outbound.protection.outlook.com [104.47.70.105]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qj10d66jp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:55:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L26YVZQfOFQcycfoS1mdW5ipR7KMXwFssJKTxaa8DmDwuK/MRVmsd4i7GR/yfWjx/+VkSxGu4WGrNbxBYlnGSDu7OTyXxbzDlWNxHRGPgeTWFZr/whQrPATuKHj0+Fe2fWVA45ZLFO46dY83UOhYYftpLETjByVF9Zhzo/W5PA7X+yh+i3Qu6wP0TaWYTUDbUpKAmZhqIRdI36Qw43DO/c3zlGQXtAVJWyElhysXFTL7PFquVOTJEPwppbGNP2XDrgcfAUNb590bVSXsRlqVSAopKJKXsJIMveyA0tLVkmXceVdZhihHGBeKXnlaDWAgYf6fx9UEpykNhoeS3GX+7A== 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=FZc89H8cc3jCASthTOjGzkEfMxavJWu8DLVc2e6ZxQ0=; b=S/MSgTUHt/GaLWNhGeNxPEQFGZXuX6aE337L36wsqAh4jXbQcs22kaPTsM2RWmr4NtQlDXRxHzYoZVG6lafdnML2zX38cT59K1t9kAIpsXC5YTxg8/XUfW8HS+h0I1VHl+/bWELKSGhvvrYYuhSSBrxuKNDhOHhoYKo1l7m5c41QgPLXYh2OlITWMzW+f3AJGaL9BgLXmOtrnLPFrZ5DNxucNhIfio12AOcU5J9Jq1qAjbfE9bCyrHx+UJElpXLq/2ateyFjMWka3yvdZmcG+UiHT0p30tZVs1bH64sbj6BGcHqwY9Oarbcqtu/D+8BPohLVSJKxFp9UQoKiZpW72g== 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=FZc89H8cc3jCASthTOjGzkEfMxavJWu8DLVc2e6ZxQ0=; b=K1BWzRg7EiO1+SY+Iiba4AoIDvqn2XjLz/BLklGmmL6yt3psOdGuTcN5jBtyuaJPsXlHnwYtyYZ0irSCsIoOYYcg3r3hy1OYwE5WwRG7Yy2efNdlT8BfurFK54h+O+rEJtV6K5hoigsYfFGMCOXdvNC5xbRnJFklIweOV9zewG4= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Thu, 18 May 2023 14:55:51 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:55: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" , David Binderman , Peng Zhang Subject: [PATCH v4 01/35] maple_tree: Fix static analyser cppcheck issue Date: Thu, 18 May 2023 10:55:10 -0400 Message-Id: <20230518145544.1722059-2-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0141.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d5::12) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM6PR10MB4347:EE_ X-MS-Office365-Filtering-Correlation-Id: 44f98ea4-4e4c-4aab-84c8-08db57aff91a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LbT0IxPcBLkgNgRxryjbeGWpH3mqD31jIswB9OR0u2fPOXRSobFYl/yOlKm4DD7pquc4MXQsomyfgJqEDSnX6+TM/F5S6BdN2RLBjoao2YT1gf9VteAjuD8iKMxHNCNvjAwGSIP27bqREIYYuUt6B4KaKHH65ROc3IOhdXFhznuiKUaxe3amcS3L5ZlAJAYX1/992OvY83qY5CXc55zwbYCmqBz9QfcNFxHKtr9+s0kyfmExsR4huaVFXKGZ8hD3HvjO8HjGV25slhhjwoKevDpexOKz82QmNB7iyeMaSZAuZStOp2mvo0Pi4+Z6aheIzFSr1oAI1wIIfXZY/xa+NPvHbS50NZ55ch8iBpd9V2itZkrni8RkkO7kgBl68U8SQK4VO2utWpird52sSd7Yno64CTCutibbikeJqzb2bSlND3R9fDNlszC0Kh4rDyEt6AXBFDg0d6I7NKLXXq5EP99poHMxME4wjwZEKfJcxkJl2zB7LHiRIAK7/oFkwRRqEIVLMuEoIw685HpdmWT/IqVfc/4l/1NcDqYDpkLJIwGhBwJ6QlFS2lr5f+cgvLHH X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(366004)(136003)(346002)(396003)(451199021)(86362001)(2616005)(4326008)(6666004)(26005)(6506007)(6512007)(1076003)(6486002)(6916009)(66556008)(66476007)(66946007)(316002)(38100700002)(36756003)(186003)(478600001)(8936002)(8676002)(54906003)(2906002)(41300700001)(45080400002)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: h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VN7WjuttDzOJik4VKCyuGiHYAlOod15OILyQtgkLsd43XKj67x/J2enQ0cW/GpjDm9VcVACJWDonCS6X/McELo0o1sNtGHbeLwwTnYThJJeFeJzo82iHffvSYXOrRCHSIjEj99F4rs7uN5I5CffLShtQEiZtsuq2zncV+LBWGHows0p6Oqp+oGDnpkjg9pqYWoOpGdYM4FIeX4whL8zsnMND0nd7RZJJz60wEw7qVuXbb/+QAQpyKGH75/YDSWBK8ernlqNiVUL9r4h3LUr0BgLBodFUGmShjEaHRJOOZXRi5um5buogbiBMSygR2yPUVUQR4qwPWzi7iEkbTMtavemHxnUf34Bj6jC121iKcb8RkMUZ/ELma/S1T67PcBnLCEA1cuj1VevQ7lwTLoZ3TKsXX4/1i8UciIc7aLDhljjnqIyGmy4ouVxyK4sV58ASkvdYkJYj3YNq5pwcWn3OCYvo7xHLo1kUrWpWYnbGIKiWEgdmQN6cJKsZjoocMbSWuBWsfHJUwrSIedKKi+Uz0hzwt+yuZe8csl/iHA== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Nmr/qphyWK/o8lLzB44F/ookJYYjDkQtxM0EQtsf9KzHsd1YQucKNTlVDByol2JgGNsNR0NRo9hL37XeBbWLS/EIpGDIisrYkK4v8i5hMc9Lzh4z6nf8TuaX2/+0j9ghxS0e2utoDdSAEqKz1gwOuLzVZQToA+JHUFopXUPlMSV72Mw9J5Iuy/npuameCS3Xoj/KMKxDX6SkyTAwVfraNE02EoYkBysdFOUDyRnRSeBd5Eunf+fmZWb403Ak+ZImGpxaar416yjM1Z89F1Tm38PbkGIuNJ3I//7SzW2cWkTvQqkl6xuSbqH3z/LfZdIWaUn45ilAFnHNmWUnpzvaVQZFxB+2yzsUMuY6T83iVaUDubvhvTQ8bsLAhiSGqa+uRr7cGWzzym4CPtihXpIfrJdlEYpxP9i4SHk9M6pR6RPo4LvH17wJlRB5e8Fmaf5bQfUnhIWha0TJee66JRjHgSSB2vMYDms1WOoo1bY45I4Lk5EbXGoUUKr7lkZfIUmoaB1Ri2kD0KWw1XtQMKykRe5y9EXyDA5GKfNF+qR5UojcrQ56g6zPzaYfUuFa6nxqRdU53W6gb8b6E3/pOSSHBdFNq27pNLDuMwZBldBu2QZEhM0bYgda4q+c/MQMAeq1wAXOb24Z/0byNxMSTryeMc3JMmW6gVHMyHqfbwf8bP5UZLZ+phbJm2Vx/eYNs+gWxgoHYLFlc9bnJG0IakdLjelKuSIajp67d7yDs2tpZb3Xp33/nad09TytRmmeqeHOFuCBCcmBvBcYcZC8ibyKMA2hi59EfPJLYyh4ETZVilayYh2EGrUjDDHnR7hOUIVExzZXJjjwcA6uWct8tpUrVl7C1YriKJyUTlPZvl9lBzfESnkXnZB3D0AJSi2fhzrcpLovSOdoYx1R1uPeRcPczWvxuyURvN8CmNALu0mdIjlQ0FOmZFLxh8l/mPa9Oj0qlYPx//+gA4Hf7WAhpsy46A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 44f98ea4-4e4c-4aab-84c8-08db57aff91a X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:55:51.4470 (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: RgCKL9i+gPwGIPHirTd5MqkvPVXSwAwpanWI+eOjKOuPREdgLE3NUEto88EnnrP7H340BDv5/6TJ2AuDl3ebnQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 adultscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: NMKOVRtQiQ2mXTf_azDIsyeWanyjEtnL X-Proofpoint-ORIG-GUID: NMKOVRtQiQ2mXTf_azDIsyeWanyjEtnL X-Rspam-User: X-Stat-Signature: 85iiy5otdpdaqd3emr6bmnok5x16g4ay X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: DC0D6A000F X-HE-Tag: 1684421771-630412 X-HE-Meta: U2FsdGVkX1+bPU2wU29aTAeL/6aVhdXft1yB3XBuYBaL/dCTuB7AjfBNvA8PQwX1cS/z0+5e2fgBEQc677q0VTEyyV/3x62/wRMJQ/cPwNf0fvKUSUnyTzCCfga6x5/ysy54AmJiSfe68b3nTfEgxP0254L7fGNqidQIDBbCPqJKQKoiXEj0DagyVwT8WybqLSQCBF/27CMVM1VDawmV/L5bh2xK4mdCQ13VFY3BOxl6Eva6Dwk6Rm0Sub40eg+QhtXvDG1KYIMK/MMuAY/N1Uo6NRAxYIKBNQDG8IEARhD1p/auSQ1zSdB0eRb83ju/dFQgFlcu0rJXlcaZV8aY2vCNhylss+HzgVDHd7H/e4Ir+BwnHwTOIzL7Gp6aGugHqT5JIoM6z3E1RAm8I1Ij9ThrPV3QX53UxlFQrvFdeNFHsNNXJoI1Vx5LbXZrHBA/A4Z4XybLE7xjGgIPRIzPJy7EHRegwfAGZyofY30VyxKYGjrXEVzTGtuv24i+fvpy5cn8SQrTD4wM26aJLNyna40KTEMZyfrfJ5uqF3mrVmWpTXDmBwzMzQ9/kQXjRX5C0GNOC2yqYx/3kyRVmctCLaavYDNNEArHfAwD3cZ2svljFER8/mzgZBlnwb6HIRUWBf8+NVCQz4TQ5Wu359wORa6t6l3Ut+us5TJ+XhGadgKYCliOlow/z5XsWxgC0ZfziYXQn2eWIMYCi0djO3vfm0VsHHPMHC2/Mp58iGAK+jYYIl+9PQn1rNO2sMIsmMV1rhzYnQoZak9JZib87PHoUzn8S+AxB8sGY5i2R9ZsixHvmMKj2hVQCQhnXZjlhK8FwFSugqCQ5zI/ceA6aLRztalSlppb6uYQfAHIeJ1WvYnq3XLZsNZdSm57iMrITb3EcI9EK7qzuy9JjbUJffQbO0806IouP3GlPqoKaJQA4yNUZHICwPdEbP+v357oEetR0cWLMcHuXIVWEBDSml8 wuD/icTx M5gEqDwMo2omysyoGd07utGshjvRxGoJaqjy4BCpVHRk89yd086simp7LgaHr/cK11VdadnhEERR7ror0jR/uL6M5cyrnHEHIBlFWQY0kiXdDvnugekQni+G3vMsme7XSzyPXEEN2ssjrvyV+Hh2VmyvyBuDZBHYWdfoEiCX3MATanTkHl6ElkRSpbnvwnMmqEra29fJ84wOG6+xR6EhjNwo2yN67UgmBVFBvtKUJTAhHGRMbqfRAOqCCecmLwfecbh3XEJ2MwgmSiGLX7hTecTGgU1dZG/4RbBEve5Yg0STpSOc+rbyfmfwtL6gVyU9roz0BVUUg8U039svbSRMX14Qvvr8QIQqhSuySrN9la+ppSN9GsbQG3a7BLE0g+Y79K58zdtGCjMxjjMXlHLe+nIksPbDkH6BVQfb6jXKW1B0JDD28VJOu79OZgHIBvsLtZnikbsyCOkRJhznBgUNP7/ehak6G8nhmc61AhYLDDprNOhVAZrTHIv7ZIpKhpAO2Duf5 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: Static analyser of the maple tree code noticed that the split variable is being used to dereference into an array prior to checking the variable itself. Fix this issue by changing the order of the statement to check the variable first. Reported-by: David Binderman Signed-off-by: Liam R. Howlett Reviewed-by: Peng Zhang --- lib/maple_tree.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 110a36479dce..9cf4fca42310 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1943,8 +1943,9 @@ static inline int mab_calc_split(struct ma_state *mas, * causes one node to be deficient. * NOTE: mt_min_slots is 1 based, b_end and split are zero. */ - while (((bn->pivot[split] - min) < slot_count - 1) && - (split < slot_count - 1) && (b_end - split > slot_min)) + while ((split < slot_count - 1) && + ((bn->pivot[split] - min) < slot_count - 1) && + (b_end - split > slot_min)) split++; } From patchwork Thu May 18 14:55:11 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: 13246930 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 3938EC77B7D for ; Thu, 18 May 2023 14:56:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AB216900006; Thu, 18 May 2023 10:56:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A62A8900003; Thu, 18 May 2023 10:56:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8B60E900006; Thu, 18 May 2023 10:56:04 -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 76542900003 for ; Thu, 18 May 2023 10:56:04 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 223EAA088E for ; Thu, 18 May 2023 14:56:03 +0000 (UTC) X-FDA: 80803675848.21.61DD7EF Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf17.hostedemail.com (Postfix) with ESMTP id 25EF640017 for ; Thu, 18 May 2023 14:55:59 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=MpYzH4MA; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=nM+F3RTR; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf17.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-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684421760; 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=LZ+Rvf0vfOSu8urkYzsX96V8zbxpG3dCO4wDwbgmX84=; b=HdHqGihJp8A1YcTBhmKbtpzRPhNfNVjeKFYAd7xSptuNP67/kmFkmjDdTTeO7yrsrzo4Dh xqMldHwfuSCMAADuV0GxnTaZPL/rWhhh0n08PE/bLCjCciq6HZ25cssn5ON0ufp2+E1VcI IlO82E7Q48x/sZWCed0ATApj/39tAKc= ARC-Authentication-Results: i=2; imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=MpYzH4MA; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=nM+F3RTR; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf17.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-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421760; a=rsa-sha256; cv=pass; b=oDHo9KpKSxnKAjNcmFZHQzsCNHWvHT0XcXmBAW0DR5JXTeIxiz8guZ79PSdZUwFh21eYJl xo75zPFK6VLc61aTANrIaFm8epP1b0YqY86coGihjWQNdm8CAncabX4TkqFpZws/4kgXNp LljhEQwiZzVa2Tei06V/N+9r20Oqf7k= 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 34I6JJtw026285; Thu, 18 May 2023 14:55: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=LZ+Rvf0vfOSu8urkYzsX96V8zbxpG3dCO4wDwbgmX84=; b=MpYzH4MAXaiZWbvjAYTQaDB9Ej0RHTlp+Ib2swHE/Sl+3V3ykxpUZqif9cvxyg2cUMVA bjmUQTmTZAOjDa+NpX+h6kSbRYChdCGlFxGuBOl37+fYSHxBan5t5wBqgD/N67lVVqYa ECO18ZNGBZU0Q9HiZDE8I4Z9WHIL/0yfZ+qoUPxZF/X1BNVHfS5ku8DwTwY+vQrDm1KU uYeU5zZx/aIkhA6FAg6W28S1vG3+lkfps4avTLbWqXJV+3JVaHpQmhTzAC/iHIxAgf1V 1g/1iGxalfpx9iUi3DxSIOmFVw0eDdvQ/rUyDjIhJX1qU9qQn7VCYW4eTflSiiXIArul RQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qmxfc2ucr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:55:57 +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 34IDrvv0004227; Thu, 18 May 2023 14:55:56 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2107.outbound.protection.outlook.com [104.47.70.107]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qj10d66ng-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:55:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MTp1S8Yoj0OHgT+XUBondm4jVWgHJc4Q9PmIbA2nOserY3y7YBE2+5Hyqwos/YRFsmuU7fv+665yxfON8HduP6tny8O9ui3T/beyPIiFCcQ5I7mPt8v5IrAyEHIxjLKM3+D0GB0wVBWWnVp1nMcBFiPOENDIkORY5VqlOM1TgaNLtIQOmovCoL0HDLiGLrrA857Swq2zLVwUbdgOHe+ZFx09KKhXwRF8AUKb7AYkI4zzUnWzDvmtvwbhBf37d/urjLBCiQs0OWlCOF2eRnyugREDXEovYX3s78K5tr+VinpvVflBB7bE+tW1g23MojDg9WUyvcIOtbtRwKrXZvhK9Q== 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=LZ+Rvf0vfOSu8urkYzsX96V8zbxpG3dCO4wDwbgmX84=; b=CViZc+m1PE3bAP3bEuKKbdmdrBSqOm0jJ8G8y91ypRRH9041tZAQOV0n3sdU6FDoMo4OXjespqmaxL6zqI6eMmD1mLh91tNTpl6CcwnmO/4MEZAXtXTpWHDXfjLmDbQUBs9SUkwsAKcyjJ4TbCkvC25DfKxzZQZclJpJFRHCZPW6BmUEpXwSWDcVKRXlPp72UmjwTACGHgELgez7zH/DH0rs0B8PgIGvH2von40T9ByBa5f6OoEEPoirLBVrnIVYm5YR8fpnxK9pNA1D5lqZkDnSo+eXYWJHNEDYDqb/RnM8/+It+aWWx/g7VSolrrpWqA8NU65Z2OAW2L6r7PyGOQ== 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=LZ+Rvf0vfOSu8urkYzsX96V8zbxpG3dCO4wDwbgmX84=; b=nM+F3RTRqlVQFIFTHvv/7wtHJf1UrWFP1ZqiJ88qa7bNyO7lmnnqSNVKvp6P8uyUCkT8RSqOylmlPH5OnAlMU+NbgP7jpP3f9wnV1G3BvTzKlIqmoIXU7lWllnAiWvwwwlrMpG+VvF7XTYCZeXIv1e5ltAdfNXiHwTNfHOKG3kc= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Thu, 18 May 2023 14:55:53 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:55: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" , Wei Yang , "Liam R . Howlett" Subject: [PATCH v4 02/35] maple_tree: Clean up mas_parent_enum() and rename to mas_parent_type() Date: Thu, 18 May 2023 10:55:11 -0400 Message-Id: <20230518145544.1722059-3-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0264.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10f::25) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM6PR10MB4347:EE_ X-MS-Office365-Filtering-Correlation-Id: aa70db6d-2356-4a60-a885-08db57affa89 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b3sTEtXCdo2+6jk9rK03VO7xdSwMkf1Bb1+yYiSfVQ4pTrdmm+BvXti4Nwb0fVJhnWw2/blWM8RiT7aKr2muuHx06NMxlEJXyf0QKdh89OG5TuwsUN8sNEtN927VrxtoVSLrMqadf35yI+AFRC2w6TVJUxrIm0LK0SwpN+23c+awcdnkDoYNwd+e0Fy4hZ4PLq3EZQcWRAoJu3vpR2q1AdxjfHi/mkh0u+3e60RRpAAMImBILwlFh1qPEn9D0//HzhF7dx8J40LKYLJIk2PYw3Dod+0RHf8cN6x+8Dcx02+4GLqzxomOO1LKskYFzcqt5FIx+uhPo2LdlX+pG8c9KJOxnTnJibLubPSPSZfgPOzafIzQkjla6++HQfoh9CxLnIY18zeUqPj89w/1sYTBCfG2/Bqwj2mwIWE26P/Lvuv/SM3nbhWAKSqASVzCjWiiYedN6cjkQaf4PXHCiyy/O9r/heMWmuZlvbKr7MMhG2vkIf+exxlSI0L+/HLNuzJufCpR75Wd9B5wwbePjLYv782pvOjNLLn/td9AY2u8l/doQSIWwdEf0VIEJIA2xb+e X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(366004)(136003)(346002)(396003)(451199021)(86362001)(2616005)(4326008)(6666004)(26005)(6506007)(6512007)(1076003)(6486002)(6916009)(66556008)(66476007)(66946007)(316002)(38100700002)(36756003)(186003)(478600001)(8936002)(8676002)(54906003)(2906002)(41300700001)(107886003)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: b6pu5IW9bZpnnn/+MB3vZgzesGibpLA4Ln4OixEk+twHknTZGk+Fc09SgongOn4UywvOR5THSt31fURz6ckmH4QG9Tyw9FX+8EdHyla4Qs62QPHB81X5HPBBHXng7MDZLBUd+ioNrXaZLtU1j6TKsAgNqt2V3I7qbCjOwtwQu9Mul9MU0RbjyVKpaN4dHsxd9aOSYnkkqA/qBVjKCE4+LA1slmnL6wlDo9UJi779MENanZdOEGBtOJKxnfpXi86Pbf8na7wJTpjAmY472bUbVKj9rMZksa6gVJ0aABXTNojqGmEqf9z20MKsVer5+2Tg9njvqTQ1mVt1OJ/Jwseg/HQ016/R1VgRR4oZlug8PZ4aw+GVeQ9madYcS/YiyVfc5VscrXzWe87SrkfkgKm+nsK5Xzo9ubf80bBkZamNZvWUic6biyOL5/lCf73i6tNgUUJxK6eZA3U+NbWDxJkNoRfhcIz8RKokGNpuVgi7r8kmn4hRH6FEbO9jiHKrV2TLQvcoNd5q19UE9VZU1a376tkeRnVXSxoaQaLZszDeREe0O/Wxe7kgBORn/G1p3Yka4e2ssEa9xpfXLch9t0RddyUSXOHhfTAoc+3YSy1SuRiOQOD3lkoeKg4954g1mkgAokf3pGbx+DXXbCwB/8JFYGVMpKGcMg1kKTknmJQDmg5a/HmdGODUTf8i/WyjKKXIDwea0IY+rrXXCWZoc/NQYa8MEA5QadHkOBeYZJVckMWRrMTcwthxT9vCocmhOiCnBbgE0GaCKluz95qf5vnhWJu/9FYZhLg8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7OcyxJ92hpksXBMC3qPFHnzIFQF/+ydP4GwkBgJXo6VRJfUlvU8PCOcxJhe6uPE4ha9feX+6dvlWrhJhSmxy6CU9rC+oGoZOalQUu6F6O4XBhYcw6vqy/rmEDDRJX2qI9cpyN20C44QUWrJFdV/VWzRP3Oalz00KyuypSMTQOKqjzXREWdpU4ZK4UUFF7XoM1oYLjV8pHHTML6JyJt0RGoPz49YWOvO+Nmc09G0gQyqqh4IxOO4JG6LxwgOe+EJt9TcTWQAJ7hwQMP2xoossc23QEPLDevutR3ZjUUSiOuV2Ibxa/fzZp/XbagbG+PelKq82SYUEE2wB2EvczH299UAUUZ5YN+Llu/M4xgRO1yBQgAY43aWHKFVsO/fmA48GBJKpP08fX6ObUp+cALBCWYaf2WreFqV08NQiYnIZtzKpXYrAem2313tDXzV0M2PRadLGKE/Fket3+VPY6oSIkC1C/p7QmhskMtRrFQAYa/GHoSTfTa/KS5ZdqgC+Ld2jp3mksHRuMdSOB/wQ9W/c89QvzYTmhls7nPqPFLijQdq2Zu72bLYhMuoPHuAuesXaFT4WbvM+DRnwZwUmkJhbYa16k8bsD5dCGId68xi7AUcP+u3u1kyDWM+/l7vwiN0PbBkRGtF5HdJVNZhrG4mMina/7Ra1yKodh5jMrjHe095Yg0LpRgquv1N8xT3qBNhy7wUK0Ysges6kzvM3IdbQxaPiGJbIaFZqVCXxJBgPe4Ln3oBFEWH+wtPb4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa70db6d-2356-4a60-a885-08db57affa89 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:55:53.8253 (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: j4ytq9wxpB+MLhhBlNYMq/zz5aZ3dCyPKWfrYMZMW/pvt7RmzzSns1TR5oaKxPJMpTNBuVkSkT/DC7L6/4rdqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 adultscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: 2-EBsmM22HTK43Mc7VoOyHEq5PY1Ov6m X-Proofpoint-ORIG-GUID: 2-EBsmM22HTK43Mc7VoOyHEq5PY1Ov6m X-Stat-Signature: ikjm9f5zfpu8yghp7g7ttrho7jksho8r X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 25EF640017 X-Rspam-User: X-HE-Tag: 1684421759-153142 X-HE-Meta: U2FsdGVkX1+uWgRtI9xxojVCjComSChDbaWTYU4WhaZk40eljGQe118cYolxFEmKvBRDMvu2eLElhEVYJJlMZD7+ar1WPcG9rD4HiKDZb/5zeID8TZPe9+xfs66CJcRn+epX5TlzR/jxp9iToAiVZd+24zjbrO8u+0L7vEZ68a4YHoTdANcoCCGd7dorImA2DIDWXeVMSstdOISqvcG/u+n/aVqAAavcwbh8aqSsQ5EjzvIN8+Bhlw8289lzHoWj0KUKUvaaiNP4AIlQ/v21UyugwZdVvz6ank5IKKh4LaPOa9yfk1JysnlqDcWrtKcY2ltVif/7+nLG0wdXwqQzpsWa8M2H3eGfqGWkn/ePXjFPj4wnFfb3uvX4IC5dr/K7xASX+VW7VzPiqkFSLlT1Hj29p8kgbgqEfiSfmaKUvZm2vkt9ueZCvv8MlOxRi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cfnw= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: "Liam R. Howlett" mas_parent_enum() is a simple wrapper for mte_parent_enum() which is only called from that wrapper. Remove the wrapper and inline mte_parent_enum() into mas_parent_enum(). At the same time, clean up the bit masking of the root pointer since it cannot be set by the time the bit masking occurs. Change the check on the root bit to a WARN_ON(), and fix the verification code to not trigger the WARN_ON() before checking if the node is root. Align the name to mas_parent_type() since mas_node_type() exists already. Reported-by: Wei Yang Signed-off-by: Liam R. Howlett Reviewed-by: Wei Yang --- lib/maple_tree.c | 50 +++++++++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 9cf4fca42310..555de3a8343e 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -425,28 +425,26 @@ static inline unsigned long mte_parent_slot_mask(unsigned long parent) } /* - * mas_parent_enum() - Return the maple_type of the parent from the stored + * mas_parent_type() - Return the maple_type of the parent from the stored * parent type. * @mas: The maple state - * @node: The maple_enode to extract the parent's enum + * @enode: The maple_enode to extract the parent's enum * Return: The node->parent maple_type */ static inline -enum maple_type mte_parent_enum(struct maple_enode *p_enode, - struct maple_tree *mt) +enum maple_type mas_parent_type(struct ma_state *mas, struct maple_enode *enode) { unsigned long p_type; - p_type = (unsigned long)p_enode; - if (p_type & MAPLE_PARENT_ROOT) - return 0; /* Validated in the caller. */ + p_type = (unsigned long)mte_to_node(enode)->parent; + if (WARN_ON(p_type & MAPLE_PARENT_ROOT)) + return 0; p_type &= MAPLE_NODE_MASK; - p_type = p_type & ~(MAPLE_PARENT_ROOT | mte_parent_slot_mask(p_type)); - + p_type &= ~mte_parent_slot_mask(p_type); switch (p_type) { case MAPLE_PARENT_RANGE64: /* or MAPLE_PARENT_ARANGE64 */ - if (mt_is_alloc(mt)) + if (mt_is_alloc(mas->tree)) return maple_arange_64; return maple_range_64; } @@ -454,12 +452,6 @@ enum maple_type mte_parent_enum(struct maple_enode *p_enode, return 0; } -static inline -enum maple_type mas_parent_enum(struct ma_state *mas, struct maple_enode *enode) -{ - return mte_parent_enum(ma_enode_ptr(mte_to_node(enode)->parent), mas->tree); -} - /* * mte_set_parent() - Set the parent node and encode the slot * @enode: The encoded maple node. @@ -1123,7 +1115,7 @@ static int mas_ascend(struct ma_state *mas) p_node = mte_parent(mas->node); if (unlikely(a_node == p_node)) return 1; - a_type = mas_parent_enum(mas, mas->node); + a_type = mas_parent_type(mas, mas->node); offset = mte_parent_slot(mas->node); a_enode = mt_mk_node(p_node, a_type); @@ -1144,7 +1136,7 @@ static int mas_ascend(struct ma_state *mas) max = ULONG_MAX; do { p_enode = a_enode; - a_type = mas_parent_enum(mas, p_enode); + a_type = mas_parent_type(mas, p_enode); a_node = mte_parent(p_enode); a_slot = mte_parent_slot(p_enode); a_enode = mt_mk_node(a_node, a_type); @@ -1659,7 +1651,7 @@ static inline void mas_parent_gap(struct ma_state *mas, unsigned char offset, enum maple_type pmt; pnode = mte_parent(mas->node); - pmt = mas_parent_enum(mas, mas->node); + pmt = mas_parent_type(mas, mas->node); penode = mt_mk_node(pnode, pmt); pgaps = ma_gaps(pnode, pmt); @@ -1691,7 +1683,7 @@ static inline void mas_parent_gap(struct ma_state *mas, unsigned char offset, /* Go to the parent node. */ pnode = mte_parent(penode); - pmt = mas_parent_enum(mas, penode); + pmt = mas_parent_type(mas, penode); pgaps = ma_gaps(pnode, pmt); offset = mte_parent_slot(penode); penode = mt_mk_node(pnode, pmt); @@ -1718,7 +1710,7 @@ static inline void mas_update_gap(struct ma_state *mas) pslot = mte_parent_slot(mas->node); p_gap = ma_gaps(mte_parent(mas->node), - mas_parent_enum(mas, mas->node))[pslot]; + mas_parent_type(mas, mas->node))[pslot]; if (p_gap != max_gap) mas_parent_gap(mas, pslot, max_gap); @@ -1767,7 +1759,7 @@ static inline void mas_replace(struct ma_state *mas, bool advanced) } else { offset = mte_parent_slot(mas->node); slots = ma_slots(mte_parent(mas->node), - mas_parent_enum(mas, mas->node)); + mas_parent_type(mas, mas->node)); old_enode = mas_slot_locked(mas, slots, offset); } @@ -3251,7 +3243,7 @@ static inline void mas_destroy_rebalance(struct ma_state *mas, unsigned char end l_mas.max = l_pivs[split]; mas->min = l_mas.max + 1; eparent = mt_mk_node(mte_parent(l_mas.node), - mas_parent_enum(&l_mas, l_mas.node)); + mas_parent_type(&l_mas, l_mas.node)); tmp += end; if (!in_rcu) { unsigned char max_p = mt_pivots[mt]; @@ -3294,7 +3286,7 @@ static inline void mas_destroy_rebalance(struct ma_state *mas, unsigned char end /* replace parent. */ offset = mte_parent_slot(mas->node); - mt = mas_parent_enum(&l_mas, l_mas.node); + mt = mas_parent_type(&l_mas, l_mas.node); parent = mas_pop_node(mas); slots = ma_slots(parent, mt); pivs = ma_pivots(parent, mt); @@ -6995,27 +6987,29 @@ static void mas_validate_gaps(struct ma_state *mas) p_slot = mte_parent_slot(mas->node); p_mn = mte_parent(mte); MT_BUG_ON(mas->tree, max_gap > mas->max); - if (ma_gaps(p_mn, mas_parent_enum(mas, mte))[p_slot] != max_gap) { + if (ma_gaps(p_mn, mas_parent_type(mas, mte))[p_slot] != max_gap) { pr_err("gap %p[%u] != %lu\n", p_mn, p_slot, max_gap); mt_dump(mas->tree); } MT_BUG_ON(mas->tree, - ma_gaps(p_mn, mas_parent_enum(mas, mte))[p_slot] != max_gap); + ma_gaps(p_mn, mas_parent_type(mas, mte))[p_slot] != max_gap); } static void mas_validate_parent_slot(struct ma_state *mas) { struct maple_node *parent; struct maple_enode *node; - enum maple_type p_type = mas_parent_enum(mas, mas->node); - unsigned char p_slot = mte_parent_slot(mas->node); + enum maple_type p_type; + unsigned char p_slot; void __rcu **slots; int i; if (mte_is_root(mas->node)) return; + p_slot = mte_parent_slot(mas->node); + p_type = mas_parent_type(mas, mas->node); parent = mte_parent(mas->node); slots = ma_slots(parent, p_type); MT_BUG_ON(mas->tree, mas_mn(mas) == parent); From patchwork Thu May 18 14:55:12 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: 13246943 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 8FF83C7EE23 for ; Thu, 18 May 2023 14:56:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2751C280005; Thu, 18 May 2023 10:56:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 224A0280004; Thu, 18 May 2023 10:56:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 02A97280005; Thu, 18 May 2023 10:56:39 -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 E3180280001 for ; Thu, 18 May 2023 10:56:39 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 8DCADADE6D for ; Thu, 18 May 2023 14:56:39 +0000 (UTC) X-FDA: 80803677318.06.88BB7F8 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf08.hostedemail.com (Postfix) with ESMTP id 3636D16001D for ; Thu, 18 May 2023 14:56:36 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=3D75iLbX; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Ez0keSAU; spf=pass (imf08.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=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421796; a=rsa-sha256; cv=pass; b=RiFD8viibZWI5Tjz/MhmFq/65USnuE9JW/3ULCfVQE3R9mQhO9ZN3gGcd9k3DVOtnMAjDY cjLDqd4Te1ja1pfnXpr2sL28qocCAtfE9YWLH6fsCuVZGvPZxXUz509Z1ZEb7OA++rwtke q6KwcxtlHSxt5aWvDxVOOi/28Bi8J9A= ARC-Authentication-Results: i=2; imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=3D75iLbX; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Ez0keSAU; spf=pass (imf08.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=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=1684421796; 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=vTkLRZV9sD6K+270TKH+xpnYAi6cmrgED7lowvnLyAM=; b=nbB/vd0XPQjT1dxxMjnpFebSQGqaouLfILvy/db/S7EjdBBqAgWDLkq1c0T8o8l4fmb6ho hcWS/w9ardQxCaBCH2y/B1Jx9Rq1nJ1iCJVbrW7OhJrAjclv9KgSaE6k5zV2yB01AN8dpO 5RNADxs2CGIQolsISdSj1vIDHyud2xo= 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 34I6IsjB012432; Thu, 18 May 2023 14:55: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=vTkLRZV9sD6K+270TKH+xpnYAi6cmrgED7lowvnLyAM=; b=3D75iLbXEDC/I0T8BgBeiRFUEYBTHsLrp01OP6deVbuiy0Rb3zYZXue9adak29Hgzorx IadYAK8AweILb37UENG7mTS39aMJA5Hv5TzmIOmI9TISzoewh8kGsL1fzW21JRizKrIN h6DUiQwPC3H8JSpyEDVKu3MzVDg7BH2KK2gbD9UkY+6fZIWb4z482w22O9TR+Gd1pjvS CaZqSA7dIO7pN9Mf6HbpkpLpzruLt75iU0YTXfXcCouwgbgv6zC10gzXYKhbL76KtxyY /iG+lhgg+ceQtKv7Z9Jyp/Q8m990OJNeAly2TzoAdWKEb55AAN5RI5UgJlvfPV3lDXUq HA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qmxwpjr8d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:55:58 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34IENu90036166; Thu, 18 May 2023 14:55:58 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2108.outbound.protection.outlook.com [104.47.70.108]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qmm03w2e1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:55:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BdcJDpHhuZPEw1yn87Q8chI1iDR4FUUiF2UJs9KDUhWGSz3GTBAYXvQf/WI0LUthc/7qt8H6rWp37r5LQf4fKRag5+EXuR47iLabcCmLwidup6H+0k2FHGc+a4AQUlxiH/UfKF9bm4mzQ/4J3cjAbkXeFFQ/RB+FQIgjUXoPLdge1hyomhp88ciBPK+Im3dnw/vba3EgRa6pHaLbos9Euqz1urJImYx4zbw+9QrNc8sGBgCWkE4DTCDeBUeixL795epY/+So2ZwNfBjfXOF0hIIIP00fzgs3oM96/9hjPK3wHMoaJI4/Z7ep+xdV0Yc1zh97Zp/qc50/u+kfceCvqg== 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=vTkLRZV9sD6K+270TKH+xpnYAi6cmrgED7lowvnLyAM=; b=i9G1tk4adNVYdT0TK0cutnfFMh9r1tVPBVoQlgTa7iz6Rh4fibmpsU+MT6BieGtdndyX8uawJzMDE4tK+YccSqkjZ9WTrwPtg4bv/M9g9+MEtPk9XwtBNB1lXyM9AGxh118CGSUj0UKKKvWLgPk1HZgsM1zeJyGPiP1Q0w13opu/KHujUn8vZ3GkBZsfa2Af1G3V4kg0cClp/LBmHkBvsqYbIyGq+jHwmMzqo2U97mA2LWOA5tWBq5iRgCk3JCeyIwuds3PkJ/qdLZA2xZNj6DIYSWTwSc+PSguEpAiAXnHpKNPO5mdgYmsHCbOxwtRDA5aEKHC/0Lmiwb4uqlnfhg== 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=vTkLRZV9sD6K+270TKH+xpnYAi6cmrgED7lowvnLyAM=; b=Ez0keSAUyscVRbvqa40Djl/rjlRnpLEMDnAESDb6IgwrJG36NK+3EsuXgBNOghUlwPPdVo9Vtlys26z5q5wU/GWJBoFOkJajij8pMJ3oDjVuE+V1kFkiUSLBbKfrwNTvznJk/6aor56svqHvKdoFf+K7Cc/z/1UDYF4Bo5dllHY= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Thu, 18 May 2023 14:55:56 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:55: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" , Peng Zhang Subject: [PATCH v4 03/35] maple_tree: Avoid unnecessary ascending Date: Thu, 18 May 2023 10:55:12 -0400 Message-Id: <20230518145544.1722059-4-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0251.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10f::19) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM6PR10MB4347:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d85856c-561c-4165-7c6c-08db57affc09 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t3oPviggk0gJFgeNfgurLBDmqk0p89jWTxc2ITUD3B07ftD4ZgeQaMUZEtpEa/A9wYEJmDjP2jjJAlk0s8c4HdU0d4hJ+Ne9auDgOmXt04Hitn+SuVDCc4g+j/IM5kIJFANrb3R14nJpn1qIn2J++x30/hb6FXfTrtd+25d+glnfFPbCed3v/d8Pz0YpvJB3HNmX301Q4STXLQqgkT34o/ihIWaoJ9MnpyU5JTpM2kCvf653dhYBpJywTd1IT3OQu6aHKngsa0lYXIColWEknaelXic47ghWrjKr1AxpEn3pdjaCrNe8VTGrk/8l24mziHF+2BI5qzj3p/p5prBLTP56PI0Eu6bTOSd7yQ/WH1hvZEay87TKg6Otc1KJ16QkQgTpKIlxJX/pHVOohv2N8IjyWCFkRno7ftrBniLSyzbeywVQo+G41lCKzQaA5JbVG/UG9GJM990vlBNmYmVs3A6bWxG7JtwOb9oqMzoT6RiHrSdib5cNxgqQ6RlxSH1K7zYZd31AlKr9UkaBlwCuFH24CKQHLIqM5D45TDV4QUZwkvooPJXOuJscdahAAecN X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(366004)(136003)(346002)(396003)(451199021)(86362001)(2616005)(4326008)(6666004)(26005)(6506007)(6512007)(1076003)(6486002)(6916009)(66556008)(66476007)(66946007)(316002)(38100700002)(36756003)(186003)(478600001)(8936002)(8676002)(54906003)(2906002)(41300700001)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /xsxNDx21mQChfAh0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FEiC5Wl0URM+TzHg28fLCijlmic+JuX5cR4xMvVcKp430Z1+eeM4QMzYa+2N5QqHQnMBjapivJG/9m6zXaLZPlOQC7W92vmQCv/zAbLkTSJVuopVGAu+h1Ml24EPeVjETD19EXjOLOET6xR9bCfWFGAb3P6yoQSDUAiZNmVf49Ic0wtsK732sj0Caf8wPF+u/J8aWT1CZxnujWuVQkaDfg98E3cqZfhAM5BKNxQ3BTYM1IH2Pr8l1F7Riln6tFf9VbtKEnPtcF9y1rafTNsrfHNP6St3GQbJ0WDiYmdy1fWntbN0j/amg9dwY4stWLS8BOgBVmm5hIbuxa4nVDH964qfHhvqE+Eysw4ZGQLgccPRPxtjQoUsKEnPJg6AfPXeMy6nfCIYQrjpOy933B4xmk5rYMfm+2+kzQyGCOfQrqs+zQIKzkk9EfLb8DV2J3CKmtEeHB4roHxxQwRVNeie X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d85856c-561c-4165-7c6c-08db57affc09 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:55:56.4004 (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: tsE602Tujvc6t/7rMxx0e+yKe8m8P0D3ys/uwcWnvxoQhQ91xLgQeN+CNnukBDBBEtEZOHLlvxRfoV7kYDV5iQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 malwarescore=0 bulkscore=0 spamscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: 6tVROkeCYLwVLJeX6Y0Nc5EfrzMLcO_E X-Proofpoint-ORIG-GUID: 6tVROkeCYLwVLJeX6Y0Nc5EfrzMLcO_E X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 3636D16001D X-Stat-Signature: wcpkknwknhuiy3r66yx33yn4c7mgk1hd X-HE-Tag: 1684421796-85404 X-HE-Meta: U2FsdGVkX1+O5Cq+SuaGKTrmMIzlZJ4eMSXRF1yZd5tLmzyrpqegcqrzC9Ttkj/PxlkU6XAAD3kQGjnwJVsV7hfIGUmMjZ5ACVbJrAeU/J1GLZ6romjF1AkssXH2iT/6urfMNRO3ZIYm6HlWwE9/ghEGhL2Z6r4GcNLrM7PiRqrGDPFZHQFtWRG7lLIG/Hs9Pi9m+0fepvtANmMXSMS9qjTL3uzFgyLHkkpoIQl4x0oKuIzGvXrWKnHY8ILr1IFOrlKtDk8Ax7UKwJ9mrGiNPdmTEQFOvD/akaPNg27BudxCZLCQgVV+SSeLY8q+zYQrncHkfHsnn0An4f0KE/NZ5HMm1FAAi6uMO8P/rq6ELyid5w4po0JuKQLC6cBQh1Q2MCKzPOGQBmZtKOMHQl4CAOilPbbSbcWjXRjWQeJDKDHakHoTVtwniW3BswWA1V8PqkWZXI9v55e/Q1X/hBaNbRgA4HoxPmQvYkFmDxaCoCMnyk1PZEGCyiKAMxNo4qzQH3sSR3D7VCoWoSgc8P0j67nc4rcQU6UMs6NUfiN4KvE9lskuEw24O5F1qq8IeCSOC7/HUleakW4GB+TaR12f7QegtNncDgmBIhNrhHfVLNptiOV2kf1TE64xP12NzJPBoPlmRAH5/HYhWnNYbstaFugWzlmLDCRjHwmy8/nptHM1urahjuhPC7HId961k9JSfIlsQsHzFhdCc1jRWs9GJ32hAbMcngD1Zk2wyLc8sEUskUI6X2TR5k5Mc0kxiOncUhXL6SDfG+ADs+ySJhdNU8SDht7UIw+jx6nFD3CDZ+6BFXo7VJPb03QHleRtTCQp5ut+FeQnIZl6y1hbimvroAB3CzK4gziululPblOze23XH/Idg2C8NQB/sexszbRLoIJwG/UuXJZAN2dw/QjuOPCk8rT9bakQ1pa3PDmHJh9jSNvmN0CwVA3gySVmWsRQRdhnRh6XKJe75TrVSYi ngOO+xZz kJ8VFSHPrsvA342Jqj2vnucF5qV5oG5jShSv1LdzEsQ3swy2GpZ1Nu/NYTLu1JkbL0sc5yT3RA74aWrIXENHr5KWVKb1c586e+nsLXqDHWRZuTvFJMd81nyj1/kfOv2M6EmCJdzQnN/xkeEd76EZgQnBGGZ43gx0iyQVMG2wcZr9RHK7FznigjBASlcKHsi3Jd5+PgEstvMAgD044CXERgYWVMv4vvGn8nRECD5meAlaj10VI8uj+xYITl9I8S56Xs1S5QR8oavnU9v84H/H5hIWBVdMAUCSlqMgFzq678vDhhv4lHL20C6Q/TC0McBn9XMJWfwVB53JTv+lwDoiPprIoEVLkdmDLkSafepGMT/HowmdO0jcjaBux+QJpHw8VsES5gHbItVvoJAmeVK/uas/8dR7CklZRlV061XTB19SNWm7juIs+6uVEUAEsOvVvWU+6aZEiYMF90ckkmuC7uSOsAZR8fC/McBkWOJBLmOcd5Ng= 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: The maple tree node limits are implied by the parent. When walking up the tree, the limit may not be known until a slot that does not have implied limits are encountered. However, if the node is the left-most or right-most node, the walking up to find that limit can be skipped. This commit also fixes the debug/testing code that was not setting the limit on walking down the tree as that optimization is not compatible with this change. Signed-off-by: Liam R. Howlett Reviewed-by: Peng Zhang --- lib/maple_tree.c | 11 ++++++++--- tools/testing/radix-tree/maple.c | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 555de3a8343e..5b29d5a916f2 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1103,7 +1103,6 @@ static int mas_ascend(struct ma_state *mas) enum maple_type a_type; unsigned long min, max; unsigned long *pivots; - unsigned char offset; bool set_max = false, set_min = false; a_node = mas_mn(mas); @@ -1115,8 +1114,9 @@ static int mas_ascend(struct ma_state *mas) p_node = mte_parent(mas->node); if (unlikely(a_node == p_node)) return 1; + a_type = mas_parent_type(mas, mas->node); - offset = mte_parent_slot(mas->node); + mas->offset = mte_parent_slot(mas->node); a_enode = mt_mk_node(p_node, a_type); /* Check to make sure all parent information is still accurate */ @@ -1124,7 +1124,6 @@ static int mas_ascend(struct ma_state *mas) return 1; mas->node = a_enode; - mas->offset = offset; if (mte_is_root(a_enode)) { mas->max = ULONG_MAX; @@ -1132,6 +1131,12 @@ static int mas_ascend(struct ma_state *mas) return 0; } + if (!mas->min) + set_min = true; + + if (mas->max == ULONG_MAX) + set_max = true; + min = 0; max = ULONG_MAX; do { diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index 9286d3baa12d..75df543e019c 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -35259,6 +35259,7 @@ static void mas_dfs_preorder(struct ma_state *mas) struct maple_enode *prev; unsigned char end, slot = 0; + unsigned long *pivots; if (mas->node == MAS_START) { mas_start(mas); @@ -35291,6 +35292,9 @@ static void mas_dfs_preorder(struct ma_state *mas) mas_ascend(mas); goto walk_up; } + pivots = ma_pivots(mte_to_node(prev), mte_node_type(prev)); + mas->max = mas_safe_pivot(mas, pivots, slot, mte_node_type(prev)); + mas->min = mas_safe_min(mas, pivots, slot); return; done: From patchwork Thu May 18 14:55:13 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: 13246931 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 D6A76C7EE25 for ; Thu, 18 May 2023 14:56:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7568F900007; Thu, 18 May 2023 10:56:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 706F0900003; Thu, 18 May 2023 10:56:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 55974900007; Thu, 18 May 2023 10:56:07 -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 47F19900003 for ; Thu, 18 May 2023 10:56:07 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id ED285C04C7 for ; Thu, 18 May 2023 14:56:06 +0000 (UTC) X-FDA: 80803675932.24.7AAFFB9 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf13.hostedemail.com (Postfix) with ESMTP id 69D0B20005 for ; Thu, 18 May 2023 14:56:03 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="HkR0/295"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=hd+SNp2T; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf13.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=1684421763; 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=D8uB8KFOovk6IU0Nv+WqVCZaBG68SuibvA7m5a5k7xs=; b=Xo4+v/iogUj4UQOM/BTk2PCSQgShCpH/mnlu+kN1tNEeHYx9aXLitXWDI7Id7czO9TMCzp FmitV3rWLocSN4ka74CA3AkKeH79Iait9RgbNJQgDSE7ImsyH3riez0a5P44bnnxbnKS16 VBE7uAXi9KcLaR6cXZi8k7zFpKueaBM= ARC-Authentication-Results: i=2; imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="HkR0/295"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=hd+SNp2T; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf13.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=1684421763; a=rsa-sha256; cv=pass; b=j193V3sDzINI1fIQo5TOhsA0y2dGDu3z8XHNvX6fn3yXN8Z6PGNMiAkOCW3B5+SBTxSgkC v18NHTIu1Gge2SlgLfv8MBqHKQIhSKVvI2NNIFkDaIwsbg8I6ZExDEaWpNe/SlDHrBKxB2 EPTRP6d/DKOp56j2walrq7ldS5Uhu7I= 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 34I6JDRa018326; Thu, 18 May 2023 14:56: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=D8uB8KFOovk6IU0Nv+WqVCZaBG68SuibvA7m5a5k7xs=; b=HkR0/2957VGlci50qaSVyHn+h+eQ1rdxvh7aAvEmJ72jN+PvU2bGrE0NQL48wD+DZdt8 SEjdyX7mT6HAce5FkW0tQUhoEB3C9OzPrC88bZKkZplKAb1UDBMdJDG74luSFYXyM3Ev CxKQ2H3X9XXfjV1Mt6QjcxPU45jjhWDdw3JzCmvp6ATlJcZvQpdDL0/xre/Ffpq6AiYF F21UsZ+JSV5OT9yQnC2fd+LTSrKuPsKR4dhBqJKlH4aH1CUWQhXGcopzY57hJA3h81tC +XWMCAIUqD1YfzCqJ38tEwV/3IMXtqXspin3/LIbsWtOpUfcBgfYSF1PwQXh5lHPKyar Ug== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qmx8j2vn6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:01 +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 34IDjxeX032141; Thu, 18 May 2023 14:56:00 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2100.outbound.protection.outlook.com [104.47.70.100]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qj10cwr04-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LzhdmZJ3LAc9RQYBSxi1SfVPEpJ7jGb+AIaeBC1QLbgE7FYMgq4PPFcgiGRkoZqVw5XlAwbAhjZvI4lue4DHaw9oB+5f2ZvVbeYB49/4cB09JzdPJznrBAlTIfw7vQh7ewd2RJie5+XsrbldqdXUsWd/uwXC6mYPa9w1I/rutPFAiCyAGQKJkShvSNRLiPbSQluew5jR6NdfuKhJAjeRz73NNM8ZejDqQFDyufiBxubWUrgpRVs0X33jOp1EAz+57dxr7Hx14JVUaF9cdo7+9ABOzwBQaLb45jAyX3hK+d252JlQFXgeNL0RYaBdpNqUdI2aD19Upcbu2hZ9z0uXyA== 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=D8uB8KFOovk6IU0Nv+WqVCZaBG68SuibvA7m5a5k7xs=; b=YaEl8Ca4Kf11o1pmj47ylnHPL4hQB8I+i+N8OvrOd7ky9MeWi+mLxnKf1d3qlu0XT/8WaInED8dNL3A8Y1CPyaUr1x/BbPqRCAzJAYH/oykIqLqOcft4/QRoXlr5AzIOt9xFD1Y7TILiu9VGxjtgEzrGuWWf4CjRaH/9wR+SlYd7GJqFIlD0GPJmZrBmyfgHrDuU/Pdmykl0BxxvH9BLpe/1nw5XwlZ8IVotGuCx29zvNjVnNbK2zUeP1FeliAEy73vas+ao+rELFQeBsvLgMYCQz9I3h96wCmC3EK9RCbApE5bL0oqi0U5JGDDnQr5czeotgFxwrQali0Dxn2GiHg== 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=D8uB8KFOovk6IU0Nv+WqVCZaBG68SuibvA7m5a5k7xs=; b=hd+SNp2TgHsjArBrs6dkY/89yYYzO8FSf1W8s/VjTD7lF1iObqzcVVwVGclCQwg6PYEaUAQZHCmJK6VKDCn1NRv2VaSOw6NU3gD2Y+dDaHVsHZmZrk+AACONmsWvZ38ZXFtoYClxMJm/MC4oYcJDnSor1QMJanSomJXthZbhwjM= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Thu, 18 May 2023 14:55:58 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:55: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 v4 04/35] maple_tree: Clean up mas_dfs_postorder() Date: Thu, 18 May 2023 10:55:13 -0400 Message-Id: <20230518145544.1722059-5-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0232.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:eb::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_|DM6PR10MB4347:EE_ X-MS-Office365-Filtering-Correlation-Id: 1184db34-e5e6-4bd5-db9d-08db57affd73 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FvteokC2pLglrru80UJ+KbMAcj7Z0p3STLAaIQ+Mw5xWimA81uHcdPZ8zqzaJ/DktMINJafJb/GBk4EH7+o0bmI2uglfq8JO5umHUPZhyB5m/+fqqXIjQQDGxfNRq44IVCvaDFlYGMcFQry9V8221RNPJ+gBydJsLO2U15VP/q36rpxfSwp0fVUKNOKEgs2wDXRKNaCblKRG17xabW6u8D8qTZKU8lzmj6/aSNDhLVE/bp8euVbwQrLPB4JaA8xZjK298923fe8RqufO2TKXPMQGDwLQ25IITvIYpNZRscp/ty81ab+6X8MNNn0wa060MyMnfdn2i5FQfnTlcut5RhjexJiUie7meeoksvF6vUHGwRySh5FFfY51AypMUPWXa46hsOWF4L7TvDjnH09Dtmk59/kTtHCylyAM5SsCXFGXztMc2gwnghbkOJ0dht8YPoCQefCobNJxGsGlENXFmx7sf9H09sHZ4InxEC5zWpKjClEU9jIZWetygZhTN/S/gmiSYBmcS8uJGFDg2hNKvUQJVu4fK3V52LGwUG8YJ6omk9ls+6G+R0CT0HCP7wN/ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(366004)(136003)(346002)(396003)(451199021)(86362001)(2616005)(4326008)(6666004)(26005)(6506007)(6512007)(1076003)(6486002)(6916009)(66556008)(66476007)(66946007)(316002)(38100700002)(36756003)(186003)(478600001)(8936002)(8676002)(2906002)(4744005)(41300700001)(107886003)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: e1weNKLKgppj7lJsrn7QK0hq13L+8ZRy8VgCwhyS5duG/B5I7eiTRy+exgb0JVoVK6dL2qbBiDiC2kum+aqwRJHaS5o6QLvpaWuhbdEhh3sANNYGsv3Tl+rHNfaY3MZjksDBbw+uGAde+dBwx0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givuAcC1JIx1uT2Gqt9ThNWC3+2cf+p2NzeNL3HYDrY9lm0Xqo3lLzX8WM3eqZQQufMNQzF3SP3MSqPW7IBen/E3bft1bxFUJiDWlBdhN5ZdwXoEdOvmSPDQbfBWvMhs8dZfVC6M2LGPXUkUtnlIgG0/jRVwzTzD2TWe4nxDL05tu11U8LQnxsXxHPTatVbPAmXPOULmnKhhyLH9XH3aFFh3fKIlJ4CT8hK3l07IkAYzndKadyTizHdw/J18mdTN3qSzWZGJunK74jmbNt3CUFJtXnv03v4ImysTxJHlwKuVknN/zhhmAEw0BF2X5Qf0P4C4aiGCX+SlasOs9rK9xD9pyTPAHSAhlmKihmYgGhRy5pvHJdBuxibq1daaD348SbYEWLdy8bdt6Peg84/Dgw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: JGC5dcW9CzcHNXIgSx1/setwd7iHYuSr9Jny1rZh2UkEXLLnHV2okAGLrC8mOeRPS1tmt8b1es/A/u7m72j3WG4TcLdHtBpOBC6IZsQvJ6nldG2Hk4zmEh0PrBYD1mqetb/ZpM/VQMrdnJM5q0OVSdaRSqUIOs7lfi4tK2YuoNghhGQPC6Hz4mrdHfYPUWBRMSN1Df9tbmNHUwfhxc29SPb4l81uBSIt8wI9C+wdSVkCM5IglCcPv5ybX0VTo58FmpoONgPWQFZUdCBsBX6656aAS5iyj9xVueyXCIPfS++/T3ADvhJ2u1mGIureX2KaQUggsWBbJMa8MbGQay656EKxkneZ94Ajh9PhFH56PQYSE3pqh4I9GBVsJAqdgqy+9x07ueOxCUKI5C4XkTGwUKCp+XC8ZDZFifnn0vQmNGJa29W135chbH0GNUcIDAF+vPj7p9n7s6LxxTCCE+S08yqKApbN4U153MFvckgIDUE+Hys8jUlBhemyByEugwRsPyw64UHm9dN588VQV3W6G7ztM55bKSQX00+h0jz/owqYY+zHeEDEPz7SehXa/wjH9F8v+LboomE9ParlgqWn/oiuR4EOXhQQ6U1Dn5Y4gsqsFB8LeK30iWsIyIR4hE1/whnz0OF3iWARj2Vq/kLEOYA/i/7zJZ1s9GtoT+c2uRzA1naFT/ftUFbpfuQH0uXOgKj/yu2khtBI9Ndr3I4uXgHTvVqhqN2naZlxWSN4xhJJd0HkebUZpWnfGIscIGbV8joAEPxtmdQLdzoUAo40I935vu00RwRmacw2/0BCZ7SsmzMpw3ID+U0Cnk2AqSevQBanfLl1/9+9D7ReiR5DXlX19Rh2tTWPpwrxx9EAc86Oe9L0GDBxuu6Sl5S5Vwr63WWYs+GgOP25ENvFM/PBPQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1184db34-e5e6-4bd5-db9d-08db57affd73 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:55:58.7302 (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: 9/BdJU6pbhVPTwS3P+yUwUxcCs/I+fYrpO72xrYC0QXJMsKUYGPTt3VsD0OIz/VKIdjk+tTXb/buNB4yaKU5ZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: SVv2g6y-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XoF18ohWINTR6IhiTsuD28R+rMPeI5XBjxpoPZIeflDVP7PPDz+D8dkAW4jiNISzYDYlfATaXsbbVmc3gI0HI7u3sCqYM4+7Ysy+Xg9A6SzSd xTLtSAQC mBdwZusEv7zmcPht/DNWA9hDviC9bqFSYl7p26PsvfgySJTaePEyZR0VB2vkVsj+DralbuQg2N2dwShbXcJU63fdvKfiXwIVRciHxc8SAktI5Oq6sFsS1JYffwWCKPQEQkYE4WMyX0xnEh/GjXvjRfXwjkK/apJNqu85XRYvVZ4WYSvhF/cRgV8HZETKph1TPQpPxwZ0mD/Vlwcx8ESVoA+aGLaZfcmo5kI4ZyAjHvHfFob//2d7ijdUmhswTpRSqNx58oL4oNq4/97z48yLXTAG+PTsUIaDv1RGOWdrF5Yc9URGnkolqidW+eEgDtplG/4LaTrpNABIRYSeys5L8iMXT/TC8fS2GLd1h6UGazdzxGtFkIm3lCsOrgGOOdaG42Lr0JCKP/JX6TsuOmtOoQm2o8C1QZOoN/NZVsfy8tjeCfEaZBC3M22oAZcvMIiBV7AVV 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: Convert loop type to ensure all variables are set to make the compiler happy, and use the mas_is_none() function instead of explicitly checking the node in the maple state. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 5b29d5a916f2..1e7e7249a0cf 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -6739,15 +6739,12 @@ static void mas_dfs_postorder(struct ma_state *mas, unsigned long max) mas->node = mn; mas_ascend(mas); - while (mas->node != MAS_NONE) { + do { p = mas->node; p_min = mas->min; p_max = mas->max; mas_prev_node(mas, 0); - } - - if (p == MAS_NONE) - return; + } while (!mas_is_none(mas)); mas->node = p; mas->max = p_max; From patchwork Thu May 18 14:55:14 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: 13246932 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 7FA55C7EE23 for ; Thu, 18 May 2023 14:56:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 20214900008; Thu, 18 May 2023 10:56:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1B1A0900003; Thu, 18 May 2023 10:56:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F1E1B900008; Thu, 18 May 2023 10:56:09 -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 DECB1900003 for ; Thu, 18 May 2023 10:56:09 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id A1E2C1A0871 for ; Thu, 18 May 2023 14:56:09 +0000 (UTC) X-FDA: 80803676058.24.752CCB3 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf29.hostedemail.com (Postfix) with ESMTP id 116E4120013 for ; Thu, 18 May 2023 14:56:05 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=QGadCQ05; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=lXyULhhC; 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; 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=1684421766; 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=da6ehd7axUic7ozbVPDbIbv6pwVFIrZh9LGE/avpY3w=; b=VwB2V1q875+uThjKpl9Ixr0T7S2NNP0ccBhfaU7c+sWUrTG0WUv8QFmA+mOpf05nih9yxO EyHpQLPOV8gEShyYcL3hl6ZuPIdMlvFwnfon3LNiKlXe+1l/1Qv4vakounljgIbZO5yXze byDJICo+FVm6q0ytsORLuAevjOv77rg= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421766; a=rsa-sha256; cv=pass; b=IC1HhBut2XjzPr5lYnq+1tKlqszmW1M9Qbs4lX0aveCsA13mRlOHcvuGjOewXhZoEnH9sp qnPcRCH3Aiv0FmfAH24yN1IIFMEPJtLh1bMDPoyOiddOZ2i2EQV2/61WPjyIqEfy5zVF+N Jauf3leTZUe1NE+3JYfLLH8DQV5VtGk= ARC-Authentication-Results: i=2; imf29.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=QGadCQ05; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=lXyULhhC; 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; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com 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 34I6IrcP012408; Thu, 18 May 2023 14:56:05 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=da6ehd7axUic7ozbVPDbIbv6pwVFIrZh9LGE/avpY3w=; b=QGadCQ05E3W4uCHPNA4ZIhhro6RyoDzH8GZLM2EHTeeMmGSRseOYer7lJYcLTsA90au9 igVZ0udCnRLPtFsP7Oj6+36WI9r4NuKNFDolarPpZt243sYAwtA95hTVaBG9X0NvswrE a9uGWceX8sTADFEjcdBibuTL8AlWFjpqxpk0LRadJ/No7KR4A/k084UiQQ3Bqd+UoZ7n OFiZO+ebtUCwkB9dXqB2x3066GFWwzeWr8n1U0XN1o9/y1CZm7ey7qtIDnASukW7axDY bKB361exWI7B16N0kQiQeaAvq3b+m+xWgUX9/tUz8F2ZYEPbxkfFLyxGmnN+6vz3wVZu Ew== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qmxwpjr8q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:04 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34IE6YTd033869; Thu, 18 May 2023 14:56:03 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2103.outbound.protection.outlook.com [104.47.70.103]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qj107c7rg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GQQn7MC5Zgoo5bCdgl/SiynRzo4tA4njw6oPha3MxD7ZjKJsjeiojWPg0Y3yxcLHz2pon+1MCBtelIprpAU5SnDUR2VWB3Q37h8s8fs03EJlXc20ESTIRRcN3hmXcwcEA7uuAyQEAFH/IhqafhRmlOa0nIngj9i7wZbR/mED1Jw9lmJDENd5Y6/L691GT+7YgXqdoKU8Tt4RdnFt9F597oEpSYlk8msj93ieuXhgIIq3BmpddiSzlZoln0SXQJzTsat3gGT8bmTb2hCWNJtqeURQbDus/PLMS+bV+JKIJXBNAP8lLsWYRqfdXmV+zGLV1DIyGJ5Lmyi13O5t+Xgntw== 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=da6ehd7axUic7ozbVPDbIbv6pwVFIrZh9LGE/avpY3w=; b=j7ThFABXUhHG94e2HEIdv5OlzKmt1K62k4hLsSgTBV9+WPNzwRrDUCZr6GXqfMFqnAyqeFEfAxQF3RIqJ3sOANnCkmWtbKzr+TqfksBEiVYGdUd9+6XIaSkU8LMd8iKkeVhqHuqjaEqKGP+lWhs9560moytxNx0w51/tFalN43KhD6PkdL87BNn9lqIuFFl/H1+aG9YD1gsOHA7EvL9MX0R8KCTAsm7DgNILQ4lbPKI79iyjqoSZMsUtG7V7wT7Ngjhc/7tOcEeKFv8ry+PaILMzTBMTz4CWWGTGVDzyZNKx2vkmnweDpZCQqb34/PmaOLmjWJv1VYPLHaeqKxXxSQ== 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=da6ehd7axUic7ozbVPDbIbv6pwVFIrZh9LGE/avpY3w=; b=lXyULhhCNdq9dohecBHtPudL31A5N91WXBXmPIW9pNRJ9PYm0fUTHmo4d+UjAVamo/K7Cnghn7XUVCZYKfXRxqa8MKFFX41qjdZQGc4Ak2AiVz87EM6xree6t1XsC8nqCEEKOGjWSY95G+uqXnuxlEEJJNQzRYGAcm6nHhky200= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Thu, 18 May 2023 14:56:00 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56:00 +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" , "Liam R . Howlett" Subject: [PATCH v4 05/35] maple_tree: Add format option to mt_dump() Date: Thu, 18 May 2023 10:55:14 -0400 Message-Id: <20230518145544.1722059-6-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0112.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:85::30) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM6PR10MB4347:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d9d5a01-e651-441c-dc57-08db57affe9d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gyhsSvnznNAaIQlo0UZs3+p1I65YiEqIqlYmGohIqlbeiv1VSGvDAMY2VixgwSwiw3j9u4f6rgXdfoQDbNz+m3DEDpqHIC4PmriJPaJ5YP8NnwHsGnXfPUTzD4Hl4Ugpvxp9c1gtctrHTVW/8Xg1w9Zj3PAyMbEWf/0k/b4nv0LDuHEI9iIBAQBeEJUkcung8K/iHh791FqaQhuZtY9tUUHa8g3Lkog0piM0YPRRiv7VqkrZYCkZYtLHUTz/YQAbVgz2THCoBF9Ge9mSDgCisVgfEr748oogBNwR7M6nq9337ob8M9nrNSbLRiK4sjVh1SlY5LIv8ab2fcvMdSVjgiRqHphHjtI8V3ZsBh4BASgYi4wt3/P/sI+gpCMby8C/Oa1W8d+GdemMBQJKhRVGW/OQkizE9xmYij2yejwpUKCxKKRrzJ4gFf2P4Gy2C9oKizBd3QUALJF0mAURdOSR8Jwuc14R1OCocQiY1+YRCHb7GReIQQOI+qqZta7NJ+fDKsJZJlY7q0RyP3xShpf2RdsKLdcCSiiRQaotwY/lmKIyL7JtGUDkFX8RjXuKETK+ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(366004)(136003)(346002)(396003)(451199021)(86362001)(2616005)(4326008)(6666004)(26005)(6506007)(6512007)(1076003)(6486002)(6916009)(66556008)(66476007)(66946007)(316002)(38100700002)(36756003)(186003)(478600001)(8936002)(8676002)(54906003)(2906002)(30864003)(41300700001)(107886003)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uWMiATzmfxKtqxhYyZ3/PzZ4wWMFpPT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rNpj6pZyEk4IAUbXb+ggAn/5ryTqhwqwpiSCZUat759HNN250dfAo6KWjHkuvn0UfXpU/dybfaFEVXU1r8zRYtrBLSMKm8Gwcvm86jHVzBHiFWyB+WvgtqfkumtV8R4SokMHOQtD4vTXYlkOWvOGxphc5KjgHvWMRYyP7Bt5Hk6JvDH271i/AmhYCcamaTr6q/71Q64xxBsv+bV4e+q9fUINqiwxi9w+FAbg2AQ/xFC30ThqhOOBMICCw8p8Uy4JeKR4kGr/ogE3MJ+p48AGnAIElhWQ9c9OZRY5tqrQd4ggxqxRScK2QVJhulqycAL03e5MqN/ZD3HU+28BwNpWP3uUa3UmALU6RRnNnN2nVR+YoJPhVQBEgjJVnRRgURWVSXCgmZ6RVJJOdA4GXE0vqBj5JZnrHT9QcI4cBL+Lg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d9d5a01-e651-441c-dc57-08db57affe9d X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:00.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: SBG9APpBe4sb65LMmXx2iF/0SrVIssFxchEEGMeTt2sauxlu+GX7qKLMB+uytKXXSZZarpKVdrPCdhC+w7ljdQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 spamscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: c7Ia-eVElTnO90cOCSIY9-NYyRUxkCnZ X-Proofpoint-ORIG-GUID: c7Ia-eVElTnO90cOCSIY9-NYyRUxkCnZ X-Stat-Signature: x3a1buq7116cbk1gjsz6yxmqsod7fpkw X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 116E4120013 X-Rspam-User: X-HE-Tag: 1684421765-484281 X-HE-Meta: U2FsdGVkX18pw18lPSh7fg/64esnI4p86H4EJSe7ZUH3VuVpDHmS3kGaNpPF3JvLFnBS7CoF6OdSGjZlHe+d1Ljg8OvEy+oA7rijbWbvSthoolV1zEQPfvg0kIyANEhSAU0i5h7RKYPP6ND8mniCFCwIF1TxvlrB8/M6CksOH2omhFe/eZwIrQIVczwNb7XDmRHQ4OrhvsXgQ1FfklsvvI1/2xVVY2CMXRInH1kSNqqOoDM5ys5FjdbRc53odHc16nM2dytZCD2nxxsUgJ4Myg0lfeytsVkTixD6Z3/VzGivpR+CEZgO304HF5z3FDYjh5Eis9iRlgACtnmAT9v5r0BbOQHcIuFF15v7CHnYq4OErXPzUds3grsqxVpBCAgM3i6CLl0jjFx//CUNOkez4wfTNc1w2gVi6U7xjrBR0MjWaFMKviF38aS7Mhxx6KhscJnxYOZikCSrG5bLSt0UVT8vCcA/9R1IOPS4O0AKB2UblGpvH1+RTwQVf47RTfnISk67CVNcU1ZGW4nMLs9uUsEJyWiXViqIlFP9HypJ1PNBWkwzG4Sjgnt5saBdsp3SfBJU45v6ofOeIPVjN341uYsAEaqgjKWagLCuoY8uGYFnM4/zDrYhC3E5ixsI7LT0vXBu6nSb3L0Ug569HSLVojxEYIlBxR23xAJm19cnD6tWNpPvr2LWQc9J35j/4pyxacbgWg00S9klv8TTIuUBN0NvV0lvF+59TJu1KhXq4sUd1nYkURf8B2VO3lGVqya2giXE5ZBgBsdBSpxRV9YhibdY6DFDglXjE8KpQysjKKu9CYv9eiTmGEJh2NVzdfBHJ6lQCwOqCndw6IoS4P9nB2sz/Y3WAZGT+ei1R2skIyn8D8XfTkP1fFrvoeCVcs6C6Ypuw869J7VcqYQvRFd6DTnmxE/ykAWNAIexmYtaoB6CC5mdrqtGK4uHb+faNwp29L37ozbo3q+xADcq7dh rDZGoCM9 iMkN4dqP8MziwD7gF6CyJpksnYaA7B3wZSDDLTMqLI4ckhldODJ1mtgl6cKRtRivgRRofADy1T7WArThpYBlboscNLc9xmVkGIeRW2SSsWazt7pAZwsTEk4GZv1qErm1ZmSm/aFm+2ovoH20aj/93bxgIviUkBGuJ81B/qsJnEn+Bd8KZOOMcHHabFbmD8tzrl4Wi0nRyNh+kslwUbbhz4uxtjvBc+P3s9FgISNW71m/eB7Sau5m1d6ZpsDAWHGdMf5AjbNHq0fppHJEmkM70ZEMLGWcU+RuzW2T3o9DvLR4sGNYNb9LluisEQV8eFft9RHKH863BhAn2mFtIw1My7ejT9lMPIPtaMjJe4GZv3jfvM96dWODeT8OvaTNxgYmcfl6z7HRVNITrD+uS1ZO1lY62vNDyQH1Q7rFedNg6Ik+fX+c= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: "Liam R. Howlett" Allow different formatting strings to be used when dumping the tree. Currently supports hex and decimal. Signed-off-by: Liam R. Howlett --- include/linux/maple_tree.h | 9 +++- lib/maple_tree.c | 87 +++++++++++++++++++++----------- lib/test_maple_tree.c | 10 ++-- mm/internal.h | 4 +- mm/mmap.c | 8 +-- tools/testing/radix-tree/maple.c | 12 ++--- 6 files changed, 82 insertions(+), 48 deletions(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index 1fadb5f5978b..140fb271be4a 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -670,10 +670,15 @@ void *mt_next(struct maple_tree *mt, unsigned long index, unsigned long 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); +void mt_dump(const struct maple_tree *mt, enum mt_dump_format format); void mt_validate(struct maple_tree *mt); void mt_cache_shrink(void); #define MT_BUG_ON(__tree, __x) do { \ @@ -681,7 +686,7 @@ void mt_cache_shrink(void); if (__x) { \ pr_info("BUG at %s:%d (%u)\n", \ __func__, __LINE__, __x); \ - mt_dump(__tree); \ + 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)); \ diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 1e7e7249a0cf..084868865849 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5699,7 +5699,7 @@ void *mas_store(struct ma_state *mas, void *entry) trace_ma_write(__func__, mas, 0, entry); #ifdef CONFIG_DEBUG_MAPLE_TREE if (mas->index > mas->last) - pr_err("Error %lu > %lu %p\n", mas->index, mas->last, entry); + pr_err("Error %lX > %lX %p\n", mas->index, mas->last, entry); MT_BUG_ON(mas->tree, mas->index > mas->last); if (mas->index > mas->last) { mas_set_err(mas, -EINVAL); @@ -6753,22 +6753,33 @@ static void mas_dfs_postorder(struct ma_state *mas, unsigned long max) /* Tree validations */ static void mt_dump_node(const struct maple_tree *mt, void *entry, - unsigned long min, unsigned long max, unsigned int depth); + unsigned long min, unsigned long max, unsigned int depth, + enum mt_dump_format format); static void mt_dump_range(unsigned long min, unsigned long max, - unsigned int depth) + unsigned int depth, enum mt_dump_format format) { static const char spaces[] = " "; - if (min == max) - pr_info("%.*s%lu: ", depth * 2, spaces, min); - else - pr_info("%.*s%lu-%lu: ", depth * 2, spaces, min, max); + switch(format) { + case mt_dump_hex: + if (min == max) + pr_info("%.*s%lx: ", depth * 2, spaces, min); + 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); + else + pr_info("%.*s%lu-%lu: ", depth * 2, spaces, min, max); + } } static void mt_dump_entry(void *entry, unsigned long min, unsigned long max, - unsigned int depth) + unsigned int depth, enum mt_dump_format format) { - mt_dump_range(min, max, depth); + mt_dump_range(min, max, depth, format); if (xa_is_value(entry)) pr_cont("value %ld (0x%lx) [%p]\n", xa_to_value(entry), @@ -6782,7 +6793,8 @@ static void mt_dump_entry(void *entry, unsigned long min, unsigned long max, } static void mt_dump_range64(const struct maple_tree *mt, void *entry, - unsigned long min, unsigned long max, unsigned int depth) + unsigned long min, unsigned long max, unsigned int depth, + enum mt_dump_format format) { struct maple_range_64 *node = &mte_to_node(entry)->mr64; bool leaf = mte_is_leaf(entry); @@ -6790,8 +6802,16 @@ static void mt_dump_range64(const struct maple_tree *mt, void *entry, int i; pr_cont(" contents: "); - for (i = 0; i < MAPLE_RANGE64_SLOTS - 1; i++) - pr_cont("%p %lu ", node->slot[i], node->pivot[i]); + for (i = 0; i < MAPLE_RANGE64_SLOTS - 1; i++) { + switch(format) { + case mt_dump_hex: + pr_cont("%p %lX ", node->slot[i], node->pivot[i]); + break; + default: + case mt_dump_dec: + pr_cont("%p %lu ", node->slot[i], node->pivot[i]); + } + } pr_cont("%p\n", node->slot[i]); for (i = 0; i < MAPLE_RANGE64_SLOTS; i++) { unsigned long last = max; @@ -6804,24 +6824,32 @@ static void mt_dump_range64(const struct maple_tree *mt, void *entry, break; if (leaf) mt_dump_entry(mt_slot(mt, node->slot, i), - first, last, depth + 1); + first, last, depth + 1, format); else if (node->slot[i]) mt_dump_node(mt, mt_slot(mt, node->slot, i), - first, last, depth + 1); + first, last, depth + 1, format); if (last == max) break; if (last > max) { - pr_err("node %p last (%lu) > max (%lu) at pivot %d!\n", + switch(format) { + case mt_dump_hex: + pr_err("node %p last (%lx) > max (%lx) at pivot %d!\n", node, last, max, i); - break; + break; + default: + case mt_dump_dec: + pr_err("node %p last (%lu) > max (%lu) at pivot %d!\n", + node, last, max, i); + } } first = last + 1; } } static void mt_dump_arange64(const struct maple_tree *mt, void *entry, - unsigned long min, unsigned long max, unsigned int depth) + unsigned long min, unsigned long max, unsigned int depth, + enum mt_dump_format format) { struct maple_arange_64 *node = &mte_to_node(entry)->ma64; bool leaf = mte_is_leaf(entry); @@ -6846,10 +6874,10 @@ static void mt_dump_arange64(const struct maple_tree *mt, void *entry, break; if (leaf) mt_dump_entry(mt_slot(mt, node->slot, i), - first, last, depth + 1); + first, last, depth + 1, format); else if (node->slot[i]) mt_dump_node(mt, mt_slot(mt, node->slot, i), - first, last, depth + 1); + first, last, depth + 1, format); if (last == max) break; @@ -6863,13 +6891,14 @@ static void mt_dump_arange64(const struct maple_tree *mt, void *entry, } static void mt_dump_node(const struct maple_tree *mt, void *entry, - unsigned long min, unsigned long max, unsigned int depth) + unsigned long min, unsigned long max, unsigned int depth, + enum mt_dump_format format) { struct maple_node *node = mte_to_node(entry); unsigned int type = mte_node_type(entry); unsigned int i; - mt_dump_range(min, max, depth); + mt_dump_range(min, max, depth, format); pr_cont("node %p depth %d type %d parent %p", node, depth, type, node ? node->parent : NULL); @@ -6880,15 +6909,15 @@ static void mt_dump_node(const struct maple_tree *mt, void *entry, if (min + i > max) pr_cont("OUT OF RANGE: "); mt_dump_entry(mt_slot(mt, node->slot, i), - min + i, min + i, depth); + min + i, min + i, depth, format); } break; case maple_leaf_64: case maple_range_64: - mt_dump_range64(mt, entry, min, max, depth); + mt_dump_range64(mt, entry, min, max, depth, format); break; case maple_arange_64: - mt_dump_arange64(mt, entry, min, max, depth); + mt_dump_arange64(mt, entry, min, max, depth, format); break; default: @@ -6896,16 +6925,16 @@ static void mt_dump_node(const struct maple_tree *mt, void *entry, } } -void mt_dump(const struct maple_tree *mt) +void mt_dump(const struct maple_tree *mt, enum mt_dump_format format) { void *entry = rcu_dereference_check(mt->ma_root, mt_locked(mt)); pr_info("maple_tree(%p) flags %X, height %u root %p\n", mt, mt->ma_flags, mt_height(mt), entry); if (!xa_is_node(entry)) - mt_dump_entry(entry, 0, 0, 0); + mt_dump_entry(entry, 0, 0, 0, format); else if (entry) - mt_dump_node(mt, entry, 0, mt_node_max(entry), 0); + mt_dump_node(mt, entry, 0, mt_node_max(entry), 0, format); } EXPORT_SYMBOL_GPL(mt_dump); @@ -6958,7 +6987,7 @@ static void mas_validate_gaps(struct ma_state *mas) mas_mn(mas), i, mas_get_slot(mas, i), gap, p_end, p_start); - mt_dump(mas->tree); + mt_dump(mas->tree, mt_dump_hex); MT_BUG_ON(mas->tree, gap != p_end - p_start + 1); @@ -6991,7 +7020,7 @@ static void mas_validate_gaps(struct ma_state *mas) MT_BUG_ON(mas->tree, max_gap > mas->max); if (ma_gaps(p_mn, mas_parent_type(mas, mte))[p_slot] != max_gap) { pr_err("gap %p[%u] != %lu\n", p_mn, p_slot, max_gap); - mt_dump(mas->tree); + mt_dump(mas->tree, mt_dump_hex); } MT_BUG_ON(mas->tree, diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index f1db333270e9..d6929270dd36 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -219,7 +219,7 @@ static noinline void check_rev_seq(struct maple_tree *mt, unsigned long max, #ifndef __KERNEL__ if (verbose) { rcu_barrier(); - mt_dump(mt); + mt_dump(mt, mt_dump_dec); pr_info(" %s test of 0-%lu %luK in %d active (%d total)\n", __func__, max, mt_get_alloc_size()/1024, mt_nr_allocated(), mt_nr_tallocated()); @@ -248,7 +248,7 @@ static noinline void check_seq(struct maple_tree *mt, unsigned long max, #ifndef __KERNEL__ if (verbose) { rcu_barrier(); - mt_dump(mt); + mt_dump(mt, mt_dump_dec); pr_info(" seq test of 0-%lu %luK in %d active (%d total)\n", max, mt_get_alloc_size()/1024, mt_nr_allocated(), mt_nr_tallocated()); @@ -893,7 +893,7 @@ static noinline void check_alloc_range(struct maple_tree *mt) #if DEBUG_ALLOC_RANGE pr_debug("\tInsert %lu-%lu\n", range[i] >> 12, (range[i + 1] >> 12) - 1); - mt_dump(mt); + mt_dump(mt, mt_dump_hex); #endif check_insert_range(mt, range[i] >> 12, (range[i + 1] >> 12) - 1, xa_mk_value(range[i] >> 12), 0); @@ -934,7 +934,7 @@ static noinline void check_alloc_range(struct maple_tree *mt) xa_mk_value(req_range[i] >> 12)); /* pointer */ mt_validate(mt); #if DEBUG_ALLOC_RANGE - mt_dump(mt); + mt_dump(mt, mt_dump_hex); #endif } @@ -1572,7 +1572,7 @@ static noinline void check_node_overwrite(struct maple_tree *mt) mtree_test_store_range(mt, i*100, i*100 + 50, xa_mk_value(i*100)); mtree_test_store_range(mt, 319951, 367950, NULL); - /*mt_dump(mt); */ + /*mt_dump(mt, mt_dump_dec); */ mt_validate(mt); } diff --git a/mm/internal.h b/mm/internal.h index 68410c6d97ac..4c195920f565 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1051,13 +1051,13 @@ static inline void vma_iter_store(struct vma_iterator *vmi, printk("%lu > %lu\n", vmi->mas.index, vma->vm_start); printk("store of vma %lu-%lu", vma->vm_start, vma->vm_end); printk("into slot %lu-%lu", vmi->mas.index, vmi->mas.last); - mt_dump(vmi->mas.tree); + mt_dump(vmi->mas.tree, mt_dump_hex); } if (WARN_ON(vmi->mas.node != MAS_START && vmi->mas.last < vma->vm_start)) { printk("%lu < %lu\n", vmi->mas.last, vma->vm_start); printk("store of vma %lu-%lu", vma->vm_start, vma->vm_end); printk("into slot %lu-%lu", vmi->mas.index, vmi->mas.last); - mt_dump(vmi->mas.tree); + mt_dump(vmi->mas.tree, mt_dump_hex); } #endif diff --git a/mm/mmap.c b/mm/mmap.c index e96f96c69c34..76eaf12f1390 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -301,7 +301,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) #if defined(CONFIG_DEBUG_VM_MAPLE_TREE) extern void mt_validate(struct maple_tree *mt); -extern void mt_dump(const struct maple_tree *mt); +extern void mt_dump(const struct maple_tree *mt, enum mt_dump_format fmt); /* Validate the maple tree */ static void validate_mm_mt(struct mm_struct *mm) @@ -323,18 +323,18 @@ static void validate_mm_mt(struct mm_struct *mm) pr_emerg("mt vma: %p %lu - %lu\n", vma_mt, vma_mt->vm_start, vma_mt->vm_end); - mt_dump(mas.tree); + mt_dump(mas.tree, mt_dump_hex); if (vma_mt->vm_end != mas.last + 1) { pr_err("vma: %p vma_mt %lu-%lu\tmt %lu-%lu\n", mm, vma_mt->vm_start, vma_mt->vm_end, mas.index, mas.last); - mt_dump(mas.tree); + mt_dump(mas.tree, mt_dump_hex); } VM_BUG_ON_MM(vma_mt->vm_end != mas.last + 1, mm); if (vma_mt->vm_start != mas.index) { pr_err("vma: %p vma_mt %p %lu - %lu doesn't match\n", mm, vma_mt, vma_mt->vm_start, vma_mt->vm_end); - mt_dump(mas.tree); + mt_dump(mas.tree, mt_dump_hex); } VM_BUG_ON_MM(vma_mt->vm_start != mas.index, mm); } diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index 75df543e019c..ebcb3faf85ea 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -1054,7 +1054,7 @@ static noinline void check_erase2_testset(struct maple_tree *mt, if (entry_count) MT_BUG_ON(mt, !mt_height(mt)); #if check_erase2_debug > 1 - mt_dump(mt); + mt_dump(mt, mt_dump_hex); #endif #if check_erase2_debug pr_err("Done\n"); @@ -1085,7 +1085,7 @@ static noinline void check_erase2_testset(struct maple_tree *mt, mas_for_each(&mas, foo, ULONG_MAX) { if (xa_is_zero(foo)) { if (addr == mas.index) { - mt_dump(mas.tree); + mt_dump(mas.tree, mt_dump_hex); pr_err("retry failed %lu - %lu\n", mas.index, mas.last); MT_BUG_ON(mt, 1); @@ -34513,7 +34513,7 @@ static void *rcu_reader_rev(void *ptr) if (mas.index != r_start) { alt = xa_mk_value(index + i * 2 + 1 + RCU_RANGE_COUNT); - mt_dump(test->mt); + mt_dump(test->mt, mt_dump_dec); printk("Error: %lu-%lu %p != %lu-%lu %p %p line %d i %d\n", mas.index, mas.last, entry, r_start, r_end, expected, alt, @@ -35784,10 +35784,10 @@ void farmer_tests(void) struct maple_node *node; DEFINE_MTREE(tree); - mt_dump(&tree); + mt_dump(&tree, mt_dump_dec); tree.ma_root = xa_mk_value(0); - mt_dump(&tree); + mt_dump(&tree, mt_dump_dec); node = mt_alloc_one(GFP_KERNEL); node->parent = (void *)((unsigned long)(&tree) | 1); @@ -35797,7 +35797,7 @@ void farmer_tests(void) node->mr64.pivot[1] = 1; node->mr64.pivot[2] = 0; tree.ma_root = mt_mk_node(node, maple_leaf_64); - mt_dump(&tree); + mt_dump(&tree, mt_dump_dec); node->parent = ma_parent_ptr(node); ma_free_rcu(node); From patchwork Thu May 18 14:55:15 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: 13246933 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 DA52BC7EE25 for ; Thu, 18 May 2023 14:56:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 77F23900009; Thu, 18 May 2023 10:56:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 730FD900003; Thu, 18 May 2023 10:56:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 559E8900009; Thu, 18 May 2023 10:56:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 469B2900003 for ; Thu, 18 May 2023 10:56:12 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id D30F71208B6 for ; Thu, 18 May 2023 14:56:11 +0000 (UTC) X-FDA: 80803676142.28.B6F731F Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf23.hostedemail.com (Postfix) with ESMTP id 5C84D140022 for ; Thu, 18 May 2023 14:56:08 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=yDwp6wmD; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=NC1AfEUW; spf=pass (imf23.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=1684421768; 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=b6NFuY1Cli4ZxcQEF1wHnuQb58sUXliXR5M9M7xX02Y=; b=1Yux7tUVC8K1MkRxe4ZmWdRT9ong+YEpitbACRr4bijPGwqaTJvYURPv7bJXE4LlCGiuy7 oAfteNiZdq6+psR5YXcuCSiDEsZpgGajNfv9O/DoDEIKPeuizBx0A7oOcVfQ+tii5iosyn +2prEOKtvgweGBSdgi7kO81wYpotOVc= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421768; a=rsa-sha256; cv=pass; b=Mt1FxT35qR9gsYPPqxiyp9VcrIlbqyEQIex2IW16xNkVBbvxjBBfvwrfqilg/o0eLu6SXY CU1Kw1hWI8TycfjgxR7Cpm901EsMtoEH9VL3kutaU+B4L/zOmh/iF1pMF46UTiLTHMtvjF RoWjImFtdRD2iMJ9OJn3HUADVsZvzz0= ARC-Authentication-Results: i=2; imf23.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=yDwp6wmD; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=NC1AfEUW; spf=pass (imf23.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 34I6JDwi018330; Thu, 18 May 2023 14:56:07 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=b6NFuY1Cli4ZxcQEF1wHnuQb58sUXliXR5M9M7xX02Y=; b=yDwp6wmDBM9uW6tcSjWCdUd9ZTDYfLmtHlYTXfcglePt4veqm9MsRt9h5gLFNslNerda vZq6ogYU+wbhTXQkGeM0tYCkeQucy5yQB/2E4ylu8IMpH5WgcPGfm+7V/5MAp0EmyO9Y uO4aHyk1i+flPKbB0Ll3Azyv8WjOQq/hkRd5SkARsFOiiO4SWene1qpwavTfYLO277J/ KUdTji62eUb2c3056xCQo6bMMbuRaoY0QpczDQSiD/uQ3jLoeGRMMzsTjR0dAMPZF0DA wIOkRjmcRvYugyZj8EFB0ONQ/pCavLg+LzL7Q9CEXEJkRusTaqO2I+YCvPcRgwA0+nwe qg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qmx8j2vnb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:06 +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 34IE1P74004143; Thu, 18 May 2023 14:56:05 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2109.outbound.protection.outlook.com [104.47.70.109]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qj10d66wn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PBGPGOfrbZ3zfrPoMRq1esGh2bwI6bbJwt0TGYOA4K1IYtRG8bpnSeW4ollXATZ3OdCLQqWmitH24lKsqW7F9tkO5f1Q6IOP3T8nkNIzoMP7sRTqr10ZfGRON8lSOZ3ZmPqN1NiLSM0SP1mCwJ3yTtR2DW+DYjc9ubIG4Z1AVYwzUD085C0+8DWPoA6FLzKS1hG20Ht5p7qf5w76FFs/UG9vhJ6IKzrh7MRSwL1/lx2QWs05tJwU61a1hoLmq4KamNpoNCy/9XHEcXI2ptVOoot2wq8zafqFRKwBu6d7mrHGgXIc1RWe4eg/xVIkQkgVMXGmB6uaNX4GO9DufNYIWA== 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=b6NFuY1Cli4ZxcQEF1wHnuQb58sUXliXR5M9M7xX02Y=; b=UGwxfDxGZ4GJGIeyk6v5aniHTxSnaZeyZPwTsbv82FAVsbHWQdX9+G5ew/NJ/NI7omVCHi6qNfcNTogLoQoA6r5CRhjPbX2Rf04E6+0ZFHaFYQZ2eDUKQ6vJbPJc3VXl2suBRNjQTmPkx0e9M3aimwLZ77L65/mQKkEHSYojuH8AnosWWhZjfuI2tpHColUL6oZy9kD0H4TLwChAI2f9notUTvhhNkF+wp4QFaqaLk7MM2Q5PkJ0jJ4nROVUH3R9aMgN/hakxCCxRMQPP15kmXMkIqdBB+OazPD5sUx/xB4PWS8mHs3a7IvNvK8SO2XEXb4ZJbhobbu84BvPbLgaLA== 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=b6NFuY1Cli4ZxcQEF1wHnuQb58sUXliXR5M9M7xX02Y=; b=NC1AfEUWqNr3kF1+QBHgbB238jZiGAGRE2IjLe88LWEBNyQPhBs48MgxtDx9m/sMeMJScKIFAuc6xpmu2+WAZBhqUNnFTSKco0lW4dNTlkFoPhLOlst3b59MRf2dI3OuT4kFIcxYCTu/K59rL3e8fPrfT4bXZmRxL5uVgkk/ShI= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Thu, 18 May 2023 14:56:03 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56:03 +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 v4 06/35] maple_tree: Add debug BUG_ON and WARN_ON variants Date: Thu, 18 May 2023 10:55:15 -0400 Message-Id: <20230518145544.1722059-7-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0290.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10e::23) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM6PR10MB4347:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c6a7bf0-50e9-4a80-c2cd-08db57b00030 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s3UOWhFza14ewH+TPTmENd+LGzNdwxQSqJyDFhl08B3GcFZwFOh8SUKpACoMcNug0Wzo6RLsxzU8UZVCYAqreNQocyRQ0NJA58XzRES14lIeYuzfVs6eNmqPfW81xOGxyt5gTaQ1qgPmCIrZob/lEoKKz91cJgmHfqsftXPl4OASjR38SSAE46hgmjo8BweCl137S1hsOXtwOJRmdrdvX/Goykqex4SkEqzIaYh5TQA9LtGBra4/bjZtbwyvrWcrVbwRAvT69uYr1HW9HkTOWUb20CkVZ49gixZSjSt0Y9ctQNTnJaogavbmUdz0ZIVrJmZUBqaIhWBOCzS3t3cYj+/fqcymRcDQuJXdAov+O/6PYoRIkihC+g2P3l5yAXHYgSFbppVF7PA9V6C0RIqWhAKuaaIZ8mMlsQNAsv23pCB71Xjq8BDqDVFjjrA7Uaqq2TjoWudbewM6NOofrZDtEAvY7XNoqdzqAbzMhS4VOBKGF/5bR+6pFFQQYDFr0LaF3f5DyXSRGyxX/p7k0UUAXloacZRQEBbsEGC9SAgBz7OKZWQg3AlK53VYyUxaPFJu X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(366004)(136003)(346002)(396003)(451199021)(86362001)(2616005)(4326008)(6666004)(26005)(6506007)(6512007)(1076003)(6486002)(6916009)(66556008)(66476007)(66946007)(316002)(38100700002)(36756003)(186003)(478600001)(8936002)(8676002)(2906002)(41300700001)(107886003)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1wqL+IfcoMPPn6Nm1UVuTqOSk5GjjVqcz3mh/OAG1npxoccOOYYrDZ1IwvcWJORmQXyjaXcPJvTG8XtC4KgxVE1l6IodFe3sQ3PxMDjnXCC9nIuWlt8rF6CM7kWikAo2KCfWOgy+Robq0VZMT1vfdL8s9xdTMvSCN0AoPRNmVcgJK5ai/2gFpVlKvTbkF/ojl9DcYrYi/BtId+kLMF1nENxQJOflvgYLqFxXUU7fLbKCCFhgD5bVzvtXBySWQrVqnxkR2ag9MC6fmHl+jYXM2MgF7cMWYI6kjAfzyVBdXmWsLzb9zhuI8wE/xy4cxlBt7t294toXyNttAv+fByrxdH1dkTtxOrNyQyakDyJU15H8ETxAHsFitMJmFTlFwBWsKmd0LtjgijO5pAlZ0frJzOHhtMSsBMnBGKnb89WBgDAeoddHeScn7Dfpw6L8DCzngwZUm6/Q09kbIybtAaWauLO2HmXSdJoLzJYxYxFN7W1G1TqjKcOttymVfqAvO0xaemW4k5+ttx5hLQA1jZ0y5V2sFrqVEfspkM/9R2s7wylHuKslALqcDbdFd9Eu9bGCVoj04mLlzOyRPXA/vzIi6y4oeYGaAwu6F73uN+3y8EkL7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iyhw5Ib+H67gNNDbe6S50HBQ5g9jCY2NYrfynmMtGyo+i9n1exff+8dsrXd5J0g8pxDfc4nTjdZTXv693e834jRFfCC1DOVqqhAQvpJw5KeRulCcCpAZg5NoQQy8h/0YyDSq5Rp/y4Fh6Hi5ooZ2FG8j4rN/HCfRJyqDqQncxEHwphd1yQpZSq4LPEG9HDW4Ndb6g+H1ccm3kQicPt/VbW0zsfovAGCk/YLltrqCbHOMPcj2Y3H9/yPzu9TjmmJOWubeSmshNVogewouWURYzjA0kFaWnOMDl6DrFFQ81xOT9QnZ1qgdEQBokBEW2v1UU+AQ/sPq6jbEG7RaG/nGXqv9s/lFv7FyIfG7Zj3IQUhA/yTlmM/AIcoQ9QWQt7wbc7WoBKZBNd+nxKTXCL8NEJG23Cn3ElJzrSG5X7OfDuGXmi+qUZOzcjsXZRc9J47HrBegbzzloPduFeR0b0wuEiVAvT7vxYXQinXoJkbrU5wIdyXKWq3BZ+k3/KYnRvgq8+wtoRj09X7er7gwn/BAOPFqYd39s4FHGai/6bw7l5AvTRmzCHIsV/jBAg8aqv3QpopUD6Msww7flNgfWYjf78deqYSjusqr5K4fgn99ZGJ3cgsZWn1O1DUkGsHhfJ+3/x5VPd0prc7YUJZjtsHzXkb2ZCrkLwSDXX730VxJvfo3snZqnZ01Ai0pu7mUXRu4tl1Ww+MC3lrTM+ONjBRo31GLRpVkRN1E4JlDxBNixEA8OICPZMNOMpKFjwtFyw4Kh2V72KZ0ZJCfqGxmpJ7QXv6vIMg1N9kEni3IU2CgBEagFNtE01OG9cTgpOZSmAj1jP+LFbTaSvj03lTHs/7zt1SQZ5eC2mf4Yno54+6KMssG353wXCFXQdzUzX0iwRhETirweYATMCgPQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c6a7bf0-50e9-4a80-c2cd-08db57b00030 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:03.3136 (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: DkaUwxLKA75uVd48XIzEohHL7O4CUOce6j2dTVot5Ee4dXBoQryUbFgsXvNWGglwcRNsXAQDXCJHnomsq5RvPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 adultscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: 1Jc4f_3Hm22FCjvyvbpPXhgK3BUVPG-Z X-Proofpoint-ORIG-GUID: 1Jc4f_3Hm22FCjvyvbpPXhgK3BUVPG-Z X-Rspamd-Queue-Id: 5C84D140022 X-Stat-Signature: yzmcjtan3488h31ydkuxk3woysmbpjni X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1684421768-569833 X-HE-Meta: U2FsdGVkX1//mo4HeWEYl0Szlw/j+X709nvS67lWJKw6/u4kGSTh1NldBAPOZ6SrylZHhoUUoIBmjR+aMnKcGy0ozNFWjwVpgryXqookqmaLffIUT8mgjKak1pMbIg4LMOOSNrtoN7TH43Z8hzDI4Qe5CAAd0qph9Ws+xAb1REUctP3BV0h8JGYshIfu1GRibnertSlQJBpbscORVM+LTrKfgUhj/t9Ce+SwO8DvVp0O3DXHbKZwHHYTxIpMA6io3sD9Us1wb+oCl1pwaJxn7mshJ9M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GQaUCkE3VNHbKiT4NV55XAaHWfSyPchREhku/W6lUCdRoU2h6fQL8MCA/3VQKIbA= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Add debug macros to dump the maple state and/or the tree for both warning and bug_on calls. Signed-off-by: Liam R. Howlett --- include/linux/maple_tree.h | 100 +++++++++++++++++++++++++++++++++++-- lib/maple_tree.c | 34 ++++++++++++- 2 files changed, 129 insertions(+), 5 deletions(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index 140fb271be4a..204d7941a39e 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -482,13 +482,13 @@ static inline void mas_init(struct ma_state *mas, struct maple_tree *tree, } /* Checks if a mas has not found anything */ -static inline bool mas_is_none(struct ma_state *mas) +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(struct ma_state *mas) +static inline bool mas_is_paused(const struct ma_state *mas) { return mas->node == MAS_PAUSE; } @@ -679,6 +679,8 @@ 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 { \ @@ -695,8 +697,100 @@ void mt_cache_shrink(void); 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 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/lib/maple_tree.c b/lib/maple_tree.c index 084868865849..a28b021f740f 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -240,12 +240,12 @@ static inline void mas_set_err(struct ma_state *mas, long err) mas->node = MA_ERROR(err); } -static inline bool mas_is_ptr(struct ma_state *mas) +static inline bool mas_is_ptr(const struct ma_state *mas) { return mas->node == MAS_ROOT; } -static inline bool mas_is_start(struct ma_state *mas) +static inline bool mas_is_start(const struct ma_state *mas) { return mas->node == MAS_START; } @@ -7251,4 +7251,34 @@ void mt_validate(struct maple_tree *mt) } 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); + 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) + pr_err("Check index & last\n"); +} +EXPORT_SYMBOL_GPL(mas_dump); + +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->end_piv); +} +EXPORT_SYMBOL_GPL(mas_wr_dump); + #endif /* CONFIG_DEBUG_MAPLE_TREE */ From patchwork Thu May 18 14:55:16 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: 13246934 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 B52E9C7EE23 for ; Thu, 18 May 2023 14:56:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 86AB390000A; Thu, 18 May 2023 10:56:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 81863900003; Thu, 18 May 2023 10:56:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F52C90000A; Thu, 18 May 2023 10:56:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 4CD6F900003 for ; Thu, 18 May 2023 10:56:13 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 27739C07E9 for ; Thu, 18 May 2023 14:56:13 +0000 (UTC) X-FDA: 80803676226.21.31F40C7 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf01.hostedemail.com (Postfix) with ESMTP id 416F440018 for ; Thu, 18 May 2023 14:56:09 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=zusOND3j; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=gAOxYX0f; 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; 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=1684421769; 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=ZKKnh5tXR7cSv5pdvv3zTwdCIZvoiw2m8PYAGu4XPKg=; b=BsVgvIaaYX/riufhi8ssSbw0kX0rEkctlkO3r3TCDFdLUO5YLWLUoF/us9+4KD0C1CNQ0Z FM5L0V3Gpm7UQ/dj7dImJrvaF6fuIzoLar/uy7UHoIVo1MfupXCftuf9egcANhOlzPWd84 8CCSu1oNTRqEwie12kVGlaLCEIUb82Q= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421769; a=rsa-sha256; cv=pass; b=b0tJ+ikonRIDP2T4ux/pEf7P6nhZLC/uTCdLTUGvvkSvOjxlncaFqDIVtlsBkJRCNdGDxg zPZtyWSsog8PW1O4OqLkp7AE45LojcOarux4/ffipt/2AbJr202wKQhC1XKJwHNIucnuSQ pTMmzoPPl5Nz5115JAPH8QxrIeHN68U= ARC-Authentication-Results: i=2; imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=zusOND3j; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=gAOxYX0f; 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; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34I6IoKK006515; Thu, 18 May 2023 14:56:08 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=ZKKnh5tXR7cSv5pdvv3zTwdCIZvoiw2m8PYAGu4XPKg=; b=zusOND3jxNSaWdi6eSETaFyVoEGaqGs6TZGcV383xiFCTLKkOqWIw3EMMNih70A7/OnJ haksnh5BpVvkr2gldyQ3rwXWPzBWQJjeqoRBAXcMOTb+kALmWmKIFajehETrzEsA/JCE DbfU/UUZGtTpOBOJZ81EteI2uMgmXXTTXs1H/CZ9XqNetKVTknuYaM7uq49TbA4TiFxO hjAmSjHArvDLQnc0W69emoKIBLJCNmVnuJc7T8I1N68ukppm+AttIr7tiU7ruTM6/759 gjDYUOQsUXYqwp079sEydZKtx9zqZJ7VWgie+tedITxfelNODI6njGYFI2UIczfRN2Fc LQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qj0ye82ng-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:08 +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 34IE4MUs032127; Thu, 18 May 2023 14:56:07 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2101.outbound.protection.outlook.com [104.47.70.101]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qj10cwr77-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YR1fh/Zw6PREDYM+jJJHKhPIR9xjXRoQjfYHiGCz23E9cg1w6iXXsfDoV5Ln/lgh13YAx480YA+dw/hO7DnahG0WoReRQ9toJKpXC9ruFTR6Ryer+9qVRQxivFdcfU8LmrWhcXarS7FTtq6Z8y+ujsZQ+9F3dCi+9yU1QB02AENcNnxDEvFS8hiOYV3gUm9RQ+H6cabG9ohe96jN12rrZI9lDYVyLEyWtjmyeTpmAWymu9HEzwAWyKaWPXqory2PHKAiqp/O5hfB9ief0ebP+i2AHj3mxMxWPkLS4AV4sw6Dv/N5EMSM3GCeolbsXGoRpv6WFzpaXDiY0Zwd+62kaw== 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=ZKKnh5tXR7cSv5pdvv3zTwdCIZvoiw2m8PYAGu4XPKg=; b=C/1PD2hMQAysd1RRSol/OuWE2KM5knbofysAgA741yYL6iQJ8WikrM8g+QwkCnZTRg3niVvEDbkPoTqMWTZ0KATXNel9pP7toko5cnTq8hd9zMmdiyevICaX9D0J9V0WsXxlpNgmdc4PHcsYczXxgsK3yvSB8Ynzsfje/S20mS+jo1YPD0TvghU0oZqFWC/fde9E2uq91kJHJrR5hV1Tj2o0vfR7+3EwpwBalmKoSab8ykiDibLOmX4cmO71/vegW4K3nRHhc7ThyxPSVocRxiYikAJ1FInoPPrtONl37z40KEHGEEQxvV6IA4OYTJz/rnRwGgcRFgv9bYGpiKA+nA== 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=ZKKnh5tXR7cSv5pdvv3zTwdCIZvoiw2m8PYAGu4XPKg=; b=gAOxYX0fsswPPsmwyR01feMKdIFb3ZPay9E2nS/Ehg+ZuVo9tNBEVLGmqoScj0ttx1D9FMsXtvWM3EI1ENh932kiCUaZv6BmsaF29ozcOg96cQwtidLDHvYIXLVfsbr3tz4dcFh7UHBrS5DnOYmXVkYlN+G/wxxS318NQMI7Sfo= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Thu, 18 May 2023 14:56:05 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56:05 +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" , "Liam R . Howlett" Subject: [PATCH v4 07/35] maple_tree: Convert BUG_ON() to MT_BUG_ON() Date: Thu, 18 May 2023 10:55:16 -0400 Message-Id: <20230518145544.1722059-8-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0293.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10e::21) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM6PR10MB4347:EE_ X-MS-Office365-Filtering-Correlation-Id: 8394f47a-ea65-474f-f901-08db57b001b2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 84zeeMybTITJcJpGcGDGQ9GaAjYjlPuihbR9wLXAD2tWtwGMtEdDTArHz9CpQa5T2oPB5J+Ndvnr9dUazNBoeRKznp83ewb6WJddY1whpx5kVWEJfEZ5VaRW+ukqPFcSIiuty13j4xWcGY4kN5aDdBqZC1IbFGbY0l07Yl+FGZRAts6VfARD0opYVI2rr7ADhUNHmNbipQGz6krIcl+bfnYaTLI6ucEFIY/9d5MQ7/bRaD6kTNPPXN1S0VuRqePIxgUg9yn4u1ZeZg0wWey1GNafPEzpxLlxMeZI4E54cLkgmv/Fyie8NUW5KrzYBYPruGqGcxY3sqQqhwXLr2ZGh4rcOwWH6X/kogTttEvJhNYmBnlwo8irEwKyB1BDOpzjqNdWqoD/QDIeTLhaXKbr5hIbsC9MKL+yPxVjAwcjWJM1yvxpZoBD460Nl7jcDmvwwyenfFlzAuYod6G9VTNr3W9mR6dahp7Risgg7AYKImfzTorKrI5dCbVNN/waKy6Q/BJ4RHgKSKrfFePqABKx9sea0KNangMRUt74ZyO9cBcstRrDSHSM6C7mHG+o2c94 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(366004)(136003)(346002)(396003)(451199021)(86362001)(2616005)(4326008)(6666004)(26005)(6506007)(6512007)(1076003)(6486002)(6916009)(66556008)(66476007)(66946007)(316002)(38100700002)(36756003)(186003)(478600001)(8936002)(8676002)(54906003)(2906002)(4744005)(41300700001)(107886003)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ntedK5ZFawT9Jge1CXXN2Iux7HkdbxROG4SiPdjj/+UG02f+t2sjinnVEKJQ9ByQoy8hnz17sUD4z+Z8+bdHZWuqk0B0vmlLNb3qZv9Fz/VTmZDOojkWBQRmNgpPcTTWxhp3+EIr0+f088ElIYZMUptOJm4az2mmPlXwYVXkYS3bQPS03mhz8l/nn8xw21wkDKXXLlJMWI92LlmPl3jtaajbxzifwzQtA4kfXESY17TkHrlMc4DFC8K98Kwovd1qLR/27KNit/Kru2vuTSu6FO5ZhVH4bMUPGKNxreOiJLv+q/qV0BFWq40TmvO5XYuHgUoSwxq7VZXTkJjudyIA0IATxtZTl76Z+T7wrZUscwlfK9jB3+IxzBZQfldNr75myC713VY0LQ7alwc8TaKBU2zscZXi9i07npCp2ciGKAvWk8YpW9evon4Z4t6trJAaYbRW6vLBCnQHshFQ+h9jc46Stj10+BvMuu1kkdKQzkjGinUwERZagjFmE1BBNf2q9eyjbbjsb2HsmfsptzxU3x1e9W/UAxA09FajCsdVnV3DPG03RGqHnX/acEIR3Ihk9hU9nfmAxYJgEKr0P0gijoSF0rPr8/XWewzz0Qf6kiqYZRKHPV43gQmekGdvFIlB7H/xwVsyiV+gwOLmrWMeHIeaGfqOn2nUcugjoI2hCtwMENuyjPgROS/q5VGr73UKvD9GS9dXzbBumH+6yrXre9zgP3MphG36fbPHTFriSo7+aDuJk8M/ZiajwlNJ+AR/6uUIz+i0bZJZXmM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n+bPY5oA6wF4GzRUHKLfrk5RxHp+hKTUQoGZfbqkii7KrJ9oMonBODwsyU5lENv7uggJSnnItslBFDyEvPr1PdngNEAk9Fr8nwCmK0r5NGMo2TiIqrTQSbA7DM+3AYgM3WvbqIEdZyy/djIkr7KY0qYayk4a6lKmNwX+2lne6MVsOEZc2fG4YYh4C4OI3e8GWf3eGFkSFkVzLxUbYpiSZXuyQuA3E/GlgGih5sJoX4JkVWSUFujyvwDHq9AVYye6bRLGEQWnjXOKj8J1CGbIkFZsfoPEIqxm3tENYF+I+O44et7Y/YumG+Dby8W6/5UnNR+EQDapPVQ6EjPp0QftxzGzAfR/p92l24rovnGrRAzBBKNzgWT1GinxQABSZ0K1nzZHbX22emgH715EKtfCfX37ie82lfXqZtRhwHWdibW3WIcMum80sT0sre2HVSc4ZTg3bltiXWLR8jbrbtcPHEm/DOrNQ66PVXpoPqNMvlx4FUzRDlOyAThtdAHJ4GcE7tschjFcGZVwRD/gm2LerQo549Wfz5atH6aboKI9Ay9GD2pvhfHJO/tzPY4uM5rfHyKT6MGgsYf1PYxqSvQBRnijh+DiSmwRE6Uld00y3sRwWqYYEESvFaV6lr5Zitw/1dEMavJXUcIV+Dx74+6BCQyDeNE/TyfFBdHPdfITa7Hii7829acYLw3Nko9CJRUl8xZqhVzNy2n9IHJLpYLncnW4WkpgfuM+DShss+Jhvyoow+mayViXg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8394f47a-ea65-474f-f901-08db57b001b2 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:05.8489 (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: f9dC7gzr0U8yNqj7CrFvf2Z9ttdvrlWmd4XGusBxDJXrAmRwnFRraO2A0TyYemV/BancYHmsS56SWqSX3oJ4nA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-ORIG-GUID: hl-By1MQmLTQz3hIRzHjeqrYZ4p58ndK X-Proofpoint-GUID: hl-By1MQmLTQz3hIRzHjeqrYZ4p58ndK X-Rspamd-Queue-Id: 416F440018 X-Stat-Signature: f6oxa91rscbwnzuf4biq5icq3okjjxoh X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1684421769-604747 X-HE-Meta: U2FsdGVkX18zdZ54Yor0xFzRQYvOV/oQLFFECAAuLvBTJXOUHOCyF+4KnSgelv4qldhkB4vHxiMViMeaTNwtMCzEJtAw9G34AulCzZR9WZFW9UBy7EFf3xm9h9n802wvGtW/lV2mP28nso/5gYInNhkK5gJAIQrKvtDPey0YgQjGu/5svQibc/0nwoDp58GZ+w9V9qHEffQc1OBcxkYdK5E4Z9FDfaK3nWG0KRqsF/EaGRkVCTDAiuxH+cKTB+/D9fGkhXHKvmr+sLQzJ5/FR+i2KdELQBwxaZKny/U14veIYuuENfS7vCablZ9l0Ns28ojM7KmNGNScw7EBgkMo/OA+a170gDcHgPZEts1K/zGhajEJ6TNW4ZmL8Jgb1jvTohURrckw2NOL8tTih+eHC64wvH0QCAFAC6OEzegUmTAmf7J75/yil2IcjQBC+lWKI7nATt5MMSNUyvjfEwJ07uB4q8bA3WLmgEjBanFe5CJOJhspms6RpDyHBEXZiQLj/8sYF4fau4ZMHwKZFlo5tWfwro2DWJuRGeBDDLCrloZE1SUW7yMwJRC6LuUKw1OC4jD3SsSOAWCzGGAnVyFTyEJWVpXm36W5m72HGBQgibKKCJ2VyQUrZzGkSQNv49leLsJV6Oa49ZVYbPrdZjFu0A0gtEn87K6sqnjCIwYbiA41chX2jB9wdJCGZS35usakh/t4y9ldJzFzRh9qWlnoWmAkzroiGVe7PNbqWaBmDfEWkX58tGPFxMWohZmHbF6e5TX9D9tYuHaviGwDR8GO+BAtHRNnddzEMZU6F7rVujDHC6CRQMCP3soAStVZtRqwkzhhdrTk3Tm9DSEJ1wxy6DgKA3Q++Gqmu9OMcJgvdXrzZAd6HmuNToaXM4FybnIQSm1//0VK2L2jv3mm4ZWo5yMeUTX6LTfnpnH756jTJwfPjTu/1MNiHaWjV2aVD1BVFSBDrIui6BuM8qewSp/ h0CCilry 20z5SVrPRpZxtgNOZrowdj2t/463upocFWTijP+G34F93q1obtDC44uNBeRDsfp2fdxVVjZxV1L8qzioxJ3VunIqY1S66HtQhHhGhA8QEe/vH2SxWbWWZsiYtWnW1G3Cfy2OmkJ8n7Ltl7tLaj3l/QFBNPEePC8llyRxUxgKtdop//XGOXn6WG0dUnN+CXg6Fo1ZXxFySEVTwLN5++Yb8cV6/WwPXheHTQNKni37DsT/yGto0q3mfIxlQWQi5mLJtzC/98G+muAXU/CW1g+6SQ2eFIlobtN8ZFaL19MJskifgKpRvQQDvBC/D89ZC3VjxOxRpOgFnZVcNoR9O4un/nDcQGCTRqp1kpYT+Qpq2ESbCFpu1XAT6JiM7i9QZf/y0BCb7JztIVoMKJKqgkLiDNlrL2pz1bJ0h3ykOjUOlByN6dGI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: "Liam R. Howlett" Use MT_BUG_ON() to get more information when running with MAPLE_TREE_DEBUG enabled. 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 a28b021f740f..c3ce2bc59412 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -194,7 +194,7 @@ static void mas_set_height(struct ma_state *mas) unsigned int new_flags = mas->tree->ma_flags; new_flags &= ~MT_FLAGS_HEIGHT_MASK; - BUG_ON(mas->depth > MAPLE_HEIGHT_MAX); + MT_BUG_ON(mas->tree, mas->depth > MAPLE_HEIGHT_MAX); new_flags |= mas->depth << MT_FLAGS_HEIGHT_OFFSET; mas->tree->ma_flags = new_flags; } From patchwork Thu May 18 14:55:17 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: 13246936 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 DD40DC77B7D for ; Thu, 18 May 2023 14:56:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4C01C90000C; Thu, 18 May 2023 10:56:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4482D900003; Thu, 18 May 2023 10:56:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 27FF890000C; Thu, 18 May 2023 10:56:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 166A0900003 for ; Thu, 18 May 2023 10:56:17 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id DEA498085B for ; Thu, 18 May 2023 14:56:16 +0000 (UTC) X-FDA: 80803676352.16.FCD509C Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf02.hostedemail.com (Postfix) with ESMTP id 5D1B780010 for ; Thu, 18 May 2023 14:56:13 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=KLLtgtxu; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=AeKmOlpG; 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=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=1684421773; 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=iIEqoKHCtZVIcHQcln7ub7Fr3AEamO8DkcUXBPgJVW0=; b=Nb+FgskTcPDrGvIWmD3Jc4DL4huSXCm+xZ0IgvzqLRegcSK0wWEa0PBL68p9PEOXSA3I4g G269ZFnlzPGiwMbg7Ipa8+U9+xiFYhgOi5DQkaibDH4SnvpijXsrQeRSIzfmoCWYKX8Xd1 I7TEaTdhNhjMSzRqysaWskEUz3VA2wQ= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421773; a=rsa-sha256; cv=pass; b=xC9S2NkhN3gxxyFhIyKe67lAh5UpIeHw0BlGyxhvCXHkRhNgFD34C4rY/yrzZ7j6f4y+wk hrR3ck/GuE06j1FfRUYiKwyL2iW0YnfyzmKtN4w2Mrgbz4I94G7+xq0gLX+70OB2GD2iHj 2YcHdvcJRWYTE+eB/VQ7HrCGhOREfUM= ARC-Authentication-Results: i=2; imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=KLLtgtxu; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=AeKmOlpG; 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=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com 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 34I6IpcF003885; Thu, 18 May 2023 14:56:12 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=iIEqoKHCtZVIcHQcln7ub7Fr3AEamO8DkcUXBPgJVW0=; b=KLLtgtxuOqobTuSqI6fvrBtxKQ7Uz8G/beucSIIJX3X+tNRguA+cGpEd5kxX/ZCy58q0 zGmyOyCxNQqXnexctByZu6vzEtCdjypZJVb+UdfhUbHH0KGXc8QbMHnPjnynztWs2Ztg Rbq7soGTwaWKnqulxq2Ig1PlHC007cmGxA0zmanbbvWn38KJHVEKbchZ6k0IaqRCHpjK Rj2ncStexZQ2YoHLhMB7AO8dLGooXZfSV79VNrgqXQKmjaH9GuptK5U0FLBKzwZcir5D L9xkwGVqEETFLuMPksIh4sI6WfGIEKG4TCk/55EpTFK35hdo8IVDlOepr2RWMKnaKgf7 cg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qj33v043b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:11 +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 34IE9Wc4025017; Thu, 18 May 2023 14:56:11 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2101.outbound.protection.outlook.com [104.47.70.101]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qj106vkvr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TSI2vh65brkq1vEIPyyT0+T2t5gbfIDrKZXmvhflfe9wkRwwKy5j93nZFISN/UR5tOgoQoRY3QNfCciNyGLM+xIFsvHp6McJP6yRDVKhUsxV646UErCkGg/f7CuQnD+U6VRDMrsRGRlSzn+Owe/PCSwBw024KtKy1wlNxbjeJDk429kIaf9OCxFuuNjRRYi3hHxlmahCJ0ZqbcjvmAfffdEM9NCtAqU1EF1Mw12zIeurvvGmmx4v1OnWBaEXl8R6xbh+pZd7lKXM9QMeDOoJlDZNgB5I2w1jHNm72QTF8OCaluymlfFjrSJcSPt8WcmVfCtfs/XcRbtT3eAWuxwfbw== 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=iIEqoKHCtZVIcHQcln7ub7Fr3AEamO8DkcUXBPgJVW0=; b=WFSTtgQLvtPhD9Z6ijt4N+opsQkduyjqvn17lTL10jC6g0Ci2x6fw8EZjd8m7roheDPb4IimBq/4B4yeRs8nrWIYNI4TfAJXprt8F7sQa7o0rCvjbqZ3leTuFZonrnRmcvGbOD935bEmvOYLh+YRYmcjYDFRSC9kAd6fShoSvXnECEfvZXS0499REPfC2jrzmG2Xzsz6eznAWDYnt+CRciyINxRlBYnTcB/2jp54W15PQ/1+ouZBYZ+sY22MfmSijxGhV9T1ED1qq1JLcfG/w/G8S8DF17RmDHuJfozKvC+ZTnmejsEZHApXrT75ttEUOmVy1UiwZM+NEwV6VR7odQ== 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=iIEqoKHCtZVIcHQcln7ub7Fr3AEamO8DkcUXBPgJVW0=; b=AeKmOlpGsjXg3Ro4DlzUUDxuaScIM0N+BZUba5Z3lM23T7VnDQVGiuBs3hIn7bpV7cDHQ5LGwT3Ex5KO9WBZh3IJggxZV/p3NKYo81dJIBPt8DSJoCmeEbAWzYY7VP8BkmCOxID2S4sok6VhxWedKR4PBGojj38pBfuk7LMVeE4= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Thu, 18 May 2023 14:56:08 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56:08 +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" , "Liam R . Howlett" Subject: [PATCH v4 08/35] maple_tree: Change RCU checks to WARN_ON() instead of BUG_ON() Date: Thu, 18 May 2023 10:55:17 -0400 Message-Id: <20230518145544.1722059-9-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0085.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:ff::23) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM6PR10MB4347:EE_ X-MS-Office365-Filtering-Correlation-Id: e7048e49-2387-4cfe-68aa-08db57b0034f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gURmUyVULnU2pzDkWml4HZ5MjgeCIytIM5T+jd8eMcSA9+nYaOZ61jW7SMrhNhxEQ2F44Sowr1MI5UNhAuJAnsaxMJ7O+voSyWMepKTZT0KXkxBi+bcX5J3u6YHmohLHa0GA41cNcbESOl/0zR7iwiu3xKOovop1xbjetYEFbYPidwK5zm+IFH79mooz4t1/ZBsRGm1PTcd0w19cMK/Dv24dcClwQBg7rxruxA9+1krgIZZicELFiXZwvzynJ3Cb/bOYulORnd48DujABkqlB+SrpErp6Zw8K7IuMBddOT2nVR8rAK4dyw8cIIx85DIdOBvPiFM/p3hisGrlZEG+p1a/5ZOc59wNYfryjDuKUihSz0y9kETfQaHcszIPgV9rwN+Ddo4BvMVPlAlmA/qsfvY/BPjWssfGGE9YygdQOyjssyAXBhN+xcfyaDnOtm7oFGDdxnFuB66NSsPqbOVl/NC0di7OJdmMNGXIXa6ItJPBmyoWOKPeXepz45PTS2QO4rmMByDcrViSPPPKSr4Y2QbEZtW/dAELeM2JA3w3ZXbJRNP7hbFwnrar4+LBL78/ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(366004)(136003)(346002)(396003)(451199021)(86362001)(2616005)(4326008)(6666004)(26005)(6506007)(6512007)(1076003)(6486002)(6916009)(66556008)(66476007)(66946007)(316002)(38100700002)(36756003)(186003)(478600001)(8936002)(8676002)(54906003)(2906002)(4744005)(41300700001)(107886003)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AVJRa0ito6gYx+pqxxttkC0oOVguPwViDw6P3+7mZlMd0L60zvmI0jLBjP5k+CFuGQSY9BeUpVKcaaU/c9z7XovBqCJ6Nd0Io4zByLyREd8bheZxnfR3/Sy5amtFFNgz+Ve177XNMAWWydRdnOQfCrErVFyjwj+JCbqDy4sARnBGMn9S1C1iv+ojtj7fz2qaK4Ve1ayv9hbG8yYtNWnNrNiQij3yJttwPVOJ5NqRXgLtR6hgupEgRJmFW4xNTnHb0mcIpXDYQa7GZchgla04aH6Lt6w3/Lk92djrgUs6IoOqGrzjcAUmdP4wX2j0+9PFUI8WAr6O8+b8BuVzkuw74SUPqHAiQKLRJ0PYMdJFP/C2FRxC5ZHSeahsyoOk3v8xwGWj/ROxhsOuVp8jIOAYnMUkJgaFeiEL2A73hCDZmMETm97hpRCEuDTaFcYXwNGb4m9RAL8e9OD185OD6GCp0/SOQsQINbyLC8N6QTG81XkJ1mGN0b6odIsm7owGqrAi2mfSEziDOjLMO2KrfuxNYdv7G83c/64nOyJt1Fp55NXme1k/CAD/WD9QK38xwLVQuCoNkEsgdbm7H7LQ3x615+3yk8r3FOkq6UzFi2zzW+VK6jHtrJDqkAA6iBftdINVass4otx54pJVXvOxPdfyfI13g9pYZojq//QrNWu6iRDYhS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9Y81v2/ku/rHH0hLj/WgbH4RU9kLvvOb6SmRDaYV6y3SeBqv+J1031aKnySG0Upyw6wombXu+jLU15+f6kIOaIEP/vd4iRKmUX8xJy0+KmXAbmC9I2y/hTVoWiDNWtQ86NwdS7WhzwB3Vii5+jEgprYatMh48hDqUSraIgdNstwMru6e0EG56bo0FvLzAB8Y+ysGgepjJDdDLQh8OpWMQH+8oFOZtMuqqmM6gWdTOpqUtkyGJx/jhxqfWn1g2XDvb3mySVnc1omm0jiP3Bqe6e7y5k82Acm8VA7ZsHWtGQwvHBt2DyFDA44yZ+inI4AdZSaCdkCpQoCfrKBbNPIZkuAl85UoapFDw6ynK4gn/MyzLUv4ja9eS+gAJ2mYVsBPfeuZzGDLNsWQvF6+m2HbSRth8d9bJ+/xKS0itcWHzAqaiPH5lKGhsBo3Gl519cCEervcPqzJf71bn/rnDJ8rxMVgx54e7KhRUPnhVq5O/XzRe/10Y9L7deeb3y8fdTVvHBOvJl3p/74aIdTug83a6sjgnBoENqodiSaSk1dqPismTvnemDztI252a4n8NGYFWufbWiLMrojpmRs/lhB7DR0nHbf0/T9EDP1j7tokvvt3gbrVB/dHgHU//fGLCFy8TdxBM5j7MJkOhzPzmozj9PtoL+jDTxUcQAOIdky5PoWOCuJmIWTkhxPgadbHWkAq+xbOQY7pOxcuioC/DrdbjJ1XS1ze3bOBzQc3mgqzfWx3E8F89NHZARd9xNykwipuLmQUMh8TbHXxNXS9dnk9eWKYUhIxe3zKLl3rzg/vCe63Hrh38+ao6ioy31pZK6VcrQhCrAgGyMPba54FMCHPOcJ90lpyjDA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7048e49-2387-4cfe-68aa-08db57b0034f X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:08.5456 (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: HLzxDBgytF2pxu6pEu7v2yaCuLtmr/IAn6frAoGIqdR0RrsGXhmhSkSm6Vbs6EQJMSM2uAUSNE5vqPQoV73Uew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 spamscore=0 adultscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: 6RaQFkGPGvNa87k0dyIPuXTp7jIgsqPz X-Proofpoint-ORIG-GUID: 6RaQFkGPGvNa87k0dyIPuXTp7jIgsqPz X-Stat-Signature: og51x1udtknwj4aws4ug4a4ykhkm64ws X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 5D1B780010 X-Rspam-User: X-HE-Tag: 1684421773-485406 X-HE-Meta: U2FsdGVkX19XfThVu+QNFgTwcP9qtsXi8tV2cBOcwJkbsui3OkgvadP8RTdRABdY5siIKuuHluofXDQVXag+x4NA76F9l5/lJIdB+m8RZ0PcCQr3MsHwrd0GRWBwgQDB47czsmuro681Kts9pR2nV9EftjQ+ts2SXE1fZFmtN109ZaqjLRuK/g3p14xo/3uDX/i6LMkl951wcmTgzRJwLiLYbpZvVjDGA6Mfz7X3Z5O+3NHdLt5wOdjq5opx/I/j6DiYxTFBK+gOW3NuRMSU2he/9bjXsXb9QsuQc3zbYC0zmZv68pS2ZCPaLVGknq81j3QOp6Z1AAKxpfQkKVNsIvhPY4CGVPu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i+UK8CCpmmZofciUaGVVDWUOLLBkx/3hrZ94vZ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: "Liam R. Howlett" If RCU is enabled and the tree isn't locked, just warn the user and avoid crashing the kernel. Signed-off-by: Liam R. Howlett --- include/linux/maple_tree.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index 204d7941a39e..ed92abf4c1fb 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -616,7 +616,7 @@ static inline void mt_clear_in_rcu(struct maple_tree *mt) return; if (mt_external_lock(mt)) { - BUG_ON(!mt_lock_is_held(mt)); + WARN_ON(!mt_lock_is_held(mt)); mt->ma_flags &= ~MT_FLAGS_USE_RCU; } else { mtree_lock(mt); @@ -635,7 +635,7 @@ static inline void mt_set_in_rcu(struct maple_tree *mt) return; if (mt_external_lock(mt)) { - BUG_ON(!mt_lock_is_held(mt)); + WARN_ON(!mt_lock_is_held(mt)); mt->ma_flags |= MT_FLAGS_USE_RCU; } else { mtree_lock(mt); From patchwork Thu May 18 14:55: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: 13246937 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 1241CC7EE2A for ; Thu, 18 May 2023 14:56:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8684290000D; Thu, 18 May 2023 10:56:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 81A4A900003; Thu, 18 May 2023 10:56:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6446B90000D; Thu, 18 May 2023 10:56:20 -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 57754900003 for ; Thu, 18 May 2023 10:56:20 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 9FF1F1C7577 for ; Thu, 18 May 2023 14:56:19 +0000 (UTC) X-FDA: 80803676478.26.4F32D37 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf21.hostedemail.com (Postfix) with ESMTP id 1C05B1C0012 for ; Thu, 18 May 2023 14:56:15 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="qgMZr/RX"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=WseFp9PB; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf21.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=1684421776; 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=qP9dd19Zy82dZAbmnDhZ0v5iuqHTboMRfJ22/dlTxVI=; b=T7b1k+MPFQ5J4yUnmm9YYrdB2C+PKPTuX/KLnmOOYfS3VG6AexQxnTZ3rDZ4oasYnTCslI WptUCyqdZBHazWAL5/2nvQJt+Yi1l4LNXWlKjjOQ9BA6tFSgWJcUZoxyTd01K1XtOOH/Ro QWfgYbw5wyYoHuGPciaQtJEKqLRcCPY= ARC-Authentication-Results: i=2; imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="qgMZr/RX"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=WseFp9PB; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf21.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=1684421776; a=rsa-sha256; cv=pass; b=Oivu2xMmIVmXkdK7gbXOiZBkGdpZF2+tN8fGf1xOQ1t+TROkcE25D1kQ7yYPet932cMX30 evb5aqBsy7eU7tOPiOv8ulnvajz3CyIAJIyu+xoLwud/14F3CmiiApWH7SeRH2htY60nKR xoBK7cblqtZPE4xrLOY05yOd7n0UPIQ= 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 34I6IrdL028532; Thu, 18 May 2023 14:56:14 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=qP9dd19Zy82dZAbmnDhZ0v5iuqHTboMRfJ22/dlTxVI=; b=qgMZr/RXok3QHpyEKEoCL9oWQu/WE4lc/0BJv8A0PkzpEHhuZd9FfBtAfR8XIIXmVufA 9oEspFjlkvzSrLmzfrUoNFoIRzeR/+gfbPZOMO3mwBpiaDIzbXGigSYxL12b5L6pMZQa at53Ey61zXX/nb+BoxWmTRcTbuayUhzZrqTJXHxiFTxH0JcNDsT4FaE2B8EBx0MUwGY0 QhNP5H6iMjKCj3ik+mhMuGZIWVHJQCGRA9SDy5eRTJ/GRcZZDUnu4a2dAUSZ3rHOx73p Lr1+tlup6ERbkaRBXusrYPyvJmLGt0haopIjHqwE3ACsBwvnw+mHaaVMgvSJ/rsv/fgG 8g== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qj1fc8f90-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:14 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34IE8Kdh033921; Thu, 18 May 2023 14:56:13 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2102.outbound.protection.outlook.com [104.47.70.102]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qj107c820-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S1HbdzodyUEmDt8qgExqAgR17vmORMZ712RSA9f69mlk8TpLcRurHms/AkOZpx1JZu8MeNdZ5nNXbZK+l2Iby4hwC6g+msdyoVEhsiaM/+M9uGTvD0l+eYJixtLIOVrkPjeGtqNXlD4xINT6L4SF1fx2nn/gvIrZ8Jvp/qhGJ3IPRryUwHCrbEJYdnrw+J2ZPPdjz6M9MwV0rG/egj3HlAVcHExrwU5M0LjSW2BLBOEvB9ZTFahkSC+FGHNjNbNJOY+GZv/vnkrl5dkjHUtJ3V04MBSKHcF/MUxv3DvmbIgfxr48aq9R4zEB7mSjen4ecjgAeRDW7BKDx2eDgOUFBw== 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=qP9dd19Zy82dZAbmnDhZ0v5iuqHTboMRfJ22/dlTxVI=; b=mQdMPqwGhp7fhO7NCEyllGguMJXCePtPqQhOgoRTy1DZ81qI8DzzWCbhXG4W7ucKTAPPsUAj8KBtpqCtlVFKTQlp3OMHlFHIaNbgzfUY/uMpV/d5g6uuj89+1nfA9Tgj7JA13mxS4N/ehJLTnRC16eJOYouX/5lDZ+EJQKjGdviK6HsorRn9NfGhVUnPQzF4OoeqZ1qBmOMJLrACrwgznaxA8AE8FA5wWXkZjvQplFhtbzmnLeBY/V6XrLOlzVMcqJuSdrITGRyqgUJh32Ib899qeC/goyKwlRrd/+iDfnVKUUrBzhz/adiEJ/bzCwMVmbl4kxT6X/fYvLdMbD7LRw== 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=qP9dd19Zy82dZAbmnDhZ0v5iuqHTboMRfJ22/dlTxVI=; b=WseFp9PBoz8E3udTMsIr/wxjkacvCo+xLobM/Yp5QcD2VhqCR5PhlPb96cTLc3ga2BvuYv2x5D3oQxi/AOukyhWBfjaSJQJDV8e/ij2+EfRmsQwQlGHeQntZFNjhmb6HFQuBLEqAeJu5hXL98sAfa6Vl5l9/6Rt1ZOO6QcdHLl8= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Thu, 18 May 2023 14:56:10 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56:10 +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" , "Liam R . Howlett" Subject: [PATCH v4 09/35] maple_tree: Convert debug code to use MT_WARN_ON() and MAS_WARN_ON() Date: Thu, 18 May 2023 10:55:18 -0400 Message-Id: <20230518145544.1722059-10-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0339.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:fc::22) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM6PR10MB4347:EE_ X-MS-Office365-Filtering-Correlation-Id: ae7dc1bd-f484-480a-1998-08db57b0048a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M3JL1brhEGCGnEjf/xBg/Qesm3oG3tQD07Nl/CY4LcrePXQ8Z2XbQuwOkxBjvXxxhBtxj4yNUbdDpuQ1oWhUIMW3MDuB2mJqArIS+O9pQGUMzxN2y4Nk5rmeUWgIvClduWGkfSE3cQ1hqEI2VncX+KEhJ3qaqAKGbcOa/bcPCAufykN2tG8mrmJPt6r1wiwRIjjR5hdpyIqMiQg+bDDihcceLPskJaaJJS43KEJY2LP0dnH9iZU3vr6KM9oxHRwT5Yh0bNrXV6SHa+HSUTMKKeR7QTzA80cLHd77FTh3xIFV+Fd2A2uFAco2k5rJzf4c8cdbLdHV5rKbC9Xl3yWmWY0U1dNeyf8ZGZbyxFc8NPYgKYkTPrVr+BhcsQEBvQtSdttuFXsDI3wpB9wAj7L7+Zgaksuk09mquwQyOgPSTvwFtcZtKU1IRx691rbz17vUrjm+ctUiAVwk5/+zhcnjl8d/3eRWItrPZQD/gxDubU9PXmWP7hHwWlS41Sktpa1kXGSbzwJe2u+z+lhDoECZyFoJmSASpOogB9WDIiygww1t3erfxZLq+bfHIu3cEi+/ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(366004)(136003)(346002)(396003)(451199021)(86362001)(2616005)(4326008)(26005)(6506007)(6512007)(1076003)(6486002)(6916009)(66556008)(66476007)(66946007)(316002)(38100700002)(36756003)(186003)(478600001)(8936002)(8676002)(54906003)(2906002)(41300700001)(107886003)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EW8ci2CTAWH6+Mb2mhENOzU+LYwG8KJMK0yo/8dJJpao6Re3G9YK7uKwo3wqX52uKdGJ32d6pBiuUnyyOGqPpDc8SlxXHyRWg2s0NPdM0UTTi4vofClWXOsFXe2GoF76ahOGEJm3Wqi2ao2Jeaht9MCIkjo246TCdm94gTawGe/fhwrb9jPnJMhm2xfmk4rUCJtsIDD85LvjRBBNVg9RqPV2FMxRm7JE4HQdqxsMKXt504Ppps4tqI6UaAu4DT4JjGrETTxCSQnNSQDPLjq6mJkqPBqvRyFEKI3eig9f9RjIy0oDNVQdaIVI1RHH+5V7SX7GnEH3SPFUE5x8bzALEGZRfLmGd9BPJKe4rOLQfESTT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nkYlyz2M0Fh6KUvQnxyRJdJfua+kAucwBBzUL2j/38Rlu4vlguOo4aeN205h7p5Ll9V+6SRg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae7dc1bd-f484-480a-1998-08db57b0048a X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:10.6571 (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: +yoTv4b2lpjrbLpQ68hea+H/xuH9F3sPoKYGbdBiMJDgP+/iDvfhrUIKzeJocAxvBBjItZr5X3Gp7l3x0e+jzQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 spamscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-ORIG-GUID: Hp7Z5ks0L0a7gtK-oW2ABlSPG1UfeVJL X-Proofpoint-GUID: Hp7Z5ks0L0a7gtK-oW2ABlSPG1UfeVJL X-Stat-Signature: yttdyfe886wh7qi69r1cq9j5cu46nnn7 X-Rspam-User: X-Rspamd-Queue-Id: 1C05B1C0012 X-Rspamd-Server: rspam07 X-HE-Tag: 1684421775-261371 X-HE-Meta: U2FsdGVkX1/x9KelnWEPYng6JneU/0kg5tq9JaWqx/pT1g0c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Hyni+uwCNmkBo9RIdbwLzd8XWjG/f+AwZvrUwDnY2uQE9hZFrT7dJ2WzFHP12rf/y0C/OHlWV8S8TM96tmYsnVhaKxo7Axd50/k4kvDDKmrJh0H+grESAcP9rmHGJDjOJ7VPY39OLl8VYKrATcZ7yYK2I5elItlTxauekLKO71cNeEnfQWUz0PnwKvmQ7vlzfGuJ4hsE1k4m/GnYflZS3grTVJFAyUA08crjBNEbzSveXxaADuyd6zL8q0lR1RKlVVNGf+tVmFrxGNoK7O+L9XotFZAWsMVTo= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: "Liam R. Howlett" Using MT_WARN_ON() allows for the removal of if statements before logging. Using MAS_WARN_ON() will provide more information when issues are encountered. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index c3ce2bc59412..8fd83f21caf0 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5698,9 +5698,9 @@ void *mas_store(struct ma_state *mas, void *entry) trace_ma_write(__func__, mas, 0, entry); #ifdef CONFIG_DEBUG_MAPLE_TREE - if (mas->index > mas->last) + if (MAS_WARN_ON(mas, mas->index > mas->last)) pr_err("Error %lX > %lX %p\n", mas->index, mas->last, entry); - MT_BUG_ON(mas->tree, mas->index > mas->last); + if (mas->index > mas->last) { mas_set_err(mas, -EINVAL); return NULL; @@ -6529,10 +6529,9 @@ void *mt_find(struct maple_tree *mt, unsigned long *index, unsigned long max) if (likely(entry)) { *index = mas.last + 1; #ifdef CONFIG_DEBUG_MAPLE_TREE - if ((*index) && (*index) <= copy) + if (MT_WARN_ON(mt, (*index) && ((*index) <= copy))) pr_err("index not increased! %lx <= %lx\n", *index, copy); - MT_BUG_ON(mt, (*index) && ((*index) <= copy)); #endif } @@ -6678,7 +6677,7 @@ static inline void *mas_first_entry(struct ma_state *mas, struct maple_node *mn, max = mas->max; mas->offset = 0; while (likely(!ma_is_leaf(mt))) { - MT_BUG_ON(mas->tree, mte_dead_node(mas->node)); + MAS_WARN_ON(mas, mte_dead_node(mas->node)); slots = ma_slots(mn, mt); entry = mas_slot(mas, slots, 0); pivots = ma_pivots(mn, mt); @@ -6689,7 +6688,7 @@ static inline void *mas_first_entry(struct ma_state *mas, struct maple_node *mn, mn = mas_mn(mas); mt = mte_node_type(mas->node); } - MT_BUG_ON(mas->tree, mte_dead_node(mas->node)); + MAS_WARN_ON(mas, mte_dead_node(mas->node)); mas->max = max; slots = ma_slots(mn, mt); @@ -7133,18 +7132,18 @@ static void mas_validate_limits(struct ma_state *mas) if (prev_piv > piv) { pr_err("%p[%u] piv %lu < prev_piv %lu\n", mas_mn(mas), i, piv, prev_piv); - MT_BUG_ON(mas->tree, piv < prev_piv); + MAS_WARN_ON(mas, piv < prev_piv); } if (piv < mas->min) { pr_err("%p[%u] %lu < %lu\n", mas_mn(mas), i, piv, mas->min); - MT_BUG_ON(mas->tree, piv < mas->min); + MAS_WARN_ON(mas, piv < mas->min); } if (piv > mas->max) { pr_err("%p[%u] %lu > %lu\n", mas_mn(mas), i, piv, mas->max); - MT_BUG_ON(mas->tree, piv > mas->max); + MAS_WARN_ON(mas, piv > mas->max); } prev_piv = piv; if (piv == mas->max) @@ -7167,7 +7166,7 @@ static void mas_validate_limits(struct ma_state *mas) pr_err("%p[%u] should not have piv %lu\n", mas_mn(mas), i, piv); - MT_BUG_ON(mas->tree, i < mt_pivots[type] - 1); + MAS_WARN_ON(mas, i < mt_pivots[type] - 1); } } } @@ -7226,16 +7225,15 @@ void mt_validate(struct maple_tree *mt) mas_first_entry(&mas, mas_mn(&mas), ULONG_MAX, mte_node_type(mas.node)); while (!mas_is_none(&mas)) { - MT_BUG_ON(mas.tree, mte_dead_node(mas.node)); + MAS_WARN_ON(&mas, mte_dead_node(mas.node)); if (!mte_is_root(mas.node)) { end = mas_data_end(&mas); - if ((end < mt_min_slot_count(mas.node)) && - (mas.max != ULONG_MAX)) { + if (MAS_WARN_ON(&mas, + (end < mt_min_slot_count(mas.node)) && + (mas.max != ULONG_MAX))) { pr_err("Invalid size %u of %p\n", end, - mas_mn(&mas)); - MT_BUG_ON(mas.tree, 1); + mas_mn(&mas)); } - } mas_validate_parent_slot(&mas); mas_validate_child_slot(&mas); From patchwork Thu May 18 14:55: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: 13246938 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 53E6FC7EE2E for ; Thu, 18 May 2023 14:56:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C15D990000E; Thu, 18 May 2023 10:56:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B7503900003; Thu, 18 May 2023 10:56:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 99F8090000E; Thu, 18 May 2023 10:56:22 -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 8C584900003 for ; Thu, 18 May 2023 10:56:22 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 31C5B1208AC for ; Thu, 18 May 2023 14:56:22 +0000 (UTC) X-FDA: 80803676604.01.01FE375 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf30.hostedemail.com (Postfix) with ESMTP id 8D0AF80010 for ; Thu, 18 May 2023 14:56:18 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=uXvGufey; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="i+o6F0/K"; spf=pass (imf30.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421778; a=rsa-sha256; cv=pass; b=kyBKdEJK8TveP5SvcD/cIx8rmrWLDbCnAZdUIsC6y45t/xzyo/fBb5XgvivOfgzYBK/sUv xF9P1QzShOIV78w5fOx6eOTad89BB1kIswNXB/wqkTd1bHRPOtLPSfXzbMzI1YHQC9lA1V m2Kk68ysDvzQ3cpBbzRJHrLkPB6OSuA= ARC-Authentication-Results: i=2; imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=uXvGufey; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="i+o6F0/K"; spf=pass (imf30.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; 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=1684421778; 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=VDhmyk7oP/1stbX6BGTaGlN6dqJtXdNwYcxrzUyCvQ4=; b=K9diPKughSm1MqRdhzqHTEK94Mt3TwVHG6mo2Eee4lun28NVQZ6mjD/iPtOyMsKMv3Dhfc 4x94/RSJp18ydDICH/wYbgMK8hKKQO8+cFsqR8PkJb+CTTjGZCjwz8CevRzu5MS7ZnQnAn 57EY5FdzwD7ZGVRMYZ8EPYQpDv1fG9U= 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 34I6Iq3r003901; Thu, 18 May 2023 14:56:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=VDhmyk7oP/1stbX6BGTaGlN6dqJtXdNwYcxrzUyCvQ4=; b=uXvGufey76lIxmWIIu9PdtjVtsJavWYY0V92QPBvkPtFr6qIhnRewOmOxmyZbBXMUphX gYqe/vwgjNY0V8tIxBt9kyoCze/xjAhF20kA/jVZvi6yWpPidSVhbVIWdIrVenG9EYAR FMw+Rkrd1jGDnQ7Scf99VN21c0ouxU9OLOaALDpLjJpleaBBjOWZHe++kkhQnbmRQ0cf eUYHD3hr5WjbQMT3duzPd60PXIqlgP87jryzNQbDxX8O+bfa9bBQTaGwwXJmdz9AggLs 2rQUA3Ph5EVxo8gqw4pwBNtPDcU25sRUeDDuYcfeSdBFtz1vCnp+73E/MHr0KontL9q1 pQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qj33v043g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:16 +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 34IDsu25032190; Thu, 18 May 2023 14:56:15 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2107.outbound.protection.outlook.com [104.47.70.107]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qj10cwre5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IrwxaCgRs+OFVFbUGLeWsIXSsgrrPsTObRjWcgpVIUCw/BFVGByyT1Ms6YaKUNlW1wt7G/s/j/ICo/ykk/achYg0zLyJsqCMgPDbPhpyaYuHXlwT6lNsMEdYgUNBIRBXFFapzGDEUaoKjoI6d+KqmScUlhLFV7JAWiqSZsUNSdqyiwjw8CrbbsLc21OfxecbZ/nv8Cc7sFvjLuhkRFxwVFuTwxK1nT1wc1SEqtSnH6BpYrbEK4cJxYaTmlK2322xtB82UOMyW/kGZ6L8m8HEmpDnOmx7u0Dx4/yLDlWY2IWzyKvLtL7xk+LQiY7osq2l4u+BOwASgRxlz/00s2igXA== 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=VDhmyk7oP/1stbX6BGTaGlN6dqJtXdNwYcxrzUyCvQ4=; b=gpNwzK+M4CnK0zL77dxOrhjvxT/kkxnTzbm4o4KvEdPC4gJd+h/ByYgRkLHnW6mKbzzd7qF+DI14PHqsy+OToZHea4rVTqGHlyLvjsHYXRokWx/8yI4ml7FY855kgd7/VbyazxuIxSRb7WgKX5JBOv2Qqj19lGboA02yz8L4tSf27qtCDCSY08R6Ks7cZ9bPHcipTlExGAFtEFcnC+AN59xfOW73AVDAasr3RqvGUZbEnVvWs8CTzx+A1AHtbXHeaB12z2a1XYjlvIf3zt0ZEUA8QiGFDIjeN/AKpvaCeb1e8yl3L3g6Pv0j/ULbUt4GzCmGmPaAjEqf3vj5VZ3l2w== 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=VDhmyk7oP/1stbX6BGTaGlN6dqJtXdNwYcxrzUyCvQ4=; b=i+o6F0/KaBwjyiRvbcaDkb5x6HDis3vbY82e/ee7WJWF8vClabQZkRNWUmDYL4CWoxEcg/u1nvIhsjj9K8LfhB5YsXaLZZr93bZlCy+4vVAd6X5itMjWlrrxXOU26WmWgeXDAkvToJcRfjDO6ZKBGXozVf0Dz+vbrmg1drBxdTU= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Thu, 18 May 2023 14:56:13 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56:12 +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 v4 10/35] maple_tree: Use MAS_BUG_ON() when setting a leaf node as a parent Date: Thu, 18 May 2023 10:55:19 -0400 Message-Id: <20230518145544.1722059-11-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0004.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:86::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_|DM6PR10MB4347:EE_ X-MS-Office365-Filtering-Correlation-Id: 4269abef-2577-4133-663a-08db57b005e1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZFuZi2t9sqcZDDNzCXCIuCDYoQnBf5ovDh1xu7cDDGGys7QmscK5VmrOhrsKRebNwdQeHonGJWpVExepa8v7uCTbuVdu6nd9RqgkK26+gOoaUupvbaO52hQtouOKU5er1TXfKtrx3IhYhwwiCZw3Rir+GPG2addSRz6U01xSi75gbXAe0t1m/B4Zcp0x45PJ51BU+B//ntUmnKq9oyGhCkAZUQH4BkIhKBLZ+bZkHVXL715dT/gSbZ3AMoLwttjmHHnBEr/de8DjOOr6T89vSMX9lQN7bKYCYdeIxPqWaD/4bCsq9ijTSj9nTvEiVyMhv6g7g5ynXU1FB2zbgWlSckLGs6jAuWA9W6hUAY9qFvozURGs+ar5L7sM0cqyATBaklwl5jmESZakp1CFCGI8q79mEirglvlN4vIxL/xHukM3/t2NgEEX5oNAj5yUsR/gMD6T+GPCiabTBmI+7mcW05q7tFPJUi+LqTwsY1M6SYQCeStJW/eCLrg3GdN3SBdUZihxWrnrI37owGRHadeXjBdYcpmWz6Bjj1t5DKlKmi5CjFYD1rh8C9sjMyHVmvpE X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(366004)(136003)(346002)(396003)(451199021)(86362001)(2616005)(4326008)(26005)(6506007)(6512007)(1076003)(6486002)(6916009)(66556008)(66476007)(66946007)(316002)(38100700002)(36756003)(186003)(478600001)(8936002)(8676002)(2906002)(41300700001)(107886003)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: akrhMQMkoKvHbkXyr69YxpfK7W/CnLsWe2uelHEVe31arPXwxxIuQchDFzm/mTQksOsDYfpFtLzrOHk44TYDx1iXlzIyfv7hut1O7X9Tm+E2kOVgVZ0rqIhVFcr5cUOEq8JCuju6XqQAusKSdpIWrCGTlRQuOhuuwjdr5nbjuWPE769bFUKuByK11FhYRSPFLB4rCGI6P756dphVzvNiaMmZQELjg59I9qKtPP652MNFQpiRB3VuRqJ+0Zn49X0tK8X/WdWHXefE7y2m3DzrbSsH3gGqPjXHux/lwWN/BcanuKDIz/hG21SVfuXYPC46c+HWDrGQA79ZUFYcyxOEDMdDo08+B1XG8AmefI3HOIj6cVrYjpMZI/m4OFnTQn9ENpHJnETDlYBoe84mfnyi0+j3rUU9RY7WPLOy+SEgNkrFPcBWGNb6u59rcHfu2gjkLQB0Nk8eqc8eL8QayzJIa+PDGncD0hNXr9uuK4LRSCzLLQxgSqcbnerdZ0fdUEDHvCczjQdArumL3J5OaykEEvBJX+VcZ0ZqWst7ud7B+NKLcmUyiBTH1rQjUFlzogaZj/IoFQKs/DoHrjqPMcbwKhaMXhjN9KfRW6LfowW45Z2c6g59/IL65aX2QetY62QO9ftmw6bhWt6majcbfIpA8X1mdocbmIphLNZ+yEhHqP6y3PnNCypBUOXtjCXa2ItUo+J/6miCmEPuT4HmEK0TPM8L2kYc2opRdAccufcj5qV1w9NKjMelB1lcvO90MUJ+UU0Gw54A4vC5FaGYP52i8VmOCmEh0d5lLc5Xhtuq0fOmhlYtNlcO6NW4eb+86SZA6OfW3nZC+PbviqfYEJX2CH6O5/BY/m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G44K08luNWDRgwCdKkHSIay2Mu6BK1gMka0vxCuM2uIy/KPtQ4gNi1XBJO6qYPYMS8DE9P7e3utmopV1PRG9KTqIrs4t+D6jLzkyYeRRmVZx639ENPEK/3MHvI3Bgqkcm5lSAqfKiWf9x8+bFeFeC6WSU+BwOp5pc6U1mvEu1yeZ4xXtYTJwYMvStxwzHhR3CjdSG3hn5PrO67eLvGmd96NJwr9X5w5RhzmxbD3anSeVFxD7rb63TTQ1F9EbyTj3QOKZG19Etvjb+9WdDHUa3q0g0c7zMYvtp65/0qaTI6G/TsZS8NqeES7T5PcraUQC9nFICBXyqWFkAt+TRWgT+o4gEPQUxatlMpy8Xc7T91FbcPMwZ8Iygkz6iOQPDBKMxzR3gZX1mfNn9eoZ3aW4tld3fkAW9zGWlLwEvJxpWr3n40sCOTLOYXOUMn+S93hWMibFHD7LrNNlDcrwSRPyWqe1tJpkexV1egJVYmSF4Dr5MtqWnwxaTEvglP2sf6aOqghktrS2CF6dsMCHh20IQFKyUWuwMkKuWiBpEgxZlPuTg2APbXUwVXdwri7tZMKZignfQDqVZ36Ncxy+yadz+7Zk0IlEdLH+miukUeVJbxgmOuzZvCuF9Jt+eZZD/t+SOHFXVPQeSVG6wJkMpZe9mtwdKdUp/Q== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4269abef-2577-4133-663a-08db57b005e1 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:12.8567 (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: /dXxUaLB+wtr7cPtm++CVNAso55KOTv7XRzAv6c0zoMDD46HqUFg3UZIqW1TLT/OEhzNthwCXUK3BMtS147qmA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: 37e9NwwdYmB95Jzq96JnACwfoCjKWzpd X-Proofpoint-ORIG-GUID: 37e9NwwdYmB95Jzq96JnACwfoCjKWzpd X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 8D0AF80010 X-Stat-Signature: hduy1us74yr19thx3fy4iss8345p5k8u X-HE-Tag: 1684421778-731356 X-HE-Meta: U2FsdGVkX19P+wSv3Q9KiE+TpPbCUk8Et9Vjb+LjqYNroAZWNs6CYTahGulJjiB2VyQs8Rt5jxbpw9RVPoGgA//y5irsQoVUvY5L2yZWx6wu+THwouwTHCw091gYhZiGUXEsCGCK3QxXjSBu51KDh/a/fJ0JH4B8xmNKHgBN3GrcZ99ekkcgsIXdhcbticwL63arc3zno9GJ1eTTcrgMtzU+5v4XIDydrzIedSAIfxMW1DHcqNHdDQwZ8dCJVKXZm+aRI01jLruujKSyiy27WKRcM+QcUgLVvl3CMoXFkX6MzgjX1LjWouaOxiVT4jPhbXN7gLlvnXNgfyfqyaKOt0VTYVhRB8EIsMGUjhrN7AEnc3k+39O7yLL0zuM+r1MGIb9MuMFi4WOF91RWexua3DQqJWWyla6tFLp+iTLaz27dVfJSyuSvG4xuvYlYkaTwXqsASsTFZGH4UUQJXAVMOLp/K2biRNiFHrC0fVQG5Vk6F71X8CH2yY3JiYT8pY4J9Sdsm7n3R01f0HbFNWQegIieTatt6PiI7nGaDhnADL0wKqb5ZGh0KN4kqmcU/qUycKELKGNPS0gcq5sZxH6pzDxoFk1Ll+7459VoyvPh7HFK8YcZ0G9DhYJcjLnALtlqzh5VR5HOlEM5x9FSxrz2vW3CgqDmGHC5Tpbjlc7hXH7Z2fj6KOapM0hkIayMx8+IKKlB7zoT6RBxkwU7laDG03tc30etoWWiykFqiv/CHdOudqwiHjhfdzv1yC1Yi/rbmb7cSszrqpE/JXA9AeEBiziE5YbsGK5Goqi7tAnPOoi/CDhvbCf0lN5LD9KDQtwEbwPAZBFNOCTQVvRIzLpm9Tmb6lVvnv2nBnH3fD8W8xV2nfVjQCk3yUlv71CM5MjdeAo0PYa6B2wUesJh0YmNgOJzRpuB/T1UxAtrIdEQ0qD5LPnc7+XA9SNWEVsJqRfy+nFjwNR6VWqtcp1X2+U VxRVVr0P hkCFrg6UeLwsUq6h7wSZXl01hdFVgctnLjmdKEacJj53pylMgncFgnR06AzdlCvnmJvX/93eyEpE3wQzS4wrv6m+bvBwfb3LeRqGuDde423rJMC9/7v6swOVU5/FIc96KbXUeM7DCiBWjOTBL+Afhkwx5C/Uy5q0Q3HtObRdcVUF1ReOgspaN5DAkYDLLrVjPQrYQN/YzW9ozccNugjyqxmfnrA4g06fCz9UA5xZHIqDGAY7uo6TgSs6UA1CcAdhZyQuIoaYAJEAmIFUusP+ABWvbm8R6/8HPQ6knoUqPjJBYMysEz57B6SEbUbSQDFg5ebCDsTV94DAmnPglWC9+8UXmaRWp79knRLFUudKG1sqVpjVJ2MFU7fpQ3q2pga3x3CE/PEFUvWbzEhuSv8t9/np037xp+GPOH1fA4kYFv3TxrSw= 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: Use MAS_BUG_ON() to dump the maple state and tree in the unlikely event of an issue. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 8fd83f21caf0..a594f1d88d06 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -453,7 +453,7 @@ enum maple_type mas_parent_type(struct ma_state *mas, struct maple_enode *enode) } /* - * mte_set_parent() - Set the parent node and encode the slot + * mas_set_parent() - Set the parent node and encode the slot * @enode: The encoded maple node. * @parent: The encoded maple node that is the parent of @enode. * @slot: The slot that @enode resides in @parent. @@ -462,16 +462,16 @@ enum maple_type mas_parent_type(struct ma_state *mas, struct maple_enode *enode) * parent type. */ static inline -void mte_set_parent(struct maple_enode *enode, const struct maple_enode *parent, - unsigned char slot) +void mas_set_parent(struct ma_state *mas, struct maple_enode *enode, + const struct maple_enode *parent, unsigned char slot) { unsigned long val = (unsigned long)parent; unsigned long shift; unsigned long type; enum maple_type p_type = mte_node_type(parent); - BUG_ON(p_type == maple_dense); - BUG_ON(p_type == maple_leaf_64); + MAS_BUG_ON(mas, p_type == maple_dense); + MAS_BUG_ON(mas, p_type == maple_leaf_64); switch (p_type) { case maple_range_64: @@ -1740,7 +1740,7 @@ static inline void mas_adopt_children(struct ma_state *mas, offset = ma_data_end(node, type, pivots, mas->max); do { child = mas_slot_locked(mas, slots, offset); - mte_set_parent(child, parent, offset); + mas_set_parent(mas, child, parent, offset); } while (offset--); } @@ -2705,9 +2705,9 @@ static inline void mas_set_split_parent(struct ma_state *mas, return; if ((*slot) <= split) - mte_set_parent(mas->node, left, *slot); + mas_set_parent(mas, mas->node, left, *slot); else if (right) - mte_set_parent(mas->node, right, (*slot) - split - 1); + mas_set_parent(mas, mas->node, right, (*slot) - split - 1); (*slot)++; } @@ -3104,12 +3104,12 @@ static int mas_spanning_rebalance(struct ma_state *mas, mte_node_type(mast->orig_l->node)); mast->orig_l->depth++; mab_mas_cp(mast->bn, 0, mt_slots[mast->bn->type] - 1, &l_mas, true); - mte_set_parent(left, l_mas.node, slot); + mas_set_parent(mas, left, l_mas.node, slot); if (middle) - mte_set_parent(middle, l_mas.node, ++slot); + mas_set_parent(mas, middle, l_mas.node, ++slot); if (right) - mte_set_parent(right, l_mas.node, ++slot); + mas_set_parent(mas, right, l_mas.node, ++slot); if (mas_is_root_limits(mast->l)) { new_root: @@ -3336,8 +3336,8 @@ static inline bool mas_split_final_node(struct maple_subtree_state *mast, * The Big_node data should just fit in a single node. */ ancestor = mas_new_ma_node(mas, mast->bn); - mte_set_parent(mast->l->node, ancestor, mast->l->offset); - mte_set_parent(mast->r->node, ancestor, mast->r->offset); + mas_set_parent(mas, mast->l->node, ancestor, mast->l->offset); + mas_set_parent(mas, mast->r->node, ancestor, mast->r->offset); mte_to_node(ancestor)->parent = mas_mn(mas)->parent; mast->l->node = ancestor; From patchwork Thu May 18 14:55: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: 13246939 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 25A19C77B7D for ; Thu, 18 May 2023 14:56:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B0207900010; Thu, 18 May 2023 10:56:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A890C90000F; Thu, 18 May 2023 10:56:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8B40E900010; Thu, 18 May 2023 10:56:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 78EE0900003 for ; Thu, 18 May 2023 10:56:25 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8DAE516021B for ; Thu, 18 May 2023 14:56:24 +0000 (UTC) X-FDA: 80803676688.11.8A3BEE9 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf17.hostedemail.com (Postfix) with ESMTP id C72234001A for ; Thu, 18 May 2023 14:56:19 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=hvi3MrDe; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=NRtpEKvz; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf17.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=1684421780; 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=036u3Np0Z36ocna1vzafx6uHq45BbcXy2glhvh2TOgM=; b=6SESd6aowVxr70MckkUh3MuFLA2ietp5k/3ZuSPAB10iVRwQuaKsRhExru2RW17q9ugfKw 5TfX7tvtXiZSY0R99kEi0VGwzmbA+41QFXVeGKRY4erzi+3MDIiEaJJDrQJ0vYndn/SPs0 le9YHwIz7iCpGFbVqjZIgF+Gn6FYq+w= ARC-Authentication-Results: i=2; imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=hvi3MrDe; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=NRtpEKvz; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf17.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=1684421780; a=rsa-sha256; cv=pass; b=sIkQm30L1/0UznkdPjMoBCY5pOl6DjdxW1HM7r0r3HLgZ5PwsJbWIq3oqcCG9R4zsIZJEk mVpNt8nZf9Hy51+O7tgG0RkrVS97FxC5/L6h35MjdsoZ/rLL1NHLxabrMJt972syGagHNv ANfwzhSk1KKpxzZ//0RlCWvwf0tq+Qk= 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 34I6IqxI003904; Thu, 18 May 2023 14:56:18 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=036u3Np0Z36ocna1vzafx6uHq45BbcXy2glhvh2TOgM=; b=hvi3MrDefed2tIKCpvjfMw8Unh25ICT7jpd/IQacZE5ou+xh/vA/gkMCjskNmvg0yzR3 P1IsezX32l3Y/5iESrD66yjYoIxFv5OgvSo9Uu89fiB6Z1uNRot9FwOGsgI4sUoJnYgH do7XI57TtIdQ7o3GSQAhdehBpbuYCnaGUROqsxtBjemcNl0Tck/8FgQCXJQbeNwc2PyO DOIoo0HMVVBLrrCNehS8aFG2P2BcC1S6DA8RHresZ09cdQ2NgQqTEih+4BC9CO719hVx LtZkRDgf7g1LQEZxKHwTQXX7Yh1ByEIsAVHT7gvZgFxkWcHgtaXwjmc30xFp/EsREoZQ jA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qj33v043j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:18 +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 34IEIxHK032121; Thu, 18 May 2023 14:56:17 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2106.outbound.protection.outlook.com [104.47.70.106]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qj10cwrgw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nHmiyYdd4foSjSoIL/OPxP2G885OV4W+xpoV1yEJh6a0Mziyuvz6alxnEctmad+3L2uRt54376gdS4w6zx+iRMcBfF46u5LKi4fq3m5AjyYPOoOOTWzWL42dqc+G7jBYQupAb5kmcHtcW2KEp7KYwK/1Txd0IBVoFy92cDzK2vfR3uiajvTEVDA19989SEJJ1QqcdoxWRfjl4AMt0PcCLmQ9R+cp6MRbCSS7LL7aArq1wwkbo9HcPMh+o38eKH1XuIFLJ19gxMkpD4J9Je4H5Mpe2yfntUFJ2RgjUg1XP2OMRy/k7d2EtSXZtE1wpwabK5/XR+ykiqkoEbrMZUXHVQ== 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=036u3Np0Z36ocna1vzafx6uHq45BbcXy2glhvh2TOgM=; b=jWHvhzSEgjfKgU7zCAWH/QaQoBozHO9pAZBFXhZMEgwspekVNOGX8+OJSi974XpiB2K2bZaMxC9G/JphP8LNqRLx3BC5ugEKYXFkTClXnmRIUQ2kXDHS3tSF7tIpRY7mAuDI1qq3rmEt0vmBXASAGKO3vJp60BTui0hYvvXxiBQT46ydHcGyRc/BJzbK2qPiLDIZhFa/WXfSZa9BN32cbEggLIhxMPTVheOr5pZRRbBSCnps3z2NSw5lI6EEhlKGh6+uiPOyPiR2CgZT8mBzm6MuPEddDSfAuLzgvoKGgL6bsOAm2XFY0dADGwzxPizVulMzAGfEeSUR3vJUGwaieg== 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=036u3Np0Z36ocna1vzafx6uHq45BbcXy2glhvh2TOgM=; b=NRtpEKvzcS+UI7ZQ1HFjA0EtT8YIud1i9Z6HYnRAHOrosch5H7a3boKhSFwdhIfhc+ldjXLNx5DiieUla3vXqaTi1/gn1XDlaK9l3HKm7xE3AMoPwZ3F7mQONIWTEXLfdraBAAFkVAOQZohvbCpG/o2dkdZ2MZ04dIc8b1/0oCc= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Thu, 18 May 2023 14:56:15 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56:15 +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 v4 11/35] maple_tree: Use MAS_BUG_ON() in mas_set_height() Date: Thu, 18 May 2023 10:55:20 -0400 Message-Id: <20230518145544.1722059-12-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0009.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:86::21) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM6PR10MB4347:EE_ X-MS-Office365-Filtering-Correlation-Id: e2a29ebe-abf3-41e3-fed1-08db57b00765 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nNDX51mYlwmH6P9Bq4jaBsMufTuAhpUd2rmtFj9d9XGEnsuvkq5gf0Y1Ts/5bKtlZD+waZerMKgn+3gamFj6Rw2Vsaj6WzQFtgjZ+H+oS+A6jkq+t6N5cnhBZsGEyXpqJqF8LaMEN0Rm4O7XjP8dl2QMrrBqB9IvA1HJ/jr85b5ybNRMSLt9ymnq3sHpKQv3iCgy4PnVHNliLjPexwm2ZLhd8NnD/moxKexSAXBoXTpKiraN8WX2u8AwB+yrh4xT93b7cAvvR0HQm4BfpCbDlew0dDoyaXf32yhxXPaIZVGYiYEIIHyn0/7IdphHUQ0VvunyUmJR4LvbShlagk4q3w6/hfqg69D6SAkYRyewiXFhxoFEPxuN0K80j3FrM7Qmrm3zFjCflQKd4kkp9DR58/cK70UkBvWWwTApk0VG8iyA1zj57SS2Kpue5YRHz8EXsoQlX9pauLdCnVIVeekLlu/k8wAjCL/d8Xh9iuk84fSynCt7V2UYtdR8asRr9zsIe6ySy1m65Efzllo9Rrr3stD1JPun5eA/6nS0JxM45tGbEmklLqF9J0oca/ViDcMh X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(366004)(136003)(346002)(396003)(451199021)(86362001)(2616005)(4326008)(6666004)(26005)(6506007)(6512007)(1076003)(6486002)(6916009)(66556008)(66476007)(66946007)(316002)(38100700002)(36756003)(186003)(478600001)(8936002)(8676002)(2906002)(4744005)(41300700001)(107886003)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cg+KYeQgfl999tunnQdsbEfXaSHz5XpWFuN+X/ZGfn98vS9GW2riC57d7+ASQdHb51goZI17ONwOAdG0bIq8t1fmln6So/QuDPiwBl7vWFm90AnoXe1/rUd5fhN2eJDEnTEyTiVt+VoJarn8oz+T8ld+B0OJxeLOHiMWpPKUXGIV+YHf2jQJ2Mk//65wMyh7uBY/KijBk4bESWKkhviGJFAVXwx5Troq+UeYgL52ku8Q73i/IyHhJMmb3A6rFlGCysLQLK92PLNxpDGD88+bHSE8CNY8ZiKEIjQyKB8G1mOuNqAMO+xigfACafiuZt+up4JY18mltUU4m4TulPujYGJmi8vIChO6vFWe3SDvfh/DnFHZFwTkP2Y5GuM7ViAE/0Um2ZwKLbjgh5eXji1WFGm9AF4qkfPuvhHjzVwk4xxtw/+cJb9re1lVvhMhK5QC5/jGHTt0oQ4tZlVm2KYs8lI7RF1AlKCXYhvrlyEPmlxBjEraP+93772Nm/iWr6HC1B2e5pPpakBubUvRxkWCA6quPrw2RCvT0zDOx4Na/qhu265Baip8rHLCNCrUkZ5dXnmPwTnJ7T/1hqrJfpg+NqNNv4zI5g8k7QkRgiLC4dYLCgKWiVparffs65CAfA/5Dw2S8RlUgKmqSBOLR9XL7xy2OA+3SsH45OqlMcaaaXVvoTuWzQ8zzniDBz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g7dAlU/CCHCig+8xHMEw25YJZpcKYBmYWQFggwJzOKxkKeX5Iu2KWdeKOl8+Vj4R2s5O/n8DuJhpoeQNiCeevlNAm3idrMRnYwqAG97ctthcF91Isq7RCCHoSDJBo4/9G0Ojn8gOYyaysjhgyQJZQAh5QlQf9oCV+5CghOk/IknUJAuPKC1PtDU4Ahg5rRu4TTGRpKr6meideotn3fYPlZ6B1WLyy/B71Ga9bKnObX6laSBMD6aocWtvV5IOTcs2p77umVJpmA3KtNLBjmsadfVRFx0V7gjzd7RyNL6T2yOPbnWRPsfTLbsel31dNKOx5XDSrXWUn/W/o7Hi1GFxoVnQTq/ddNoOu2SxbMO+I3ML5Gx0ntM3J1zsP8HfmGGhmE7vYMElt3DDb4mJhv+Xh/wBfnIcRGkaNYdwv9yjwde7Aa7UgvkTNsHthYWnx19VQoWrD2qH0p0aX7qc5/K/qXoceNnw57k37ciNqhRoWH+ub+Krw/ev0JBMQno3MVu3vChSNvKVU8tC1lR7Y7+/1YSmvHiDjsA5oI9YXvzRg3tTuxkSVth1NnE1CIkZ6henR2KO4er5r3nnXorrfXHjk0yWjjY/e/jc5pTr5M68zcmPuV5Of33/VkDjNayPHHAj86PgZ+6GtKKVJoZ3Oj/vgRCa1jPR1ZUvi/9ckY1ezW+GSxftHu+s6CRgyUhRg/OGLwiOpBTYUMF8/8cPCMgvdaSgFEXwnlrTNQlTQwPhAffjHWy6kb0VdENcUSsVNODcAhFBfAGUhIxvFDFTS6FosgL7/N/mLd/krRX+2a0YIdlq7BnvlyN+x++H8XzSKmrHyqQMTgu46v67NTIhOGFYbA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e2a29ebe-abf3-41e3-fed1-08db57b00765 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:15.4056 (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: FNSUg9jAvQWqqDCnIG0OmbIvKPNxnP3c0I0sHJSAraPiLd1a2WcJfn9lxfl4kFlzrrIB6rdj3QUR1p89DgRakA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: -pMsodl5__u1cw-MHwCjLQ4WtzyHTN4z X-Proofpoint-ORIG-GUID: -pMsodl5__u1cw-MHwCjLQ4WtzyHTN4z X-Stat-Signature: diiet6yc1naa736dbefss8w14msg1gxg X-Rspam-User: X-Rspamd-Queue-Id: C72234001A X-Rspamd-Server: rspam07 X-HE-Tag: 1684421779-98245 X-HE-Meta: U2FsdGVkX1/JdoI1h4CkzK051TpOy7QLU8NAH5sADAM3676coXhETXKP6j2pVGOUlS9tXqeCYKeO0PfLpOqr4t7xuLbm85EjIJcXPplKkrZpKG4mkK0BQok4egVUEzUeoPfG7Q0/emQRmNk7uRzR1jiCEIG2aMG7X6f1Rzfai+S2tAngwU2gWuyQXsye49f53h1XEnppUbPCEm6O2GO4LxX8zro7UqiTxKc1kWYjz616OXYLNurjPpwNSKhZAlsB68b6RfA30ZCWc/6TilNGLiJLHA0OwzTm/0o7ksxfRQzgsgbEfhkUmdh4MI3nKoJKu93918nPR2EiCAikhqd6I00C0GTok9RQfu9y9Pd5JU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ity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Use MAS_BUG_ON() instead of MT_BUG_ON() to get the maple state information. In the unlikely event of a tree height of > 31, try to increase the probability of useful information being logged. 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 a594f1d88d06..da441042ec8a 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -194,7 +194,7 @@ static void mas_set_height(struct ma_state *mas) unsigned int new_flags = mas->tree->ma_flags; new_flags &= ~MT_FLAGS_HEIGHT_MASK; - MT_BUG_ON(mas->tree, mas->depth > MAPLE_HEIGHT_MAX); + MAS_BUG_ON(mas, mas->depth > MAPLE_HEIGHT_MAX); new_flags |= mas->depth << MT_FLAGS_HEIGHT_OFFSET; mas->tree->ma_flags = new_flags; } From patchwork Thu May 18 14:55: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: 13246940 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 1E21DC7EE2A for ; Thu, 18 May 2023 14:56:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DE8C4900003; Thu, 18 May 2023 10:56:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CD91F280001; Thu, 18 May 2023 10:56:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9EED7900003; Thu, 18 May 2023 10:56:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 7C0E690000F for ; Thu, 18 May 2023 10:56:25 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 43B07C04C7 for ; Thu, 18 May 2023 14:56:25 +0000 (UTC) X-FDA: 80803676730.05.9FFF915 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf21.hostedemail.com (Postfix) with ESMTP id D86CA1C0018 for ; Thu, 18 May 2023 14:56:21 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=Wm7+RcP6; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=eoa1fJSo; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf21.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.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=1684421782; 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=+1Cnymg/7mO2nO6mlpzfBpp4aHgiKpcmRjtkpJNYvLU=; b=MUmZOPgt+BcFyF6YJBYaooF5KThjiYGTOELPA/kEWBNPAoF9hz1+pvLLEOZd8vd3Dbvqmp MQ5Zn842PE9vFSrAGKNp5z1o9vWcI/+n208AswbsVRZ4HSKohw901ycqLolqE4yAHcJFAb YZ7S3DiRBEjWbmuDrIC7Hr3C/VNJ2W8= ARC-Authentication-Results: i=2; imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=Wm7+RcP6; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=eoa1fJSo; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf21.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421782; a=rsa-sha256; cv=pass; b=P7N30kFbgvUicFUHxjx85faMlL6NQNXxZ7x8hnb8bfU6rbdgHjvHkVztqTvwMS4JVRejN4 Yhn8HRSdVYx65OqHpWwbwg6GfGMEjHFl2hKhEAGHjsWMa54Ic55VeP1UKZrVafNn3h4nPO wjFUYYCzb0q0hcCQrXQ1NPPP1kRiw0o= Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34I6Iv19012574; Thu, 18 May 2023 14:56:21 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=+1Cnymg/7mO2nO6mlpzfBpp4aHgiKpcmRjtkpJNYvLU=; b=Wm7+RcP6psDXAeM8Mr328Gyj44F5Ujrsdo/HbZhmXffZi2zhE4pTfARx7TfYVJOEuONw S+ZxK68wRQZe6ZrNHEsRZthH48HSWOgtFi7WJ109M5OeJ9ZxUgKiMu1xlE1j1u7233Ti KLX77RWq5xt0MkaPim8nYULZYGXqu3QxzqE8k+wJtVimo3WO3G+ShiUVKfpuR1+EbRqe avsfJMIB7ZFewVoQVZqN6Z954VICBjrq2V0YXFUV6OUburx5kq7PV0sBgTLD6x5Nda4J DURd/fDqEejJtqHLzcfbECpl2j2EdgwdtMaYaqrTKjIQcjEORFbWQgaEXW1bmcoqvZ7c HQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qj2kdrgxc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:20 +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 34IDMtjY004153; Thu, 18 May 2023 14:56:20 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2107.outbound.protection.outlook.com [104.47.70.107]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qj10d67c6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hKphV88DHwmuTQIXLpPqtdKOc8PgYy1ngTJ+Q68mQhdwnIZvZFY9pYAD7gHvNTJ+h6znbj5AmPdQeL0td6/I6bAge66PQmxvTeVFtQp+vKwzYpWBiRM5h7YSh4nJ7xzpKoJbfRUtBRMhgDCqPwEMJtEN9fQdLOy3bnHpFVc/wyFNJi3RCPkI66DK8RK5bQhRXU5GBRd5z5D27sSQl9BLzX+DGpvb1Sv13gQWs2bkgV35lPg1cX0PCBPHBwXMP5rqIjMM2zKK7OtyAgIsYRiYBgBSEAyg5d/OU4OSmp/UfoyoL4ZGjejAT0Kb7D7LC62ICE19GgkFYsYFbFC70gRCPw== 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=+1Cnymg/7mO2nO6mlpzfBpp4aHgiKpcmRjtkpJNYvLU=; b=HkbI7rcAY9HAhyJks5+bVXxDIblaHEbYYhUWiDj8axOCPNNwbU6X4aQ8CWWQnlO2WA160JBk3fAaIqTcuRdHMu2U0GnecJwKv4bvt91Jax647dvPny04uyeQ016+AYqx0gp9tyAUxAvZmxP8UsYadqxyM9RS4LxqzYZoJeO89+4ADmGkkqWZQnGzcxB0Nhy3KvYLiWNUjAlxhrix60BKAvKOcyjnAZ1JHAO32x+e1/XODVPNZC6On09Sin6r92Z2N8v9KqwhYtyNmJK/0QSXnZNixTTRJqadUQiYHVlm09IAWSXw1fx3aV9G7SUbWAc4NEq01FHLxUwc5iW/GJvvZA== 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=+1Cnymg/7mO2nO6mlpzfBpp4aHgiKpcmRjtkpJNYvLU=; b=eoa1fJSok0ZweMopdFVzFu6/FUmYifE3vWlhI0FnoyxUiGS9pMEyVQnSWJp5u3IoCagvwSXAcCvmstt92na0v/3Ridvrj5+5yFS0u7SAo83tPtLMNH+HpQusiHca/E2WFII340VARA+iqS7fhGxNezzNED/mYkXbEQPDO0e+A/w= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Thu, 18 May 2023 14:56:18 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56:18 +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 v4 12/35] maple_tree: Use MAS_BUG_ON() from mas_topiary_range() Date: Thu, 18 May 2023 10:55:21 -0400 Message-Id: <20230518145544.1722059-13-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4P288CA0008.CANP288.PROD.OUTLOOK.COM (2603:10b6:b01:d4::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_|DM6PR10MB4347:EE_ X-MS-Office365-Filtering-Correlation-Id: c1fae5ea-11d1-4c0a-df41-08db57b00955 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7fSbEg9awxoHeKFAc0ODXlmPmWQ80DWHn6JX2jUIz7Ka3uAQ8DRW6NNp9txjWHK2aPgkUV5s278rsN7114S0hgGMdmcqjU8op0VBkdkgLc5sBYNh8gluMCvXxo/tosACNgydlfFzZta6UnfWYK3BQU9cgBEQXbgY5QNILClRt06LMJzDvJB/onPvswCqzm8DNtTxwvJkqfDOMtJS6dsPvmZSYytpw00hXDocVyTDpHVmowVNKg3nnFJz6MrHZ8dXBuwQ6Fd5YGtg0eQBGwhfW0yPzu/50J3o4FyU4u0B6+zq9qoyohzcAjxbN6t+p+jJTyCDgHWEItUbcZXSg8QtWDeOvA37M4XASGCn85m1TNpPXviH9WlVc2SZf3v9RsfPY7ZRqCi8ssY1vawmabQ89CxZCE/SyWUP9g4SVV88ouIIWib7OLthUH3QQ08JCzWHW3Mz70P64dnp14YIchrMmSqiNTKdu9IN8B18Pfs6Mbust2l/7Q/RkL9xaZDluAQ4SweY23JB4TAVDi27BDXAHqnYbmRPWb+B2w/CPG1r6T48A4ZPaKoGm3QgQzcJzc9q X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(366004)(136003)(346002)(396003)(451199021)(86362001)(2616005)(4326008)(6666004)(26005)(6506007)(6512007)(1076003)(6486002)(6916009)(66556008)(66476007)(66946007)(316002)(38100700002)(36756003)(186003)(478600001)(8936002)(8676002)(2906002)(4744005)(41300700001)(107886003)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: p015azz8/5xBh4eRlQJTMe5RmYh3YNN84I7mYs+ceT4i9ltDTgcgGT/tji72HX6LdSXuviNij7xlm2hmoPxvB1VLgRHvsAP4Oo8lT4ixkYT5pWj38LDA8N7mMhGUFDVDrACT0fesyD4x2wT5EYP5AMEmRjReeMAAwj3gQqbJSObrz89qEk/b0zzwy6n6L58vFrjWCwCtZBSOZmFa5+1rQ0s8TcRfKWscSJSo7WsZdsliPJcYPETadDoqw4v8xMVtfMn2yfSXCXkCwyzoCxrUgfWpVEuGFHjwUmSQMD7WsUO/DA8SGHK7uLBoluuXtEPZ74A1k1BGE9RY0NP014dTxE+0HfvfV6sK+0J8aa5zFoBLx0ipGF0y/4oW8PZpAO0FNFUjXnaGwsfw2pNmDEbpbZrkRpbrUH89cvJHBQYvjH3njG7/ZSDXDq74ioiyg0j2MSTNBTMqUirFVtBK2wNCiH1b3oB6bFomN9eqYNq+3eE44ytaxS2+iJ/3IBMwCaKM9OFkZRJX0W/FhNFDI3WoRviC1NX2W3Mo2B2afacKltj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Hop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: pYhbGgMyRLAQOy51i9K/BeAcWlMIPohrK9AltZ2+va/01BdxSkp61r2VOWVzDU8C7R7fRTTyPXwognl6wtISRGS+sXUboS9+dLgwqtu98o1obd4SZSn1OfY9ibFD1jylrYg5dDt1kh9Bx0wmQXwAOAqmSAYHHSzhDRjHAbbyWBGAaq9FUDn9tetOwIHBoA877C0JVW+OJ5UsPe8ws79q2L6XcNMQlOjksQyMuque+7gxTLMJ8B09V+G/wF1jR5jlvxF/j5i/pgCKNs4ItzutiRGLEwLCnGVM3dUqjQ6d8ws2Fc8/8naBONvZPAclnokeMx8KRPr7Nueo/YaD/lk0KODF30mAN7z0xr4slWrtbkJCH/t61Kxp23mHvc0vabP+dQHQKQvpPb+9QJV8WAJjM9aWFWEgn8jttPhVljA4F4ArzXvXMd+Mnjuav1X0kEu1/DG/xlcniwLvnlIR3n2p+dCIAUhUkzWQcRdSK5WwCGj3uVUE5j+3Jmkzz/5O4PFRJr66TNUWExGlulDQoqVIZW/PLyImdmrehYFgnM7tpdzBWKL9zEagZORl7tu5NTl7ndI/Vw7/mcZqzyGV4hUClj+FjvDHdAyj9OviYe3d+x6aunvXFwTrbKmwwykJ4NvXpWaMOK82UQ4mkNkB3s4k5hX04G4It7W8VqzBLiPYB6gmB/woR+JOrkWmWvzz74o7KabfHJvCepxjmCUziCDMogdx9a/hjZMUAgK9VnhNOibJPmfzwefXDSHQpMP+iMtI6u6FIEa7WlsxkwKRK55I7UqsoYYG2KcJw9q8WhR/0ymNIwKEQn3cfHNkkHNsc5jnlB9DHvMuO3KwRRw4RwMj0u+b+k347ok+N9QRoeOoKpvHeyf4RNssub3pU0GJLS+5zY9MF+SOyrELPF1Chaezag== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1fae5ea-11d1-4c0a-df41-08db57b00955 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:18.6545 (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: Ru3PJnR2uupRfvvz7OinE9R9uYU4e5d/rjnvqawPBib5+Ht48vClmwcpVLL1g5FeeMDk6J14AVlsM13gjmFbCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 adultscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: X8EkVB2_hK-VlevvEUyDX4q6VxMad7mM X-Proofpoint-ORIG-GUID: X8EkVB2_hK-VlevvEUyDX4q6VxMad7mM X-Stat-Signature: ug87owuz453xf4ub4udgzd46na4tfngq X-Rspam-User: X-Rspamd-Queue-Id: D86CA1C0018 X-Rspamd-Server: rspam07 X-HE-Tag: 1684421781-592913 X-HE-Meta: U2FsdGVkX1/5tk8Ao09gktVt6acRaz58lRCV19QWkODHSrLVSIdjNDO/31EKeOc/imL8KMpJQu9tOpqb0wPxmS89cZDmqfzSn8bnLyCErCUk2Mart9SJnpNng1JlhY8QLz/x/hclSI1Zl5jWTdWe6DQn3DwGYwecN1Ja25l8tyX2uvd8nfFkpaHU3yqA8AkkRBrsJl9IbVFYA5GURf14Wfz8/hJEdGkNrTJsVK6gL3IqQCIGYFVca294t+AdWy908d/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bQiR6IVbI2uBkCRpwceBgbSFhcpknliEnZeYlajUmGUhfN+ZAAEmgxff3NQ+gShonZFpPifPZsKSU7IkDJamykDyAYvc1JbzqMeQ16qg9gNg51cC6KIDMw1nOCH8LqhUWrYohEAuvhZUe+uISrrZCA== 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: In the even of trying to remove data from a leaf node by use of mas_topiary_range(), log the maple state. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index da441042ec8a..824967872d42 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2345,7 +2345,8 @@ static inline void mas_topiary_range(struct ma_state *mas, void __rcu **slots; unsigned char offset; - MT_BUG_ON(mas->tree, mte_is_leaf(mas->node)); + MAS_BUG_ON(mas, mte_is_leaf(mas->node)); + slots = ma_slots(mas_mn(mas), mte_node_type(mas->node)); for (offset = start; offset <= end; offset++) { struct maple_enode *enode = mas_slot_locked(mas, slots, offset); From patchwork Thu May 18 14:55: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: 13246941 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 7D6ADC7EE23 for ; Thu, 18 May 2023 14:56:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6E56A280002; Thu, 18 May 2023 10:56:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 644EC280001; Thu, 18 May 2023 10:56:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 497E0280002; Thu, 18 May 2023 10:56:29 -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 34EFE280001 for ; Thu, 18 May 2023 10:56:29 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 04799140625 for ; Thu, 18 May 2023 14:56:28 +0000 (UTC) X-FDA: 80803676898.02.0D00484 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf17.hostedemail.com (Postfix) with ESMTP id 8646840008 for ; Thu, 18 May 2023 14:56:25 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=Kec0NXM0; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=rzJIsnZO; spf=pass (imf17.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=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=1684421785; 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=3HZ3vbj+BcfPoHJq+Bw/aAHXzvJwU8JEeXwDTjw2Uc4=; b=a6B/bjQiXK3RD11JUCyB7rj0WBBw5GAPSS2Isw2CQnny20XjaJgOXfIZHbe5WqzRGv7hoL rAH9ZB9igjpCp6l2BnbtgaLYBT+ID3eDMFxPwtTgqk7OypQ9guiVHmxZuEYkxjz7RDVQYt FlLPuOiBmitF3U7+aX1EcLyE2hdxC48= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421785; a=rsa-sha256; cv=pass; b=mD3ae2+yCYSlABrfjbsgnjSYNPfJrkWUtCqmpQEoRfosPNOhnnb9UbzANnlq/zk7C3Yasb X7Qk4dk46ESUBNk/co9wttjBJTuS58rWbO7Zks+H/B0bO6DQ/9yvmAUxfmKZQ+R5GkQyBr dK3PPCPpcocbnHZLraLVwNqcnX5ds3o= ARC-Authentication-Results: i=2; imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=Kec0NXM0; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=rzJIsnZO; spf=pass (imf17.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=pass ("microsoft.com:s=arcselector9901:i=1") 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 34I6IrUj012412; Thu, 18 May 2023 14:56:24 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=3HZ3vbj+BcfPoHJq+Bw/aAHXzvJwU8JEeXwDTjw2Uc4=; b=Kec0NXM08McgcKvYxokypQiz5Mh6VOwzts7DxIICGDOSxb2/Ji9RfmPW8VkVWlq5hms3 4utRGqXg8wUc5SaedVgWgP/NUPFMg/sMX7eyz3dzjxkfKP77ZOSnQ/sD9GS+06ILDRCc RaxBl8uMBCUBJMIV28PYsgxfyeAwsqTgL5vr9/cGk+/wKqrDfsVtq54pyAlptl+DHoQ0 10W27STh3u/27ZxIaGpGPWh1d/JMzqqjN/oT8OYMnJ+9ZTP8tPQoqMwDfWrsDvPU+Y34 2Z8SzRDq/AedM+WbQq/QykhWaO3slTZ11AwqpuSOayj/705vgDdbiy8DkD/QFH6JB3Hh pQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qmxwpjr9k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:24 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34IDWkZr033842; Thu, 18 May 2023 14:56:23 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2101.outbound.protection.outlook.com [104.47.70.101]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qj107c8bq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FolXvrm614XRmiKjY8/B+DjLPNmUBNqdOCdSIS46PpPOalmhxOyFuGVi9OiwOy17RQkQpnG1ES5NYgUG2yWYKXZ6GIcPxczV0cILWexOmv5lWu8/HVFr/TYvij46080KHhYjCKiJIFMYp072l6mhP1BE/adlEgjcb5Mw8EAu8hvz2GeOLDnx8QIp4Vft0RlLzBqqyM/KKxkZmuFHCd+fv5POMzlROb+7XeH3jLYavo1gI3LGKyil3P+SPyb6UwrUm20HhO1aKH1rsIx81mk2xdT88ikfyi7fp+9YtOzdBvZ2KzzQxcOdM/APwv44ETsI4qF0TFIsjXirH4OqIdWLig== 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=3HZ3vbj+BcfPoHJq+Bw/aAHXzvJwU8JEeXwDTjw2Uc4=; b=CRXpBuk1flYLCYs8irOCbpk7xf9N2zlbzm8u9BzGSu881Iz/wglo5ZfeY8qoGm4VbHKxgeaAyKSkpFvpndyIDdQgEp5oi+dt0YAAS0mRht1fuoI/BUcaODMX6COLvwOM0S80ltnC19rqRjZl8Ru1gm8SNAtNhhHYk7wnPzYttqe4crzM8KXEylnpgccEHjUGEkMp8oYf6Pz5ZXGLsy+NmfH4xzNGaRCPA0xcT5bB6vFT3sw6NbSWNBkX4lh+GJgwv70IaYoCBLF/PFyi5tg61b9v05M2yXYZF4YkUA+BSP93RUa3JyubARWmi//JfyNKjgXSt8E2JofyqkE604ZqpQ== 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=3HZ3vbj+BcfPoHJq+Bw/aAHXzvJwU8JEeXwDTjw2Uc4=; b=rzJIsnZOjzyMyETxBtADyX3KdZkjF8/WG5f0jtGOSpdwS7sQ37R2zKfGIXFEOBn48Tr0LZnVIT2BVSmgAyF+u8ZxxNjdhbMApSaYWcLbtZNWlbQZSWufyFovMnKh60sDtc+0i9SLLTvqT+zyCEsC2zejyuqfffDlQ2l5+zZFL1g= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Thu, 18 May 2023 14:56:21 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56:20 +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 v4 13/35] maple_tree: Use MAS_WR_BUG_ON() in mas_store_prealloc() Date: Thu, 18 May 2023 10:55:22 -0400 Message-Id: <20230518145544.1722059-14-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0347.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:fc::18) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM6PR10MB4347:EE_ X-MS-Office365-Filtering-Correlation-Id: e19e0982-f26a-4352-8e4d-08db57b00aaf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M0dRB1YHTU8ZTFcJHQlY4p6dyKep1VxRGOqvbo7kAFjhvqL30fsAcKwF8df4it5nifMCHIxT1B5oo4SVmNbM35tdovYQ36+scDbb81tzqVkCEvgsb2+5GAR1X+rcRMkOJwlpYRRJUx5ubshIaHy5UpHElfjRtCif9FY2N7QhM5mPRjbm03EKJGqwf8s8IaxkiEczQoFxelBQmXe0mPqumkKs7wX8n8SmW4kJB+sM7kpmG7mYUI/hOxcaMdRdmAyHmkZjleR6Zd+hE7bbdsgIH+AkusP6t3Y9lhZN5KFUKvnsDFOAykEN6JrCXa9qcjEPL0kx38NMlD65sNiGUxEmycQcWiABccN8lPHwF6OzDWcYaE+QNJW6igtl1AN0Jzbjc4/iMdkMUFJ/aWDv6g1zO4fcXdzAUG0vOHUqd6aN6+OlUp8tlvQLtNg3Cn3gRGt0C5zfDrg+hbYONyedLn8E5CdYxjdc7SsPBbaOMxR+cTUoMVWdgVD5QOXltBWgwqTanqIKvgTJu42Zehz67bn5Y9RV6wN5OXjxtjRU7/Mhz+MiP+UsSkdxPy8kq0dV6RVi X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(366004)(136003)(346002)(396003)(451199021)(86362001)(2616005)(4326008)(26005)(6506007)(6512007)(1076003)(6486002)(6916009)(66556008)(66476007)(66946007)(316002)(38100700002)(36756003)(186003)(478600001)(8936002)(8676002)(2906002)(4744005)(41300700001)(107886003)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ds10f34JKXV23CENgh/y5uOtbPcEOWqyWtPiGe2rLyBvFPb97Ooxy7D2FlSHK0YS2U/A0kFu6VXGJvNbd14UY8C4qYxH6RAgan+WtGJUr5urcIPbeBAJXH0RfRppWMBsG7xG0t7ie6AWmn88sV1TGuEjRXLzjks9NZ3cgYAP9nTe8yYh4QewJ6LfafjUgaGH4bNZ3xf6PcMO5vLVpmUywnD9vBKdf/FXhFTzP5sBZLmQ/1s2BaxHXfHZI4NqNwV/6OJBDlgssVddo3BGgZe/YcxgFA7+m5FE03BYhsoISI+Pn3bpGstgKD0/1CiB7X8pP2fhRkiZeHCfc+j+vWDtNkrR+llnsS5IWYPFhO7fVArk0mXiV4XnQrEZFeK5CFNdVaqcxWEsGYo9f0CkaT+AEntLlJvNEIJF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Igs5vywG3HLfrCpatFyyOEHg8944yHPnp5mAXJKa3oj6tttYnz9u5v5etpH/GxKeW4eg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e19e0982-f26a-4352-8e4d-08db57b00aaf X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:20.9293 (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: tE7Y34mP2LH4eYyt1yxuObywh8WR5cHt7wlifiCz8YnyOklgSHSCDCk4UIj/1DUscMaoWDSw8KDrr4zj/SxzEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 spamscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: JMHvIFWRoDdEUObgdpQx1OtigJrzvK8m X-Proofpoint-ORIG-GUID: JMHvIFWRoDdEUObgdpQx1OtigJrzvK8m X-Rspamd-Queue-Id: 8646840008 X-Rspam-User: X-Rspamd-Server: rspam06 X-Stat-Signature: cy361et9scyez84p5m6yndpffxpqh9bq X-HE-Tag: 1684421785-993882 X-HE-Meta: U2FsdGVkX18pMPWp6oSbG7vDU1HWnu7u4S/etezTDHdToDO9tmM7FdRFJRDEkuJ4gVrHl9M1xo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o6QOosvHlY5KW7SQTJVlars+xfGCHx3o0O4497BQXrO3yC20/IzSkFmuui6yU2wwKmLVK4MzdFg9KmVh3ZEuXDKIIvIvswDG2tywOUN6zRKsaXny2T3qRAd59v8qJa8e54O5wwH7Fg/h2ZC8IE+piwTG+rq7fXTz1Nw9i5Df1zouqeALrN8d2IWQ0lWapr8ft2fm/sFnbnvFnOs9z+W3hHM0oniHthNOXGQYfNE+hxOzxhckJPp9yYXALh/iwuaPIs= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: mas_store_prealloc() should never fail, but if it does due to internal tree issues then get as much debug information as possible prior to crashing the kernel. 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 824967872d42..d5ccf7bcf3b5 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5761,7 +5761,7 @@ void mas_store_prealloc(struct ma_state *mas, void *entry) mas_wr_store_setup(&wr_mas); trace_ma_write(__func__, mas, 0, entry); mas_wr_store_entry(&wr_mas); - BUG_ON(mas_is_err(mas)); + MAS_WR_BUG_ON(&wr_mas, mas_is_err(mas)); mas_destroy(mas); } EXPORT_SYMBOL_GPL(mas_store_prealloc); From patchwork Thu May 18 14:55: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: 13246942 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 B44B9C7EE25 for ; Thu, 18 May 2023 14:56:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 693FF280003; Thu, 18 May 2023 10:56:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5F80E280001; Thu, 18 May 2023 10:56:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 42297280003; Thu, 18 May 2023 10:56:31 -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 32A9A280001 for ; Thu, 18 May 2023 10:56:31 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 0A0FF120879 for ; Thu, 18 May 2023 14:56:31 +0000 (UTC) X-FDA: 80803676982.20.15EEF8D Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf13.hostedemail.com (Postfix) with ESMTP id 62D8420011 for ; Thu, 18 May 2023 14:56:27 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=wyQWfPo5; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=zpn7uxSx; spf=pass (imf13.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684421787; 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=Loeg5K+AxFuoMDuc5bDgd5qopMfTkWVEkjprcxbfs6Q=; b=YjlQoTgYlOZfJtwgoJCPeUr4ZuMjDFFkyNe6T484WDUIZYA8LvV8pZCaNmG2FZeKWrR8RB x1k6z06iHOJA63aS5SeAqq6cJiPayqg3wLuwj9ynildSvLryyx5d/QrFtxLSILYWfSjZ51 YL9uwgmgMNxZCeMNm5AOZP1/AqtB8TU= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421787; a=rsa-sha256; cv=pass; b=0RYdgBgCeRrhcjT5Qs0+srYv9YgxvyPsV/2WqiF7W/OpuWp6Ujobml4CYV7tuVrH8mWOto o5Ih6wY70mDccMYcT/bJlMpNv4gjo2pgu4LfrYl6BP6CSnrR7naVAG1YWp0cdJyhMza3pd btcZODQenrfHHq9uuZ1jpdmw8knq9/w= ARC-Authentication-Results: i=2; imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=wyQWfPo5; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=zpn7uxSx; spf=pass (imf13.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com 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 34ICEtDO010660; Thu, 18 May 2023 14:56:26 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=Loeg5K+AxFuoMDuc5bDgd5qopMfTkWVEkjprcxbfs6Q=; b=wyQWfPo5jw+2YeoC9iwo/3lMYObpL0nKbARz9rosDIYXthg5Ky1n/LjF0g42yczvVA4H wFcItkynoCwBk5eZsClOpjMv1rz1fmoPWPslvt9au16yXy1SaTzGDI7dLiqmFvOGvWc0 DvVHspAVpyevr6z5rcM3i/dtjobGcIS8b8uozuSi/eYxD0oWepUyjmTbEfmaE1Wt+8OT mYzdIPqgKYog0h6ct2p/Qlw9EhGAmOqDNx6Qk4HFuX9OO6RFUZw0L96Sial9S4U5QKf0 qDVM4h7/hZy68FbHXmAn19sfGnOOonQg8NKe7e8H0UlJJykFiQ+gRXsMnxK3Z38Z65rB Bg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qnkux8ak7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:26 +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 34IE4GjC025022; Thu, 18 May 2023 14:56:25 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2102.outbound.protection.outlook.com [104.47.70.102]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qj106vm9j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jk1e2pUDdctgicmGdak76FX1biAeBLxoBXN4Z2txfuWPxgtbgWEw+eThyvDwzOHx+6IHfZRqQQvZS3/7DGlUQB/gLWqkMGI5AAUdR1co8FkgGC5+Ucekbb2MFE19paYZ6AFOGUE9qz5W6sCosybrv7RGPIZl8eTxD9o25fqwKd569A+4m3DwCuovXeckqymzaEGwwJgFHC/3jJXwNJkuVmkJ8+C7pzD6f4gs71Y8UvVWkYncbe8sDn85Qx2wN0rOSfeLEnFV8gpeOlmMP8v8hVaKO0J4s4tRGVGZSh58R1FrRVWAfueivfjTv5j8w+9M/DWpUC42fqWMWIpbL0XfPg== 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=Loeg5K+AxFuoMDuc5bDgd5qopMfTkWVEkjprcxbfs6Q=; b=U/0NVb9KSUSh9gBjeqhJV9F4aDP2n9vi2zFqKhj+Y/k3p+EJ9TojvruSmTJ4e5bIB6VPcP8FXS61dJnk7sf98OMQgNMJ4cafto7WUEQWc7Hr1ernzjzRzMDcPlzOKDCueZpITCsnBnk4hdJrtCCvBjhek52ZRVv51rm43VqCzzSWCmUMP7rtEW9GTTKkZENULm7rw8QpWALB6znje2hcaoxzZKD4l1QYY1mYF1oaYqKmcUSTNhJjOEyMiNUNiK10Pd+L30Gb6LhlRcI+SjAu30p4yRc1Z7AZXxJJYsrbP9pJDdGnMdQKZaXGj17XhMtaSL1CC0ONGUkyzx08EFdw5w== 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=Loeg5K+AxFuoMDuc5bDgd5qopMfTkWVEkjprcxbfs6Q=; b=zpn7uxSx/vqHUYWk5n72UYwpjhy92qbM5X9WlNXvUGVhAHuo+H93Y1SJ5v1m6YlGhq8QbOGGvm5vIwzDmUngPvncovxUppE0dZd5QtjHPs5KDT8ckQLvdTYTT7zmhiX+x3nkYzYSi01/yEOZ9C46RtFbRiznfjG4NgyDQPxtVJU= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Thu, 18 May 2023 14:56:22 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56:22 +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 v4 14/35] maple_tree: Use MAS_BUG_ON() prior to calling mas_meta_gap() Date: Thu, 18 May 2023 10:55:23 -0400 Message-Id: <20230518145544.1722059-15-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0108.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d7::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_|DM6PR10MB4347:EE_ X-MS-Office365-Filtering-Correlation-Id: a2aeb6e9-7406-4004-05c4-08db57b00bd0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HWXZdMbxWCy+NY4XjImZXS27mW/r28Bs0fABoO2U0SJr4+bt+Az6iRmFBTfP4i6lOnXSB/BImTX2b0sbaf+RNP7zrg52PPeSL8UDDNf+Y0y+oShCyFOUmLg8q3k8/5yWFCGyfKHbIPe0uScy1uugDvEyIscgLsasMmfzY3omGq5aIqI7MixqsDIVp1BAiYrT/WiCe3zDPgqSu2t3OacKyuE2jfm5P+F9wGwgkSI1RRB7CiGNWXw9NoLq1fZm6GOAyQLOwkiIBCTdNoHaoa9DKgv6tPuUCtMWdh2BUA+aLeJ83D7PYFsZJZRM2lY5gvkRE7DWtjivrh602veML1bGec6IPwH6XfKC92h+Kc7uSnFgbPPOcwBu60SUjFqACUf0fT9yhqMkkmCI8jYaRUmnnVhGIyTEEHYdrpZibmQjAEheGFaPdBCqfA9XJSMISdcbksY/euSBBBc/pBHGRrwJtQpMY+DkRyacS6phj9BS4+HNziRv4IxYICiQq1JUzgN2d0XzIlzJPh3hh0f+CK0O3mklsTZbYnX/iE26KPP8r0sqWyNcxCrK6Geexci37v15 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(366004)(136003)(346002)(396003)(451199021)(86362001)(2616005)(4326008)(26005)(6506007)(6512007)(1076003)(6486002)(6916009)(66556008)(66476007)(66946007)(316002)(38100700002)(36756003)(186003)(478600001)(8936002)(8676002)(2906002)(41300700001)(107886003)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VVWpvfEsmBpmTEuKp2WMeWipyU5IXrFdJcz5uvY6RCrwoFbeSPoXHmMHQdRRNV+V9YlEDW7dA5uuHieuK8PvbOepGePo5LGhdd/z2fDeTHu84v/TXq3mpGhEQMGMeA3tlq8bCK6iMXJKHlZtNjx2b6xCgnIS1pfmDvcGxVqp+OzEoHHgDlCVyd0uPurUml0IypNR6Rt9dfd68lThgtsXFb9ZecruYW5gCWZCqUm9/ZitmvU6gmSwtvxGySxIS8K9lD6PDAe64aqzDizETFL5bU7cK8VWSi2GgtJhttmYXnrxNZtODL5vxqbuULy0IwHOS7xntEuslAXRoCU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bbyrnlz1SkLNTiML+MiySQH5Bl8DDeE5omBUvCmW6im72/vm0L7afUwN00clkPG3oJAx0dbjLlriqi2lgA5iBj3MEQ3OIjG+V4KC0y50yTqqChuB34J7a5003UnI56nQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a2aeb6e9-7406-4004-05c4-08db57b00bd0 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:22.8113 (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: HWBpC/bGZY9Mcd7Aira1dXfUKpOi+HtEkgsNZ8H3IKa551kLKZeBrwvF3US0Fgln/p7e6wc5DTRRntMSrfUsmg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 spamscore=0 adultscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-ORIG-GUID: hCMlzqsSuwi1bxTbegoNwJmik0KNaLfn X-Proofpoint-GUID: hCMlzqsSuwi1bxTbegoNwJmik0KNaLfn X-Stat-Signature: gpcefcd56tk68j8jf8beuz9gqiy5eg6d X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 62D8420011 X-Rspam-User: X-HE-Tag: 1684421787-418292 X-HE-Meta: U2FsdGVk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PV7rOivhBM8pTry1V2+tYIKTUg4c4UWm8VXZViVtR71Pe/fKcjIN6RFQPfR5Sq8OcT/p3iTDs90erACgPqJcaRwQDfyN9NVvN1F3sQTR1FOlNTx7d1FwZjojUf0tQB08ukyhxvPhByGoAuAdWV1liRJQ+qY3LTFnxKh7azKoYH1CZHDIUc8AXmRXDZDlyDkbzBIq2LjddJzeKM84sDCdQw26zUbDumh0hHFzzUoghlcfsNjjb5W91ea7buPsDtuc+73Y7IgmLey1mKq0gN8AIhQFW0xOHlfm4ca39vDSHdeBQncv18Mqx4iFOyjpNsGafsOvz30AzBGU= 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: Replace the call to BUG_ON() in mas_meta_gap() with calls before the function call MAS_BUG_ON() to get more information on error condition. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index d5ccf7bcf3b5..d7809a7000c5 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -963,8 +963,6 @@ static inline unsigned char ma_meta_end(struct maple_node *mn, static inline unsigned char ma_meta_gap(struct maple_node *mn, enum maple_type mt) { - BUG_ON(mt != maple_arange_64); - return mn->ma64.meta.gap; } @@ -1628,6 +1626,7 @@ static inline unsigned long mas_max_gap(struct ma_state *mas) return mas_leaf_max_gap(mas); node = mas_mn(mas); + MAS_BUG_ON(mas, mt != maple_arange_64); offset = ma_meta_gap(node, mt); if (offset == MAPLE_ARANGE64_META_MAX) return 0; @@ -1661,6 +1660,7 @@ static inline void mas_parent_gap(struct ma_state *mas, unsigned char offset, pgaps = ma_gaps(pnode, pmt); ascend: + MAS_BUG_ON(mas, pmt != maple_arange_64); meta_offset = ma_meta_gap(pnode, pmt); if (meta_offset == MAPLE_ARANGE64_META_MAX) meta_gap = 0; From patchwork Thu May 18 14:55: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: 13246947 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 ED8E3C7EE23 for ; Thu, 18 May 2023 14:56:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5FAFD280008; Thu, 18 May 2023 10:56:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 53243280004; Thu, 18 May 2023 10:56:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 35D90280008; Thu, 18 May 2023 10:56:48 -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 23843280004 for ; Thu, 18 May 2023 10:56:48 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 048FB1C6D0E for ; Thu, 18 May 2023 14:56:47 +0000 (UTC) X-FDA: 80803677696.28.D153B59 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf26.hostedemail.com (Postfix) with ESMTP id 8D7F6140014 for ; Thu, 18 May 2023 14:56:43 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=UTPS2Nug; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ltpZv+K8; spf=pass (imf26.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=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=1684421803; 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=4MZtDw4J06RcQX0cknN/oceBJwsIK35YZxd7Ng4DHGc=; b=h4adkO0v6fOjwT5ATmR8Ri8EVzkKDGCXgORDoCZ7WTy7rYEPe+XfyPHznvjasPyKM64iyI BHt7KERRDc7WjDNZHas4AJueV/mSFtwR89jSeLaY3qIYTVbuQl6swZ9GdrGSlj2UUj0sKT qmBlH873BJAOunVXss9fWcptZ0yf5BM= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421803; a=rsa-sha256; cv=pass; b=Pud0Vd7EpoBSMDshegZQptmIMx6vZ+Vi+/xsDUPasKOB4lgpZcNh52EyM5gk51IZ6Yje9s vdXJ4ySg1ZNTPS/uNlEY0c1pmfsqQGmUdn7GdhpkTE/CNLMtrSxwts5Pk/mFd0N128MR54 WFkU4aLsy+RkNasGV2qKKgmG4U/+84o= ARC-Authentication-Results: i=2; imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=UTPS2Nug; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ltpZv+K8; spf=pass (imf26.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=pass ("microsoft.com:s=arcselector9901:i=1") Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34I6Imq7012468; Thu, 18 May 2023 14:56:28 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=4MZtDw4J06RcQX0cknN/oceBJwsIK35YZxd7Ng4DHGc=; b=UTPS2Nug2EG4ACSLkTFNvodooAe8r15AhwAV/HfeM4h9WbvIk9sAIqSWDmB8bzgIuOrd nx4Gjt9hRr5Bu/u/rbmUEJDE9XjgjhOAFKiNjEhbr+KSp5w4PM/6X5k79mHcemImmIMR 5af738nkhZCDBh05Dj/RXYCZi/bD9I0QvJQd7pzXXVYr91byP73DV6q74wtoJYIbphSh NMpUxRP2sjwMJ5IpWzQ6pDBqv7/1AZkpusJ0jRMoOt9jk/w40HOgvin3yaE/+VuPLktD BFL7taiCBeQ3gXXIL4R8CIDEqWkS4eDRnJezOIU7j+BAVze7Wk6VdpISlprrReJhRHr9 Qw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qj2kdrgxt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:28 +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 34IEu7OT040086; Thu, 18 May 2023 14:56:27 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2104.outbound.protection.outlook.com [104.47.70.104]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qj106mpsn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D6ji0btn6nba4r2FoksNEv03LqUmjTyzh+mesX7yIQS4RheQV1zqls5tUuyw75A8yjT+l0FStzc5kIAn6jQsmG1nBWs8+lZoyKynXLUBcAft/H+w1VaKXLtNCvUEYLvym944iGMgiOc2xQjplhwITXmW3HNzT0tA+yEcdf690LMIZcXf+T6m0EwIETxtdnUyWasBMMCCx04udpQqEBlkC2tr5uZ33MrmxuPPbyEM/VZnYSOaOGuCeL2XCLzwL1k8wmP0+ihCwFbzf3yHMcgOyyQTHgTpD+z8zYYUxWZksJ1ODe/HrDKF5p+VBFdLwy9y0VGfVYHGQ+2P6wiydsPtMw== 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=4MZtDw4J06RcQX0cknN/oceBJwsIK35YZxd7Ng4DHGc=; b=DojWTmu1jukOhwfZWhArcPjKfYZrpx0XP5qg+JC4AE6GdHsh57Mqd5PCicsPvrZPCETlCVQBYtHw7ehuYJ+VBdPd7s+OcX9/0mctJ1HWO+0IpFG4cXyzRyjdqnrxU24MvXNrdI/OQ4xjYTCYlPGX2WcQoH5088L1Zcv4o97b/jI2X/eOavEnDEod8Q2WAbX0xfSbSf36otIb6qEJrAjJ+pEjJp9tk2zEy8XdTnvLdnwOK/Gj9dBsjGn4FNHHNdZxK6t+EFaGm4U92tQdbabmFh/92dxt9IB21uA3FAGPQ2A/LtvZyM7MzVJQDGbp6GfGNqzSZfAswwLeTOzHme+IfA== 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=4MZtDw4J06RcQX0cknN/oceBJwsIK35YZxd7Ng4DHGc=; b=ltpZv+K8nTHe/OTBMJD1TnXVgeFaBOrTb64lX885dnPfglFCV5J7sC9Bytv+hmbJQKee1cpd7n4XceM0l2wPFdKmXlg4QVn1KoZm9wEN8kHA+qfQIEjnrVdck3Yum/n9QQZgUWQLFXgttaBXIh+3uueLXAyrODoBwGtfXvJEPgk= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Thu, 18 May 2023 14:56:24 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56:24 +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" , Peng Zhang Subject: [PATCH v4 15/35] maple_tree: Return error on mte_pivots() out of range Date: Thu, 18 May 2023 10:55:24 -0400 Message-Id: <20230518145544.1722059-16-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0110.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d7::6) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM6PR10MB4347:EE_ X-MS-Office365-Filtering-Correlation-Id: 0e490de1-120a-4e1f-41e7-08db57b00cf5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HK08ziRtqxRwF91OAShqgIea22V+zaE1YdBdpF38+9CYmhmWb5DUGTLFSk0Dgw/Xvc3vpYkKlCkm0cboHSkuH4zFERo1naGFzdOsLavt8DnPLochgdW3LE0lQ1ibF4By3/YiLdBbzoQJmtHdr9KfhRsdIreRIwzvbCQ9qW/P6KuomwffyA7hHwu0lWfcB+FFkd6IOT10zZT8Rvw0riUsgVTsaC4GvxIswUyANuoYVmbg0COzYXUmmlU2NFDqMIGdDlGssjofoITpn7q88/bCeU0RM3jOpwXnfluaNNW/DiKBH6hV278FSWSXKohR4v5wC/AOaEVv58Sa03AZN17/ftDlxCwU3DaApYMPnkd/sAcaVfzhAOdi+owEZcFezAoguuwb6OW8JfTINouf5NONPVcZ9mSttKjsZTXVGUYb4rpJbhrwZo/5QdWiAM8G/6LsI1/yiLXvvvdwecr/dDYY4mqXKGebDcbh91vnLhKYD+m5WtOnA3kF6qhgiadD5k87fDAo3vz/Tf2RmzoW3fKcIWwVgchUQ2CbNvVkBGZsGL6PWy7n0SnxISQkpD/mmgCG X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(366004)(136003)(346002)(396003)(451199021)(86362001)(2616005)(4326008)(26005)(6506007)(6512007)(1076003)(6486002)(6916009)(66556008)(66476007)(66946007)(316002)(38100700002)(36756003)(186003)(478600001)(8936002)(8676002)(54906003)(2906002)(41300700001)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Cbzn1kSabOocGsfkNJFP7931oJQxQqIAFrnvF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A0R9TlB9njo1mNGkPsfkiVCjrGXX49aLSSod/xLG5pJuDbomAIYpbKRhHW8wkg4gxaXvzSIwO/OeHV6jx99gCia/6Qzh/2XuIT2fjQzkFn7cRJGaDMTCKWTL42njSKc62Y/Bck17ri8Gc8i90tEIgJZApl02FH7nyIZuV5uh/w4280I0ZQS8CZhy2efFpZ48rcYfOoCTSYyNB5ripZR+lgI5Xjh2FdcDcXjFHmBQq8BAALjAUIzY4J4gGIUTMsT1nk9kFmwCJd9dt0L6vIXbonfCb9oK+keAyrhQuBnK3NTu9B98xLNA4QvOdmRGyyDm4yLg1yPoGBGR+2R0uQP+I0WPQzLuAnJiUqFUZ9yzABdvDLtOrUmabaP1SpyDRMfMyjAa8u/QM2izYq7dtH6fmsj3Ha9RoCMLNQpH2a0RVknLOBqjkPLA0rRi6inZPEITIcUD9D/oc9yVo4d6yxpgqlVPL/GWSi X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0e490de1-120a-4e1f-41e7-08db57b00cf5 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:24.7288 (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: 8BuU7IjxRUEzZ0Vk9JUDPnyWEFwgps2aXefEkPcMBZr2rgA0vsQ2FVNteWkcmg4G+JcmTDX5jcJgwP9rjCWSdg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: v33UtgKjWn_jLqCX8-aT7Wi3ERorXtG4 X-Proofpoint-ORIG-GUID: v33UtgKjWn_jLqCX8-aT7Wi3ERorXtG4 X-Rspamd-Queue-Id: 8D7F6140014 X-Stat-Signature: fror8ix8sywqjsfdrxkw4fw38hdxei9j X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1684421803-151659 X-HE-Meta: U2FsdGVkX19R8d3K1xQB9Sbdf0M1iAqmA8ZYEHYkaWE4r4R4S7BRkNCANNwvn/hDmWdu00VckSb1Et/bbn6ZePXlkmwuNmBdUFYr0kv06ZIzxDwuY+G8zbublOj5ciZXtc9CgYqGRMoeVcIOYZ2Bj0pr24qdY1nevLygHkulifkznegVvuMwZtUj867Pr2n3I1CvP5pt0MFOUCSa/rzC0Oi2m8gwuS7kIlwBy8MluSrL/lot+jJQ4aggGP3vjar4w4hvv0IJw5a0OSPZfYyCbn4eRIg6dSLiaz2Jhq3qn4lv1lo/8o2V1EIaXjcZ7AzoR98nLNvnDIB/bqvZTvPOrRpPvyxHFSU+6Bzp6GJhTXMrimjhn4YQLBgjvKjOblmL3WZAPxTgSo3r8JQKqDl9BQLTT0/06Z3HqsOyPD8HHOVyofXHCNM4fCQeAcnE1gYnHoZRrLrOIfDCHS7bsnFPTmlzG9K7IiANwuDaggB8Uyzrb1Twx7aW3VXi0FcYU/Mn+Ka0sdAv2733EJDHWZo4Wy52BVk9LPQBAacyBDP8GlvmgVhQPp+cWkOz6x4VHSnaqjwjpTAiceRrkYesNOdlXB89Q+qRGrkLU/ixpW47qfzeFXKEpPdWKTOZNYG4nPrtiKvLzycT2/OLXfaFC43zhD0lf7vQcezE8hRoM/sPLLSS9iLRh/3RsglzZBphn2hb6qvU+QdMLQDo5Lm/tUJBZdiM+TMpal5uwrs/R+Yc1bZ/+gaNioRm5jDR3FYWuYyCN3DXMJkt4T8P2lqSsPwXE6MDN6p5dl25MOPn92ip82/dJ2gPdruRPx9UyFcC2PBsjr5Pz0LyosHgmc+Zt5P7DM71EpVGh7Ne3e6OyjfIfp6wfMeHcbEmSYDwUEqsq9AHW4J5AqXt4yNroqMPpaZlqICGYwcu1uArMyhsjGUtjT6wT0CFCjOXoq53jQB6577PZ4O9STy+3q2lGQ5xyDc dOnTWPOC /jQpvGMeH1IZWYh65ZNv8kPLiNLwP1gEEKxMdUb29tHgQQCFgjMTxzWIn2EmbFdpLvFailBaX2UYur8pcCfE6dfwkAEw6SQ7x6jOW3couLBCJ2qTjVUMpJkPYMv8sNduntc+lg6TG4R8hmFXlbicW1bPHG4OTpW8CxmqlPz25kF56Dh7dVHvHkO7ay98Itm0UzM81rYIv24pkF4PFY6m4w4Bownb9lnopX5lvdBm2BW6CKJGK2QEz6n2fsDMAfOoHOru8kzLLwEAQJmSuzia3PJMwQipT2+pxX4L5JkVMlv2inyoL8xFnbJms3yVZsDsxN5XhD2BI/T4Zy3vCegxxvmpzKu+PAHd/wSQizclVeu9cKDdagzPJtimhVJVFiIN5fqC556gnM+VPdYj6z4nGHNahvXiAuYDKJMOeALWAPYVHp6MucqH5t+cZkh2IkY4n3xoUep7mgq/nRBkxpmN/kJhsDKrzMIHtS3dNx8V50Jk+zYA= 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: Rename mte_pivots() to mas_pivots() and pass through the ma_state to set the error code to -EIO when the offset is out of range for the node type. Change the WARN_ON() to MAS_WARN_ON() to log the maple state. Signed-off-by: Liam R. Howlett Reviewed-by: Peng Zhang --- lib/maple_tree.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index d7809a7000c5..9f3784f4a5b7 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -663,22 +663,22 @@ static inline unsigned long *ma_gaps(struct maple_node *node, } /* - * mte_pivot() - Get the pivot at @piv of the maple encoded node. - * @mn: The maple encoded node. + * mas_pivot() - Get the pivot at @piv of the maple encoded node. + * @mas: The maple state. * @piv: The pivot. * * Return: the pivot at @piv of @mn. */ -static inline unsigned long mte_pivot(const struct maple_enode *mn, - unsigned char piv) +static inline unsigned long mas_pivot(struct ma_state *mas, unsigned char piv) { - struct maple_node *node = mte_to_node(mn); - enum maple_type type = mte_node_type(mn); + struct maple_node *node = mas_mn(mas); + enum maple_type type = mte_node_type(mas->node); - if (piv >= mt_pivots[type]) { - WARN_ON(1); + if (MAS_WARN_ON(mas, piv >= mt_pivots[type])) { + mas_set_err(mas, -EIO); return 0; } + switch (type) { case maple_arange_64: return node->ma64.pivot[piv]; @@ -5399,8 +5399,8 @@ static inline int mas_alloc(struct ma_state *mas, void *entry, return xa_err(mas->node); if (!mas->index) - return mte_pivot(mas->node, 0); - return mte_pivot(mas->node, 1); + return mas_pivot(mas, 0); + return mas_pivot(mas, 1); } /* Must be walking a tree. */ @@ -5417,7 +5417,10 @@ static inline int mas_alloc(struct ma_state *mas, void *entry, */ min = mas->min; if (mas->offset) - min = mte_pivot(mas->node, mas->offset - 1) + 1; + min = mas_pivot(mas, mas->offset - 1) + 1; + + if (mas_is_err(mas)) + return xa_err(mas->node); if (mas->index < min) mas->index = min; From patchwork Thu May 18 14:55: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: 13246944 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 C6C42C77B7D for ; Thu, 18 May 2023 14:56:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4AF38280001; Thu, 18 May 2023 10:56:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 425AA280006; Thu, 18 May 2023 10:56:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C7B1280001; Thu, 18 May 2023 10:56:40 -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 E9B40280004 for ; Thu, 18 May 2023 10:56:39 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id AF8CF8086C for ; Thu, 18 May 2023 14:56:39 +0000 (UTC) X-FDA: 80803677318.07.2D60F87 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf18.hostedemail.com (Postfix) with ESMTP id 2A0871C000D for ; Thu, 18 May 2023 14:56:35 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=m53dTDfc; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=mxwAgGUc; spf=pass (imf18.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=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421796; a=rsa-sha256; cv=pass; b=NE/hLIrfs5ZoZ7LucfSRNMbxxjwsIb3e/c2qseejY1fQIjQ+QeRawBSdl9zu3dx3DyTKiO cQiUx4M7Fcx+J8zBuyHkkx5hdHdltjdyBJv8Zll/T9env1QfQHkJZbxdeX7ehqJFe/Rbrz OyuRaTn4SxatD7xjZUCYsxjmBfl5z/g= ARC-Authentication-Results: i=2; imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=m53dTDfc; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=mxwAgGUc; spf=pass (imf18.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=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=1684421796; 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=AhOimAGqg4GYCjDL7HXRxE6yLE8kYlwv7NuKQQsWpnY=; b=EB2yzKzu03yywisxWps/qfVm1gEb5dTFA+28JvbMjPubJwMXY8Doa/dyVPtNB83V5XZVo8 f40uaJ0STtkkKL0+bmFkBGtPK6orlyN0qA1VAJj+iNE+GV34rg06ScKgC0zFKr5I+nXjz0 mZGpvuXqFTT8IkniAh9B5eh0QA9c+eY= Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34I6IoeR006514; Thu, 18 May 2023 14:56:35 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=AhOimAGqg4GYCjDL7HXRxE6yLE8kYlwv7NuKQQsWpnY=; b=m53dTDfcFuVO1WHNG2hQG/CI9cHjTnVSdu8D1mnmz/Dt8VXASMhBsMBgcZnlzoXoEYc+ HthDK1cg6d68enBogNuh3inI+zSp+RLg0xj7GVLPapzI3irYcCbJf7XhwKVBddHW8vPG 0nTItAuwVTm0K85bvMoHud3N5Yd6NI1h2ZWCQKczPr+qjNf/f1HAfgXqBSjOLK+JgeWT HUsMnCq9vLD7oO6YA/ax5jMT6G0grHDvFFtskapsXNGrKRLdRWyLxNrwRZQInEiPb0T1 1q6vlhmMkLRnxsIFMYzT3BvwcTbSSqcJefVjMNWSzKqzzuejy9FwkYwsg+RdV9LrUXyt Bw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qj0ye82px-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:34 +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 34IE2jRs025047; Thu, 18 May 2023 14:56:34 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2102.outbound.protection.outlook.com [104.47.55.102]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qj106vmg2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K2mU2vKrYO1S6FzRw3TzNX79e7C91GV8wF82rzbx/TBb1rzjh6QCuYSsq4s72mG/UxBiyyr+blbvV61oilTwM0xsLUwT4Lpn3AhcffL1bmYDfgWzOFQRHjgJTRRqkd4SpukVWYk1hGwBtdQ0OlU65ymykfVjv9eYVbFcHqQyhatG/QW+h53lUw24Nb8NDqMQ9X7LZ6Ggbowo7TUyje05Duep38D1/80lNGyBm9t9Trlfx1OOBWhIWZ3B1PSMiC+t1ZpkLX4n7Wlj195sywfKnF1NA4LoOmhLTwrZh5dHiIy0hBR+HgZOVnsExN3DM69GZcvHcpf2B0ca7SSeFvVo6Q== 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=AhOimAGqg4GYCjDL7HXRxE6yLE8kYlwv7NuKQQsWpnY=; b=F4J5TWW9Rj38hg8f0rPBziSyLRQcMGri82nNVu98nTwe+rsUlyFhDG2MknL1UL3GDlzTrUZkBtb6gGazLmzs00Vuy2csiARkbvx0TmEWtyLcRO1qNXCeAe9bfRgTKcD+wTlr8MoOZt6vTYH1Z/lsbfalY5bejHWwqcA9/V3SOnzif5ydA0qTJjjebKOKyozE6VRRIlgogpt3mzILCP+yTDCn2XUjREdsomX6sMzzsMvl+X6e0Q9HGoprO+TWh0q3IrYia4KK9Y6VlmQvJ/YtrDYF1slJUaxp6BtsimlS65RMnAXh2kb6PFJ98gDwBfZS8Da2haT4pfUvRI3i7vxW6Q== 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=AhOimAGqg4GYCjDL7HXRxE6yLE8kYlwv7NuKQQsWpnY=; b=mxwAgGUcGq8xW7mI6X6RgdUlkgioJIYiReOPdMC6vXu9pp9lkQ4xzzrOqGujQPAq2/uMTMp+alZFJZmug1krWuJmqVdhKgSgguti4INDSopiVzGXSX52Cj4wtHeKtW/zWGzLzPlnF76awnZANKUA3OsSBi9tk9vSk2TrazRYNLo= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM4PR10MB7427.namprd10.prod.outlook.com (2603:10b6:8:181::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:56:28 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56:27 +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 v4 16/35] maple_tree: Make test code work without debug enabled Date: Thu, 18 May 2023 10:55:25 -0400 Message-Id: <20230518145544.1722059-17-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0436.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10d::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_|DM4PR10MB7427:EE_ X-MS-Office365-Filtering-Correlation-Id: 14db782c-ec00-42ba-c60e-08db57b00e85 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s+gHL4DrrQLrTIY/+aieMrc2bCLNbBzOptUH/dOueNV1/DVaKpLraqyIXdXOHmInJNRvIYD3hOrUXmVt3YYYSFe/ITXhPI8UFnJ3131CmZgDBBaTycRXGLtfrqp7bpd7V0n10WHcRPhjpTcKo2dYH1OCPF28jLU3thxJhoyugOwc+pOvkSVsdu++ZEhEIxuYHxtvAYzH93uQfK9hMwmYTNXcmIBSueG/Q7kfikbcX7FM+KtLfDMTgLLYc0UThFOoU+L0yJ5t9ORpTJO/DR/8yh4qGp7EbpypldF44cdkw8l5REZy5ngCww8zwAHqlr44yZIU1OcJdPRzJDOzHYz9VhViLJ1NDo3M3B1TzrFcs1ZT/IBr2AC0Eq0YOCRUol8dHxxAqEkDd/FNRLd5N2gs5KGM4WruQLwgl33rX6/tWchLzjDSzVwD0b9KZ1/IGoRD2l+Ezyp/bdS5+/oLAWT22tiWnmHPWqh1KwgBLQlCeDqOTHD3/LHmQTyQvFzv5HJYd/ungeOI8GoB9q14SG0UfqAIHkoVpa7p3nRyVLv4Uk+o/HQ6MTbfkOSqZBK7xUyQ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(346002)(136003)(376002)(366004)(451199021)(8676002)(5660300002)(8936002)(4326008)(316002)(6512007)(1076003)(83380400001)(6506007)(26005)(107886003)(86362001)(186003)(38100700002)(2616005)(41300700001)(478600001)(66476007)(66946007)(66556008)(6916009)(6486002)(36756003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jUalHPnhdcefBAdWO6u6FJ+DJWez0/QJ+S5rsWf3azbLL8YFxwmtgWSjO3kkkm4eHPMlA42PFZwVpPB4wgELfe2gQnWMYTsTSoYBBKKFVLmJg9VTiNkeuzYgCVdWkp2RxvP9AHPpQDglwm2vic4mGkFYFAxzkRr5oQUyUZs3uuCYizhOPa2+CZHRXFvCmopqqh0d5yozEe4csZef6iA9ZNL5tkvvzAnUju5ZpXQm5lR/BkXWtGf0kT5gLKwvYQ0fMaNNlfymPu4IXoGI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Mv5N5lTVQ2Mca1BN5Z+Z5U3c4+6JO4eqQ3Xp9NFl7CAatQ53gvwY45hjjewn7fRVcKm8pH52MJMvud0hbd2gRXEE9aW9YgFjqzY2jr+oBngm+CtlwRe+2Qn+tOU/1/wfC2dB7M86pNrIg3PCUNrEYTTJ8FkiBoy/jeoQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 14db782c-ec00-42ba-c60e-08db57b00e85 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:27.3733 (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: eFcsQE6dm2uDjeAHU1qcXDXJNUpuDSIsSd8U/7sXwxs97b7lQpLfBzMVzhVup2Kv4IoFaR5vG+Zj/qGZf6GigQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB7427 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 spamscore=0 adultscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-ORIG-GUID: 9aFzYIoYy03ERcOjivn3eoHGHrdh-XxE X-Proofpoint-GUID: 9aFzYIoYy03ERcOjivn3eoHGHrdh-XxE X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 2A0871C000D X-Stat-Signature: nteoekuz4ysw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7bqXnhSnHA6exgxLpFEJG2SBkTuxtENffkmlGhbMh4z/EguQS/kzHiwcQQ1zkXjlyoZiB5fVyUgat4HXFrJgvOgtnp/ZFOAqkxk3P0A8anB7CJna1KvIjwrhfLAu2dH45FkLgPMtS0j26Cw+dit4gzCdkua6NQaQTh4+x35jog0vGPzhYomQcpdcwmolZJdMb5knF1u2EZeAkMznEvgV4BE79KzSmQEAVB020ex74cuIL8Ok9hazS9jFGAHgzF/WVgd5R4fMKIj57AfiRa3jrPZ+2ZjOlkBh7QVWv+sSgE1y6GiXpREICAs6Pn4C2c0ywQHHxwH8S4RqhkNTnAsektoE9vKglmfroRp2gEoxNTGqMK7HWHbXsOY++hpjfY6qrW8RPdmC61keYlxMYm3DwYtK2/18NRlP+OJKlSNag== 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: The test code is less useful without debug, but can still do general validations. Define mt_dump(), mas_dump() and mas_wr_dump() as a noop if debug is not enabled and document it in the test module information that more information can be obtained with another kernel config option. MT_BUG_ON() will report a failures without tree dumps, and the output will be less useful. Signed-off-by: Liam R. Howlett --- lib/Kconfig.debug | 10 +++++++--- lib/test_maple_tree.c | 27 ++++++++++++++++++++++++--- tools/testing/radix-tree/maple.c | 1 - 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index be272aa2fc0a..17ba96a3c7bf 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -2293,9 +2293,13 @@ config TEST_XARRAY tristate "Test the XArray code at runtime" config TEST_MAPLE_TREE - depends on DEBUG_KERNEL - select DEBUG_MAPLE_TREE - tristate "Test the Maple Tree code at runtime" + tristate "Test the Maple Tree code at runtime or module load" + help + Enable this option to test the maple tree code functions at boot, or + when the module is loaded. Enable "Debug Maple Trees" will enable + more verbose output on failures. + + If unsure, say N. config TEST_RHASHTABLE tristate "Perform selftest on resizable hash table" diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index d6929270dd36..93b40a78c4f5 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -11,12 +11,33 @@ #include #define MTREE_ALLOC_MAX 0x2000000000000Ul -#ifndef CONFIG_DEBUG_MAPLE_TREE -#define CONFIG_DEBUG_MAPLE_TREE -#endif #define CONFIG_MAPLE_SEARCH #define MAPLE_32BIT (MAPLE_NODE_SLOTS > 31) +#ifndef CONFIG_DEBUG_MAPLE_TREE +#define mt_dump(mt, fmt) do {} while (0) +#define mt_validate(mt) do {} while (0) +#define mt_cache_shrink() do {} while (0) +#define mas_dump(mas) do {} while (0) +#define mas_wr_dump(mas) do {} while (0) +atomic_t maple_tree_tests_run; +atomic_t maple_tree_tests_passed; +#undef MT_BUG_ON + +#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); \ + pr_info("Pass: %u Run:%u\n", \ + atomic_read(&maple_tree_tests_passed), \ + atomic_read(&maple_tree_tests_run)); \ + } else { \ + atomic_inc(&maple_tree_tests_passed); \ + } \ +} while (0) +#endif + /* #define BENCH_SLOT_STORE */ /* #define BENCH_NODE_STORE */ /* #define BENCH_AWALK */ diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index ebcb3faf85ea..cf37ed9ab6c4 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -22,7 +22,6 @@ #define dump_stack() assert(0) #include "../../../lib/maple_tree.c" -#undef CONFIG_DEBUG_MAPLE_TREE #include "../../../lib/test_maple_tree.c" #define RCU_RANGE_COUNT 1000 From patchwork Thu May 18 14:55: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: 13246945 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 EDEA0C7EE23 for ; Thu, 18 May 2023 14:56:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A3D1E280006; Thu, 18 May 2023 10:56:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9ECA3280004; Thu, 18 May 2023 10:56:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7CA52280006; Thu, 18 May 2023 10:56:40 -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 65F11280004 for ; Thu, 18 May 2023 10:56:40 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 060D0AE219 for ; Thu, 18 May 2023 14:56:40 +0000 (UTC) X-FDA: 80803677360.01.276280E Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf08.hostedemail.com (Postfix) with ESMTP id 8B691160015 for ; Thu, 18 May 2023 14:56:36 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=VC2L+Vcr; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=0R8BP09w; spf=pass (imf08.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=1684421796; 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=jgzmmTEKWB0i9WIDRw5vqMkC751jSozh6uHq83GAlk4=; b=3EeAkKLnX8nXW9tFZMUcnfoK3BPBeT2M1HZ5drHK93t6SGYGpIVeegncqYlMu4Xb8VBQIz IGyA+5HhXtHi5NsTq3dtWJC50BlvBm5eFUANKaXBRtRPNelR8In4ms8SP+jZMUKsajSpsi kxANV5A2IMcYY8C0jWReuCarwx8B7OM= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421796; a=rsa-sha256; cv=pass; b=QuUx6TF6djBH034pXKoUaPayBqLWJHBzMK9xjwm4/WhGQCpySylH/JIROOSZ8VgVt8avq6 pxqCFFOlizOuYcQ6WZO3jIqLyBHA8ReH/y23D0jMKVHUJ1ZgHnS5YtB6iM1a3icXvS9HwE d4EPhA4fGSBa7x0Lt/9E2iamf3W0QCk= ARC-Authentication-Results: i=2; imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=VC2L+Vcr; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=0R8BP09w; spf=pass (imf08.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 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 34I6IrCb028533; Thu, 18 May 2023 14:56:35 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=jgzmmTEKWB0i9WIDRw5vqMkC751jSozh6uHq83GAlk4=; b=VC2L+VcrC7WzM+4LH4i8df29aNJ3iplg8P8ZbAOqAkBELEb9Oz9A1O/cBgj1tOAhWzPw mO4Ejk6QUEdFNqsYVD341lM/NUUlDShibj1eF/Fnua+/eBaYMZWu4mDVr3b4fO1cHuO/ +ysgPLCIGVl1zIbZ/c2STX1w9kV5FfARbvCcuT9iMnU6DmLhmTLsUAAzbMKhUzuMo691 uYSjpHyJWnXBoEM76MJOyxdEPFRGwVAibrnblKtRx+TPak0kPKOG4SSpg10cVbQZU5bg fiARZzriec3xOI8tQ/BTSaG9ln1P0DmfvNIh63uWmfELpaTS4LszUovjvknGTSUx/5nV Dg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qj1fc8f9c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:35 +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 34IE2jRt025047; Thu, 18 May 2023 14:56:34 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2102.outbound.protection.outlook.com [104.47.55.102]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qj106vmg2-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KqYkF1GKeYgayPmn8YAtC9CXx3d9PKt0yT1SPHbSH15iMOsHcrsXR52N0i6X4X3DegpKsE0bSKF60gEzFInnUNGAouVEFPoroYHBG1HO1aYbUGd7ikmhZ5ZjcsLXESg+8iQVBzOph+SPdGq/o4dMXeebNRr6Q2QomIwNWzHptBs569/bjWAhNZzIy7wqln1pcYdC0SN/mUURJWTnSpVEfa3pdqFnrlAk6cQeZCS7UOBVHoTGDO6XcufyLminaVsq2uWPFVDCmxchEVeDlt/GOaqfyQoQ+GRn/CbRASOrLyONkSjk2uzuMLstFruc4z9jpFo6yN9/v03sjRuTYoDSYA== 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=jgzmmTEKWB0i9WIDRw5vqMkC751jSozh6uHq83GAlk4=; b=f8maN9mvqxHhKFko/bHRuD3WWmmo7y5JbdaRrsWXa612QAO6gc/Tiq0KXfgpw+L62/hZjdjIGYNVu6CTV0nyB9b9G1jwpKPsaL3FyYxL5EKB4+UVtrhxmLbDW1v4m4znZTmIvIvk096qDXJWzZOVko1U1tM0E8z5MjyTGfzHjciciLo1HwRZWJ4rLOahnu/cspShlJfFkFBc81Y66PeQMHnbCJJsTVFYbnHnbEwrLn+fyh7rPG55WTHoYtUpJurWj6hh4JCByu/OqlDaIyJ6Suet5I5vw4q7W8IKO2wW8LCP+YdKhYGs2tLaiOSWvnxZn7tTDJhAmn20JhBBZVUxhg== 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=jgzmmTEKWB0i9WIDRw5vqMkC751jSozh6uHq83GAlk4=; b=0R8BP09wa2lZAJmKXApwO6FiUIOU1VVCQeQ/fAV0aBv+MVNoEpYhvtShVlbyWr+cuHzjy5VhKQxSdRYq40HVjy6BiFHB+jQDjOv7VQYyGd/sTwFsyjKuWkRaExusQut52uAMYAMUNCp5YwT/f+mIpLbnnlFjuUDEd3eQj+9FooA= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM4PR10MB7427.namprd10.prod.outlook.com (2603:10b6:8:181::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:56:30 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56:30 +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 v4 17/35] mm: Update validate_mm() to use vma iterator Date: Thu, 18 May 2023 10:55:26 -0400 Message-Id: <20230518145544.1722059-18-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0137.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d5::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_|DM4PR10MB7427:EE_ X-MS-Office365-Filtering-Correlation-Id: b43756ac-f4c4-49e1-bedf-08db57b0102b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lLRnoW39v3Q9ppxPaQKXOWfYQSlOGmWrly3JVcTga3lKimcA7lq3Z9e7BdGLA7WCNt9oyoHRvmUFKRoN+N1v2/N5zKFQofp6xdFkSJz9V4l1+dwXVjYtTxcEPSMxP2XgOc3fhV0P6FAFzort/0AzyfhuhoeI2E858xnqV4hIucrl/ISmxO0vMiceUwVT/4lB/A5k3JK/dwTJwpJFiflmHsu00ram/4CtlOdzuBAwZBm3S6/HiCNN3OhijNL4dAgRXouy0AMpCFalxclcctd4NjGFrSRgo+PChKs88venurnZf5CibxTpDpsAsT6C2GeVVpwkCRCNgSDNn+88sscs3S0pF94xSNxsp1Hz2GtYTfLiFqIYtGi9/rTVwj3CzneSw/LwF+C5qAGc2OW5NDAJhPjnrV4q0hmX68apZbRjhDCunm6ZIn2q6iUCCdkov/qvM5qSPa+zuUtkWYXb9UCw6sIwzoyk/lVim2tofUKhhOFRJWOG1LNsgUt/O0r4sq143H/V+oKR4hlFVlMc/2Dc9lRg2bHK2m7MfIlgWuu+C/1+lJp/f3Q5a4qBr6727n+g X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(346002)(136003)(376002)(366004)(451199021)(8676002)(5660300002)(8936002)(4326008)(316002)(6512007)(1076003)(83380400001)(6506007)(26005)(107886003)(86362001)(186003)(38100700002)(2616005)(41300700001)(478600001)(66476007)(6666004)(66946007)(66556008)(6916009)(6486002)(36756003)(2906002)(15650500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JO3nxuezhTFc78H7pJw7yssS43h6TSe/rKZp4PZ1LigUguiL4sG8lA2516tBzI4ljq2Uu1gchBS8C8OQe6KCgHqgQqU6ZAVe7STKd5+pG1G8lTWJ30c1itP+TJLZhF11ex56hYHK+a4pvD48nu0sLRINhxyDbyrDLt9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fZMMVjk7SG50KxRHJThe9UQ7lkBCRbVG3ohr8bsE7JrnnP9+qptngb+5Blr7hcwsJzx3D9o8CMMXEbiChIuZwrlkT5FQ+t1uvF8UVLUhptQEs29JOXeMCPvKcmB1Xa5Ks+XUV6ivmTWbfmvPS4+0OV2M41VOa4Lzmub7FxYpT+K8Pt3YpCKepoEcPh8t0HpYe4R4Ht8frplMzgfAbSv2nrQcAViJ35JqBzCWQLBzMhc/WjfEkichybu9X5HuNp9N9uIvYJX3ytB96svqTkR+dvb6/yhvEoYYsW46LZ204M+0Lg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b43756ac-f4c4-49e1-bedf-08db57b0102b X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:30.1797 (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: RVCvdD3lTANcAh5bcTyM9xQIgeFMsVAz4hHoH/n0vUkG340bcApVES86ftSQbdnnevz7QtXxXSPeTVuBjCgowg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB7427 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 spamscore=0 adultscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-ORIG-GUID: CggSIR-pyJfj6SW50aFit6UDWGN4i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y6A7AB0KtxBDwG0SWe2fwxul+gTu9pH+Kjk3hWQ83lXhUsF8D4V+F3ILCZpOZV+wKPrcBzxxUitg XxpBfME8 KuW3cZglicdZLIMb1ymksbxRMU9mV/KsaamnSexbVWp4LkJRiKhlL81Gx4hIQzsoEPtD+lWoOXsKh0KykKxo+gh9Fg7PuOPavyeNwwNJePty1zBQvnfPDlVgDwHn3xy6mTAN2nP0Hn+Ov6A2COFNA2Giup7dXMqQmCi3uszj6Q97Rp7HBGBOD6MX5Us7Wfgdmuf95UFdhgDhpuQgm+dFsNWMOql9f21da19lhbwGHFAIrpLVB1hRJHffst1e/4yD3R6PMmbsekLrCuJIthmn2JkmBlCZDXtwEd3j76nTqJInshO3qHxpu605cYpY/XyvkxXQSX+8Rugi2m8bVsdmkcbbe/CBek8CQaD0q9dVhW3e3MRS8ROXczFCZ79Hh1nCBR+DpqS5MyVleRlzkMqShmFdaDqBhZ6Y8Jwp0eFh8zs/XwXw= 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: Use the vma iterator in the validation code and combine the code to check the maple tree into the main validate_mm() function. Introduce a new function vma_iter_dump_tree() to dump the maple tree in hex layout. Replace all calls to validate_mm_mt() with validate_mm(). Signed-off-by: Liam R. Howlett --- include/linux/mmdebug.h | 14 ++++++ mm/debug.c | 9 ++++ mm/internal.h | 3 +- mm/mmap.c | 101 ++++++++++++++++------------------------ 4 files changed, 66 insertions(+), 61 deletions(-) diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h index b8728d11c949..7c3e7b0b0e8f 100644 --- a/include/linux/mmdebug.h +++ b/include/linux/mmdebug.h @@ -8,10 +8,12 @@ struct page; struct vm_area_struct; struct mm_struct; +struct vma_iterator; void dump_page(struct page *page, const char *reason); void dump_vma(const struct vm_area_struct *vma); void dump_mm(const struct mm_struct *mm); +void vma_iter_dump_tree(const struct vma_iterator *vmi); #ifdef CONFIG_DEBUG_VM #define VM_BUG_ON(cond) BUG_ON(cond) @@ -74,6 +76,17 @@ void dump_mm(const struct mm_struct *mm); } \ unlikely(__ret_warn_once); \ }) +#define VM_WARN_ON_ONCE_MM(cond, mm) ({ \ + static bool __section(".data.once") __warned; \ + int __ret_warn_once = !!(cond); \ + \ + if (unlikely(__ret_warn_once && !__warned)) { \ + dump_mm(mm); \ + __warned = true; \ + WARN_ON(1); \ + } \ + unlikely(__ret_warn_once); \ +}) #define VM_WARN_ON(cond) (void)WARN_ON(cond) #define VM_WARN_ON_ONCE(cond) (void)WARN_ON_ONCE(cond) @@ -90,6 +103,7 @@ void dump_mm(const struct mm_struct *mm); #define VM_WARN_ON_ONCE_PAGE(cond, page) BUILD_BUG_ON_INVALID(cond) #define VM_WARN_ON_FOLIO(cond, folio) BUILD_BUG_ON_INVALID(cond) #define VM_WARN_ON_ONCE_FOLIO(cond, folio) BUILD_BUG_ON_INVALID(cond) +#define VM_WARN_ON_ONCE_MM(cond, mm) BUILD_BUG_ON_INVALID(cond) #define VM_WARN_ONCE(cond, format...) BUILD_BUG_ON_INVALID(cond) #define VM_WARN(cond, format...) BUILD_BUG_ON_INVALID(cond) #endif diff --git a/mm/debug.c b/mm/debug.c index c7b228097bd9..ee533a5ceb79 100644 --- a/mm/debug.c +++ b/mm/debug.c @@ -268,4 +268,13 @@ void page_init_poison(struct page *page, size_t size) if (page_init_poisoning) memset(page, PAGE_POISON_PATTERN, size); } + +void vma_iter_dump_tree(const struct vma_iterator *vmi) +{ +#if defined(CONFIG_DEBUG_VM_MAPLE_TREE) + mas_dump(&vmi->mas); + mt_dump(vmi->mas.tree, mt_dump_hex); +#endif /* CONFIG_DEBUG_VM_MAPLE_TREE */ +} + #endif /* CONFIG_DEBUG_VM */ diff --git a/mm/internal.h b/mm/internal.h index 4c195920f565..8d1a8bd00124 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1051,13 +1051,14 @@ static inline void vma_iter_store(struct vma_iterator *vmi, printk("%lu > %lu\n", vmi->mas.index, vma->vm_start); printk("store of vma %lu-%lu", vma->vm_start, vma->vm_end); printk("into slot %lu-%lu", vmi->mas.index, vmi->mas.last); - mt_dump(vmi->mas.tree, mt_dump_hex); + vma_iter_dump_tree(vmi); } if (WARN_ON(vmi->mas.node != MAS_START && vmi->mas.last < vma->vm_start)) { printk("%lu < %lu\n", vmi->mas.last, vma->vm_start); printk("store of vma %lu-%lu", vma->vm_start, vma->vm_end); printk("into slot %lu-%lu", vmi->mas.index, vmi->mas.last); mt_dump(vmi->mas.tree, mt_dump_hex); + vma_iter_dump_tree(vmi); } #endif diff --git a/mm/mmap.c b/mm/mmap.c index 76eaf12f1390..bcebfd926632 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -299,62 +299,44 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) return origbrk; } -#if defined(CONFIG_DEBUG_VM_MAPLE_TREE) -extern void mt_validate(struct maple_tree *mt); -extern void mt_dump(const struct maple_tree *mt, enum mt_dump_format fmt); - -/* Validate the maple tree */ -static void validate_mm_mt(struct mm_struct *mm) -{ - struct maple_tree *mt = &mm->mm_mt; - struct vm_area_struct *vma_mt; - - MA_STATE(mas, mt, 0, 0); - - mt_validate(&mm->mm_mt); - mas_for_each(&mas, vma_mt, ULONG_MAX) { - if ((vma_mt->vm_start != mas.index) || - (vma_mt->vm_end - 1 != mas.last)) { - pr_emerg("issue in %s\n", current->comm); - dump_stack(); - dump_vma(vma_mt); - pr_emerg("mt piv: %p %lu - %lu\n", vma_mt, - mas.index, mas.last); - pr_emerg("mt vma: %p %lu - %lu\n", vma_mt, - vma_mt->vm_start, vma_mt->vm_end); - - mt_dump(mas.tree, mt_dump_hex); - if (vma_mt->vm_end != mas.last + 1) { - pr_err("vma: %p vma_mt %lu-%lu\tmt %lu-%lu\n", - mm, vma_mt->vm_start, vma_mt->vm_end, - mas.index, mas.last); - mt_dump(mas.tree, mt_dump_hex); - } - VM_BUG_ON_MM(vma_mt->vm_end != mas.last + 1, mm); - if (vma_mt->vm_start != mas.index) { - pr_err("vma: %p vma_mt %p %lu - %lu doesn't match\n", - mm, vma_mt, vma_mt->vm_start, vma_mt->vm_end); - mt_dump(mas.tree, mt_dump_hex); - } - VM_BUG_ON_MM(vma_mt->vm_start != mas.index, mm); - } - } -} - +#if defined(CONFIG_DEBUG_VM) static void validate_mm(struct mm_struct *mm) { int bug = 0; int i = 0; struct vm_area_struct *vma; - MA_STATE(mas, &mm->mm_mt, 0, 0); + VMA_ITERATOR(vmi, mm, 0); - validate_mm_mt(mm); +#if defined(CONFIG_DEBUG_VM_MAPLE_TREE) + mt_validate(&mm->mm_mt); +#endif - mas_for_each(&mas, vma, ULONG_MAX) { + for_each_vma(vmi, vma) { #ifdef CONFIG_DEBUG_VM_RB struct anon_vma *anon_vma = vma->anon_vma; struct anon_vma_chain *avc; +#endif + unsigned long vmi_start, vmi_end; + bool warn = 0; + + vmi_start = vma_iter_addr(&vmi); + vmi_end = vma_iter_end(&vmi); + if (VM_WARN_ON_ONCE_MM(vma->vm_end != vmi_end, mm)) + warn = 1; + + if (VM_WARN_ON_ONCE_MM(vma->vm_start != vmi_start, mm)) + warn = 1; + + if (warn) { + pr_emerg("issue in %s\n", current->comm); + dump_stack(); + dump_vma(vma); + pr_emerg("tree range: %px start %lx end %lx\n", vma, + vmi_start, vmi_end - 1); + vma_iter_dump_tree(&vmi); + } +#ifdef CONFIG_DEBUG_VM_RB if (anon_vma) { anon_vma_lock_read(anon_vma); list_for_each_entry(avc, &vma->anon_vma_chain, same_vma) @@ -365,16 +347,15 @@ static void validate_mm(struct mm_struct *mm) i++; } if (i != mm->map_count) { - pr_emerg("map_count %d mas_for_each %d\n", mm->map_count, i); + pr_emerg("map_count %d vma iterator %d\n", mm->map_count, i); bug = 1; } VM_BUG_ON_MM(bug, mm); } -#else /* !CONFIG_DEBUG_VM_MAPLE_TREE */ -#define validate_mm_mt(root) do { } while (0) +#else /* !CONFIG_DEBUG_VM */ #define validate_mm(mm) do { } while (0) -#endif /* CONFIG_DEBUG_VM_MAPLE_TREE */ +#endif /* CONFIG_DEBUG_VM */ /* * vma has some anon_vma assigned, and is already inserted on that @@ -2261,7 +2242,7 @@ int __split_vma(struct vma_iterator *vmi, struct vm_area_struct *vma, struct vm_area_struct *new; int err; - validate_mm_mt(vma->vm_mm); + validate_mm(vma->vm_mm); WARN_ON(vma->vm_start >= addr); WARN_ON(vma->vm_end <= addr); @@ -2319,7 +2300,7 @@ int __split_vma(struct vma_iterator *vmi, struct vm_area_struct *vma, /* Success. */ if (new_below) vma_next(vmi); - validate_mm_mt(vma->vm_mm); + validate_mm(vma->vm_mm); return 0; out_free_mpol: @@ -2328,7 +2309,7 @@ int __split_vma(struct vma_iterator *vmi, struct vm_area_struct *vma, vma_iter_free(vmi); out_free_vma: vm_area_free(new); - validate_mm_mt(vma->vm_mm); + validate_mm(vma->vm_mm); return err; } @@ -2963,7 +2944,7 @@ int do_vma_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma, arch_unmap(mm, start, end); ret = do_vmi_align_munmap(vmi, vma, mm, start, end, uf, downgrade); - validate_mm_mt(mm); + validate_mm(mm); return ret; } @@ -2985,7 +2966,7 @@ static int do_brk_flags(struct vma_iterator *vmi, struct vm_area_struct *vma, struct mm_struct *mm = current->mm; struct vma_prepare vp; - validate_mm_mt(mm); + validate_mm(mm); /* * Check against address space limits by the changed size * Note: This happens *after* clearing old mappings in some code paths. @@ -3226,7 +3207,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, bool faulted_in_anon_vma = true; VMA_ITERATOR(vmi, mm, addr); - validate_mm_mt(mm); + validate_mm(mm); /* * If anonymous vma has not yet been faulted, update new pgoff * to match new location, to increase its chance of merging. @@ -3285,7 +3266,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, goto out_vma_link; *need_rmap_locks = false; } - validate_mm_mt(mm); + validate_mm(mm); return new_vma; out_vma_link: @@ -3301,7 +3282,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, out_free_vma: vm_area_free(new_vma); out: - validate_mm_mt(mm); + validate_mm(mm); return NULL; } @@ -3438,7 +3419,7 @@ static struct vm_area_struct *__install_special_mapping( int ret; struct vm_area_struct *vma; - validate_mm_mt(mm); + validate_mm(mm); vma = vm_area_alloc(mm); if (unlikely(vma == NULL)) return ERR_PTR(-ENOMEM); @@ -3461,12 +3442,12 @@ static struct vm_area_struct *__install_special_mapping( perf_event_mmap(vma); - validate_mm_mt(mm); + validate_mm(mm); return vma; out: vm_area_free(vma); - validate_mm_mt(mm); + validate_mm(mm); return ERR_PTR(ret); } From patchwork Thu May 18 14:55: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: 13246946 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 8449CC7EE25 for ; Thu, 18 May 2023 14:56:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5836E280007; Thu, 18 May 2023 10:56:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4E47C280004; Thu, 18 May 2023 10:56:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 30FFB280007; Thu, 18 May 2023 10:56:41 -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 1CE75280004 for ; Thu, 18 May 2023 10:56:41 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id DAB7B120879 for ; Thu, 18 May 2023 14:56:40 +0000 (UTC) X-FDA: 80803677360.27.E069D52 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf16.hostedemail.com (Postfix) with ESMTP id 6387E180010 for ; Thu, 18 May 2023 14:56:37 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=dOUc4NJx; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=QzSHztme; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf16.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-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421797; a=rsa-sha256; cv=pass; b=Qzo6/5DDU9i0WS/apWZSN0AO99yKpb7C4NDXVQszKxTNbpq5QdJQWbGtat6Mp5/Z2nicGP PaO96bVsXMbF2d6Pxa3+h6KVovzd6ChXg43PtAZovXwql0waSiGaSNBy4FvJJWv6di2NpL JT0GJMGWc4yHdkb5AXWMCp1yG8F+Gsc= ARC-Authentication-Results: i=2; imf16.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=dOUc4NJx; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=QzSHztme; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf16.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=1684421797; 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=RveCcSvwg4Nj9ioOmIG0jRkv1pBMfvzYki92JJYfpt4=; b=WgG6pqQbXrXhkyRXhzX1LF8QLFHQlNoDLQmXUrCL84JDzIUmz61F7QAL/RSd64VlsyjBv7 9sLPR/g+Ivav5BClYfEHJsGz29onYwEiu5toSveJEYDDMOCWheql2IQdWDU9RHJj7uds2c WLyY9qQ6KC0Lr8WEM7XB8fpDq4fRtGk= Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34I6IoDI006511; Thu, 18 May 2023 14:56:36 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=RveCcSvwg4Nj9ioOmIG0jRkv1pBMfvzYki92JJYfpt4=; b=dOUc4NJxGf4jRm8jkoC4t9FJ04fgyDLT8qz6hRSRwjCmlisM4ouXsc7xTweLJMvc8kkA ntqbZR7SsKVQ4zHi68je/B0A+YSwk7XHUUTNfkGTCsyIQf0pk3vYEnd4wdsjzu06S75F ZctWSG6C9pCgoQt1fN/gm+19DHPswj9T6IzFqh7VTHXl+hw3RBCjO0eqSHXCDGVvujHP A8s/LR6fb1i0x0D922NjlpQtkFvsuaO5heTuC3RxMCaiTQagH0zEShCFVnpSd55LaT8V u21L40odi/OmSBIolXM/3FuLJFjxLH4X6RJ+lnIQWDPheWKIGlwU4OA/RiH60mBzmCdg 9w== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qj0ye82q0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:35 +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 34IE2jRu025047; Thu, 18 May 2023 14:56:35 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2102.outbound.protection.outlook.com [104.47.55.102]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qj106vmg2-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sk2+3Zfi1PE2JV4TTCdnXCPw1v33CCp8afYud5/ZtTVZY3rPVwZ1qccf/R4E+UzE0SHRlJaRoi3GN9en5Y+bZ7K58J6Mo2hsUKiMMhLGErUxGaZ1RsyePzN2UDJqYUuV6zvSMyJnjmyrqtSLDd7XGtoLem4x8tEGXSUmyF1AQMgFRfO6Z3xxwZMtQI6KpDyshybJawZQDr1Osd+D+9Q0dSckz+vhXwqmY8oVTvhU1jd4VIb0J7/6bIPIlLzzqruQcv9zGOsvz+GwxvbrV+dvNdkPgvuErMacXPmNKuQ/cJZ9sV3qic5iZkXRK6Xn6EsWcq3y4F32icDOUw3S9DHbTw== 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=RveCcSvwg4Nj9ioOmIG0jRkv1pBMfvzYki92JJYfpt4=; b=e5HFn4Ivjgbp9X47X9ogmqCbEzW31AjhBUgSXTaHO7YHVcmH10ZC3R/vRakYzrEbnOLO769XQb+lwbjGxtZRo0lpaUjJ5ePmwVBDKj5vUEGh1YS7cYKF61BMCIf3EYgIv4UvffZOF1usRTvidBsSjf8anBreIwfR0MM/T/GjXryp3Dy/8fG8Wv7KUazwLTWF21grdjtzAgpruNmbSc27WiAROBh7SPVckt0MnPGaAUiNDVGu885p2WQuUpC7+WXBFjgOxpoj0uI4arfaMAsL2jAEqGABhz99h7h9iW2RGLPoyNNF5vwPd1RJhxBxsJeOYLvzp1boIb1sZAkIPuY/cw== 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=RveCcSvwg4Nj9ioOmIG0jRkv1pBMfvzYki92JJYfpt4=; b=QzSHztme4ajPtjSh00b+s6Pl5fBz72UvlFOUq92CP3VlMTy1CUjwLtxVtm39S/wVNowAbjWZGVzYG+mV1+Ujxc22jWdmvxSlC2FpVnDIP8GJmp8Hoe+sj5zg94vqFQl5VIdmRyUDetFxGEBTQUkEXv5gyl/IQIQCsNC7YJLBvYU= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM4PR10MB7427.namprd10.prod.outlook.com (2603:10b6:8:181::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:56:32 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56:32 +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" , Sergey Senozhatsky Subject: [PATCH v4 18/35] mm: Update vma_iter_store() to use MAS_WARN_ON() Date: Thu, 18 May 2023 10:55:27 -0400 Message-Id: <20230518145544.1722059-19-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT1PR01CA0084.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:2d::23) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM4PR10MB7427:EE_ X-MS-Office365-Filtering-Correlation-Id: e7bfcd50-2003-4f80-94d5-08db57b0118c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xVau9lZyxifVZx7NT8ESzi+G/mvRqreev6gWamrHAQB1erShhkJXWreTdL/2rbuC/a7QXuAtLDgHJY+lZBkSHj/5L63X+yR/tSS5UEZJCh3dE1cpz+AsKOWdjjx4hVKHMAUuTbfBVmnRt2We/r/4H5sEYu2fakDcqVakqbYt/CAgBE9cmEP1pfGTDMgRF61bubZ+noMPq7h7MlQln0HE0y8b/Ls+eu9On2X5AkaJY6gabkbrYEA7zsC1RTy8zUGxhxq99HXGQK9AwYeGblRLIaV1/pi18gzhZpOYyJ9CDlgf2ShhcbyoGYz7OLU9WK0ACBhBC28Z8NrvEWzyv6FC2jhedfz5iY5Ux0CIOsLT0xn+bLbf/5zMRtNx6VLOJ48DAk/V8wEtvwRqvpJQR7/lfsKsWoG6s+krQCY04f2PeLhLp+AOinhu5wVprJi4AgBf5P4IivuuNq/c47z4UAGJdnqKK9g+ImKidvNjSH10b0hZKkDEV6Cg2qzQJMHQVxxluU3Sp5HaRkrdcSBsFcdf6WirlA6Kuy5q9vJyL1ysmR1kviWW0YnAl3lxnx3SVcy/ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(346002)(136003)(376002)(366004)(451199021)(8676002)(5660300002)(8936002)(4326008)(316002)(6512007)(1076003)(83380400001)(6506007)(26005)(86362001)(186003)(38100700002)(2616005)(41300700001)(478600001)(66476007)(6666004)(66946007)(66556008)(6916009)(6486002)(36756003)(54906003)(2906002)(15650500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: K6tuF2EPsOT8UuOXvQBXUFeOkpb0HtJhKIbpx3H+u7egJUu14GZkAHFrakyxVBtWj8TWPr49KH5iovfd/2fXWxqlj0Cb1HcI7VYjg57yIv294oAh29vWdU00z3v62L4CKZP8GzLWd84lvr1yGNdnDsLY74O2GgAvCzQfZaevpLLT+Z9rrPLr0OdeqWSUlqj0DN8R56gvwu2ml45gO+TPxXN6uuIEshjkgP1nyIFuq8Q4Y73ju7qvd9o2F6EiabOCJfIaf0v91yykGB/aUjzZFrbVCjRsu7iQZ/uGw4tfGUhkbwUQlnzabj4i+MzN6M9uasJPeIyzDu9yZQqQWM663WMfChvscCca9axXxSlGCcr+Tr2Q6MRV+5QwCm+YoOQ3EcN/8Yo/gORSf++odS8Fy/esiRBEyE1RUmO6XEdvcjN0TBeftMvy1u/qrk5RcJDUeRzRDhv89EDTo62EWJYYSWGRgRrHZh7qnzZPj2Z37yk/i0GBnywzk5RV7g1cP6WAT/T3z1bc5FAJjcwkerce8rApUNVKWc/nJd2RbjTKyROnMFLzdwE/WytAzO37XnObUtLFZdFlzmsIw1YueROtA4xfz1EmwKsCzFtgE948DiptV6syZ5pi4qem8igKZK+JkdPKtAKMv0x49pfONePiv+6Bq3Jkh+c5lwn6V/ve1TVLbJLFUmyvTRIrwOjt9brTD7F3HubjRGAE8AnqLKBB+Ic3Pbl2lq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VQE8LrHmRMi98pBclJvvtOYyy2el72EekIGDz5nxcfFoDfX3C5iXBEJvR+J7oEWF/1Fxyxf+2uAHiOwgDPItpYs8JwaoRNnG97F/wNQsgRx8JZtPcf9x7O2nuMNTUj69jMzvCqVqwgitqS8T7BXdcY77hvQBAstL7SFyV7aPefSzcrAAHTPDb/PkgVBfN766OfnZP3OPBzVmVAAGZoyx0kEsf/NCahV5Mw1j37imfEKC/sAuFOtGBMK3YVLUTj6U4bOtCcWw4aZsGdJ7qhwceExt5yinJqHaaDv6/7Pd2MNKFWacatVtqcK7a5R4q7Z54vxp9OJNTfFU/9XM/sx9XjxIYspd+Wb4L6jev8APLkrUBRONjISEP02GVWd2VHpA01XUMXajoP7q+P+VQXsBmQGhm2EslbzIMBokwt1vY4flWTDx3U0DNM/UoSxfD6S6CyS+PnJ6vYEk9PhQpMmKH0128b2h3PRj/5bBfZyr1dpF279FeQixdU0UZvO2MovE/rncHc0pirSpHKujwNQ/iuZxzhRpcoySkQILAe1pVe24G2PWCdfPJf4tasQTUtX3oTB4dyJTADO1aM8uoIAYdISCwUklgchMM48Hn/oANuex4JMEu+mBjQZBPqDIXcuHBGE4Y/d9yTk3OSLg48ctV2m2dxem5MWVpVuqXTOZXAlhvQ4XP2Bo1fxTd2dej9wZpP9ua/8KL14VUqz0nPBgJxdwX/cjJcR9lxWndZFde9/8Lx3w2AoHlj6pPMdyqjM+iHzBQVei+KpacWSCOdCLDTVdrWx2Idjdkfqzu5urwhSM2h6kRzegJePO3s0EFyGUxlZJhOHvwQIL X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7bfcd50-2003-4f80-94d5-08db57b0118c X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:32.4325 (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: 9FtZeMrzo+fr9H6C97+KJZobZqjqON1RrAW9s3oeOC3Dwh8H88YLm0dbjJ6MXqgsj84phdUi5hvltqypauIwIQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB7427 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 spamscore=0 adultscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-ORIG-GUID: TjvGn7p7v5cv94hSr8X2r-ykWeNCozLt X-Proofpoint-GUID: TjvGn7p7v5cv94hSr8X2r-ykWeNCozLt X-Rspam-User: X-Stat-Signature: 5yaqediec35kho4jwcc4qft7nduc543o X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 6387E180010 X-HE-Tag: 1684421797-726222 X-HE-Meta: U2FsdGVkX1/df6PRT1Q5gxkGqo0kGfhhNMuliD33bq1GleLj3VNnRnR+QXOg6lHpeSW3Z0kNE+yQPxnghXqYnndllJMZLlezzK7k1LKBVvORnInqja7OmgeakDwM2ISaGWT1vAQnpoTH+wCldqWQbUMZrCLztminC/yUebfL0HnFF8BDBmn68m0I2k9iMW9rXdye3e+sS5KE+wkeAjkSFJk+/2we+UXHugKcrhWKaeH0+/av9Vrt7aZMeJlHgnf738+omjBqY7/5LtqWbYoVactXs08DLXbmWv0TJwozou4rw9XdK+P2eChcgsZtBWfVl8zNPBeHX8BWPFxwrt86Fw74dnA9iJExCp58BqedVRmyDYkE9vW4wOYGrzccMQUeBur1ngoIan/4SBD9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W+g5ZbY= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: MAS_WARN_ON() will provide more information on the maple state and can be more useful for debugging. Use this version of WARN_ON() in the debugging code when storing to the tree. Update the printk to a pr_warn(), but this will only be printed when maple tree debug is enabled anyways. Making all print statements into one will keep them together on a busy terminal. Signed-off-by: Liam R. Howlett Reviewed-by: Sergey Senozhatsky --- mm/internal.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index 8d1a8bd00124..644fa8b761f5 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1047,18 +1047,17 @@ static inline void vma_iter_store(struct vma_iterator *vmi, { #if defined(CONFIG_DEBUG_VM_MAPLE_TREE) - if (WARN_ON(vmi->mas.node != MAS_START && vmi->mas.index > vma->vm_start)) { - printk("%lu > %lu\n", vmi->mas.index, vma->vm_start); - printk("store of vma %lu-%lu", vma->vm_start, vma->vm_end); - printk("into slot %lu-%lu", vmi->mas.index, vmi->mas.last); - vma_iter_dump_tree(vmi); + if (MAS_WARN_ON(&vmi->mas, vmi->mas.node != MAS_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 (WARN_ON(vmi->mas.node != MAS_START && vmi->mas.last < vma->vm_start)) { - printk("%lu < %lu\n", vmi->mas.last, vma->vm_start); - printk("store of vma %lu-%lu", vma->vm_start, vma->vm_end); - printk("into slot %lu-%lu", vmi->mas.index, vmi->mas.last); - mt_dump(vmi->mas.tree, mt_dump_hex); - vma_iter_dump_tree(vmi); + if (MAS_WARN_ON(&vmi->mas, vmi->mas.node != MAS_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, + vmi->mas.index, vmi->mas.last); } #endif From patchwork Thu May 18 14:55: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: 13247241 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 DE30DC77B7A for ; Thu, 18 May 2023 18:32:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 52F49900004; Thu, 18 May 2023 14:32:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4DFC2900003; Thu, 18 May 2023 14:32:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 30B2B900004; Thu, 18 May 2023 14:32:13 -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 1D1BB900003 for ; Thu, 18 May 2023 14:32:13 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id CC2D81C773E for ; Thu, 18 May 2023 18:32:12 +0000 (UTC) X-FDA: 80804220504.08.3B12E80 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf01.hostedemail.com (Postfix) with ESMTP id 9A46B4000D for ; Thu, 18 May 2023 18:32:08 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=Ue9frCUm; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=LS+RIyzk; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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; 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=1684434728; 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=JRf5CpRos+iWIv/Z65CbUYb3MhzysGHLrb7+B1JTlcY=; b=C7GdBr52GgAcfOXROAjbdX8INp/ip+wdKwvjQ7mwmP7vEolgRymS4M6g3Oy65+pVduffKY M1WHWqpDr+/eZ/gdv0Z3IL/RSGLy7xV6y0MvxZXLE2yRSjkx4eVvd5z7XXKYqvYxra1iSP +fO+KTELEinWVvTjXOT6isQIVYmAxng= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684434728; a=rsa-sha256; cv=pass; b=ZzECJGR8vYyJQ1cWZ1KTV3Pk+YMdxaUSOW+p+C4DHpNI+q153812HVdgpzgtP8y+p5VAk+ CyJVE9Y4VPJEANY2il93Ua6lPd4661e1T5uWOFdHR/DG1GFRTKTWPsGCXSns2zyQp0tumh bMU0PK1XuJiKU3OHebUmX3p1M1F4LlI= ARC-Authentication-Results: i=2; imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=Ue9frCUm; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=LS+RIyzk; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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; dmarc=pass (policy=none) header.from=oracle.com 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 34I6IrW7012428; Thu, 18 May 2023 14:56:40 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=JRf5CpRos+iWIv/Z65CbUYb3MhzysGHLrb7+B1JTlcY=; b=Ue9frCUmsfuOdCDqknYo3GrfxturMCKbbcvl0z8nbDQSLmIfAwqdblDEAwAOAUw0gbST G+AXq/hjTiCWFngb7m+tgtp7AC6Z+CeLP9O3sq4D53ytoxnwkMPdEz06mq5cB6ghdRIn OeBMzcsJLp88G6OD0M8q0CB5StM4mIhqteakzg5ZwaJyJdo7U1Dn4I3ebhrs20vMgzTw yR1G1gjgKClEe+M9NsZIYb2rNiYuX5hHB+K5zVSJDkumTwvb5ncGqlF8HXo4ZsN3kDjv i2tswluyfODTgqjr9Ot4DOihLUg/J1joGuj7xKXKrmOLN/kUbChQZkMs2RrxY37j33SY 9A== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qmxwpjrap-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:39 +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 34IEC28m040073; Thu, 18 May 2023 14:56:39 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2109.outbound.protection.outlook.com [104.47.55.109]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qj106mq5p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LnPosYn1YGOPL+2wiLUwNuiaWvsjxw829OIXsPSf9iKOkDhuj/h3RZLCLx5uNlPeWk7q/ak5Ndy5remhLIhtUbwhYPUbZXQd/9H3yaXD2lxP8M0lp+aTGG5gYFHAN3t3Qj60N9jJ2FtT0iB6TmzhLak0s8ZOmiTosbG6OCIUTzuaegx9eVmtt7nDQECbfOPpO7kDGoEvDv24RWGgNsIhORNeLbySZGDS5cQHAvsnWC1YDwsNCJQjw722FH/Co2i8IIYT6H07+pUyf+QCl/V4v+Lv4LCax4zaK0s/C1NkRxOTv5azOaEIKUcq0nZ/rXbm8BnexpOxXRE1c0rdWvX0Dg== 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=JRf5CpRos+iWIv/Z65CbUYb3MhzysGHLrb7+B1JTlcY=; b=UOZ67HRjeeXXIHfDnn4qduscIDzE93Zi3qsMGke9Z46BUnbpYrCLByvIm2uR0uwTHyLEnHsB2s9vmE9ea8DjNBUXp0sC8CG7cwkGXTx2jIZwXDrnerC72nSANp9150p3aHM3oZfk5F2N6a5cZArhRX6l9cHZDVEVJQjcqEptwq0I4siNKL10LY6dVWkFxCJNeYvMSukvg5uL37x+UXfat5JG5e+Hm+mumyBc4pn9kj0rVmAeE9Ac7k264ydkn5hk14WMXPJjyOYDVmg2Vs6k7sN1uu9FPyN++DvvH0FR53ZHpwhFfGOeKv2/I3TBYtzWlvpGt1y7rlf8SUGm+CKN3g== 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=JRf5CpRos+iWIv/Z65CbUYb3MhzysGHLrb7+B1JTlcY=; b=LS+RIyzkXJXU56L4a3XJYk0rDsd/Bj9LMyhp8cUz8Lyy97vARN+yuMmFumL/eoWEKKd26SZdneb0BGGTx4g+VfzHaebfSleMiqY7t1iLH6Vgf2wEXqVkDIm46p8e/U8oEGznBXRo7NtOYhJLZQu9TB5MOUcuq6bIa65ACajkn3U= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM4PR10MB7427.namprd10.prod.outlook.com (2603:10b6:8:181::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:56:35 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56:35 +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 v4 19/35] maple_tree: Add __init and __exit to test module Date: Thu, 18 May 2023 10:55:28 -0400 Message-Id: <20230518145544.1722059-20-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0059.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:82::6) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM4PR10MB7427:EE_ X-MS-Office365-Filtering-Correlation-Id: 816aadc3-44ce-454b-c52c-08db57b0136b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dzJZtxg76/uNr96PFKSD7ySuSRGC5RYAmJ+tkfGC8Ke7KCQeXfdWtijXJvAVYXG1G4MRi671/8IKuxZD8DUsnInR5gfNGqwi2gfe6M4iJIy0uPdxSpltDXCQG6IdcsJBiaCDO1wxacvCT6Lt7U0w1XEgIbQyMCohL19qVW3linRatVi1/bqnQYxK/Wc9391FMPkBPOgidatRCywec3t7LfIDnmNwvilaBK+mFpL+F3ZtBRhLVpWqrbj2ApAOHowUzv0KkTTJ3oXtYSBqWQWHFBDpM/Pf2OLi8Ld7iKTFnDbkI4xeYRZNsrctg0J3pTk7lU2dDjnMPUeZV5OtMeX4L6tRjVPgMxdfH1ZxLhvj2s7BhmdkuqaYkLgIXupbtgZG7WP0LQJJrEhpTHNwFT9O9StmnmG2twkruvMagQiIAtqDK/fKRjVNhfB8x8s0psHrYXgJkCmJm/SJZJ4sdocLD6/y2ErgvUPgsBlhGvkv07YX0kbBA7oSF5oNi9x8ahfxjGOy+LQhRrOgOV45RfOIcjnBM8filfbSLhe2wJkX1WDw4p1VK3q3a51ulxaQHWkr X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(346002)(136003)(376002)(366004)(451199021)(8676002)(5660300002)(8936002)(4326008)(316002)(6512007)(1076003)(83380400001)(6506007)(26005)(107886003)(86362001)(186003)(38100700002)(2616005)(40140700001)(41300700001)(478600001)(66476007)(6666004)(66946007)(66556008)(6916009)(6486002)(36756003)(2906002)(30864003)(579004);DIR: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d3XlbP5smFVX3rgz24404qMGovOEDSkL6OI/r7zXWwKNWa4JNUDynHC3zXc1GhJkBLJS4J+ezjSFZ+ASalJMmNXE4s8GKz6pcIkl8MnEQksn4aKT0XMFRbN9pXfnNVh4+T7PVIGtB1Dif6m6tlxFskSRSHH7U9zkpH0nvNwAtTn8vqQnh4EiXQI5s0DkWaCmy5Tq9l1MOKWW2rYKu8KhlE/1N+btvZ/uAONvdp5GXCC5cz8AaDJm45KihAhzrvTUBnuXSDuyLojpW1LQK2rXvX+uiJMTefUQEC+69cRmFXEfSxaqmjeuQyqYmpXcpu+BeimMxcnLXMdwrrQ/Uyr63qvMMwyJnFakiwBcy5TvCGAjsjzh6sb2zCmnEBHWVBRYON+ScXasu/fThWCWdiX3I4zDL0t7gXONfVhh60W5Scha+9Ikvx9bafGIPVa/l3VZrc18N0EOHsLrfH7gdkPLadhjrLkm6CsSHC2s3x9TG3h2pE1UH8/wuvDWfbwKsnJAb9CE2jqUhfRA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 816aadc3-44ce-454b-c52c-08db57b0136b X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:35.7057 (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: uaXkNx0CSjrQiPNvJdxme5aX/wcMTznN8Q9UapUZFdgUw7FkGRVvVsg05L+m2CXLfPprZ4y6YIwmruPFBf4vnQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB7427 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: B9hzyscuY2AO5Z-0yWiuezNa3TNO3d0C X-Proofpoint-ORIG-GUID: B9hzyscuY2AO5Z-0yWiuezNa3TNO3d0C X-Stat-Signature: p4canwf3quwzsowtabrxoo546jqu8f4n X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 9A46B4000D X-Rspam-User: X-HE-Tag: 1684434728-229060 X-HE-Meta: U2FsdGVkX19J0bGR6SXd8KW10xk+w7gJr0Kz39bfTjB2t+9kTFIGd5/T9DuHvpWR5GmqbDCuvaLiU2H6Y1uiDoq7EPun6z2MGVKX0WZ0f8gb+ZeAUg4f4q58i8iAtOxHizfbemJXSFbwHMZWNSXA7P+/kgef1lLz70fGPvc439bDZdw3yeN+DDDSSUkyLGP+TGUYo3RtujEWz3AHrzQ4mrvP93ZdFjS8Dyl+eeyq43wjdfSetUJ1/dtRPtprswCwr0f+l4fkU1Hf7C7H0zIPA4kA/I7Ml8Ee/6TrKCocfdZ34IGQij4mmR6AkaJ53V1x9/jIzDSe1yc410dBdiPkXDZh+FnsUJhD4THVyPJNZXgUvKCJBXECHJGS47NOsCpGp5VCWsSIjx9qpiwvBm2s5qs5H3d8wynjwMs0neMQLwIaznKF5Y++sXXOujSjamMtLCi5vs/rK/zL2kQMFSSEBq7noJMM68rT+UVzvGhKyTlV5bHGkYoQh1JIAEmHpdII8RMHNC6N48egvYTAqvc/piGIY+Xj5CZWS+ANOW3Gawz51WPoNFRUxoP0bTz5Az3PgO0NMMprnt6lCRS2Mc5DI1KCLL8GR+bv0QmNiOkMNuGYykPMw/6/zRAhOBk1kp03DLOAy1Z4vP8HlQL15sX1OuIbpvrTWnMVQZ7/1h8sSbmJjSfRTvYQZ9gnDKk7sE0wSe6Gnj6UC5/1oGlP3fzjfcjhvQ063+iX4LF3sUqtA8kD2XiPBiVX5I0HWmBNzSFD3XTO70hf/jrx6vjjI3PvSZikBtRmkDRI8Q1C9JdRHxmqkqUaexf6G+dKvGmpsQWU7Gh9ZdIhAPw1c6CNr/PA/YZvMe6UOl8oBBEek/Y27UkDBPptJ8gc7lfqBCSSxcrXKytVo+NZKY2JQDRaohvz4SBKvZ9nj2OKU516sJG9I6QbWFYMTRBo2ZRu7B1HLphJlt/YG62ULT3wi3bVSrr pmqohIXe gZW6K/M2mIdPWoJE0UwevAQvriA3ffLxXvSXoRfWs8H7ZGwxwpxaMq+GckoLZ/vtg3M8dzqPK4kDjknCblZnJ98Xmwn/9fJRpXObLm/pGTaIzKZBVVgKCBkxxUeVwqFj6b8a/dC6FOATjHCMPf2Kxvh5lX1XK/8SUBVRkQHNTuQAs4GmKtKX7gZmUcFUWcQJLfF6QbX3PZJ+eQWYChk8bBJ8OtFmz26dAoQ18ps57ywMxWGqPQqEYNC00yxDtBZq6PJjxHd+Yk4o9XGeg0zD3uEnwgXXAPiggmeTOopt/eJJB1UcGIek+CjHiHeHCjB80PWUgQyH18R+/tEwgum9wZtMcp9XuK19SScC5a7bQ01ITxfTXpBFfWzLdAvu+pWLVTaz7TjGW6sgIjQKjBGlZ3j72Kczi2w+liyF3JOjgZRa63lQS3VW/mxyOZt7gOoZvWxGHIcHS3I5/qMQubpAzQF0FCemrZvZiN2xNGEzYGRuwxik= 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: The test functions are not needed after the module is removed, so mark them as such. Add __exit to the module removal function. Some other variables have been marked as const static as well. Suggested-by: Andrew Morton Signed-off-by: Liam R. Howlett --- lib/test_maple_tree.c | 158 +++++++++++++------------- tools/testing/radix-tree/linux/init.h | 1 + tools/testing/radix-tree/maple.c | 147 ++++++++++++------------ 3 files changed, 155 insertions(+), 151 deletions(-) diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index 93b40a78c4f5..19b130c9ddde 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -51,54 +51,54 @@ atomic_t maple_tree_tests_passed; #else #define cond_resched() do {} while (0) #endif -static -int mtree_insert_index(struct maple_tree *mt, unsigned long index, gfp_t gfp) +static int __init mtree_insert_index(struct maple_tree *mt, + unsigned long index, gfp_t gfp) { return mtree_insert(mt, index, xa_mk_value(index & LONG_MAX), gfp); } -static void mtree_erase_index(struct maple_tree *mt, unsigned long index) +static void __init mtree_erase_index(struct maple_tree *mt, unsigned long index) { MT_BUG_ON(mt, mtree_erase(mt, index) != xa_mk_value(index & LONG_MAX)); MT_BUG_ON(mt, mtree_load(mt, index) != NULL); } -static int mtree_test_insert(struct maple_tree *mt, unsigned long index, +static int __init mtree_test_insert(struct maple_tree *mt, unsigned long index, void *ptr) { return mtree_insert(mt, index, ptr, GFP_KERNEL); } -static int mtree_test_store_range(struct maple_tree *mt, unsigned long start, - unsigned long end, void *ptr) +static int __init mtree_test_store_range(struct maple_tree *mt, + unsigned long start, unsigned long end, void *ptr) { return mtree_store_range(mt, start, end, ptr, GFP_KERNEL); } -static int mtree_test_store(struct maple_tree *mt, unsigned long start, +static int __init mtree_test_store(struct maple_tree *mt, unsigned long start, void *ptr) { return mtree_test_store_range(mt, start, start, ptr); } -static int mtree_test_insert_range(struct maple_tree *mt, unsigned long start, - unsigned long end, void *ptr) +static int __init mtree_test_insert_range(struct maple_tree *mt, + unsigned long start, unsigned long end, void *ptr) { return mtree_insert_range(mt, start, end, ptr, GFP_KERNEL); } -static void *mtree_test_load(struct maple_tree *mt, unsigned long index) +static void __init *mtree_test_load(struct maple_tree *mt, unsigned long index) { return mtree_load(mt, index); } -static void *mtree_test_erase(struct maple_tree *mt, unsigned long index) +static void __init *mtree_test_erase(struct maple_tree *mt, unsigned long index) { return mtree_erase(mt, index); } #if defined(CONFIG_64BIT) -static noinline void check_mtree_alloc_range(struct maple_tree *mt, +static noinline void __init check_mtree_alloc_range(struct maple_tree *mt, unsigned long start, unsigned long end, unsigned long size, unsigned long expected, int eret, void *ptr) { @@ -115,7 +115,7 @@ static noinline void check_mtree_alloc_range(struct maple_tree *mt, MT_BUG_ON(mt, result != expected); } -static noinline void check_mtree_alloc_rrange(struct maple_tree *mt, +static noinline void __init check_mtree_alloc_rrange(struct maple_tree *mt, unsigned long start, unsigned long end, unsigned long size, unsigned long expected, int eret, void *ptr) { @@ -133,8 +133,8 @@ static noinline void check_mtree_alloc_rrange(struct maple_tree *mt, } #endif -static noinline void check_load(struct maple_tree *mt, unsigned long index, - void *ptr) +static noinline void __init check_load(struct maple_tree *mt, + unsigned long index, void *ptr) { void *ret = mtree_test_load(mt, index); @@ -143,7 +143,7 @@ static noinline void check_load(struct maple_tree *mt, unsigned long index, MT_BUG_ON(mt, ret != ptr); } -static noinline void check_store_range(struct maple_tree *mt, +static noinline void __init check_store_range(struct maple_tree *mt, unsigned long start, unsigned long end, void *ptr, int expected) { int ret = -EINVAL; @@ -159,7 +159,7 @@ static noinline void check_store_range(struct maple_tree *mt, check_load(mt, i, ptr); } -static noinline void check_insert_range(struct maple_tree *mt, +static noinline void __init check_insert_range(struct maple_tree *mt, unsigned long start, unsigned long end, void *ptr, int expected) { int ret = -EINVAL; @@ -175,8 +175,8 @@ static noinline void check_insert_range(struct maple_tree *mt, check_load(mt, i, ptr); } -static noinline void check_insert(struct maple_tree *mt, unsigned long index, - void *ptr) +static noinline void __init check_insert(struct maple_tree *mt, + unsigned long index, void *ptr) { int ret = -EINVAL; @@ -184,7 +184,7 @@ static noinline void check_insert(struct maple_tree *mt, unsigned long index, MT_BUG_ON(mt, ret != 0); } -static noinline void check_dup_insert(struct maple_tree *mt, +static noinline void __init check_dup_insert(struct maple_tree *mt, unsigned long index, void *ptr) { int ret = -EINVAL; @@ -194,13 +194,13 @@ static noinline void check_dup_insert(struct maple_tree *mt, } -static noinline -void check_index_load(struct maple_tree *mt, unsigned long index) +static noinline void __init check_index_load(struct maple_tree *mt, + unsigned long index) { return check_load(mt, index, xa_mk_value(index & LONG_MAX)); } -static inline int not_empty(struct maple_node *node) +static inline __init int not_empty(struct maple_node *node) { int i; @@ -215,8 +215,8 @@ static inline int not_empty(struct maple_node *node) } -static noinline void check_rev_seq(struct maple_tree *mt, unsigned long max, - bool verbose) +static noinline void __init check_rev_seq(struct maple_tree *mt, + unsigned long max, bool verbose) { unsigned long i = max, j; @@ -248,7 +248,7 @@ static noinline void check_rev_seq(struct maple_tree *mt, unsigned long max, #endif } -static noinline void check_seq(struct maple_tree *mt, unsigned long max, +static noinline void __init check_seq(struct maple_tree *mt, unsigned long max, bool verbose) { unsigned long i, j; @@ -277,7 +277,7 @@ static noinline void check_seq(struct maple_tree *mt, unsigned long max, #endif } -static noinline void check_lb_not_empty(struct maple_tree *mt) +static noinline void __init check_lb_not_empty(struct maple_tree *mt) { unsigned long i, j; unsigned long huge = 4000UL * 1000 * 1000; @@ -296,13 +296,13 @@ static noinline void check_lb_not_empty(struct maple_tree *mt) mtree_destroy(mt); } -static noinline void check_lower_bound_split(struct maple_tree *mt) +static noinline void __init check_lower_bound_split(struct maple_tree *mt) { MT_BUG_ON(mt, !mtree_empty(mt)); check_lb_not_empty(mt); } -static noinline void check_upper_bound_split(struct maple_tree *mt) +static noinline void __init check_upper_bound_split(struct maple_tree *mt) { unsigned long i, j; unsigned long huge; @@ -327,7 +327,7 @@ static noinline void check_upper_bound_split(struct maple_tree *mt) mtree_destroy(mt); } -static noinline void check_mid_split(struct maple_tree *mt) +static noinline void __init check_mid_split(struct maple_tree *mt) { unsigned long huge = 8000UL * 1000 * 1000; @@ -336,7 +336,7 @@ static noinline void check_mid_split(struct maple_tree *mt) check_lb_not_empty(mt); } -static noinline void check_rev_find(struct maple_tree *mt) +static noinline void __init check_rev_find(struct maple_tree *mt) { int i, nr_entries = 200; void *val; @@ -375,7 +375,7 @@ static noinline void check_rev_find(struct maple_tree *mt) rcu_read_unlock(); } -static noinline void check_find(struct maple_tree *mt) +static noinline void __init check_find(struct maple_tree *mt) { unsigned long val = 0; unsigned long count; @@ -592,7 +592,7 @@ static noinline void check_find(struct maple_tree *mt) mtree_destroy(mt); } -static noinline void check_find_2(struct maple_tree *mt) +static noinline void __init check_find_2(struct maple_tree *mt) { unsigned long i, j; void *entry; @@ -637,7 +637,7 @@ static noinline void check_find_2(struct maple_tree *mt) #if defined(CONFIG_64BIT) -static noinline void check_alloc_rev_range(struct maple_tree *mt) +static noinline void __init check_alloc_rev_range(struct maple_tree *mt) { /* * Generated by: @@ -645,7 +645,7 @@ static noinline void check_alloc_rev_range(struct maple_tree *mt) * awk -F "-" '{printf "0x%s, 0x%s, ", $1, $2}' */ - unsigned long range[] = { + static const unsigned long range[] = { /* Inclusive , Exclusive. */ 0x565234af2000, 0x565234af4000, 0x565234af4000, 0x565234af9000, @@ -673,7 +673,7 @@ static noinline void check_alloc_rev_range(struct maple_tree *mt) 0x7fff58791000, 0x7fff58793000, }; - unsigned long holes[] = { + static const unsigned long holes[] = { /* * Note: start of hole is INCLUSIVE * end of hole is EXCLUSIVE @@ -693,7 +693,7 @@ static noinline void check_alloc_rev_range(struct maple_tree *mt) * 4. number that should be returned. * 5. return value */ - unsigned long req_range[] = { + static const unsigned long req_range[] = { 0x565234af9000, /* Min */ 0x7fff58791000, /* Max */ 0x1000, /* Size */ @@ -804,7 +804,7 @@ static noinline void check_alloc_rev_range(struct maple_tree *mt) mtree_destroy(mt); } -static noinline void check_alloc_range(struct maple_tree *mt) +static noinline void __init check_alloc_range(struct maple_tree *mt) { /* * Generated by: @@ -812,7 +812,7 @@ static noinline void check_alloc_range(struct maple_tree *mt) * awk -F "-" '{printf "0x%s, 0x%s, ", $1, $2}' */ - unsigned long range[] = { + static const unsigned long range[] = { /* Inclusive , Exclusive. */ 0x565234af2000, 0x565234af4000, 0x565234af4000, 0x565234af9000, @@ -839,7 +839,7 @@ static noinline void check_alloc_range(struct maple_tree *mt) 0x7fff5878e000, 0x7fff58791000, 0x7fff58791000, 0x7fff58793000, }; - unsigned long holes[] = { + static const unsigned long holes[] = { /* Start of hole, end of hole, size of hole (+1) */ 0x565234afb000, 0x565234afc000, 0x1000, 0x565234afe000, 0x565235def000, 0x12F1000, @@ -854,7 +854,7 @@ static noinline void check_alloc_range(struct maple_tree *mt) * 4. number that should be returned. * 5. return value */ - unsigned long req_range[] = { + static const unsigned long req_range[] = { 0x565234af9000, /* Min */ 0x7fff58791000, /* Max */ 0x1000, /* Size */ @@ -963,10 +963,10 @@ static noinline void check_alloc_range(struct maple_tree *mt) } #endif -static noinline void check_ranges(struct maple_tree *mt) +static noinline void __init check_ranges(struct maple_tree *mt) { int i, val, val2; - unsigned long r[] = { + static const unsigned long r[] = { 10, 15, 20, 25, 17, 22, /* Overlaps previous range. */ @@ -1231,7 +1231,7 @@ static noinline void check_ranges(struct maple_tree *mt) MT_BUG_ON(mt, mt_height(mt) != 4); } -static noinline void check_next_entry(struct maple_tree *mt) +static noinline void __init check_next_entry(struct maple_tree *mt) { void *entry = NULL; unsigned long limit = 30, i = 0; @@ -1255,7 +1255,7 @@ static noinline void check_next_entry(struct maple_tree *mt) mtree_destroy(mt); } -static noinline void check_prev_entry(struct maple_tree *mt) +static noinline void __init check_prev_entry(struct maple_tree *mt) { unsigned long index = 16; void *value; @@ -1299,7 +1299,7 @@ static noinline void check_prev_entry(struct maple_tree *mt) mas_unlock(&mas); } -static noinline void check_root_expand(struct maple_tree *mt) +static noinline void __init check_root_expand(struct maple_tree *mt) { MA_STATE(mas, mt, 0, 0); void *ptr; @@ -1388,13 +1388,13 @@ static noinline void check_root_expand(struct maple_tree *mt) mas_unlock(&mas); } -static noinline void check_gap_combining(struct maple_tree *mt) +static noinline void __init check_gap_combining(struct maple_tree *mt) { struct maple_enode *mn1, *mn2; void *entry; unsigned long singletons = 100; - unsigned long *seq100; - unsigned long seq100_64[] = { + static const unsigned long *seq100; + static const unsigned long seq100_64[] = { /* 0-5 */ 74, 75, 76, 50, 100, 2, @@ -1408,7 +1408,7 @@ static noinline void check_gap_combining(struct maple_tree *mt) 76, 2, 79, 85, 4, }; - unsigned long seq100_32[] = { + static const unsigned long seq100_32[] = { /* 0-5 */ 61, 62, 63, 50, 100, 2, @@ -1422,11 +1422,11 @@ static noinline void check_gap_combining(struct maple_tree *mt) 76, 2, 79, 85, 4, }; - unsigned long seq2000[] = { + static const unsigned long seq2000[] = { 1152, 1151, 1100, 1200, 2, }; - unsigned long seq400[] = { + static const unsigned long seq400[] = { 286, 318, 256, 260, 266, 270, 275, 280, 290, 398, 286, 310, @@ -1585,7 +1585,7 @@ static noinline void check_gap_combining(struct maple_tree *mt) mt_set_non_kernel(0); mtree_destroy(mt); } -static noinline void check_node_overwrite(struct maple_tree *mt) +static noinline void __init check_node_overwrite(struct maple_tree *mt) { int i, max = 4000; @@ -1598,7 +1598,7 @@ static noinline void check_node_overwrite(struct maple_tree *mt) } #if defined(BENCH_SLOT_STORE) -static noinline void bench_slot_store(struct maple_tree *mt) +static noinline void __init bench_slot_store(struct maple_tree *mt) { int i, brk = 105, max = 1040, brk_start = 100, count = 20000000; @@ -1614,7 +1614,7 @@ static noinline void bench_slot_store(struct maple_tree *mt) #endif #if defined(BENCH_NODE_STORE) -static noinline void bench_node_store(struct maple_tree *mt) +static noinline void __init bench_node_store(struct maple_tree *mt) { int i, overwrite = 76, max = 240, count = 20000000; @@ -1633,7 +1633,7 @@ static noinline void bench_node_store(struct maple_tree *mt) #endif #if defined(BENCH_AWALK) -static noinline void bench_awalk(struct maple_tree *mt) +static noinline void __init bench_awalk(struct maple_tree *mt) { int i, max = 2500, count = 50000000; MA_STATE(mas, mt, 1470, 1470); @@ -1650,7 +1650,7 @@ static noinline void bench_awalk(struct maple_tree *mt) } #endif #if defined(BENCH_WALK) -static noinline void bench_walk(struct maple_tree *mt) +static noinline void __init bench_walk(struct maple_tree *mt) { int i, max = 2500, count = 550000000; MA_STATE(mas, mt, 1470, 1470); @@ -1667,7 +1667,7 @@ static noinline void bench_walk(struct maple_tree *mt) #endif #if defined(BENCH_MT_FOR_EACH) -static noinline void bench_mt_for_each(struct maple_tree *mt) +static noinline void __init bench_mt_for_each(struct maple_tree *mt) { int i, count = 1000000; unsigned long max = 2500, index = 0; @@ -1691,7 +1691,7 @@ static noinline void bench_mt_for_each(struct maple_tree *mt) #endif /* check_forking - simulate the kernel forking sequence with the tree. */ -static noinline void check_forking(struct maple_tree *mt) +static noinline void __init check_forking(struct maple_tree *mt) { struct maple_tree newmt; @@ -1730,7 +1730,7 @@ static noinline void check_forking(struct maple_tree *mt) mtree_destroy(&newmt); } -static noinline void check_iteration(struct maple_tree *mt) +static noinline void __init check_iteration(struct maple_tree *mt) { int i, nr_entries = 125; void *val; @@ -1798,7 +1798,7 @@ static noinline void check_iteration(struct maple_tree *mt) mt_set_non_kernel(0); } -static noinline void check_mas_store_gfp(struct maple_tree *mt) +static noinline void __init check_mas_store_gfp(struct maple_tree *mt) { struct maple_tree newmt; @@ -1831,7 +1831,7 @@ static noinline void check_mas_store_gfp(struct maple_tree *mt) } #if defined(BENCH_FORK) -static noinline void bench_forking(struct maple_tree *mt) +static noinline void __init bench_forking(struct maple_tree *mt) { struct maple_tree newmt; @@ -1873,15 +1873,17 @@ static noinline void bench_forking(struct maple_tree *mt) } #endif -static noinline void next_prev_test(struct maple_tree *mt) +static noinline void __init next_prev_test(struct maple_tree *mt) { int i, nr_entries; void *val; MA_STATE(mas, mt, 0, 0); struct maple_enode *mn; - unsigned long *level2; - unsigned long level2_64[] = {707, 1000, 710, 715, 720, 725}; - unsigned long level2_32[] = {1747, 2000, 1750, 1755, 1760, 1765}; + static const unsigned long *level2; + static const unsigned long level2_64[] = { 707, 1000, 710, 715, 720, + 725}; + static const unsigned long level2_32[] = { 1747, 2000, 1750, 1755, + 1760, 1765}; if (MAPLE_32BIT) { nr_entries = 500; @@ -2049,7 +2051,7 @@ static noinline void next_prev_test(struct maple_tree *mt) /* Test spanning writes that require balancing right sibling or right cousin */ -static noinline void check_spanning_relatives(struct maple_tree *mt) +static noinline void __init check_spanning_relatives(struct maple_tree *mt) { unsigned long i, nr_entries = 1000; @@ -2062,7 +2064,7 @@ static noinline void check_spanning_relatives(struct maple_tree *mt) mtree_store_range(mt, 9365, 9955, NULL, GFP_KERNEL); } -static noinline void check_fuzzer(struct maple_tree *mt) +static noinline void __init check_fuzzer(struct maple_tree *mt) { /* * 1. Causes a spanning rebalance of a single root node. @@ -2459,7 +2461,7 @@ static noinline void check_fuzzer(struct maple_tree *mt) } /* duplicate the tree with a specific gap */ -static noinline void check_dup_gaps(struct maple_tree *mt, +static noinline void __init check_dup_gaps(struct maple_tree *mt, unsigned long nr_entries, bool zero_start, unsigned long gap) { @@ -2499,7 +2501,7 @@ static noinline void check_dup_gaps(struct maple_tree *mt, } /* Duplicate many sizes of trees. Mainly to test expected entry values */ -static noinline void check_dup(struct maple_tree *mt) +static noinline void __init check_dup(struct maple_tree *mt) { int i; int big_start = 100010; @@ -2587,7 +2589,7 @@ static noinline void check_dup(struct maple_tree *mt) } } -static noinline void check_bnode_min_spanning(struct maple_tree *mt) +static noinline void __init check_bnode_min_spanning(struct maple_tree *mt) { int i = 50; MA_STATE(mas, mt, 0, 0); @@ -2606,7 +2608,7 @@ static noinline void check_bnode_min_spanning(struct maple_tree *mt) mt_set_non_kernel(0); } -static noinline void check_empty_area_window(struct maple_tree *mt) +static noinline void __init check_empty_area_window(struct maple_tree *mt) { unsigned long i, nr_entries = 20; MA_STATE(mas, mt, 0, 0); @@ -2691,7 +2693,7 @@ static noinline void check_empty_area_window(struct maple_tree *mt) rcu_read_unlock(); } -static noinline void check_empty_area_fill(struct maple_tree *mt) +static noinline void __init check_empty_area_fill(struct maple_tree *mt) { const unsigned long max = 0x25D78000; unsigned long size; @@ -2735,11 +2737,11 @@ static noinline void check_empty_area_fill(struct maple_tree *mt) } static DEFINE_MTREE(tree); -static int maple_tree_seed(void) +static int __init maple_tree_seed(void) { - unsigned long set[] = {5015, 5014, 5017, 25, 1000, - 1001, 1002, 1003, 1005, 0, - 5003, 5002}; + unsigned long set[] = { 5015, 5014, 5017, 25, 1000, + 1001, 1002, 1003, 1005, 0, + 5003, 5002}; void *ptr = &set; pr_info("\nTEST STARTING\n\n"); @@ -3009,7 +3011,7 @@ static int maple_tree_seed(void) return -EINVAL; } -static void maple_tree_harvest(void) +static void __exit maple_tree_harvest(void) { } diff --git a/tools/testing/radix-tree/linux/init.h b/tools/testing/radix-tree/linux/init.h index 1bb0afc21309..81563c3dfce7 100644 --- a/tools/testing/radix-tree/linux/init.h +++ b/tools/testing/radix-tree/linux/init.h @@ -1 +1,2 @@ #define __init +#define __exit diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index cf37ed9ab6c4..03539d86cdf0 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -14,6 +14,7 @@ #include "test.h" #include #include +#include "linux/init.h" #define module_init(x) #define module_exit(x) @@ -80,7 +81,7 @@ static void check_mas_alloc_node_count(struct ma_state *mas) * check_new_node() - Check the creation of new nodes and error path * verification. */ -static noinline void check_new_node(struct maple_tree *mt) +static noinline void __init check_new_node(struct maple_tree *mt) { struct maple_node *mn, *mn2, *mn3; @@ -454,7 +455,7 @@ static noinline void check_new_node(struct maple_tree *mt) /* * Check erasing including RCU. */ -static noinline void check_erase(struct maple_tree *mt, unsigned long index, +static noinline void __init check_erase(struct maple_tree *mt, unsigned long index, void *ptr) { MT_BUG_ON(mt, mtree_test_erase(mt, index) != ptr); @@ -464,24 +465,24 @@ static noinline void check_erase(struct maple_tree *mt, unsigned long index, #define erase_check_insert(mt, i) check_insert(mt, set[i], entry[i%2]) #define erase_check_erase(mt, i) check_erase(mt, set[i], entry[i%2]) -static noinline void check_erase_testset(struct maple_tree *mt) +static noinline void __init check_erase_testset(struct maple_tree *mt) { - unsigned long set[] = { 5015, 5014, 5017, 25, 1000, - 1001, 1002, 1003, 1005, 0, - 6003, 6002, 6008, 6012, 6015, - 7003, 7002, 7008, 7012, 7015, - 8003, 8002, 8008, 8012, 8015, - 9003, 9002, 9008, 9012, 9015, - 10003, 10002, 10008, 10012, 10015, - 11003, 11002, 11008, 11012, 11015, - 12003, 12002, 12008, 12012, 12015, - 13003, 13002, 13008, 13012, 13015, - 14003, 14002, 14008, 14012, 14015, - 15003, 15002, 15008, 15012, 15015, - }; - - - void *ptr = &set; + static const unsigned long set[] = { 5015, 5014, 5017, 25, 1000, + 1001, 1002, 1003, 1005, 0, + 6003, 6002, 6008, 6012, 6015, + 7003, 7002, 7008, 7012, 7015, + 8003, 8002, 8008, 8012, 8015, + 9003, 9002, 9008, 9012, 9015, + 10003, 10002, 10008, 10012, 10015, + 11003, 11002, 11008, 11012, 11015, + 12003, 12002, 12008, 12012, 12015, + 13003, 13002, 13008, 13012, 13015, + 14003, 14002, 14008, 14012, 14015, + 15003, 15002, 15008, 15012, 15015, + }; + + + void *ptr = &check_erase_testset; void *entry[2] = { ptr, mt }; void *root_node; @@ -738,7 +739,7 @@ static noinline void check_erase_testset(struct maple_tree *mt) int mas_ce2_over_count(struct ma_state *mas_start, struct ma_state *mas_end, void *s_entry, unsigned long s_min, void *e_entry, unsigned long e_max, - unsigned long *set, int i, bool null_entry) + const unsigned long *set, int i, bool null_entry) { int count = 0, span = 0; unsigned long retry = 0; @@ -968,8 +969,8 @@ static inline void *mas_range_load(struct ma_state *mas, } #if defined(CONFIG_64BIT) -static noinline void check_erase2_testset(struct maple_tree *mt, - unsigned long *set, unsigned long size) +static noinline void __init check_erase2_testset(struct maple_tree *mt, + const unsigned long *set, unsigned long size) { int entry_count = 0; int check = 0; @@ -1113,11 +1114,11 @@ static noinline void check_erase2_testset(struct maple_tree *mt, /* These tests were pulled from KVM tree modifications which failed. */ -static noinline void check_erase2_sets(struct maple_tree *mt) +static noinline void __init check_erase2_sets(struct maple_tree *mt) { void *entry; unsigned long start = 0; - unsigned long set[] = { + static const unsigned long set[] = { STORE, 140737488347136, 140737488351231, STORE, 140721266458624, 140737488351231, ERASE, 140721266458624, 140737488351231, @@ -1135,7 +1136,7 @@ ERASE, 140253902692352, 140253902864383, STORE, 140253902692352, 140253902696447, STORE, 140253902696448, 140253902864383, }; - unsigned long set2[] = { + static const unsigned long set2[] = { STORE, 140737488347136, 140737488351231, STORE, 140735933583360, 140737488351231, ERASE, 140735933583360, 140737488351231, @@ -1159,7 +1160,7 @@ STORE, 140277094813696, 140277094821887, STORE, 140277094821888, 140277094825983, STORE, 140735933906944, 140735933911039, }; - unsigned long set3[] = { + static const unsigned long set3[] = { STORE, 140737488347136, 140737488351231, STORE, 140735790264320, 140737488351231, ERASE, 140735790264320, 140737488351231, @@ -1202,7 +1203,7 @@ STORE, 47135835840512, 47135835885567, STORE, 47135835885568, 47135835893759, }; - unsigned long set4[] = { + static const unsigned long set4[] = { STORE, 140737488347136, 140737488351231, STORE, 140728251703296, 140737488351231, ERASE, 140728251703296, 140737488351231, @@ -1223,7 +1224,7 @@ ERASE, 47646523277312, 47646523445247, STORE, 47646523277312, 47646523400191, }; - unsigned long set5[] = { + static const unsigned long set5[] = { STORE, 140737488347136, 140737488351231, STORE, 140726874062848, 140737488351231, ERASE, 140726874062848, 140737488351231, @@ -1356,7 +1357,7 @@ STORE, 47884791619584, 47884791623679, STORE, 47884791623680, 47884791627775, }; - unsigned long set6[] = { + static const unsigned long set6[] = { STORE, 140737488347136, 140737488351231, STORE, 140722999021568, 140737488351231, ERASE, 140722999021568, 140737488351231, @@ -1488,7 +1489,7 @@ ERASE, 47430432014336, 47430432022527, STORE, 47430432014336, 47430432018431, STORE, 47430432018432, 47430432022527, }; - unsigned long set7[] = { + static const unsigned long set7[] = { STORE, 140737488347136, 140737488351231, STORE, 140729808330752, 140737488351231, ERASE, 140729808330752, 140737488351231, @@ -1620,7 +1621,7 @@ ERASE, 47439987130368, 47439987138559, STORE, 47439987130368, 47439987134463, STORE, 47439987134464, 47439987138559, }; - unsigned long set8[] = { + static const unsigned long set8[] = { STORE, 140737488347136, 140737488351231, STORE, 140722482974720, 140737488351231, ERASE, 140722482974720, 140737488351231, @@ -1753,7 +1754,7 @@ STORE, 47708488638464, 47708488642559, STORE, 47708488642560, 47708488646655, }; - unsigned long set9[] = { + static const unsigned long set9[] = { STORE, 140737488347136, 140737488351231, STORE, 140736427839488, 140737488351231, ERASE, 140736427839488, 140736427839488, @@ -5619,7 +5620,7 @@ ERASE, 47906195480576, 47906195480576, STORE, 94641242615808, 94641242750975, }; - unsigned long set10[] = { + static const unsigned long set10[] = { STORE, 140737488347136, 140737488351231, STORE, 140736427839488, 140737488351231, ERASE, 140736427839488, 140736427839488, @@ -9483,7 +9484,7 @@ STORE, 139726599680000, 139726599684095, ERASE, 47906195480576, 47906195480576, STORE, 94641242615808, 94641242750975, }; - unsigned long set11[] = { + static const unsigned long set11[] = { STORE, 140737488347136, 140737488351231, STORE, 140732658499584, 140737488351231, ERASE, 140732658499584, 140732658499584, @@ -9509,7 +9510,7 @@ STORE, 140732658565120, 140732658569215, STORE, 140732658552832, 140732658565119, }; - unsigned long set12[] = { /* contains 12 values. */ + static const unsigned long set12[] = { /* contains 12 values. */ STORE, 140737488347136, 140737488351231, STORE, 140732658499584, 140737488351231, ERASE, 140732658499584, 140732658499584, @@ -9536,7 +9537,7 @@ STORE, 140732658552832, 140732658565119, STORE, 140014592741375, 140014592741375, /* contrived */ STORE, 140014592733184, 140014592741376, /* creates first entry retry. */ }; - unsigned long set13[] = { + static const unsigned long set13[] = { STORE, 140373516247040, 140373516251135,/*: ffffa2e7b0e10d80 */ STORE, 140373516251136, 140373516255231,/*: ffffa2e7b1195d80 */ STORE, 140373516255232, 140373516443647,/*: ffffa2e7b0e109c0 */ @@ -9549,7 +9550,7 @@ STORE, 140373518684160, 140373518688254,/*: ffffa2e7b05fec00 */ STORE, 140373518688256, 140373518692351,/*: ffffa2e7bfbdcd80 */ STORE, 140373518692352, 140373518696447,/*: ffffa2e7b0749e40 */ }; - unsigned long set14[] = { + static const unsigned long set14[] = { STORE, 140737488347136, 140737488351231, STORE, 140731667996672, 140737488351231, SNULL, 140731668000767, 140737488351231, @@ -9833,7 +9834,7 @@ SNULL, 139826136543232, 139826136809471, STORE, 139826136809472, 139826136842239, STORE, 139826136543232, 139826136809471, }; - unsigned long set15[] = { + static const unsigned long set15[] = { STORE, 140737488347136, 140737488351231, STORE, 140722061451264, 140737488351231, SNULL, 140722061455359, 140737488351231, @@ -10118,7 +10119,7 @@ STORE, 139906808958976, 139906808991743, STORE, 139906808692736, 139906808958975, }; - unsigned long set16[] = { + static const unsigned long set16[] = { STORE, 94174808662016, 94174809321471, STORE, 94174811414528, 94174811426815, STORE, 94174811426816, 94174811430911, @@ -10329,7 +10330,7 @@ STORE, 139921865613312, 139921865617407, STORE, 139921865547776, 139921865564159, }; - unsigned long set17[] = { + static const unsigned long set17[] = { STORE, 94397057224704, 94397057646591, STORE, 94397057650688, 94397057691647, STORE, 94397057691648, 94397057695743, @@ -10391,7 +10392,7 @@ STORE, 140720477511680, 140720477646847, STORE, 140720478302208, 140720478314495, STORE, 140720478314496, 140720478318591, }; - unsigned long set18[] = { + static const unsigned long set18[] = { STORE, 140737488347136, 140737488351231, STORE, 140724953673728, 140737488351231, SNULL, 140724953677823, 140737488351231, @@ -10424,7 +10425,7 @@ STORE, 140222970597376, 140222970605567, ERASE, 140222970597376, 140222970605567, STORE, 140222970597376, 140222970605567, }; - unsigned long set19[] = { + static const unsigned long set19[] = { STORE, 140737488347136, 140737488351231, STORE, 140725182459904, 140737488351231, SNULL, 140725182463999, 140737488351231, @@ -10693,7 +10694,7 @@ STORE, 140656836775936, 140656836780031, STORE, 140656787476480, 140656791920639, ERASE, 140656774639616, 140656779083775, }; - unsigned long set20[] = { + static const unsigned long set20[] = { STORE, 140737488347136, 140737488351231, STORE, 140735952392192, 140737488351231, SNULL, 140735952396287, 140737488351231, @@ -10849,7 +10850,7 @@ STORE, 140590386819072, 140590386823167, STORE, 140590386823168, 140590386827263, SNULL, 140590376591359, 140590376595455, }; - unsigned long set21[] = { + static const unsigned long set21[] = { STORE, 93874710941696, 93874711363583, STORE, 93874711367680, 93874711408639, STORE, 93874711408640, 93874711412735, @@ -10919,7 +10920,7 @@ ERASE, 140708393312256, 140708393316351, ERASE, 140708393308160, 140708393312255, ERASE, 140708393291776, 140708393308159, }; - unsigned long set22[] = { + static const unsigned long set22[] = { STORE, 93951397134336, 93951397183487, STORE, 93951397183488, 93951397728255, STORE, 93951397728256, 93951397826559, @@ -11046,7 +11047,7 @@ STORE, 140551361253376, 140551361519615, ERASE, 140551361253376, 140551361519615, }; - unsigned long set23[] = { + static const unsigned long set23[] = { STORE, 94014447943680, 94014448156671, STORE, 94014450253824, 94014450257919, STORE, 94014450257920, 94014450266111, @@ -14370,7 +14371,7 @@ SNULL, 140175956627455, 140175985139711, STORE, 140175927242752, 140175956627455, STORE, 140175956627456, 140175985139711, }; - unsigned long set24[] = { + static const unsigned long set24[] = { STORE, 140737488347136, 140737488351231, STORE, 140735281639424, 140737488351231, SNULL, 140735281643519, 140737488351231, @@ -15532,7 +15533,7 @@ ERASE, 139635393024000, 139635401412607, ERASE, 139635384627200, 139635384631295, ERASE, 139635384631296, 139635393019903, }; - unsigned long set25[] = { + static const unsigned long set25[] = { STORE, 140737488347136, 140737488351231, STORE, 140737488343040, 140737488351231, STORE, 140722547441664, 140737488351231, @@ -22320,7 +22321,7 @@ STORE, 140249652703232, 140249682087935, STORE, 140249682087936, 140249710600191, }; - unsigned long set26[] = { + static const unsigned long set26[] = { STORE, 140737488347136, 140737488351231, STORE, 140729464770560, 140737488351231, SNULL, 140729464774655, 140737488351231, @@ -22344,7 +22345,7 @@ ERASE, 140109040951296, 140109040959487, STORE, 140109040955392, 140109040959487, ERASE, 140109040955392, 140109040959487, }; - unsigned long set27[] = { + static const unsigned long set27[] = { STORE, 140737488347136, 140737488351231, STORE, 140726128070656, 140737488351231, SNULL, 140726128074751, 140737488351231, @@ -22740,7 +22741,7 @@ STORE, 140415509696512, 140415535910911, ERASE, 140415537422336, 140415562588159, STORE, 140415482433536, 140415509696511, }; - unsigned long set28[] = { + static const unsigned long set28[] = { STORE, 140737488347136, 140737488351231, STORE, 140722475622400, 140737488351231, SNULL, 140722475626495, 140737488351231, @@ -22808,7 +22809,7 @@ STORE, 139918413348864, 139918413352959, ERASE, 139918413316096, 139918413344767, STORE, 93865848528896, 93865848664063, }; - unsigned long set29[] = { + static const unsigned long set29[] = { STORE, 140737488347136, 140737488351231, STORE, 140734467944448, 140737488351231, SNULL, 140734467948543, 140737488351231, @@ -23683,7 +23684,7 @@ ERASE, 140143079972864, 140143088361471, ERASE, 140143205793792, 140143205797887, ERASE, 140143205797888, 140143214186495, }; - unsigned long set30[] = { + static const unsigned long set30[] = { STORE, 140737488347136, 140737488351231, STORE, 140733436743680, 140737488351231, SNULL, 140733436747775, 140737488351231, @@ -24565,7 +24566,7 @@ ERASE, 140165225893888, 140165225897983, ERASE, 140165225897984, 140165234286591, ERASE, 140165058105344, 140165058109439, }; - unsigned long set31[] = { + static const unsigned long set31[] = { STORE, 140737488347136, 140737488351231, STORE, 140730890784768, 140737488351231, SNULL, 140730890788863, 140737488351231, @@ -25378,7 +25379,7 @@ ERASE, 140623906590720, 140623914979327, ERASE, 140622950277120, 140622950281215, ERASE, 140622950281216, 140622958669823, }; - unsigned long set32[] = { + static const unsigned long set32[] = { STORE, 140737488347136, 140737488351231, STORE, 140731244212224, 140737488351231, SNULL, 140731244216319, 140737488351231, @@ -26174,7 +26175,7 @@ ERASE, 140400417288192, 140400425676799, ERASE, 140400283066368, 140400283070463, ERASE, 140400283070464, 140400291459071, }; - unsigned long set33[] = { + static const unsigned long set33[] = { STORE, 140737488347136, 140737488351231, STORE, 140734562918400, 140737488351231, SNULL, 140734562922495, 140737488351231, @@ -26316,7 +26317,7 @@ STORE, 140582961786880, 140583003750399, ERASE, 140582961786880, 140583003750399, }; - unsigned long set34[] = { + static const unsigned long set34[] = { STORE, 140737488347136, 140737488351231, STORE, 140731327180800, 140737488351231, SNULL, 140731327184895, 140737488351231, @@ -27197,7 +27198,7 @@ ERASE, 140012522094592, 140012530483199, ERASE, 140012033142784, 140012033146879, ERASE, 140012033146880, 140012041535487, }; - unsigned long set35[] = { + static const unsigned long set35[] = { STORE, 140737488347136, 140737488351231, STORE, 140730536939520, 140737488351231, SNULL, 140730536943615, 140737488351231, @@ -27954,7 +27955,7 @@ ERASE, 140474471936000, 140474480324607, ERASE, 140474396430336, 140474396434431, ERASE, 140474396434432, 140474404823039, }; - unsigned long set36[] = { + static const unsigned long set36[] = { STORE, 140737488347136, 140737488351231, STORE, 140723893125120, 140737488351231, SNULL, 140723893129215, 140737488351231, @@ -28815,7 +28816,7 @@ ERASE, 140121890357248, 140121898745855, ERASE, 140121269587968, 140121269592063, ERASE, 140121269592064, 140121277980671, }; - unsigned long set37[] = { + static const unsigned long set37[] = { STORE, 140737488347136, 140737488351231, STORE, 140722404016128, 140737488351231, SNULL, 140722404020223, 140737488351231, @@ -28941,7 +28942,7 @@ STORE, 139759821246464, 139759888355327, ERASE, 139759821246464, 139759888355327, ERASE, 139759888355328, 139759955464191, }; - unsigned long set38[] = { + static const unsigned long set38[] = { STORE, 140737488347136, 140737488351231, STORE, 140730666221568, 140737488351231, SNULL, 140730666225663, 140737488351231, @@ -29751,7 +29752,7 @@ ERASE, 140613504712704, 140613504716799, ERASE, 140613504716800, 140613513105407, }; - unsigned long set39[] = { + static const unsigned long set39[] = { STORE, 140737488347136, 140737488351231, STORE, 140736271417344, 140737488351231, SNULL, 140736271421439, 140737488351231, @@ -30123,7 +30124,7 @@ STORE, 140325364428800, 140325372821503, STORE, 140325356036096, 140325364428799, SNULL, 140325364432895, 140325372821503, }; - unsigned long set40[] = { + static const unsigned long set40[] = { STORE, 140737488347136, 140737488351231, STORE, 140734309167104, 140737488351231, SNULL, 140734309171199, 140737488351231, @@ -30874,7 +30875,7 @@ ERASE, 140320289300480, 140320289304575, ERASE, 140320289304576, 140320297693183, ERASE, 140320163409920, 140320163414015, }; - unsigned long set41[] = { + static const unsigned long set41[] = { STORE, 140737488347136, 140737488351231, STORE, 140728157171712, 140737488351231, SNULL, 140728157175807, 140737488351231, @@ -31184,7 +31185,7 @@ STORE, 94376135090176, 94376135094271, STORE, 94376135094272, 94376135098367, SNULL, 94376135094272, 94377208836095, }; - unsigned long set42[] = { + static const unsigned long set42[] = { STORE, 314572800, 1388314623, STORE, 1462157312, 1462169599, STORE, 1462169600, 1462185983, @@ -33861,7 +33862,7 @@ SNULL, 3798999040, 3799101439, */ }; - unsigned long set43[] = { + static const unsigned long set43[] = { STORE, 140737488347136, 140737488351231, STORE, 140734187720704, 140737488351231, SNULL, 140734187724800, 140737488351231, @@ -34995,7 +34996,7 @@ void run_check_rcu_slowread(struct maple_tree *mt, struct rcu_test_struct *vals) MT_BUG_ON(mt, !vals->seen_entry3); MT_BUG_ON(mt, !vals->seen_both); } -static noinline void check_rcu_simulated(struct maple_tree *mt) +static noinline void __init check_rcu_simulated(struct maple_tree *mt) { unsigned long i, nr_entries = 1000; unsigned long target = 4320; @@ -35156,7 +35157,7 @@ static noinline void check_rcu_simulated(struct maple_tree *mt) rcu_unregister_thread(); } -static noinline void check_rcu_threaded(struct maple_tree *mt) +static noinline void __init check_rcu_threaded(struct maple_tree *mt) { unsigned long i, nr_entries = 1000; struct rcu_test_struct vals; @@ -35369,7 +35370,7 @@ static void check_dfs_preorder(struct maple_tree *mt) /* End of depth first search tests */ /* Preallocation testing */ -static noinline void check_prealloc(struct maple_tree *mt) +static noinline void __init check_prealloc(struct maple_tree *mt) { unsigned long i, max = 100; unsigned long allocated; @@ -35497,7 +35498,7 @@ static noinline void check_prealloc(struct maple_tree *mt) /* End of preallocation testing */ /* Spanning writes, writes that span nodes and layers of the tree */ -static noinline void check_spanning_write(struct maple_tree *mt) +static noinline void __init check_spanning_write(struct maple_tree *mt) { unsigned long i, max = 5000; MA_STATE(mas, mt, 1200, 2380); @@ -35665,7 +35666,7 @@ static noinline void check_spanning_write(struct maple_tree *mt) /* End of spanning write testing */ /* Writes to a NULL area that are adjacent to other NULLs */ -static noinline void check_null_expand(struct maple_tree *mt) +static noinline void __init check_null_expand(struct maple_tree *mt) { unsigned long i, max = 100; unsigned char data_end; @@ -35726,7 +35727,7 @@ static noinline void check_null_expand(struct maple_tree *mt) /* End of NULL area expansions */ /* Checking for no memory is best done outside the kernel */ -static noinline void check_nomem(struct maple_tree *mt) +static noinline void __init check_nomem(struct maple_tree *mt) { MA_STATE(ms, mt, 1, 1); @@ -35761,7 +35762,7 @@ static noinline void check_nomem(struct maple_tree *mt) mtree_destroy(mt); } -static noinline void check_locky(struct maple_tree *mt) +static noinline void __init check_locky(struct maple_tree *mt) { MA_STATE(ms, mt, 2, 2); MA_STATE(reader, mt, 2, 2); From patchwork Thu May 18 14:55: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: 13246951 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 68A57C7EE25 for ; Thu, 18 May 2023 14:56:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D708D28000C; Thu, 18 May 2023 10:56:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D21CD280004; Thu, 18 May 2023 10:56:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B263528000C; Thu, 18 May 2023 10:56: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 A2DD0280004 for ; Thu, 18 May 2023 10:56:58 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 83533140819 for ; Thu, 18 May 2023 14:56:58 +0000 (UTC) X-FDA: 80803678116.04.A69797C Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf07.hostedemail.com (Postfix) with ESMTP id 0A75240013 for ; Thu, 18 May 2023 14:56:54 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=lYOeeb9t; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="s/ySPeV+"; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf07.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-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421815; a=rsa-sha256; cv=pass; b=dpIG02+dKOGMPcPAWMYc9I69gN+k2gG4rZ2tM2OUzqZoFU+5+BcAyck0CF9pI367peMyAX FRUs5nWxTOm6mcnV7MvmqnP+T+JoaMphz5zEHcYenDM+EVzJroHO1m8QTAOPexpFFQlVLN 0EDNNFt6v+BAOf/7Imbjfc/sVabQbg8= ARC-Authentication-Results: i=2; imf07.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=lYOeeb9t; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="s/ySPeV+"; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf07.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=1684421815; 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=o0r44DGQi8lK2mAF2MeGErME5jJFvB3OhAPffrijvsw=; b=3cm+4U3A3M5bO99QJEGEXWP2FreLuBlVt8eVdoa4/H4anSGNv3mvwI0LxAHpSIyhKACjBb /yF+RHI8NcYYdWp0gqlPxCiQgjtnA6iIlOU0KRHb7zlHkHY08nFlg/lR1q4+Ng4mU7p+gV ygkZsh1nfPkmIrfRHzbTDtMqwje4XZU= 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 34ICFdMs011817; Thu, 18 May 2023 14:56:42 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=o0r44DGQi8lK2mAF2MeGErME5jJFvB3OhAPffrijvsw=; b=lYOeeb9tDTjBgHu760IoeDoitHpUdCuD7LLlDQQ3Ik596W9oIwml1Uo4+egtXCguqkDg MZeI7wjRwWiE1SeeZ29uFHVntjvR2vjcXAG9pYgztEgffRAqheI/zMSDJvjjW2XHWk2e uC0r1BbIJ9Yl1HMrrb41t4LYkzb2SdRNt9gUsl6nCzjtbzpstfWCAa25epKaEqHWb8QJ wmecwGeXsuGEWDHZl+qqiR+ohdZvTTS9gALf7ht/7WAEo2O7TJbMyGpoPGUat0zXKdod /gxna+ss1svib4Llf6w1vDDGQ9/rN9iCv0UjhB3n1/8KOqNG/sPetP0bMO9KZSex2lIS Cw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qnkux8am4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:41 +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 34IE58OA039952; Thu, 18 May 2023 14:56:40 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qj106mq77-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DMFVcldKu0no20qaOBhHqogU9oKB1+MqoJq7sSeAKJdJYvWCVsFBACDJxczQgOKPVaC0MBMss1o2D0x9hb132f1x06LTwiwYCby7+Y2xn49XpY/40PQaglNff9UaSEfmE9xNkpThyKjA75V4kYT7Wu9CIRZagCkRME2m/JM9OadDq5HdN0Y8eyyi76EXXHGPUSCJHWAiO930Zv2Sd2RL4Iz+FtorSwtFt2spOA71+Umhv9ANcJIQXAkGoYe1EX4I2unK5QvMQm4FLhS/8jPk4YQLZzAAeLocpSEiS9QrC6LXv/h1OJcVT6ewLIVMTvf2bjerjLB9ZCMWz90Y6xrotA== 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=o0r44DGQi8lK2mAF2MeGErME5jJFvB3OhAPffrijvsw=; b=FLr3burNW0/jLUid9KA/IGZApPDOhT++qQytnjboiExsQF2ViZ1oNkKafsTRudO5+HwGcqlKDgMvIVMN6rXFtwFQL5oyZpYqG49QqzZgTc0NXkOuNB9h+iWwq9QB/X9rCQ6cj+GpXKWwIA5FwBV11lCKCBGY/omSAsJy7L6dzIIWcpe+RYTEDdMJqBctau3LyjhKHCsS3SqZwRvZH2OzJ27lCeBpT4thHuFVTHyAYoIb80RrTiODa8GyYtOImFAaRdjUMjaKdtdqTj+9f2rUnznIESK3Y2ItSFR7M/byTGhFJTmlnnTgRUXB1ji0Pk5YquY0wZ1z4BLd2egYWqU3wg== 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=o0r44DGQi8lK2mAF2MeGErME5jJFvB3OhAPffrijvsw=; b=s/ySPeV+sbo4/piqxoX5wWOjISchDKODU0DFNs9jD35gQZiVSgeX8L0LbaAiHacRUR5D2GkVg8KfWIukNifzB/KljCq3yw4cAQTo2t3lDeJkDkub468ZmS4a1nsi5A4XMGquRr4FpQjOUVRw+eEL1g6vB508lBKYtHwE4CPCed8= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM4PR10MB7427.namprd10.prod.outlook.com (2603:10b6:8:181::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:56:38 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56: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" , Peng Zhang Subject: [PATCH v4 20/35] maple_tree: Remove unnecessary check from mas_destroy() Date: Thu, 18 May 2023 10:55:29 -0400 Message-Id: <20230518145544.1722059-21-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0048.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:82::32) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM4PR10MB7427:EE_ X-MS-Office365-Filtering-Correlation-Id: 875d706d-cf57-4bac-0bfe-08db57b01520 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CbY39T8TPABngFOk3XXWn5+iR6zWcCcBKY7CrBNpW+phjZ2r5zHgJ2XSPylEf9OKCXI17slEOnjCPCP+SPQaH1x/fT3E6cOw3G3LXiUbanRlrMAJJxxZm7AzkrApeYZXT4pQsKi5hes6vO4nTyCqiy3Hsiu+OIHbgSA8MKK64PVl8LPNN5GhgAR3NDbRrFsBQNUPcNJ3n/WO505cvIUTmp85W52Ipr5uXhkgT82j5fG8FYMXGLiyE8ja1xJpRGQPuyyqybAvOfR/Wn6gWR3uj+AdHc7uBYutpEIu9tJ2nBToHsgLz/XnEpdkU6qrMdTd7pWwwjIm6djLYonUhXeYOwbIaYiCoBBjf/wlFZY+WJws9QlWx0r9VbdzHaJZUJRglcFpP/3Fj7yMDjhYzt3UYGfz83OgD5w5CLhSmunGiszb3cqZc0HxDQqPCULaVj/OURTVZP9hYBJq63kMTna8rTAt8Aky8OHVOUdcETrfTuEm8zX8vBFvl4pPinWgUnLws3Ueqy9B0FpYsxZeCWbgxaTnvPjEwtURyYD15DvCTrhp+Nk2tey9jZuMbnALvXEo X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(346002)(136003)(376002)(366004)(451199021)(8676002)(5660300002)(8936002)(4326008)(316002)(6512007)(1076003)(83380400001)(6506007)(26005)(86362001)(186003)(38100700002)(2616005)(41300700001)(478600001)(66476007)(6666004)(66946007)(66556008)(6916009)(6486002)(36756003)(54906003)(2906002)(4744005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hGU/L9P0z/sLWHGZmdfo8bPOejmYmFheOhcboWPZGdaLeeIIsfzRLwQdLyPluCE4vlR0Ao2yrcHQD08aV2TdlxcK6U92L7v58weZqRoRVn2QnVQXxjIoP8x5Z2SV7MqnW8apjiq24Db5V/EIjkyr+3CpmuHEXMim0MPmsb7wuujig7HHMFq9Bk8TeuuayCHoLoDA2NhsECiv2AKLdb9GX4UT4JMitF4UwVTFAYEM01SrZwVwVn6+81+LELWO1J+sJJngpB/MPM02LmH0RZ8drNv1cnjl0HK0Fr575d9S86o1NLc8jH8arriNFHxoCjQTiul6riBqAnPH9y6C+lPo3hFl1SjTxMkdn88/4iNarfiEjzulrua1lm7bxJljoKrMkO0ASwtrIoY6EoV0MTUdGL+JIVXhhktqSNRtRmHeeRSdkH2bIZ1r1bx3nk+md/xS25E7FzSjPPCcvLr8zYPXrVNJmp2ysAiL/wfJaII5Gi0Q16CLpVWsisB7ARoIfJb/boblcEpGAB3a65L4kKoziVZ9rZ0e91763O3dsYSTfvzkd5nHLrTiVt9l+h9OU3oucQclbhL2Zh0ceZOuopOQyB/0FbFUyL0r3atgsBN3D0KRwMXCFqKiXWltaaVMvRD8KHhxt0KyucrkoIzGFNbmsFrJIyMTvuwX+UKL4upCOYphz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tj1Q707/KwFju3P5vpLBqJ3Yg4JJUBTBCzzk72UxRhSiHiRIeWVg6ayJCszqAwPfTXKi/itFOaDPu2CTlzZpwW1tGanSuS1R17kqwb0CQcL9ROHDYw4VYO155CPymw7oK22cET2pdkGLhO71rjV7rL7/B7jkB/BOK7zeHNMyKyLBqDksu0dATH/0xFEzNxvKZHL/lR7ysKLfoJfbLCRQ2RrEqSySYSj4ETKIr54p2GG2+rs3i9+iSO+NAje9KsCy04l1vJ010Qhbl28rBggpiYVhPVz3k+v3jMfKMrE1yZONoXCY5grP9nSzzZzAYNImhHtFwrfzI+KVRUxgfnvO2W14gkHy0zXSBmkeZe7IMdFd3bnPvE1Zo8HbCIXOuAUwUJ2RsF9FVUrEW//V8gPJrFZrk+vVNpqnua3RaTHQ5q8l3qCjJB2FRZaXC/gPb0raa1FTkCDL1FrjLgDbfmeegn4/ncM9lyPYu8xryUrKFYayLrNCAjPczoaWWxQen1iksyQFYy+2s5cssMCSHj4OdgPVEjljw5tyPnKDQl1L5ggvjrRmocRYe/SS8wUb7h3mDrYbzY/n361CPHIEKPJY9vPWx8U7L75/xmoIrsZDHuxVtU2KLs5yGki4G+arNCFv1mONB/1xIbWiTvOAjsQ+Mf7gQ2VL8ItvCtkRVAGZ+/OrMuH1uTHKcDoIHPxSLffq1MFv/NPbTzbzZMFLG6lKZqjo8FkgbRBXxmH7ubNSflG9eWMmQM0nhC1eZR1V3nNfui8jHK+QvbRUwduqF0nOPdx2UGqHdTGLgbM48eADZw0z02EMYXOIAExSlSrmU3BDRoY+akYNhwGw0eoso6CcZUNP372bENxyWBGZeRjq1c+rzsnLrm/fbf3obxuov X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 875d706d-cf57-4bac-0bfe-08db57b01520 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:38.4459 (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: VOM15J2Z9KlDho56a5mUaTrloTOrE2kD1LvwSpL+Gk2ENQOK1icfazHNqlVdtLMh/K1FdJ1OBmNIynFCNLOvHA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB7427 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-ORIG-GUID: 7G9eij61nVLHRGAzBCMMGRbFfqqx6-Gi X-Proofpoint-GUID: 7G9eij61nVLHRGAzBCMMGRbFfqqx6-Gi X-Rspam-User: X-Stat-Signature: t73x9s9gzxyz7xufht1b86unhwxufoac X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 0A75240013 X-HE-Tag: 1684421814-672817 X-HE-Meta: U2FsdGVkX18zOBvWsN0s9IFQoRUnPrZ3WJ3Xqb9u+oT4lE+QEZ2GUezHCr51ldNLMDXxy1X15ijOZxkMNBm1SrU4QZNKpPeyvVAouVF/hGzgglpXHgxXGiTop9D70YPk20tlQYoUn9yfYfcTwUwIMu7sohIbIsZhcN/Wv6oml1bVZEm5IusLAevWPE2sB/u7s6F4v4nvIcugyr34D39mstMo8HiR3ORlJfGaLUnqvU1ODCenjAoHiHDOARDxid7t7WPNvhqyXK2bZS0M7MgfU+7rr9VjvF5UzSZFSvn+5qU7ajrtNYMHdDSKyniGgXvTY2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hVvyq9XqtgX3uq19wZUS7R0OrD+PrkkH8c4Nkw4uxf/3kwxT2Wk5fjVAKpCwd+V3A65PTh4BLhV4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: mas_destroy currently checks if mas->node is MAS_START prior to calling mas_start(), but this is unnecessary as mas_start() will do nothing if the node is anything but MAS_START. Signed-off-by: Liam R. Howlett Reviewed-by: Peng Zhang --- lib/maple_tree.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 9f3784f4a5b7..b3e5ae43ff8f 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5816,9 +5816,7 @@ void mas_destroy(struct ma_state *mas) if (mas->mas_flags & MA_STATE_REBALANCE) { unsigned char end; - if (mas_is_start(mas)) - mas_start(mas); - + mas_start(mas); mtree_range_walk(mas); end = mas_data_end(mas) + 1; if (end < mt_min_slot_count(mas->node) - 1) From patchwork Thu May 18 14:55:30 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: 13246953 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 9687DC77B7D for ; Thu, 18 May 2023 14:57:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EA96A28000E; Thu, 18 May 2023 10:57:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E5BB9280004; Thu, 18 May 2023 10:57:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C846E28000E; Thu, 18 May 2023 10:57:02 -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 B7CE1280004 for ; Thu, 18 May 2023 10:57:02 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 805BD1A0879 for ; Thu, 18 May 2023 14:57:02 +0000 (UTC) X-FDA: 80803678284.29.D534049 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf02.hostedemail.com (Postfix) with ESMTP id 25D718000F for ; Thu, 18 May 2023 14:56:58 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=HITpHuHO; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=LM0vOOVd; spf=pass (imf02.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684421819; 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=kk1VuRS5kSNxVjC5gqUqAVN5sQ5M/Ew4SDikwGYXJCg=; b=VYEOP36XW3PxWl9VKjuKY5miY3cBLn9qKKpUe55fnZGQtTk0GZo+tHioxJvyKo3k3MLZGd +mSJy2gfQsT9gFA5uDSPuo3hbKnHxiDUVOJXofh5vIdEW7VTuSqFT0xUKZ0RoNiE0PxyjE ht71ewRKVcIjyVjpmkQ6fiE/+ZwTAo0= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421819; a=rsa-sha256; cv=pass; b=MmInsXG/4ICA031zqtQvqSL06tU/gqeJIFzIzpmwz4jJ8A7PMEAJqnOejedK0EacwgJKxc v3DPiiR/dN2VYCzeeb9c3feDOeu7J3Px5fJkLjIHKsthHAXxSUNYFCvyNu96VJ14FhbWQM WV88qti06RsMy+k6LRwJjVrz6LXtmTk= ARC-Authentication-Results: i=2; imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=HITpHuHO; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=LM0vOOVd; spf=pass (imf02.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com 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 34ICEqPV010486; Thu, 18 May 2023 14:56: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=kk1VuRS5kSNxVjC5gqUqAVN5sQ5M/Ew4SDikwGYXJCg=; b=HITpHuHOX1gPHewBmQthXtlbWE+BVFgaYakYpCF/j2lTTCgVF5S103/hvxDM5kDJlbVE HzI4WBy3Cy/p+F1JKM1ETDRN/DEud60pAhqMyQc6s/Mu5entdTuUvYxIqPNnx7mxhMbo ZKXXi4wHRTruc3mdfD7vEPtV0ipM2zygnbG5oswqPSpGJOGJfIkv3UpEbnPsAI2zwURJ LblouYnLoiNcoNIZQfw7PIufB+b67Sxf/gTqew1Lj/bykLd7HO0IBf20u0htgZN1+Eqg 659fpJWcSjBOuCe1g975Q85NtvYRr2dVN76VzUJGZj0lpic2XilUMhsHb/bLKgBzJ1fM eQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qnkux8ame-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56: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 34IDwvVZ004274; Thu, 18 May 2023 14:56:43 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2102.outbound.protection.outlook.com [104.47.55.102]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qj10d67yd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dFhMc4LohmRJi46ozfUuvePWITLAo877BtWwIFnHAyDIz/b09/h+6Z9D4kulrQs82ukhmkc0Ki8tok2exMqbIrGbX1AutzKBKxZko5cps5oOLpkIq2vvci31Kw2jAm0vCOc3HBccKrLybxOQM7qzYmCjVyu3auyOEVmR31rd/eOkcC0cDBxvTPdprPUApxofyur1xXvpupDDXZ3/eJgBxGfA28Yf7rFtuOL5ourB7jE9oLOtI0Ws02IrmULLDdtvtpah21uTHFSakPHnMitOG2IC69GXBEmnQIJ9yNRRIIA14f7A6TuVpWIr3GvIKnaMAEbhQ4h1klNBJOEgKNSENA== 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=kk1VuRS5kSNxVjC5gqUqAVN5sQ5M/Ew4SDikwGYXJCg=; b=gEITRlcxny4bRBwPd2LUGTnGcsIXmE/QepPPPEzG9XukZznIaVQ12Fcj07AfDY/IayUX/9BNRTtnoQZS+HxVVVQ/ZO8NxX2DlnqJBljpQK2lz4HDCNU+AhlPyHtt9ak3scO0r77qR5MBDLPltszGoUt7WgXp8vZ46KSF93wRNAOa6QwIZ0iF2qjFHuek7g6W+03Uit2pSVBgcSEeDovnta1RJUCOweRWGC4F8FHrQVg2vjmzcunG6UhLvwA+IF4B6gFDh+qpOtNvjFyFHfLMqQb9wLarndtP8ZVVMVlm0e/Ef7lHVUAqbviqi660hfKYpIVBUEY1vMJaGacsmuEp9Q== 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=kk1VuRS5kSNxVjC5gqUqAVN5sQ5M/Ew4SDikwGYXJCg=; b=LM0vOOVd/T08go+Up7CoYYCTbmywOjCHyHBHT3k4LqXOBxAMYMx/trFsCZ4Kq8tCh8C4mmChdO6f4UzqLuvo9J5u3A30ne9KGCPoDmpCkncQ8deyuQXej62baOhMB059c3Ww3DQWB65eMhPznApNXzjTztYxcqZWOQQ7FCK7LrI= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM4PR10MB7427.namprd10.prod.outlook.com (2603:10b6:8:181::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:56:40 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56: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" , Peng Zhang Subject: [PATCH v4 21/35] maple_tree: mas_start() reset depth on dead node Date: Thu, 18 May 2023 10:55:30 -0400 Message-Id: <20230518145544.1722059-22-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0003.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:86::23) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM4PR10MB7427:EE_ X-MS-Office365-Filtering-Correlation-Id: ecdcf175-ff33-4eae-cf4c-08db57b0166d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sh+maO+MJ+D2kakE8yMdjywlVS1OOYEBmMHJ6xzs47Dta+Ww91AQ6xvQ7yP2vpYcVV2IKHkpyRG/QysNcIcsaUnRlcemZg7Er/94g8iQkKkJ4BDB7tZ+Ecmq2Y9K/FbtV43d6Zmdxo2pIk+PPLvCAGJ2eP1szUjvbS2aTiFtqAZSQHRgOYYahe5taWUFwxI9UyHPmS5Kk7imC8XJN0hU0Vegys+iC/62tZ7JArn5AD2uCUKsZpUfMaGTgEQsSscEGNgzW7DxHr4r+rIYXfxzXl/ASavqluMn9zluvXtYnqdX5fBDwKmiUqXADv+d7ZExdGNEe2lV4Fid/4htPg9mKW7O0V9238NYXM6jugil4xJacg87XG1pG81vPAnjVt1UlD1E7DODk52vapenqjaU3XfakNLCcheNki4W90+Ry1iqD13zPS0mDh+TEfojHaU30J6Xf5i23Zsi9iC9DN5ccHEd8bG8Q0auo0xOWCNA/OlpOpWib1Z955xFItGzLhv/femqOF7qcCvu8NQkRI0WQrIjQke5s+PkIzxqV/TaTXur0BczWHnL67ZLsKgj+Yno X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(346002)(136003)(376002)(366004)(451199021)(8676002)(5660300002)(8936002)(4326008)(316002)(6512007)(1076003)(83380400001)(6506007)(26005)(86362001)(186003)(38100700002)(2616005)(41300700001)(478600001)(66476007)(6666004)(66946007)(66556008)(6916009)(6486002)(36756003)(54906003)(2906002)(4744005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ie0Um6gvSo8/SARPKGN5YzBIWkExd5ajggppePzd92Jo3bErlhOnm+9b68LUSTa8lzZezBcaxwwXtN6O7m10yw8mf9PYr/91mCklb6h2QvvcoJmDqhpxun4HufC1l4s9RdAMfviIgCnqwD5l4ya9Ghyv2jTa1Zm2BBMWSjgLFewviWKA4jOluwHpvMU/Ipgw6/ZISg5O1+tOn1Kc2C1941dq2MoSEmWZCuNGnBSqhtUvLAa5Moo48qzhmQtaaTI3+F0QJU3A5busDRQAMQDakvTBcCRiAc0bWK6XjnoHcpKvrCRhYPbCC5xzqZBhewwiuGQACgVt4MM7ikyHI1g09G0re25TJCYo4yNjqk1iJ2Mm+/tFlvvzxzQ637aTgTqRSnQ0Sa/jUU8BOm3dSTVaKuTvLPE5gync4wtiN5DFmmPTJOPiSvSnTjDnIxW0qSRDMrEjJhQhB7Upbamk86+fkrarBArj0wHy1Brgwgj5YQcJmky/X1OYdOqkQFSp1o1LfCtqoQiUbjcsxBN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IGV2vFJeXzduOClyY/zgjnboA== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 15b07NxpTF7KDRLvHGzKXeP8bcIIXNkWfQ5JcxJyKM7wJVLN+7iAp+BFjNGXr0IkD5F84qfxguEROlpB5ScaSl0/RQ3I3OX9g2VvJqNUBbBz28L1cJhN5kgncdfQEzmsAL8gjAqMc1zE4oXDIy1s+aByYfdpcqc8AqNuxFFRj3olTZA6rcH0R1T0xjwBj02jIrSFw3Mrq9+pNOrK+L45hoa8TKOSzISj20zEYqiBekJgy1GODBPhbmtFA9ALf6PqNq8A8K9eTYL02C7EVRwrNy8/10dcqkVEbKVLXuXQBZ+RkiPby8tY+d4KylMB+XwVKzSpBC2RF0CfUjKO5I/XIierDOKMpmtPIRyzcTgPiKx/6txRrGEURBLPfVmlZcDa9kj8gKh0tr5nAjiFCEwW0oblJGzfIAPGBoWptvVOI+tFoASdqtK8cez6VynUGleU+Fuy5oJPIM1ee970UGO3ENREit1vYy8bypwPcyUMq/JqEd1JegVzrKnMo0z1R1U+a39bFdtvJqg7XR5Mp4W/n+7s4ck0HSFBUSRk66C9LuzUWTZ0Zpc4AimKNqo1SK1naWdxVXQTS23OmehLgBVk3TYBSSf2g1Yc9lzCXAA+f+Stm+35BZdbAmQfUxLmirWury8fHjrmqMLwwDGDTVZIfMbpkT4IJojuZnlzql+45qZplqnsi6mDlzKea9GpJze3VhwRhXrMiEad8F2kkA01OuGk9GrI0JEn2DQZJYRX5+zGyo6rP0u12bVgNvSGDI3/7oHnQihz/nKKWzvv1jihTfWWwGqIzSKMtc2U5y9f1stAvfOsb+l0nTdx015CPRbFgvxqkF48Fl3rpzHCXpqc7A2w/0r4GXa6VlcSkhe0IGw/+mowK1OdgoTQ5TBgo1/hehSNRE1hWVYsTFYr8VlcvOet+JrlnPnu02hQmkANa7L8ustQcRyUayVGWklgnt7K X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ecdcf175-ff33-4eae-cf4c-08db57b0166d X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:40.6450 (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: l1QRjIvdwV5wrrRu+eop6kYsZQeWmkQRpd8QsrUECTeUSxhT+l31Y1m79hoIL+x2QKY2Tt+05pnkUyS6F+7lzg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB7427 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 adultscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-ORIG-GUID: JAAlHjXfQgd_QeHHVr3E46svQe0rlBK7 X-Proofpoint-GUID: JAAlHjXfQgd_QeHHVr3E46svQe0rlBK7 X-Stat-Signature: wt176q6n337eabkwzz15s3yzjqfebsxz X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 25D718000F X-Rspam-User: X-HE-Tag: 1684421818-681505 X-HE-Meta: U2FsdGVkX18HZeH3Ic6JiIUjzs1rfE28gQpJjh4A7sAxCHu5DCMe7KuZTeDT7UdrtJmaYtGL/4WdVhVf7FrxIj68b7zwJ5L93pZ49JJ2f2ggr2OPEHb4e4o1PVDXBBrDW0Htjx8pZKqD0ARgTAFwqKtM73CtH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OAdjBIHwCc7w0HoOxnD/XTcqJoGPJ3kPlnyRSNNjd8qqjp5YePp1BCtjXg1IiKbyLoc7jstiUHdRaN04yccflqkfRVJQBEVHtpYSqoUfULHjPdt66s2r026Tl7thMWeSafpa3Qk1DKHD4f0UUHi06luBhzUm9QRtDhkeLuAsQmDVSY30XsMHtdovCxGfkyKjFlnAnO60PW+7eN3C7EXOPKrPsNxIPeUBxibWq3yI7msafGWXr3zDTZIBrRVEJM3g= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: When a dead node is detected, the depth has already been set to 1 so reset it to 0. Signed-off-by: Liam R. Howlett Reviewed-by: Peng Zhang --- 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 b3e5ae43ff8f..e233f41ed4da 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1396,9 +1396,9 @@ static inline struct maple_enode *mas_start(struct ma_state *mas) mas->min = 0; mas->max = ULONG_MAX; - mas->depth = 0; retry: + mas->depth = 0; root = mas_root(mas); /* Tree with nodes */ if (likely(xa_is_node(root))) { From patchwork Thu May 18 14:55:31 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: 13246948 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 5DE37C77B7D for ; Thu, 18 May 2023 14:56:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E3507280009; Thu, 18 May 2023 10:56:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DE5E3280004; Thu, 18 May 2023 10:56:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C397C280009; Thu, 18 May 2023 10:56:50 -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 B538C280004 for ; Thu, 18 May 2023 10:56:50 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 8250B140839 for ; Thu, 18 May 2023 14:56:50 +0000 (UTC) X-FDA: 80803677780.08.ADB570C Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf22.hostedemail.com (Postfix) with ESMTP id AC995C000D for ; Thu, 18 May 2023 14:56:46 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=kH6HK6Gx; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=HltFhs7h; spf=pass (imf22.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=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=1684421806; 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=jgywN8jRiNRwTIyRRyz+BVe3XwlkNQkfDm5N7nxtCT0=; b=WD1iQaUSFIHInTSW2N5Q0/oDZhHEf4131crFLV2qckYFMn0oeYtAeh2OcnTwVRQBBy9m98 XmBe68RTMNKCSyh36H8JWGDtA14dzzD/Kppg9JfXutAAy/8FiGgemh34oaw9dnsgOhcTw0 EqQ8qtw2uUWf3ZZZ7tgVbipz810AP6o= ARC-Authentication-Results: i=2; imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=kH6HK6Gx; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=HltFhs7h; spf=pass (imf22.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=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421806; a=rsa-sha256; cv=pass; b=CpJ2LeXNuuAOk6+EbKWtatsP+87rHdoeA7KtdLnqNhx6p4IP/4tW37uYNPB7X778hRPRTM ocdxJwS5ydL2BiDWa/AnL+sZZCblFjsdfJQtrL6dRV3Pd3VQ0wKbwXi0lMSTM8FUTvc+pV 5wl+KlOEomkufhzQgF2dZ3vFu37o86o= Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34I6IlYr012447; Thu, 18 May 2023 14:56: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=jgywN8jRiNRwTIyRRyz+BVe3XwlkNQkfDm5N7nxtCT0=; b=kH6HK6Gxj2S+IDz0cO9C8zLJo+Q59oBueWGwNXY950voWl4D95FH+WsSOTquWUj5xjfM 40Fc5KcJvkO7cekOyKjf1aIbIz3kxxKApIzGUVdhaVef5lAfZEmy7kJnVwZBa0Z6uOuD 8FdCFqrYPITEq4htsrdHD7CAN/zM/TNUPkPleczszljTRa7Lp0CLEwelwpHtZGbdj2bK drVH3Qjq2aySLBJ3iYUlxQ6mYuCCJEMFII2n0jU4BQhSKWx3gKd9ME1Tuv9VL/fSSt2u WqwA91vMbt31BxWZQK/3iZ4F34rX5yEzKIjq7n56euanSDgJwwpfQt+mwgmChQtt0GSN 5Q== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qj2kdrh00-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:45 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34IEidhb036327; Thu, 18 May 2023 14:56:44 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2104.outbound.protection.outlook.com [104.47.58.104]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qmm03w3tx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ej4njUs+c1MWR1ZoyVVAJuBWO4WbNagSIuBZjTlswtvtMy/k9AbZxCzzMSiG2w3DYdDANyodu7cedLhaTMSozniicePWDt85elnQGWpa94pOGS+UR8ZSjIsHFRDH0CZldUBGyWCzYi/GGBBzoWdUOBog7fkGBN99CDgoV9PkSagLc+ywpadxLv0kpzGR6bJuL46C9G9JKzZsmtP8NQUR5KNraGvEO96ZOpkL2lukZJGkEJUAJXWx/byBzJExxUpFatA3e0TkaqnkqnsQ6cWTXO+OnFY3l0+7G9zFR/UBPvoNlSfoj5NivKyCC31M1l9v2u/h2aGSbqnQEC2g15Ofeg== 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=jgywN8jRiNRwTIyRRyz+BVe3XwlkNQkfDm5N7nxtCT0=; b=iguE3oZgfVijyH9+8noAzyrdh+INRsYwTRTGc8AWYkk5mF4NZoqJgd8FJoHWlYZK6sfJJB1TpgNEkdfTAzc3mF2Zi8mqyu1vacCtvfMq+U8Sc0PyJtSNTh9yO4WkNgV2157wQ3mQ+LU7pWYfu65d8gobOFNQRxIJl7FX2YTUbXU2HnMT7D5fO4PbKXPe3LhJ3KUXjK8UM+rGbzu35TcgcqfqVEBxPihTnb0HYuGQzwDJZR8TH1u57ZE9RVTpTUg1SZrg1eYkzOcEvZcbzZTRux28vOlYU27kIyUH6E2JsNNi+zyCX19pLEHYj44TMWJ+qCxansqj1ZojNeEPcui4fQ== 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=jgywN8jRiNRwTIyRRyz+BVe3XwlkNQkfDm5N7nxtCT0=; b=HltFhs7hrzf12wOmonJrhpV7sxZDY/P7xxqKym5wu98kFAIW7oObiH/9PuKBYVgva4FSA/F9iQsIwChmWDsDD1Cf7Y/ZEK11uAm79XqDW3dIKVBktN7u+O482AoiJVe1wWFFLTfVnfalxawC27BvmupY6gl/Nvk7wp6UWz2JIrw= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM4PR10MB7427.namprd10.prod.outlook.com (2603:10b6:8:181::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:56:43 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56:43 +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 v4 22/35] mm/mmap: Change do_vmi_align_munmap() for maple tree iterator changes Date: Thu, 18 May 2023 10:55:31 -0400 Message-Id: <20230518145544.1722059-23-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0367.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:fd::22) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM4PR10MB7427:EE_ X-MS-Office365-Filtering-Correlation-Id: 562db84b-bd89-412d-40ec-08db57b017eb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iFB9nSxqfLDl2YTBgVnoJPeuLowhNMzBF2Q2a97DTkcoFeRrN31h8yqZJBrkGw5z0Qcg9J3E4Pm6MFUq3ARsD9WiQjjnA8FnS4O9aRxqDuBCTFaZh6kuthVoAe5uZJ3FMiGbD3HZSEkFcnJFSMPUwBIWvlBJcBRav5pAf3LIWWTC/WhCk0Dthmclnev0uCMcopM7gkMlXOQl+nI5QKBsnMlnc9YYCh9Ku+AIAV96Ty5iqly6RO9oOQLKUtdRiNpZ2kuf5PDQoFt77HsWR1Z9MJQQ3ykgMg8bjMKU/pcXfY4/vakLq+U2M2VwG56+IxTrB2BfUQxmM1RZc9v5MnS1Un2SgD8Qyn48C7nVzBipTf+DpPmIgT/KOQWnRpxvWcIHWOg/8bymp6yoKYBS+sBblWrRGNAsTdYyG41DEGa6TljGitJY1IFRVHHzP6MHFHWxDAzREM3JIUwnoOZVmrB8tDcDVRF33BEJR81jpnqiSNj58ZwgsMx5zyZTJceZOwcNX++HSvgFoTVQZiDNW6/C/y5kbP4gCfEMFx2Q0qpL0YBT/sq67KLyNxF69H1Ewkrh X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(346002)(136003)(376002)(366004)(451199021)(8676002)(5660300002)(8936002)(4326008)(316002)(6512007)(1076003)(83380400001)(6506007)(26005)(107886003)(86362001)(186003)(38100700002)(2616005)(41300700001)(478600001)(66476007)(6666004)(66946007)(66556008)(6916009)(6486002)(36756003)(2906002)(4744005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3pOt/5z6n28u8a7wnFhWguJIPykQikGNU7jb0sJSqcxiCZhsGqnuFD0xXcWoJ4iKFaSiCg85AWiRS79Qa/anlZiE/zPmICwZ502b+3m2YoNBOO6xbd1dIU70ozJFOvsLsyTJ4NaEcop6wGW1cqTeURw/Do9fqtM6nR6oCMOxjiAr1wqkStdybu19IY/uNw1rVrRPBrdJVxNW8d36W2BQ1Vv7pH8guIPigXIRhS4HAActwOcTO8ijfyJbvrYanU3aFDjgE39B5ro+Vln7zCqNosj5rOrWYw13sO6qtTuMq3zTfsw4Bz2iTSPUWFnnmF2MTzJ+jApXyYAbRsUAVYezJq2ZBT04xMlSSfEZQMqmIcz8Jwx9cZJ4YCRvgPAlXOKonK75c3vFP4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IE+aFXlRWDB761EBICPlnwlWQ6+IPM0uYAXmP5wHZG75ACOt7eMEh8FEV48q1XeM35AGXqywGbXgCbOv5tq7CynXWA2Q== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 562db84b-bd89-412d-40ec-08db57b017eb X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:43.1198 (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: hezqRNr93dbp0EQ5zJEy7IL7BF9QQBrbKzicL70f1gOe4O4ZS/jJ8/i/AHc0gvlhoqUZ+GHrXpQf/YcxZtbWPg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB7427 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 malwarescore=0 bulkscore=0 spamscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: 2NTUNuCQ95Lzfw30g5KPpFc79bmv8ea5 X-Proofpoint-ORIG-GUID: 2NTUNuCQ95Lzfw30g5KPpFc79bmv8ea5 X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: AC995C000D X-Stat-Signature: 3imrm6xqogwk1xubffjte683wndqbzcz X-HE-Tag: 1684421806-270184 X-HE-Meta: U2FsdGVkX1+cKQ3cygHMatUScm2lz6OIERWhjzATR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FSxRfpgaYVrCosf5lPaQFtF2dia28xnqk2bhrRzcpuX+i/vGDDC3DNB69DbY3b2ZFEC20zRiwqMTeTo8T5xydJwjPnuqKdyPVkmSsXfBI79Ht+orIIXEQMPyKUEa0pCTGSlasEnQ7AZ139LGZ4WMUui0i1iOj0j0/gYeqpLh3JiXZlJAOZGSHPD2C4vy6KVGpG1NvCnxXlP94XoSfCcXvY0/9GsyZLrvvw/qNkSubQXpdbMyz17QPIaNb5QnSXUdMXepkJOcckqOSowbvrMQnRmcOzyS//9OcseWRPHczw4vd0ilb9B/RKB8= 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: The maple tree iterator clean up is incompatible with the way do_vmi_align_munmap() expects it to behave. Update the expected behaviour to map now since the change will work currently. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mm/mmap.c b/mm/mmap.c index bcebfd926632..1602c854133a 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2418,7 +2418,12 @@ do_vmi_align_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma, #endif } - next = vma_next(vmi); + if (vma_iter_end(vmi) > end) + next = vma_iter_load(vmi); + + if (!next) + next = vma_next(vmi); + if (unlikely(uf)) { /* * If userfaultfd_unmap_prep returns an error the vmas From patchwork Thu May 18 14:55:32 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: 13246949 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 873DDC77B7D for ; Thu, 18 May 2023 14:56:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1D84928000A; Thu, 18 May 2023 10:56:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 18A7F280004; Thu, 18 May 2023 10:56:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F1F0F28000A; Thu, 18 May 2023 10:56:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id DFA2B280004 for ; Thu, 18 May 2023 10:56:53 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id AF2E0140819 for ; Thu, 18 May 2023 14:56:53 +0000 (UTC) X-FDA: 80803677906.11.1FD9531 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf13.hostedemail.com (Postfix) with ESMTP id ED6012000F for ; Thu, 18 May 2023 14:56:49 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=W+rvc7Vc; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=MxCsY87K; spf=pass (imf13.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=1684421810; 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=kwlks45KaPTPCTeh1SIB2wxYF9YvjH82mk47CFRH1M8=; b=SzjNyLmc9g5bzU8zseJlO6Y/IaLAes0/ArMQ5NJj9nxoBLpzHHmiSCWHR8bQsPtAjIMAZ3 zBl7VYVIFgK1iHxip6iKibiVq0CANDaGeAPRXYDhLH3oj8pd6MXb1GP9WtTWs8kw+UX+TN qJA/JB9OUrw0T0Q2A7jabouzOmkjeIE= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421810; a=rsa-sha256; cv=pass; b=XYDcDv3PsvWL6OhezMK+8EQ6o+AaA7lj2KU8HM11VUnOmeIGRG2Kaf21Md2kkU+6k+w6hk BLYBu3D2nMwosG0iPvMb+OIDH2clBoZhfJ6kZzgDUI+t2EJQJd6rHyVR4nm2Sn3a0hadoE THqW9tZP9cL3z24lLS3vYpkX68jxndU= ARC-Authentication-Results: i=2; imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=W+rvc7Vc; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=MxCsY87K; spf=pass (imf13.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 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 34I6IrSF028535; Thu, 18 May 2023 14:56: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=kwlks45KaPTPCTeh1SIB2wxYF9YvjH82mk47CFRH1M8=; b=W+rvc7VcqZBBQQhDlN4VTySouhjp+IzjWHVJx3etAYJwd9d/BbWBJvlY5JV/jkFqY4KI n4tdIfL9O1DfCFHZRKQ2+jJb6ICAYSlmXQ3UYSjrWxeBimEGmzGDpGZuCwMRbqSv9Wxn RZSW3XnIPWygdFxFOZ+zi4EaFsJ1fN0h7hxy4V/5FqUf4/bnoABbDWmwzdFRjBTCsU/9 Jn7yjyDxlq+o//H+3mvWjT2OZrDH8bZwumr0tkDm/mM7ywKIk6UvQuCOVm7Eb90IJ9Uq XaWx3k/BRUjV9PkDSC3mtQNOpQ92sCrGC30qnn9RNadHNQpRy30QfG6baprfa0VllzE4 vA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qj1fc8f9g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56: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 34IEC28s040073; Thu, 18 May 2023 14:56:47 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2102.outbound.protection.outlook.com [104.47.55.102]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qj106mqd8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EnrxVp0/+Bs0lFCNtMRBMnGbOlDuTweZuQxUbKnxztQ6nbbJKk98GX7+AHWhbv9o+ILb4BarV378da5VQGx22qi67ZPzuGOzPDJImZ2X1vZAaUOAyU8rXbZYBx+/hbVyiVYrb2aKtR7eNjN6rLzUwziWmuQCByvr4trUfFebv0bhhQP4yzO8UNubYa+iQbk30925tMYeUzOS4edgz92yWZALhso4zGAOkEktWtSkmOTAlwJWEOxvztvaqSaA9d5TFLxxM4Iw2TDQi3l02HtA+7TQaG0NGy3oxsE3UbMWKflIzOi5cRPdGQh+IfofOkBMx8hjFzqlA8KTL9HNPJ6DdQ== 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=kwlks45KaPTPCTeh1SIB2wxYF9YvjH82mk47CFRH1M8=; b=BKOd0QUX9eiKLGKilaI6dMQ8w/enhuLxb/+ibeMnryXfPCtNUSQcDDlrj8NZVYA43dube+C1sgBXXsefPWwMybLFOWdLg0EZLxfCGf1a45X7yfdKjh9GLOqH/AD8+AX8hJib42IL9S4WhVu0BIWE4iHPCAC6DL9DadYwbR+7ug6WTzWzV+8GvNQfn4hlPgTtIhI/djZykj2g4pruSvNDOKD3TZwHsXKSfrTNW6jxd9/zw9hPfqL7m/qq/dXL2ct+0hngShjzv4dCUIKjRCTazmv2YoPwBI6IAcL0vPH9KFrzbzVICJMlOSCA9GDjalNMstcPZ5qox4jKveZZ46hRzw== 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=kwlks45KaPTPCTeh1SIB2wxYF9YvjH82mk47CFRH1M8=; b=MxCsY87K6JH2yvzXFP3qO2YzdxBQTVv6E+JIDj6Y+lsZJrvvxxlahU9Wt3PBe436slICsMRgdF1YChPyHulcmWQRF0/eAqQaeD2KKZgqgaAs5z/8v3gHx9u2JM1sW1whmP42YeVk5MlP2nk17wmB+mpAhdGzIydXx+Zd4hZjZCU= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM4PR10MB7427.namprd10.prod.outlook.com (2603:10b6:8:181::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:56:45 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56: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 v4 23/35] maple_tree: Try harder to keep active node after mas_next() Date: Thu, 18 May 2023 10:55:32 -0400 Message-Id: <20230518145544.1722059-24-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0077.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:84::25) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM4PR10MB7427:EE_ X-MS-Office365-Filtering-Correlation-Id: 43704bbf-2109-449c-db78-08db57b01950 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o8JEUyvakc/M4fuVlyw0Z3bc6KuZktHkfNLS0/JON+QyR5eodfsCyPtVPx0gdkttqE7wMzJ2Pc0kMjC/QsqlTMUtuOuG2BFSv71MitFoE1Vy3EMY7BX0LPm3hliVJAxJ9kJI+zPSaed6oK8vroEa0yXoNuoJWBKCJAc86zrDmnEaJs6Adzs1zXCGqwXTSYsBt/Pi9G87NugZsc7pX9ts9nwh0hIA9CejcSEli1mJq2w/Q7sldxTfouqoE81Db3AnpcVYqihpWnCNGRmK9BuPy1978fyduvh/9Rp91vvzxubn6nzSu2Gx0/WDgd9RZZuf3dk8lV4YhHrzNuCjt1HGjzsIayXXpdOF+fcOxejYrDCRxp0RefA8YR/kBG3FNLIhxkQFNFSpWfcbTsxH8CWhk22MtbC58UzFu927G1BraZF/0D0bYDnFQ8F0/E5EqbX+3sFs4JrgKQE8UUT68//uVJsyG+904tob6wr7yx6uKYvnWaI895QAdMLw8uGIGt4pyjRHB5P/eslSusZx+Cxl2Q9cji3NL4Mm4i6AQeOift2XkT/lHWjArKJgzoYx5XMlnl3OhcgRQbIP9GV37377ymWuQKOscSYjTQGvPcyb5j1YXFdRZ1joTgt8sFnjl3Nn7hJf2DrQUdAIbtRWcZFURA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(346002)(136003)(376002)(366004)(451199021)(8676002)(5660300002)(8936002)(4326008)(316002)(6512007)(1076003)(83380400001)(6506007)(26005)(107886003)(86362001)(186003)(38100700002)(2616005)(41300700001)(478600001)(66476007)(6666004)(66946007)(66556008)(6916009)(6486002)(36756003)(2906002)(34023003)(148693002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AUllk+MnSeuwOCLaD4aw55TtOV/5uAcGoQYSZCagWz06Vjk5o1bWtaQ255EMFK2ihophjHlZoXCKbZN6Um+y/MYl4UCozp6sFHmNPz1evEpEqs4HfatVjbQjJcep+fgfEv/O+V1l4WcuiZrcx44oX9HVGGHzKm34vM0hsy+TZ8JJY7m4lMyagrLiXkBBdNjrakAJoaZW2vaiMzw8TejczY/gPlM2AVftIflzHo673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+3ZWqazhVfazcd7d8YN3j0N3tNvuWDkYy/pCeJOwnkCHzNh/m9YoqMkFBUQgUkryw2kWe+WzqdaTbLr/vsBNWoJ96cfnokNm9m+f5v4JX+NwInWD8suLUDOOpXu458RT3yyfXfem9CAofFd3WQZ7SIFxNTL0SQZw7u8UG4qR0rbRleFCJFFNEqlso1yDIQFxcKKug2ktV2/syviNOnzb+2oouRsv71laKpDMUL96kIZ/cr3WwGt6WIcC2g/X4CdMqD/KVPcMO6hodaJj38dzTQVgEj3LecTwKzEVS7cEBTMTV8Q== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: cArVtuG8sgTpV5ggGkAz7saxom/0P5nxU0ELE6IvLQ6pbe8TUWQbahFAYsHsigapdJSoj1sTnv0qWJbHk0fb9IBNgbyci0saGwDUsH5rrIAr0neAepnT/8FaLXBUDIFCI5/msMCXjiZYgqErv+Ue+QncbfvyfnqrEMI8Jpdp9HiJ+arufe+Aux2EGmPlYlodqDdwrb0tvuqXcnRxNm3rNECYxl0NuQErkV0gJclVizqOsE3Cql7VhXnjwRBjzmQEsEjXDO+VbO7hXZbW2O8k7aYM2Qog0iC3/ZaCMNj3Y4yN6M8PO1OlA6nkOZrryHB+hbmCpxkGailXoYucbYN9udXBH2+ANCenwb0Pr8z+EPIzpQS/a8AuSXmqit5gR3uLjzay4DoQGJxiMV7YQEKkpBYosc9szULZp7hOGQuhnYtH6rMVT75ibO8wCIIYAjTDUHRXJ7+TXUBToH2Qvig7oEsdTITc1A2WF88CVSsNia8mblrUmc9IykZmAr5dc8moam78libP4dVhhprBbn8Nzo3l5nsmtCP5bVL/uK/tRv2q/nGSql2B2LjVuOumSAqXUPFaTM4S1O+LATkQhRa6CEK/61S5rwoqR7jlo/b5aOs7Pjx4Iyri8lYdvFMNvy8hoi8W0O68B2OdQvybr3r6OgwNYo0zylzdfaubpw05i0F5yiDXGpvJgL7xM+c7h8cw687aq4zRT3HuuEwxkCY3XogbgZvxSiikr6WOAwbClEhBNT1r2zr+YcLqRKzf7vgVUP8LxiLrzSyRQ/NqwD0V1jFQfW/VdSQHphdYNMcO7kZfzm81EKceECLlG8L/SLrigKCghYHmYvw8RuCCFBA6nA/rF+GzuzC/jLdDHBNrEedIwt/RiGlnK+rCW2y3aiGQP3FabWBkbaSpeLtg3RIpvQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43704bbf-2109-449c-db78-08db57b01950 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:45.4894 (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: s6Q2xjH1+S75XyxWwhAgVPs779yy30DkFKE9tcnB/xpNI4H/za/aTRi6upPC2sx6vCZOyWbSid6Tj1rZQenKNg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB7427 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-ORIG-GUID: hHG3fmaLQ_gb4abwatAWfcCA3_Cs3aQG X-Proofpoint-GUID: hHG3fmaLQ_gb4abwatAWfcCA3_Cs3aQG X-Stat-Signature: xyn8taycmehrw459dxi6tebu5tax4cap X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: ED6012000F X-Rspam-User: X-HE-Tag: 1684421809-140888 X-HE-Meta: U2FsdGVkX1/HEclFq8xa2hVmnmvcGk6VJeljSvEtaaVcbZ2q3bSzR3H4CB5oyf4x7nUopL184P+vniOihYNV8GI0HumtTi7uwmulJRaaFD8ydEG8RuexnrCyu1EQGjs1BehYdvli3zcnDEZEDn7UhCjyRMEOpS+Am1jY0pGsOP+N+/58DY6lM2TVUALlfKvNKFwqEyZjlXa98JDCmYBuqn1HdIf+6DSsTcpaE3nFB/BGAvMKcHNx+yDDKenLQWN1K3UNwMTtON61tPwUy4SoA4MI1U30Ta2oDAT0ZG41avgr9kBWawM5/aqZbXDSC88HYb3Twjjl009OZ5eUXY6gsvvv261XgNz3yOF5t3dphX8clPhpSdzqtTvCjEZPIqljZ8QOdIoVYY6Dt8n4rgLmxFB0BtrMh5TuodDmBwvPDzuj92rjQDOlulfLe8mwz64xeAHOCjOHGO1mlD6yEZVGDt15UReVLEFcno3YFroAf3aynUblEIY4YaurVQuM7AvI7Em9sCpNTdDrWC0hf8gLi2ZtJrRRgIBY/Y/MTZEdxHNSsWcHaGHZYW7YThF8TFFgM3UUeGhwisudZtgjJLSHWqxONydoVtsMTdeKD3o7SWELYrQoccqKkSCn0Te0khwMG9pSVnXVUpDTKiUpupWiPQ78iuptL4KpRBoxPt6/dbX/34rBjzQgjfndTfad+ftKMbGxiC30zsTa+eay5L/xO0hTWYYI15nTCKb0oafWA4faZg9IxQ1TDsFbsSaiMQ7VaF7H4P43SfXM0SQWohPliBhqp9z0AO0oiIjlPqccPoWd7q0d5fI33IaGA1U/1QNp5+bGW9O75QF0zKweVzSGtx93A5H2667+5dVdF8SDmNbUhYHGFlJksicOMXovP9rd8xd9RktzWqq55F5A/ArDbfzeKL5AHM35dM9xpLocWqnm6x67sGvehwESA8UD+B2BttKf/5XvupYx1mcF+jt Ga6kw7So Y0NgG9f2/YEemmN410ctuKLi/yk8hb9uednemIHCn7g5KMQ8XZ9uweIEOyzHXNxHzMCfs4TbJCvyJ556oZvgNPS5XdyiSAB7VtbXtBgM3BvC9pY9M2AoDszkY6xpp/YgDc96ZDN/4GRS6Kwp6MgxoAF43bgDSABnPXb29x3CJWUjTrFff/Jc3HRze2YHiKzVNzw3DrEtzygX7QaIS2fJCZxY7W1d+Udgb1K3F8KQ6hgEix1G+mLJVJvmfI/AVmxxMfB+B/TJ9zn1l+WdzRuN1Y/ufjsSy93vneHtRn48PsIpamESfrQ/ZSUwZEna4nTPWSHg5uvldKMG+BJpPgtl1f/1Fv5N1w6CPoVyRXOBTpcTjsqN92KhPBgBzViASn4luzd5Y1qmQXyNL0NqEA5lIZAWcTCZB/x3PSFgTb45thp+3cIo= 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: Clean up the mas_next() call to try and keep a node reference when possible. This will avoid re-walking the tree in most cases. Also clean up the single entry tree handling to ensure index/last are consistent with what one would expect. (returning NULL with limit of 1-oo). Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 89 +++++++++++++++++++++++++----------------------- 1 file changed, 47 insertions(+), 42 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index e233f41ed4da..09142af08214 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4726,33 +4726,25 @@ static inline void *mas_next_nentry(struct ma_state *mas, if (ma_dead_node(node)) return NULL; + mas->last = pivot; if (entry) - goto found; + return entry; if (pivot >= max) return NULL; + if (pivot >= mas->max) + return NULL; + mas->index = pivot + 1; mas->offset++; } - if (mas->index > mas->max) { - mas->index = mas->last; - return NULL; - } - - pivot = mas_safe_pivot(mas, pivots, mas->offset, type); + pivot = mas_logical_pivot(mas, pivots, mas->offset, type); entry = mas_slot(mas, slots, mas->offset); if (ma_dead_node(node)) return NULL; - if (!pivot) - return NULL; - - if (!entry) - return NULL; - -found: mas->last = pivot; return entry; } @@ -4781,21 +4773,15 @@ static inline void mas_rewalk(struct ma_state *mas, unsigned long index) static inline void *mas_next_entry(struct ma_state *mas, unsigned long limit) { void *entry = NULL; - struct maple_enode *prev_node; struct maple_node *node; - unsigned char offset; unsigned long last; enum maple_type mt; - if (mas->index > limit) { - mas->index = mas->last = limit; - mas_pause(mas); + if (mas->last >= limit) return NULL; - } + last = mas->last; retry: - offset = mas->offset; - prev_node = mas->node; node = mas_mn(mas); mt = mte_node_type(mas->node); mas->offset++; @@ -4814,12 +4800,10 @@ static inline void *mas_next_entry(struct ma_state *mas, unsigned long limit) if (likely(entry)) return entry; - if (unlikely((mas->index > limit))) - break; + if (unlikely((mas->last >= limit))) + return NULL; next_node: - prev_node = mas->node; - offset = mas->offset; if (unlikely(mas_next_node(mas, node, limit))) { mas_rewalk(mas, last); goto retry; @@ -4829,9 +4813,6 @@ static inline void *mas_next_entry(struct ma_state *mas, unsigned long limit) mt = mte_node_type(mas->node); } - mas->index = mas->last = limit; - mas->offset = offset; - mas->node = prev_node; return NULL; } @@ -5919,6 +5900,8 @@ EXPORT_SYMBOL_GPL(mas_expected_entries); */ void *mas_next(struct ma_state *mas, unsigned long max) { + bool was_none = mas_is_none(mas); + if (mas_is_none(mas) || mas_is_paused(mas)) mas->node = MAS_START; @@ -5926,16 +5909,16 @@ void *mas_next(struct ma_state *mas, unsigned long max) mas_walk(mas); /* Retries on dead nodes handled by mas_walk */ if (mas_is_ptr(mas)) { - if (!mas->index) { - mas->index = 1; - mas->last = ULONG_MAX; + if (was_none && mas->index == 0) { + mas->index = mas->last = 0; + return mas_root(mas); } + mas->index = 1; + mas->last = ULONG_MAX; + mas->node = MAS_NONE; return NULL; } - if (mas->last == ULONG_MAX) - return NULL; - /* Retries on dead nodes handled by mas_next_entry */ return mas_next_entry(mas, max); } @@ -6059,17 +6042,25 @@ EXPORT_SYMBOL_GPL(mas_pause); */ void *mas_find(struct ma_state *mas, unsigned long max) { + if (unlikely(mas_is_none(mas))) { + if (unlikely(mas->last >= max)) + return NULL; + + mas->index = mas->last; + mas->node = MAS_START; + } + if (unlikely(mas_is_paused(mas))) { - if (unlikely(mas->last == ULONG_MAX)) { - mas->node = MAS_NONE; + if (unlikely(mas->last >= max)) return NULL; - } + mas->node = MAS_START; mas->index = ++mas->last; } - if (unlikely(mas_is_none(mas))) - mas->node = MAS_START; + + if (unlikely(mas_is_ptr(mas))) + goto ptr_out_of_range; if (unlikely(mas_is_start(mas))) { /* First run or continue */ @@ -6081,13 +6072,27 @@ void *mas_find(struct ma_state *mas, unsigned long max) entry = mas_walk(mas); if (entry) return entry; + } - if (unlikely(!mas_searchable(mas))) + if (unlikely(!mas_searchable(mas))) { + if (unlikely(mas_is_ptr(mas))) + goto ptr_out_of_range; + + return NULL; + } + + if (mas->index == max) return NULL; /* Retries on dead nodes handled by mas_next_entry */ return mas_next_entry(mas, max); + +ptr_out_of_range: + mas->node = MAS_NONE; + mas->index = 1; + mas->last = ULONG_MAX; + return NULL; } EXPORT_SYMBOL_GPL(mas_find); @@ -6518,7 +6523,7 @@ void *mt_find(struct maple_tree *mt, unsigned long *index, unsigned long max) if (entry) goto unlock; - while (mas_searchable(&mas) && (mas.index < max)) { + while (mas_searchable(&mas) && (mas.last < max)) { entry = mas_next_entry(&mas, max); if (likely(entry && !xa_is_zero(entry))) break; From patchwork Thu May 18 14:55:33 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: 13246950 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 CB377C7EE23 for ; Thu, 18 May 2023 14:56:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6462128000B; Thu, 18 May 2023 10:56:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5A7C2280004; Thu, 18 May 2023 10:56:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3387C28000B; Thu, 18 May 2023 10:56:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 203D4280004 for ; Thu, 18 May 2023 10:56:56 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id DB211A058D for ; Thu, 18 May 2023 14:56:55 +0000 (UTC) X-FDA: 80803677990.19.C14F347 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf26.hostedemail.com (Postfix) with ESMTP id 626E7140012 for ; Thu, 18 May 2023 14:56:52 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=3YxNQOMS; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=y12prn5o; spf=pass (imf26.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=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=1684421812; 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=W28sfOc1Ebm9G6oXnJIkL5YbIyR2oRp0bN+zyezWu+4=; b=kJt/TNc3mB9fMoS5Nn7h+RgvVobW1kNx1fE+bEqZSmE70b26vBpMybkX/ANw/OYBElOWp5 dt6tvKCIDoIva8uDPncZAm1Yeglckb1bdzPvpa1/jUhW0fwOj7LB53pqNjwplRCxoRlcnJ hXFff2xZbO3nnYwdGtkRjI31G7oblr4= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421812; a=rsa-sha256; cv=pass; b=S71Tj/k4NlfLhMbtW+QuDd2+iOBwxmQwlWGZmSeF15vd29kxzez388J0gLEhhPZ7J1RcIO exhBy6ZXvweLJC917IfPjc08rEJHFQdO/ZOKqGXXkEJ/pckA3TaCvqCg2KywS8qAIt3BJo QhLEdilqu5FKY5Km5Ml0QSU6pHeqxdM= ARC-Authentication-Results: i=2; imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=3YxNQOMS; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=y12prn5o; spf=pass (imf26.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=pass ("microsoft.com:s=arcselector9901:i=1") Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34I6IoJ5006529; Thu, 18 May 2023 14:56: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=W28sfOc1Ebm9G6oXnJIkL5YbIyR2oRp0bN+zyezWu+4=; b=3YxNQOMSLm8Fl/AJk96bIxq/5lBKdJqNWDfuyK6x8L18iN6pwv190qLqdoUMgUe32O49 9zReLs4K153qsTLZi8Z8YlytXC7FaST5ipzLWIyw0Uu3ebf5fkAH5PEX5U0VsrQnRuPn 2FQLgO9/K20+odHAev/UNv35IbaEWm4QGHc/TMTUeSNLIV+NnM8MEhVlX9pf1evTF3OZ iPJkesoVZgx54ttopPMpbnuyBbAt84slHr4WfbCVhyzTK1ESSRkh5PaNq6qQ53V7GXhC HalaV6BCJJywhBSK9BvbJdvT4hiolzR2OsLnlFzm3yC+iG1urXI9MXnN8DismS3+lJj+ FQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qj0ye82r0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:51 +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 34IDdCHd040028; Thu, 18 May 2023 14:56:50 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2109.outbound.protection.outlook.com [104.47.58.109]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qj106mqeu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B/LMqj4xnMPwm4eoRHHVTcNEraqYZ8eijPxIfo2WJSQiFZcig8lLHK5bfvTeOm92uY73Lf3aB9PD9pvMnLsVJ+yvMwgZcsHNTMRTNVZBlHMO5YpIvdnod1GWy5Ltp1U7lr7STPD9zg/mXwCc22WgWtP7B6ouCyJZd2OsBUk1CZg2IAesi87NagP/HivB37TkI1JBKbpe9QBAOyhJGxiXptdMr0NClEslmwiCs22IsZ2GvsLoM+J+hjHmz/HUDXAFJUYLNFcgluTploj4KpQV6O+RhZyr0vVHQdS6jOPJ68LgFCL0pVzulvitnslQ4R+QVP1f3sAs9UK5SGmRNXnLcg== 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=W28sfOc1Ebm9G6oXnJIkL5YbIyR2oRp0bN+zyezWu+4=; b=BwA7SQm1TlMtoR3ib19r/2ULCra0yguEL9YD3gK1GcCIEQxxtj3VQnL0O37I+xDWM7Q1MBbSAGNFNXMstxMNKqERwrCpZNNyyWn4Gvb/XmstbuzvUK/vS3IlO/yDF1obnqI1EQhr2Yu9FGNr8JjhdxIJzRB5GBxNCsOZZDjyoPr33uGGXswpJfAUHopOLj3lGM0sPK9RuGALOaRaYyv+CXrgK9n9EfSfluUMenyOKgTZx3UeKVJhV3ltEW4DZxWTOM0Fqe+IzO0BuAOtnk6ZzWQUWYDVeSkuvcNHT6m1IxN4aTOXLLpbcvIYP2+LPoOVjVz6LX+AD+6eLVAqGEizvA== 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=W28sfOc1Ebm9G6oXnJIkL5YbIyR2oRp0bN+zyezWu+4=; b=y12prn5ooAR91eKDzVZ+MSOP0wRklXkwtJ/FlHZ+2hD7+LkrpraeOqu7UIFbHkvpf3ghAVzW+SQVz5ILDHDt4/LO4ywqTkrMLrKDCFoysm1myp95ug5YHAp7V7NtMG2ogH+cFE4S174spe9zRO6Czw0JQAMgFOhTpL2KjWx4I8g= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM4PR10MB7427.namprd10.prod.outlook.com (2603:10b6:8:181::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:56:48 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56:48 +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 v4 24/35] maple_tree: Try harder to keep active node with mas_prev() Date: Thu, 18 May 2023 10:55:33 -0400 Message-Id: <20230518145544.1722059-25-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0054.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:111::11) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM4PR10MB7427:EE_ X-MS-Office365-Filtering-Correlation-Id: 38c390d5-990c-4fd4-242b-08db57b01ae6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jxDpKdJaRu88zBjVUO/9+Z1+ZbM/uBLZ/SbYz1SonUn1Y0O4QEcw/AI4j8adcsBZ4FRLatqPvj3EHLte0FVokYxppYe2IMlv/e8wgZKTapXLTVYCKqFMF361xk5HC1oTxtMzlw81qLEwsvXvUs5euXxDc5vJrKfznd8XF+LLTY2LgpzLIdjP5GnleMLMaXJrG2fxndZF/++pI05FjRxPM1LcZwfYNu8WQeC5PicZnx09LBZIwhe/tPxWJQFig5m6Iro/CMQguSFZQ+e4butCV+iBJRv7HTTLdNWEfAPjEmGSEZcSIRoCFAtK+LRqyRYj32gXNGuA0shVovRyWVzHdni6XDjLaaJQhp+3PjeuLFJXNWJeGAPVv7Kh9HyqVLi9TUj2yfKg+s2MQWESYy2Vv9Qa2VTlvCk7EWpdvE8n3XaFEZXQu+O8VdZ2/psSHtK6ahuMtZHAPQo2BwD8m/X+9Mqae94h5/tvF4wTHq8D5YGVv4dgtICz9rt2n3hJVVshpX84Iuq2Dx7BEW0hY9YcnURwHS74VnwQnTztpZs9CurRv88GNvGmL0vBCEmm1Az8YMAKLiRSzphsFXXrzclsLu7SiMsDP99FgfWv9sf4nzLwPNtRcEom/QqPLdAiffRYSphrhvvY/R/A/snQlNVraA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(346002)(136003)(376002)(366004)(451199021)(8676002)(5660300002)(8936002)(4326008)(316002)(6512007)(1076003)(83380400001)(6506007)(26005)(107886003)(86362001)(186003)(38100700002)(2616005)(41300700001)(478600001)(66476007)(6666004)(66946007)(66556008)(6916009)(6486002)(36756003)(2906002)(34023003)(148693002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hRiV/57gg/QRhfny02ygSTSGSwekIEVJnh0jU4Vvk5vZKbFakZePXWUOmScsN0tKOlwgscwlyPJmq/GM12b7il+w0nkTLJ9BUypjZRziTqGJhCj0lvjtaTkYdS6N+QzB96GrslrojnMwgnxyWxOFo72H72XbuQo5kXWlcX7heMXo4WbG8y7o3tcdFRrPk/7nd/gkeTVyxYJcq1FutvoFKPuC6wb8g+2ShI1Ge6FjcX0B+KXZ6VIkTzKYaK1BuIMelqN/bGbYtXl52M8lc8PAhDPKN6FyQNneAY03qhd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R9pB+A+3GofTLPX9d+DdUIDgK1Nno5qf8GyQL/rdJouO0m0mEdYc5SNWBys9HrcDKjDCZpHuofZHIYBbUt5kR+0biir2aM3ugwZ0+n/sk0+OrS8vdx7WbMTfM1kOS1YJ1HqM5QORTaoWd6cXIvHKCHaHHNyzjI848UNljFEHb0430a9DYLEG1XuI3pvWwSB3Wrnca1r6AVEfrm5AJVBMF4Ci0FXY52BH7xtgkFarjusjP/lh0X+HCKrglsIw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Xzf67/Wq3FcXQD4g4FUUTZrZJ0NM2/d7p2W/6RDggl1JSpuZIrm4EL9eMbjhMePJ13oyzcXFIyAq+7v72yPgg0LV4RJRDcVKg1/cpKXYndJNjP1wV74Me028YHVL/tmjk33gwQox1OHzt6J8XQode4BdQOxajrkCWn5seho0cscBsfMhGy3RbOi+uXgMB5uFwSPFIneq65scBZhikq+f2J4EpNtxpfzbjI+OBA2LxknQS3Eugpf0BMfoFtkaNQHonkRmv/RgZ7E6HX//xmVrwDbnr/rS9SQfOpOVsT8lNA2jl8xFrfJIaV0MJVscG8K7l/fKMqEwBBrsMjsu6SGv4DsK6U7iGaqksGkidRiuvZGRM2sry6atv1XctWqgK0lY4gW927yQHVu1S8OuJIn0JyiDH2JmE3qt+qE/FDUxWYpMo10JUdUlCrHXslOVCl2X+TzIE6fxEZikCff3E/TAtcU+QdawqqFcUn1zYKCFKPUJrAIA+FQXupBGb2RhyVN6nxNs2RohdNxB2jDADCjSQQGYxr2GWV74BO4ZUEmTx2SXskcHnKfkjqB66j91vuo+8GDbI66FRqkUfFjoYVHPz2y1bOALCF3cLA/FFBQz56cgbPAo9tIAJ3fMlHdW1UVGCGstNqZKYHunmabjezXij45l8QzR3t+S2b+OiYRZIGS86jcOv/i8ECgVzTOg0KbJxJx3sC12yEgNkq4mCNLMELXFQuRezSB/uMUjWCL5DITM6RYacL6z5Kvy8tIBVYJTnh10nPXJvfzA3arrHFeWDgkXBBf0nGaqA8OaCNT30MxOlRtKpK+Bp/0PeibgMV/teOw6Wtxr9QLANzCz69KZhMlGd+7Tkg3Bcn1xUgN0DuKDdm8ZwRekdVejZ4aF6EjkHm0gyLKFUz/znmB7Y0vrLw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 38c390d5-990c-4fd4-242b-08db57b01ae6 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:48.1711 (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: tUh1pqpfYTUbKGUcZ+a9MtTGErXNPyI7r8B+9I66kFFFgzccF2nggozCFV05YNZEVDgdN5/I28MYKiYOAGM9eQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB7427 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-ORIG-GUID: ILsHtbKFAdztoPaxyvw3AyTf6eZPg-jf X-Proofpoint-GUID: ILsHtbKFAdztoPaxyvw3AyTf6eZPg-jf X-Stat-Signature: zduoq9nbhfyjhy89xc66jpfag6kdrkxf X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 626E7140012 X-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RMQ2AAW0Be1bDy7Y9DssNSchW7aLVa6XhZw/oreBtINnnMCUHjo+wG1ehrjwcZ4Br0o/GhlxicC6a2+fcPv4jlJR9zmmelTyt2tvION2gqFlEEh2UyK0zaD2eKL2oGNC/pZvh8OTQR4/kxmXTTUMSgWvOf9cpbqYyoGETIukG1mwzAsHeCSD3pw7E29YoH7pcKJ3FMeEvd+RHMCo5pnJxGDPOyA4teah4SH45mDHqQ0CrgHPoTXTx+sfdM/SdP7+auj5sepkrNtSPvsrJJ0+21kOmkZalYsrEqVG51/Lko5nXkhzGOA4w24UYx/eZijuhPJrYY006qwKrrN1pYKWr/3+UBI2BCQiUU0I9SQE7q83Ptl5QWFxc8Kh69g= 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: Keep a reference to the node when possible with mas_prev(). This will avoid re-walking the tree. In keeping a reference to the node, keep the last/index accurate to the range being referenced. This means the limit may be within the range, but the range may extend outside of the limit. Also fix the single entry tree to respect the range (of 0), or set the node to MAS_NONE in the case of shifting beyond 0. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 125 +++++++++++++++++++++++++++++++---------------- 1 file changed, 83 insertions(+), 42 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 09142af08214..425ad922bb2d 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4827,7 +4827,7 @@ static inline void *mas_prev_nentry(struct ma_state *mas, unsigned long limit, unsigned long index) { unsigned long pivot, min; - unsigned char offset; + unsigned char offset, count; struct maple_node *mn; enum maple_type mt; unsigned long *pivots; @@ -4841,29 +4841,42 @@ static inline void *mas_prev_nentry(struct ma_state *mas, unsigned long limit, mn = mas_mn(mas); mt = mte_node_type(mas->node); offset = mas->offset - 1; - if (offset >= mt_slots[mt]) - offset = mt_slots[mt] - 1; - slots = ma_slots(mn, mt); pivots = ma_pivots(mn, mt); + count = ma_data_end(mn, mt, pivots, mas->max); if (unlikely(ma_dead_node(mn))) { mas_rewalk(mas, index); goto retry; } - if (offset == mt_pivots[mt]) + offset = mas->offset - 1; + if (offset >= mt_slots[mt]) + offset = mt_slots[mt] - 1; + + if (offset >= count) { pivot = mas->max; - else + offset = count; + } else { pivot = pivots[offset]; + } if (unlikely(ma_dead_node(mn))) { mas_rewalk(mas, index); goto retry; } - while (offset && ((!mas_slot(mas, slots, offset) && pivot >= limit) || - !pivot)) + while (offset && !mas_slot(mas, slots, offset)) { pivot = pivots[--offset]; + if (pivot >= limit) + break; + } + + /* + * If the slot was null but we've shifted outside the limits, then set + * the range to the last NULL. + */ + if (unlikely((pivot < limit) && (offset < mas->offset))) + pivot = pivots[++offset]; min = mas_safe_min(mas, pivots, offset); entry = mas_slot(mas, slots, offset); @@ -4872,32 +4885,33 @@ static inline void *mas_prev_nentry(struct ma_state *mas, unsigned long limit, goto retry; } - if (likely(entry)) { - mas->offset = offset; - mas->last = pivot; - mas->index = min; - } + mas->offset = offset; + mas->last = pivot; + mas->index = min; return entry; } static inline void *mas_prev_entry(struct ma_state *mas, unsigned long min) { void *entry; + struct maple_enode *prev_enode; + unsigned char prev_offset; - if (mas->index < min) { - mas->index = mas->last = min; - mas->node = MAS_NONE; + if (mas->index < min) return NULL; - } + retry: + prev_enode = mas->node; + prev_offset = mas->offset; while (likely(!mas_is_none(mas))) { entry = mas_prev_nentry(mas, min, mas->index); - if (unlikely(mas->last < min)) - goto not_found; if (likely(entry)) return entry; + if (unlikely(mas->index <= min)) + return NULL; + if (unlikely(mas_prev_node(mas, min))) { mas_rewalk(mas, mas->index); goto retry; @@ -4906,9 +4920,8 @@ static inline void *mas_prev_entry(struct ma_state *mas, unsigned long min) mas->offset++; } - mas->offset--; -not_found: - mas->index = mas->last = min; + mas->node = prev_enode; + mas->offset = prev_offset; return NULL; } @@ -5957,15 +5970,8 @@ EXPORT_SYMBOL_GPL(mt_next); */ void *mas_prev(struct ma_state *mas, unsigned long min) { - if (!mas->index) { - /* Nothing comes before 0 */ - mas->last = 0; - mas->node = MAS_NONE; - return NULL; - } - - if (unlikely(mas_is_ptr(mas))) - return NULL; + if (mas->index <= min) + goto none; if (mas_is_none(mas) || mas_is_paused(mas)) mas->node = MAS_START; @@ -5973,19 +5979,30 @@ void *mas_prev(struct ma_state *mas, unsigned long min) if (mas_is_start(mas)) { mas_walk(mas); if (!mas->index) - return NULL; + goto none; } - if (mas_is_ptr(mas)) { - if (!mas->index) { - mas->last = 0; - return NULL; - } - + if (unlikely(mas_is_ptr(mas))) { + if (!mas->index) + goto none; mas->index = mas->last = 0; - return mas_root_locked(mas); + return mas_root(mas); + } + + if (mas_is_none(mas)) { + if (mas->index) { + /* Walked to out-of-range pointer? */ + mas->index = mas->last = 0; + mas->node = MAS_ROOT; + return mas_root(mas); + } + return NULL; } return mas_prev_entry(mas, min); + +none: + mas->node = MAS_NONE; + return NULL; } EXPORT_SYMBOL_GPL(mas_prev); @@ -6111,8 +6128,16 @@ EXPORT_SYMBOL_GPL(mas_find); */ void *mas_find_rev(struct ma_state *mas, unsigned long min) { + if (unlikely(mas_is_none(mas))) { + if (mas->index <= min) + goto none; + + mas->last = mas->index; + mas->node = MAS_START; + } + if (unlikely(mas_is_paused(mas))) { - if (unlikely(mas->last == ULONG_MAX)) { + if (unlikely(mas->index <= min)) { mas->node = MAS_NONE; return NULL; } @@ -6132,14 +6157,30 @@ void *mas_find_rev(struct ma_state *mas, unsigned long min) return entry; } - if (unlikely(!mas_searchable(mas))) - return NULL; + if (unlikely(!mas_searchable(mas))) { + if (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->node = MAS_ROOT; + return mas_root(mas); + } + } if (mas->index < min) return NULL; /* Retries on dead nodes handled by mas_prev_entry */ return mas_prev_entry(mas, min); + +none: + mas->node = MAS_NONE; + return NULL; } EXPORT_SYMBOL_GPL(mas_find_rev); From patchwork Thu May 18 14:55:34 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: 13246957 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 2049BC77B7D for ; Thu, 18 May 2023 14:57:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B4DC8900005; Thu, 18 May 2023 10:57:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AFEA0280008; Thu, 18 May 2023 10:57:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 92995900007; Thu, 18 May 2023 10:57:17 -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 7F5DE900005 for ; Thu, 18 May 2023 10:57:17 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 41DDD1C75E2 for ; Thu, 18 May 2023 14:57:17 +0000 (UTC) X-FDA: 80803678914.09.97D9306 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf03.hostedemail.com (Postfix) with ESMTP id B932C20014 for ; Thu, 18 May 2023 14:57:13 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=ZMFuZTSn; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=lGxiMc7r; spf=pass (imf03.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=1684421833; 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=s3ex6HS9UhbpN+9ia8BU0WmPJxpM6tKnuxn0TPH+HDw=; b=AvfmQCfukSnAm/59bofWGNG5zuw/zq3q1qusZWZrHlmqnMFG0bxRZBNFRwvLXQDVCrc9Xs 0uVpVTTBKjKoSkP3iKDGEw7SnuoY8jBCcUVK7Wjn4ohuE6A3IUetrDIjsDFFuebQStTctQ SYVAUtWDEGvv29+98wiDNDsz9HQ4VdY= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421833; a=rsa-sha256; cv=pass; b=273o95Sayw/On6lJn7dcXlMYOLioaJxqwtkEHfZ7KL5chC6x+HgSMzKpwqBbKPxFruEgbJ e7jHErr04OYA1Vbf9AfiEclCMmFyJueuhhBNcOHzUn8/xBNoUezddUEowgRGfbIMDhf7vU HkAMUug76PQKOKpGcS5smiCiro432DM= ARC-Authentication-Results: i=2; imf03.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=ZMFuZTSn; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=lGxiMc7r; spf=pass (imf03.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 34I6JDTi018335; Thu, 18 May 2023 14:56:54 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=s3ex6HS9UhbpN+9ia8BU0WmPJxpM6tKnuxn0TPH+HDw=; b=ZMFuZTSnU6tJKATAIHyu7csPrZbJUm4ahaunzio6NrMuPl2P1aOy9+JqMjsC8ZN9pROA D98c+C0Axy86si60/iVucpe9vv3T/4cnkLPOAIXOFK0H5O4XuIiM0sSqVXgMy8498/Wd gZqBn+zYxm/w8bF0fDnjAkwW9L+qhm5PStYQdm1P/0GlCUwtg0TKvQVkQID79/rsj8JD VnLqQE5GIVXOlKDGpcw/7WImuVbHM319LEYRuDwijycNBSHoWUotcQ3TxryySflInJBy zRnLFUvFEobV5OHqLrWsHiAhZ2i8ZWwAXO7mq6PuK5J/d6lovoBksZmLUkanJzrD0yOv jg== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qmx8j2vpe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:54 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34IERmLc036399; Thu, 18 May 2023 14:56:53 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2101.outbound.protection.outlook.com [104.47.55.101]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qmm03w40g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RYQItWPl6O0zmatgHVYRaKtzF+uhmAVqn+uIaNkVR6joM2aR51oWOrcvEP+mJulI//bOBcQ3iEjUP6UmcDGFtLogT1tQXShnWqRAwQWTirNpqZBBYWHgJ4Qzwl3Ck9E3Wnt2D+Xpv3qac/n3BQpfsViTULbFm+g8BSjSas3xtcy6iyeLws25eV4FoFt1ivzbrPQGmGOpwqA9AwVvj5XDsICRsmnNjORpqh697v6x1R5TZX2B3ymjPtFfExex3FGKXqsM+SiAnG4ZxMV6oq/5qz4JYE2Yjf5KWy97j0LN3TQdKn2hzmUiV1LKy+d3ry4PK24CnIBZAeNGtMlLgkV1QQ== 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=s3ex6HS9UhbpN+9ia8BU0WmPJxpM6tKnuxn0TPH+HDw=; b=XiH3ntTychzLzLOo8ytOF/7RoIx7fw1AVwyaEmOmovOWgPe/NLdgh3k7/MgDb4g4QiQR88GvpOKdgUN0dmd1zMWPNQ6Tc8wKlAXzrcJQg+/DPTyvIoYP74lf3sogXPrDhhWYPJkJYw/uHTMyJqbSctvpXIgwUyBe0+oNzRWLxvP3+4po06w6pN9PVCI8F2VQkue5oYbPkt7uXIcrEIhb5kzFTM1oToSYhNlDJTZiIT7NprDAz2TAdpVwD23ze30IaR+2qLoYGabXclUSkBZaLrs4ceI2Y+rezU46hornCLHUtZqYfgf0OtVXMkxqHOLcTLM5wcXymYhaXk3Q+h/Deg== 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=s3ex6HS9UhbpN+9ia8BU0WmPJxpM6tKnuxn0TPH+HDw=; b=lGxiMc7rhwHfm87SvpaclvaoBrMJHSm9370t3mfpfVLteBBumoZ223UVMoMqPFZspRaOEeHp5Tc27+Dmz0Y2NXyNdDit2gTy0WeRipTA3kxWWehD0ithnlvubnWpcWPiOn19oRDqtHt8kZbAwpocnUrXzWup05ljBpx2sHgidaw= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM4PR10MB7427.namprd10.prod.outlook.com (2603:10b6:8:181::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:56:50 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56:50 +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" , Peng Zhang Subject: [PATCH v4 25/35] maple_tree: Revise limit checks in mas_empty_area{_rev}() Date: Thu, 18 May 2023 10:55:34 -0400 Message-Id: <20230518145544.1722059-26-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0072.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:111::26) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM4PR10MB7427:EE_ X-MS-Office365-Filtering-Correlation-Id: e307035e-966e-4754-5a73-08db57b01c68 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SKnU9p+paBAiAAlbECTG07aiRe3QDE9wHddbg1Zp8cvVcgRf4TNNBKtSt541NpXnONzILjwX4HHkT0JJxD+fqz5zRXU+A+0ALNVPeSCmr3JTd5rHsnBxvxwvJ5E0J2YBRha9ksUzAA4WdHJdk9YOQBIxC/aaIKQdZCV1zBM4KG0dat1ZM9DxlEvBSQLOP/dTZZ95KJGPXwdp347gaFNryjCvUGR5jmy4xYr7GVeVLM31nTSXUYatIa7s3jf4J0pU9ibfwMZWq1VPNDEbwW8sZSpdNlBdD6WtH+wgl5+fRn00+zWkFHy90G4OzSTyKps/LvWox0UKlmgupI+/adQ824AdnwlDoYcdbufCkwekTIt1XRM2pOfE1Z5m/VNxyKYLrm8eWmfcM/0M8VEcpT+aUmFbiR10zfU2fbA+iqghIEFzrxV85YYTUP+Ah1ikgJ+Ot5SbMTh7LQZvjptY13/ax0afxb5nnJ/K24/Og5ur8T9xIDUkhbZ358k1QpqicCaBPqFPls6qczRUxcLmP9L7BfGyyV8OM/ZeZPeBJ31lRj49ow5ulvf2PzKjW7ajkTO1 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(346002)(136003)(376002)(366004)(451199021)(8676002)(5660300002)(8936002)(4326008)(316002)(6512007)(1076003)(83380400001)(6506007)(26005)(86362001)(186003)(38100700002)(2616005)(41300700001)(478600001)(66476007)(6666004)(66946007)(66556008)(6916009)(6486002)(36756003)(54906003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JzbKU+kyj5wjSycZpd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WyaxuIC+pdFKBUnkQ/FqQEOzQw4xNMsvbfMnGaN7uBnnxUGygbfsp01/uQ/djf/EM6lbiqp2JdA9PCkKillxOqJ4Nf9LPCwHq7Kf/sLYwIl1UfWyn9EbEF2UMGSH1UKohqjzqrOdGsTydutkOPQJDkqJL4O8e7gyVGyX1VbhESssfOkytzuY55yRtO9ttXykfskFv2bgWgnUmnIB9HplELF6ePsQtYQPYPVIki8dw3mLYMGgQWa6Id+9kaqmQnep84N0aZLgAUzj3rjHE/6RiBoKANTSQBAe8/WWIqS596lRHlRNgkx9tUdDN9yN5zWzf8lJmxPA59njYrF/FzPr7cgaX8kuLlNBb7o2xhemIpMm8pvPASoBgKdUd5Gczv4b4C+2YFzQoh4JOsNvi0KfjtuMkUwfL24+c6uXpqfeUYM4HzW9AoKoN/6SdNfsPJP1n4gyiYaEQdr2mdDVrFDX+9GeyG4T163dDwJ2k X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e307035e-966e-4754-5a73-08db57b01c68 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:50.6674 (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: AxPCoepSsoZO/Vt7JvHz2YX4gbYH0mtiHmS51Y1m24+2118+q8ZtENTxSDY7wwOMrbGA3sf2SYZ1RXkYtMQDQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB7427 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 malwarescore=0 bulkscore=0 spamscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: t-7l36pYpSjGvibqjHlgkJZlPc8D6Qap X-Proofpoint-ORIG-GUID: t-7l36pYpSjGvibqjHlgkJZlPc8D6Qap X-Rspamd-Queue-Id: B932C20014 X-Rspam-User: X-Rspamd-Server: rspam06 X-Stat-Signature: pd4y5a53r3c78xdktfep5sw4wzd9ffwx X-HE-Tag: 1684421833-571994 X-HE-Meta: U2FsdGVkX18pTsOhOGXiysTnzX0q/Hj8mELy9C+tDJvYXvdpW1pnCiNI4pSodNNfQDYWhZSpKiekdrGVm38CTQrk43oIkr0HjbKrTB6qljEPLYX5ugi3T6Ylpx9oPdW0bGdae4/qBeF5t1g+gpTsncpKt2YC1DlZlrWTyBln74rm/3gh7uG6qsiAdgPgwc7gbEZl6jps1PY1TNWhTITXSdR0DTXEJMIFZfASjeEnuNAWp0jKWMxmuT7dzWJ5coacOqXU12b9j19SV+PjOSA1q+J32qfxIpQVcYWA/vNuS5oqxZsWfq2vgqP0TFW9Jlk1BGC1PpoiHO4fCNd82RV8GDo9TmOZ8vjA/IJpnY4AlKaDq7GXDWz+04SMYhIspo3Ui8fFWIXh170t+/uEJ+qezE57UWmBPMdDUtZFbkvaw9sF7P7ObVyMbvd30ZJ6zE3IFu4e7r4vsgwbbqeX1V1IqIztfR9YgxpzeXuo+hQD9HM3h5irz1nRmbKnC5FaS5M9SXocjh2/D5UgZ2cjbRwxhn4sGe8oqrxDv70SDPQKwhB+IphAxkCBonp2j8OqG/XaeMtTx0AdAca5I7ygNDPKq8/jtfulaZnscjpJW2gHov/pW04fkmbmGOtjY7RVcdpk7AC/a1xgraUfLq3fYfHriZXd/2nCiTYCZE9HYFjOXKmRePCeVuLfJ55HVuVExIbsdqntAMnjhu2ijlvuS969ObscezUAEwNpjlrdwRnpszFwnyVM020Y26svUrYDnRcZhfGBWEKRx/Q9EL3FwdoEsXOSlf/edV8BkOolYruN+DJofL0jOmifz33sdjnQ5D3nGjN/tH/WoItw2V1T6OXqIEe6jd02OLI3Ti9SFcm378NNTCuXqx7SIHMwYgcgSkFHdHa6hFY/exFqpvy5FnIFxOgD37ul3Dhd0nqcIjnnRfLSaZaZPao9iKYKbhnAxmnAX8O+1PMgtar6Clzwwq1 N1RLgg1b MWlOUYa5IWUwY0l7uwalcwt8QESIq5uVXqq6W0qATrLOU15zjYl4qxtDczKyG13h93EK4UCX6wdPKbT9aT/O4fcP0EtrL0BtpzaQ9zv5K137LaQZjvfnCdj78jQwg6L5a7dEEv9kVkqq8ROI/0AfU4AwKRzMZswcWme0wj0kS38qEHhHwl3iyHJHWHpZ+YmhDWBuXfiEpGMULyTcCH3ctU1tqPXlaORbiWN20Vq+8F4a0ICEoJbGK9r2j97BtAP+B9N670ewJPvFKi6L6ys5gMic2njaiIi6yzsuU5rA5SKLb6m+jBhuKYMAd0YdjuIOGzPLD22uto745lyQ4sfqVdcQ0l2hrkoVqxvO1wbxWCAXDsLRvlgZEwHGWgdGAbqgU+P3kQoog9wRwwUvGxOUXE1Fy++i+kUE09I7mZiWkECWH4OYHpCcfobXu6+XW0DLUafJ6pceCAHHncsvEAtZRQpiFlcJZhZIf6tW75mVTQzOcjXs= 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: Since the maple tree is inclusive in range, ensure that a range of 1 (min = max) works for searching for a gap in either direction, and make sure the size is at least 1 but not larger than the delta between min and max. This commit also updates the testing. Unfortunately there isn't a way to safely update the tests and code without a test failure. Suggested-by: Peng Zhang Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 20 +++++++++++++------- lib/test_maple_tree.c | 28 +++++++++++++++++++++------- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 425ad922bb2d..580310741d89 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5282,7 +5282,10 @@ int mas_empty_area(struct ma_state *mas, unsigned long min, unsigned long *pivots; enum maple_type mt; - if (min >= max) + if (min > max) + return -EINVAL; + + if (size == 0 || max - min < size - 1) return -EINVAL; if (mas_is_start(mas)) @@ -5337,7 +5340,10 @@ int mas_empty_area_rev(struct ma_state *mas, unsigned long min, { struct maple_enode *last = mas->node; - if (min >= max) + if (min > max) + return -EINVAL; + + if (size == 0 || max - min < size - 1) return -EINVAL; if (mas_is_start(mas)) { @@ -5373,7 +5379,7 @@ int mas_empty_area_rev(struct ma_state *mas, unsigned long min, return -EBUSY; /* Trim the upper limit to the max. */ - if (max <= mas->last) + if (max < mas->last) mas->last = max; mas->index = mas->last - size + 1; @@ -6409,7 +6415,7 @@ int mtree_alloc_range(struct maple_tree *mt, unsigned long *startp, { int ret = 0; - MA_STATE(mas, mt, min, max - size); + MA_STATE(mas, mt, min, min); if (!mt_is_alloc(mt)) return -EINVAL; @@ -6429,7 +6435,7 @@ int mtree_alloc_range(struct maple_tree *mt, unsigned long *startp, retry: mas.offset = 0; mas.index = min; - mas.last = max - size; + mas.last = max - size + 1; ret = mas_alloc(&mas, entry, size, startp); if (mas_nomem(&mas, gfp)) goto retry; @@ -6445,14 +6451,14 @@ int mtree_alloc_rrange(struct maple_tree *mt, unsigned long *startp, { int ret = 0; - MA_STATE(mas, mt, min, max - size); + MA_STATE(mas, mt, min, max - size + 1); if (!mt_is_alloc(mt)) return -EINVAL; if (WARN_ON_ONCE(mt_is_reserved(entry))) return -EINVAL; - if (min >= max) + if (min > max) return -EINVAL; if (max < size - 1) diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index 19b130c9ddde..f167d6ef8159 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -123,7 +123,7 @@ static noinline void __init check_mtree_alloc_rrange(struct maple_tree *mt, unsigned long result = expected + 1; int ret; - ret = mtree_alloc_rrange(mt, &result, ptr, size, start, end - 1, + ret = mtree_alloc_rrange(mt, &result, ptr, size, start, end, GFP_KERNEL); MT_BUG_ON(mt, ret != eret); if (ret) @@ -701,7 +701,7 @@ static noinline void __init check_alloc_rev_range(struct maple_tree *mt) 0, /* Return value success. */ 0x0, /* Min */ - 0x565234AF1 << 12, /* Max */ + 0x565234AF0 << 12, /* Max */ 0x3000, /* Size */ 0x565234AEE << 12, /* max - 3. */ 0, /* Return value success. */ @@ -713,14 +713,14 @@ static noinline void __init check_alloc_rev_range(struct maple_tree *mt) 0, /* Return value success. */ 0x0, /* Min */ - 0x7F36D510A << 12, /* Max */ + 0x7F36D5109 << 12, /* Max */ 0x4000, /* Size */ 0x7F36D5106 << 12, /* First rev hole of size 0x4000 */ 0, /* Return value success. */ /* Ascend test. */ 0x0, - 34148798629 << 12, + 34148798628 << 12, 19 << 12, 34148797418 << 12, 0x0, @@ -732,6 +732,12 @@ static noinline void __init check_alloc_rev_range(struct maple_tree *mt) 0x0, -EBUSY, + /* Single space test. */ + 34148798725 << 12, + 34148798725 << 12, + 1 << 12, + 34148798725 << 12, + 0, }; int i, range_count = ARRAY_SIZE(range); @@ -780,9 +786,9 @@ static noinline void __init check_alloc_rev_range(struct maple_tree *mt) mas_unlock(&mas); for (i = 0; i < req_range_count; i += 5) { #if DEBUG_REV_RANGE - pr_debug("\tReverse request between %lu-%lu size %lu, should get %lu\n", - req_range[i] >> 12, - (req_range[i + 1] >> 12) - 1, + pr_debug("\tReverse request %d between %lu-%lu size %lu, should get %lu\n", + i, req_range[i] >> 12, + (req_range[i + 1] >> 12), req_range[i+2] >> 12, req_range[i+3] >> 12); #endif @@ -798,6 +804,7 @@ static noinline void __init check_alloc_rev_range(struct maple_tree *mt) mt_set_non_kernel(1); mtree_erase(mt, 34148798727); /* create a deleted range. */ + mtree_erase(mt, 34148798725); check_mtree_alloc_rrange(mt, 0, 34359052173, 210253414, 34148798725, 0, mt); @@ -901,6 +908,13 @@ static noinline void __init check_alloc_range(struct maple_tree *mt) 4503599618982063UL << 12, /* Size */ 34359052178 << 12, /* Expected location */ -EBUSY, /* Return failure. */ + + /* Test a single entry */ + 34148798648 << 12, /* Min */ + 34148798648 << 12, /* Max */ + 4096, /* Size of 1 */ + 34148798648 << 12, /* Location is the same as min/max */ + 0, /* Success */ }; int i, range_count = ARRAY_SIZE(range); int req_range_count = ARRAY_SIZE(req_range); From patchwork Thu May 18 14:55:35 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: 13246952 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 BC01EC7EE23 for ; Thu, 18 May 2023 14:57:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5F6BD28000D; Thu, 18 May 2023 10:57:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5A7B6280004; Thu, 18 May 2023 10:57:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3FA4B28000D; Thu, 18 May 2023 10:57: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 2D0EB280004 for ; Thu, 18 May 2023 10:57:02 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id E42A3406B8 for ; Thu, 18 May 2023 14:57:01 +0000 (UTC) X-FDA: 80803678242.05.726B35E Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf27.hostedemail.com (Postfix) with ESMTP id 6E28740014 for ; Thu, 18 May 2023 14:56:58 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=g8PaJDZT; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Wd3q0SI3; spf=pass (imf27.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=1684421818; 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=tcZOdnB2lE1EqsRzUn79ee6riysqDWNmIuJsfyFVFnc=; b=E0w0jgMZNK44OMo1ik6K4VDF+O00Dy0REBhOglVgfV3HFDNMpqJxWyhAIGEDeSHdIdajTk gXRXc84pqfCjo8uMZoK8h+UBSW9IdxqFfg5I+Coo0VuWVxjy7pkdfW6w4XCBx+FEVfUBZD OB5zVflhQxHU+genuUrCI6gyX8Uf2fU= ARC-Authentication-Results: i=2; imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=g8PaJDZT; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Wd3q0SI3; spf=pass (imf27.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-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421818; a=rsa-sha256; cv=pass; b=MT6iglDU1uWM836JTWP6OcmTyNLSZWRAOdLm7qPGVFUgh1gsVsDG1c1V2piprdaVXpnRfL 0G4WtEf+RJ6Zz/RRm19zCyu6KQZbP4nw/kONjCDWkN+snBffKaR02oB7/NCYOxOfng7xn8 rdevu6cgiBFlskXHYq5lum6riFu5oac= 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 34I6JD6q018341; Thu, 18 May 2023 14:56: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=tcZOdnB2lE1EqsRzUn79ee6riysqDWNmIuJsfyFVFnc=; b=g8PaJDZTh2msetZxgBtOVN7qQ8OOqr0xvyHlUzZLz3iQgAevuMqVMlr79xwP7/FJ2unh BV/Q08k3phN9PHJ6zXmGlXI6d1sA0pEmOibM03GSSeIc9WvncyGOLJ59fLC57dm1z8CM 9/hFhzcfyNQYYRUIiBcIOIXY1RLEKcTsChYDhkLU6WkBW76lhO3OD1BonUmhKRA9a9so V4MPMSqTmd66lVYLJuCIzd37Zx+xulAsZrJ4CdGw16CFqoVDEJrDsVc7KtMJP7V/pey5 d3QWQn4kvB0VBPN4Lf71uTUTKTOHHbZ0kmhtolKZj35yf1Zt3yGZ5CIdQ5YV6B7YWwfl aQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qmx8j2vpn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:57 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34IDtR7H033865; Thu, 18 May 2023 14:56:56 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2107.outbound.protection.outlook.com [104.47.58.107]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qj107c96y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ij3Ob0yjsdWkJPULN89P6c28ybI95mZZBJgzWfEkohNer62cF03QB8f854tRVlSEpk5hu8S5Ur55WAV994ZOk5W5pJy40R/PgyKGI04NF2pk36E/Rcw+bm8OKFeJmVbIFO07g3qeSGaFc+5dq/fGEdc5VQATv7BTkSxUAC8N1IUXN1+gt/U2g9UeTTlvdfrA/uZjVZde1zrwptc5SI3tVnQ0v5Rlomcez7HsYxJ4DPp0JSt8XneNaJesF6QNXtdZGDA9SliVKPfqmOmAg/6t4cG5hdWz/cgXyGANdaXWsHpNQiH52OH3bDax4JHHsPPZEqq6EuTGFOBIZ51vVOF4jw== 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=tcZOdnB2lE1EqsRzUn79ee6riysqDWNmIuJsfyFVFnc=; b=YUeKJPy940TkdWP1z3EKWh8nXSvEiUAhS6ckJmH16FdIZ3oGdY0A/FmKZmA+fRGMnTQZpZqdjTLNywHNIdyUf7HiEKFD51n+Pi/fA4sepwvZT+dhN5298gEXRvDIQjHySxzrFLh+iOebUn8klLmDQv8voPdYy7hcqBIj6TZ4nNqbZtSYNtcLa6yqdLX91gDZCj6keTVo0TbLRliw8Nf/P1+siWo0NZSTRNegVEpbFJps8w56mPFMS29kponB3bGlLySoxPebL9bcSgQUmuq3hSqAgdDnmYS/RBXOLLaYLDYyo4gesKUyD7jkm9pfw4ZPznWuLEItbxR3OjyNVS5s3A== 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=tcZOdnB2lE1EqsRzUn79ee6riysqDWNmIuJsfyFVFnc=; b=Wd3q0SI39EhBb96EjDEE+1AtXqzpZYPv70BnKfbZJ7RTxFd5wK1zZStJCYpH1XoXYXsa6UxE8yxqjGcULaBqzNLJP8gSH8m+0SrugF/FUH3nWkLlsHaJPEfGUHlLwmOxpk6d1EqXzmO4o6HAlQnChAqL0A7de7aw+AU5SJMdi5c= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM4PR10MB7427.namprd10.prod.outlook.com (2603:10b6:8:181::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:56:53 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56: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 v4 26/35] maple_tree: Fix testing mas_empty_area() Date: Thu, 18 May 2023 10:55:35 -0400 Message-Id: <20230518145544.1722059-27-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0020.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:86::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_|DM4PR10MB7427:EE_ X-MS-Office365-Filtering-Correlation-Id: 89fc54e4-875e-49ca-3ee0-08db57b01e1a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C+DpcvW8OGYoO2m4IPUSSw9n93qPPRRUYse+8KAPpGI9EiteVIQgk/oXGppANH757YkScq4HCvEimikMCbRAzcR53UpQ9Qkg6ER533JsaeADF25QXi9rECzyRW7Bfeg8IIbxjeKEDOkB+uMSWr1wvxSdqQx3ZLcIeYsrsb6eWg2WfPejQJz6LWZaLkssDeSgBWLniq4LbBEk3utik0Nz5iqQOmyxVFVzvizoRymHnj0niP6WOVgJG+1e1aDmH+bwfYxMv+SXDDSX/bJhUE7Lb+p24q4S1Qtctwb2ACMm7z5blmrJsCDYsUf8ojbsp9c70hSeX53oi5w1weyXMMF97bchHNTc0dXKkAaFuV2mqMQmnA3T8g+XQ/jLA+GXacpb7DrsgZRjDevUwu10fdN6f4pF8Z0Rh+4XaXc3PnWW90jEZYMT+q73Eu9g0BCnifJq8xuuc/WbE43/bLAcChHfwjvSryXgM18JT6h0RxmZKNxELzZogZ/XsRGEtOzpQOPBMEf8zenuP28b4HC3RfePLoziEBy27rOTiE7T5RYCyIbBGYWXKhULz6dcdlpxq3gN X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(346002)(136003)(376002)(366004)(451199021)(8676002)(5660300002)(8936002)(4326008)(316002)(6512007)(1076003)(83380400001)(6506007)(26005)(107886003)(86362001)(186003)(38100700002)(2616005)(41300700001)(478600001)(66476007)(6666004)(66946007)(66556008)(6916009)(6486002)(36756003)(2906002)(4744005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4w9H+HKVC+FD9Ies0a0ak+WG2VpskwiAQgbRz/KZDJOor942bL8eurZNBQieWzb4hOgObQsBKJzr9ufDZZGsZgpirjIenn+xcIAMIix2mbt01HTEJAQjspFwB4iVMPF81SeKYrte7tsxqtofjcwMUmAJv12w4XIgRmDTjzkuoAct639UMM4SWm/c1nK6jl4oSpBy1uwicnwh67fNg3YmPaPOJ+Tunwya+Wu0DE89jAQ8+SjJb8EZ8IptPoZQlJmxdWubv2GZH+YUHrmrqtlNNvbRW1NmFNr2BC4l+LgMqWIMaMVz3SJvWBgD6HpgTRqowTc7InU/qXWPvYqG2emw3CTlZQnjVxE8xRG8w8aSslfq2THHWtwwi78Y6vvXMuxWlufnpJ0mfTlxATGy/YtHZ+1CFyQfnAI6BR6mTi1EZjCpdFSO4ytAsHpdU8jJn4udJKl18qzGPvhXBrA1guGUa6n/weQuTbsyaONH3jkqUew+uI5F8ZnIIQ5ukEcKRyDEmWTWna+RKVubEOgaVN78dx5KjeyGx5/+lOZrVEGOGq2Z74KPJ2pK5GeDg3hYQToaJB50l6x58oCS0sZiSiVrlSWf/HWfU949IWhxJeRLpqD08RfRv+5+qXxPdcNDH8QWQTJmE4NDgt1HU6XqF7sPZjCN3BC8hcRB86IFSUVKVdk9QLVGfYrT0uCnvKEivp4jwWYpJXoKxe/BYlGIRPX1UY+9dc3EDYMVx4G8hiGwaxpONiL0OkfzqZTInImQlSjSabt/cyEDgewJkyabuUfkMBEeZnsSR5uPj3tDg6oCUYA2hNXaWA91LwhxhZnGrBOHPx78zcW1oxfeINxXIU1sAt6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x1tGURC1P2gBs+n1hxq1CnoQ1+hY+uXS0obLVFhIbF/4nPKD37CuzAF4I8qfRXCEWucA0GyXgbdqvcxZc3uQ2hyyR8XUKeJchOrYHDw4WKAhkYxkusMac/5XQv8GLkK1hq7xXIhsF5d25kVA+4VOhZqnvf+2OTyrkRtgOnI4krym5EGpL2cMefKjHT2bzf/yiMcpzf/HOBm332YGHaglCFmE1Igaj+t9yVD1p+sRlTuolkmwl841dFPCLyw1RSMK4lCK9wlYymQuxWaA1ONwivhxW/HD1QSwFpgjLROm3lVCAoj2j3zacLWoDln5AoHZEMQa7InCHzP2aUORpIkiKV7ymtQ1F2N8UdzGKuCNjil/nBxAd+/PoL89A8/FuzB5Oa4E/0cN8ibeeYmfnk8RwqDoq+NoNRl2Z2SlzvD9nI+taDo/X685fDnki/e9TxpZ2Ff5przy6yUdH7+e33AuGqzvlwj2mt0+ULNemrWEg4F4Pft8x/Rk0Vm00f6g/P74exYk5wGzjtfmKUlAGmcUOjhsfKmVDhDznNBdmrkn7uC+w+ZUfUU+JpJPTHYO2ux/4PXdd6LLAhw9oRS11MORpnzQi7ourLl/L2gQWSZhI1ax8ZqtfaOs6oZOo0cVHVvxMNMwHlKLLhqLvWLg3k78vfe31FQGLhWsH97s0/12eCzFSqDA1tcnA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89fc54e4-875e-49ca-3ee0-08db57b01e1a X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:53.5160 (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: J20/t9t8Sg6P6x3/LwS7VALg2EuqUycTYLKBz4jdGtrbxr6/XUtw5W5ktPIfXjFrfbyclXVgkhN0rrLRVOut3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB7427 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 spamscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: gHueLeqjCrf9jMseF_IlNqjl1HsMKXtP X-Proofpoint-ORIG-GUID: gHueLeqjCrf9jMseF_IlNqjl1HsMKXtP X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 6E28740014 X-Stat-Signature: c6yzjn3n8y1h8y1mzraroy6bfbxwd14i X-HE-Tag: 1684421818-114748 X-HE-Meta: U2FsdGVkX1/OQ8FHpBc04ndr1uWkAVRNb+yq9AOQaAy2US/6W3AwGYkW5FubEp5lrqSugsNOpuEdYJEroSXmYFC8Gfl1qmDs6rkW8NBYG6s5R5F1tF1bSvjcyOwQM8Z7yv5IdPaajAQiHckg3diBSttDngvbqrX5WWGHm5c39LRKpvjRpAUjfgDCWS1eZ1m/7+lytlyPEzzo+BR3nEjEZCAwE96EiwgXjUAGjCcBGkUZ5ynhQeEVK4DR9VdvnC4Dk2nICj4tKXN4H024CKcQVAhZVlxa87Sz4FWgRT8EjyC/G0floy7+T0eZSOhS6fAy7uadLENwtPiPngvQIHR2Skq8bSz1J1PL1NKBVXuzBXwz0Pb1iNWlsR9wu41IW7bXuKMgTnBViWNXMK2EvcZeCAAxJJTI4A1ayYW7y3mD8joGWYhStCysbMA+sJDnTpG6QwedfdmKaSuHUkwws2Zqw/iqgZuIx8TLR/O8o2WN2Bls+uzyTmKyb5Xxy9vcMVCOl7exKr7jVuGopuoHzzl9aDig1U8d7ujJZ+rRNKmJi7ZrPro3dTiRPc3PAP8eZT5TzGAbE3kKZlpwnhqMHmXRaXqTkEXA4bqFACwZXR6YvVBs1VriQcMGly2WWmKnMmPIUke8/VTyaCksokrAlnG/a7HBb0wTovvlL4CptkxCXQ+yVpL9DZt2QAs9g/DStW4BMpJiVNyU6pIY6LrO1pqqWvnJTXc9kkkKzjNpo4eV05iytgms4eM67BvybSJdEFZhFrtA4JVr9v0WhzjZ9Rarm4NrByinU0pOO12jns3ESW7RsJuxSn+0THL9k+CN3otQtddf8iEkrhrMIJDbm0Ps+HafCOrtHDgPB/FBp7lHQq9gkbBwHI/vyQKO/WK/9ejCrhKf7IlpXURM9TKv2TDAA+43tcc+y0CQ2LYPsH5JMKbz3WM9q0QgOb38ZzNKY2/hKr19M3WtthV6A4SST/x R/d+Z6nE ZAJqvo8a36moASprKRhNeekQyCB83nmcT5ZiUNXXOakyAbCOeXoycuW2K/g1NAd88Wxrmflv9zufbNgYpLW/zwjuOapKLmwX0V7E1k+IokBxbcbGry/267nxgyk2AG/F/32fnM4+Hy1AB1y5a5582f9OWx3vlE0IutpGOVTUXEPMmDkHrvRxXAx00bXin0pazyGTH1jhsDL/H1p9+7KsTV9tQTefni4en6u2iqX2t0HLAEz9h+9m2miLnMYY4+svNtMm+gb5isIzoKVyVJAlHAx3eb7G0sp8BV/aN7zr4daWWK+o5UHLCw0MO/s+UF6dB34KvQRJatAddrIjg5LvoLYjnq2jLSne5A7llZ6+TAr2TfCRc6dwmSAhP+wfM3+2i8yf+t+5xiYBEnXOxb1pSS96Q9NBaqlHkzfS/XMNFd7cyjNgLtK6euHNGyDO4Q4LkoCAD 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: Empty area will return -EINVAL if the search window is smaller than the requested size. Fix the test case to check for this error code. Signed-off-by: Liam R. Howlett --- lib/test_maple_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index f167d6ef8159..d295fdee2fae 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -2697,7 +2697,7 @@ static noinline void __init check_empty_area_window(struct maple_tree *mt) MT_BUG_ON(mt, mas_empty_area(&mas, 5, 100, 6) != -EBUSY); mas_reset(&mas); - MT_BUG_ON(mt, mas_empty_area(&mas, 0, 8, 10) != -EBUSY); + MT_BUG_ON(mt, mas_empty_area(&mas, 0, 8, 10) != -EINVAL); mas_reset(&mas); mas_empty_area(&mas, 100, 165, 3); From patchwork Thu May 18 14:55:36 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: 13246954 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 04112C77B7D for ; Thu, 18 May 2023 14:57:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ED11A28000F; Thu, 18 May 2023 10:57:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E814C280004; Thu, 18 May 2023 10:57:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C5DC428000F; Thu, 18 May 2023 10:57:03 -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 AA23B280004 for ; Thu, 18 May 2023 10:57:03 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 57090A088B for ; Thu, 18 May 2023 14:57:03 +0000 (UTC) X-FDA: 80803678326.27.7B6BD20 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf08.hostedemail.com (Postfix) with ESMTP id D0AB8160015 for ; Thu, 18 May 2023 14:56:59 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=Y1Gn+jcu; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=PixVlpEY; spf=pass (imf08.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=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=1684421819; 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=BNJ/xs+tArZ3RHkKqzIfUzuJIlhPq7rBrHJ1DH2BcV4=; b=dEpmxGQ3hpQD4dPsac0Diosx76dKRope3CS3eeMeDXuxGO4vYosR3sztj5RBTXRgP0O3q/ UAR+aB54ta3hfRy3cuz0/iOT3bEAvd1q99zbO/QksTxlgUmmsxlEs41Wz+SmElQG1hLWMd XlOL5/aB4uMKpyxYttjZAa9xNQgmh6Q= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421819; a=rsa-sha256; cv=pass; b=lXaygMuYMh4kD7exrIQzIorhrMRUY0de3XtqiEUVvxj8FdDazE6OpwzLto2ghL9vJ96/ay zP3z6zDKZkNZTJGwK1ApL3kUZ8dyziRSIvpGLeJ2O69vHQGdDFOPZKaBsCXo+7xD9SRmHk ir79qZS2m/9bvjUmuPxYXJfIFqfM0t4= ARC-Authentication-Results: i=2; imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=Y1Gn+jcu; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=PixVlpEY; spf=pass (imf08.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=pass ("microsoft.com:s=arcselector9901:i=1") Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34I6IlYv012447; Thu, 18 May 2023 14:56: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=BNJ/xs+tArZ3RHkKqzIfUzuJIlhPq7rBrHJ1DH2BcV4=; b=Y1Gn+jcuobXm3ljccfkRmC8VfoHx5KCw/ZgQtU3Dx038ZQ5LMQtQwR5aWYE3rB461Wn+ QP++YkGYNVzV9pH++Cj9B5MCUGWW2eVaXSs9N1sTKSfMDBj0kxLegaL1FBpq1yilI5lI oJx5HfZmcqSvpz4BCuTQHcTXGXK/A2Elo2Qke3/dmUgP+UKE21LvoSYtK+l7bZPxaQsi YAePA4PL80gQ49IwnERx3BmaFm7GfAtZEIeIPeheFUBXvdzaq65GWct66tVWVZk8o129 Yb3kFWtZTIEHnq2aHhZ0DxGSM9gZvcc4JulgKcGLD5m/W8Ee9JpfIk6ZtxTOJ2Cp8FTx jA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qj2kdrh0s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:58 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34IEIORY036313; Thu, 18 May 2023 14:56:58 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2109.outbound.protection.outlook.com [104.47.58.109]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qmm03w453-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oFyV4ukGYF1HHc1vXl8ekSQCVAAmvC2TRhYY7qnloLtiD1WgoMHR/btC15T5RSEBQlxt9HTV68p2/RbZ8fMwP9KW9FeSZfozTeD7MOiHLwN7W1O5JCAkSPI54Kct7XEC8ymIdSAvaKAPBDkTwF8igor6KDkBl6L4FzAiKTjFjdtJ8T1v23Gn7U/aFx0pIZZyD0WUmqHul3CaSCKyqIK9eqOiWbR5t3pfT+Xq4nCMNtsmAjqisYoWRLNggUmUWPRpeh2TE3MlSr08wqPvyonPtKVhRWOaCQKXUgTDtyCHuOYKVuxY4FcVs+DAdIYRWscBoMp8dfnZpikghGqHzdWy1Q== 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=BNJ/xs+tArZ3RHkKqzIfUzuJIlhPq7rBrHJ1DH2BcV4=; b=AiPDj+14LxMd4rVhNqhddFY5AnoYPBEYfGgPGTJaqoE74aQAQGRJPIA6gc9qX3VH+apsEGWoqeDaccTcNznFu0XLXWIVdIOJe8Eg04tKFM6OU+Mibcr61x4mPfLYLZREurJ3oV2fo37NoiwQTbh2Li4QwlPXVlldnXmzZN/6phEoEPXd9p26ensCV6/uW3uaQrFRSM4mmh0jl0reDnwzjIqE+7xyDiE8NpjxljHiej/JAzxiZHYlAaI/L4WLfPP+kVRi9awTDk83gNk64lkG6VcYYZLS3auKQ0oxILXZCmcJjcYDRVYZ/T+lRdUleEn5VGaV8pguyeqVc4zX56Otyw== 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=BNJ/xs+tArZ3RHkKqzIfUzuJIlhPq7rBrHJ1DH2BcV4=; b=PixVlpEYS1ujFM2PdkRpzBer+oo4zzfpkQZ4uBonm5BEF2I4z0rbbGKyZRdZNrO7zzjB7CxB1jR0lP9oUXrVhSoi7ojOKNO2SbwZm6FeajB19uHTtbRsGT0pAXNMZWQ82ndzsd/Z757rBZ1JgkjU7CXoNMt1RcobceFHrra4AOA= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM4PR10MB7427.namprd10.prod.outlook.com (2603:10b6:8:181::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:56:56 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56: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 v4 27/35] maple_tree: Introduce mas_next_slot() interface Date: Thu, 18 May 2023 10:55:36 -0400 Message-Id: <20230518145544.1722059-28-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT1PR01CA0123.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:2c::32) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM4PR10MB7427:EE_ X-MS-Office365-Filtering-Correlation-Id: c15f59ee-ba55-4bae-3ba6-08db57b01f82 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /8gp09koOMpXSxE8LYfvMMD9CeWo/NBVe+TA97LzyQjnnRpLNhHssIQnPlxsUw0/qtKNSKszm+n8inNENj9gq53jR1Hslb4pNvomPLex0/OwK50bNBZTY5dyHcaE9pnv+FNfomNFZZaq5O9eiS+xfSbkBXSUJsWdYxjQXjp848MjEZ3cZrDABD3y3Tjjqf6rSwwPXaEMllv4wFr/Oh9gksZUYZ1IQAx8SPJ22xlD72nyRLLCWtxb6yIroc6vfcdTOxZxAvVqQ8Wvb0hbBRLycC7M+L6VQ7xb7kQQUNiRivHT+qk/LnTm1aOiDxyDIL5WBYBRcHYBjAXwqgNQ5z0XTSsDa+K4cljHS+BC7DtfTFl2WL3dtl3ohlaJfI8OjijgpX9d2laTD9TzeGMlN2rUu8m0g4Lj3D82M/SvGqsKJDnt0itOG5lk8VMXASTZVqoLT60mehUXn4iVX3gm/Xt7TDPNp4RwXGzGg1NeB/NJ/5kKSdlsVWZZkVaQNdDm+yGiHfR0c5H1j7b/piAxTKgWzdNa/8S+2NeYX3LNjZGF0aYLJOLgC3Vt9YZB6ZYh9khp X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(346002)(136003)(376002)(366004)(451199021)(8676002)(5660300002)(8936002)(4326008)(316002)(6512007)(1076003)(83380400001)(6506007)(26005)(107886003)(86362001)(186003)(38100700002)(2616005)(41300700001)(478600001)(66476007)(6666004)(66946007)(66556008)(6916009)(6486002)(36756003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wp9ye8sPn+iQjgPPIZNXsVTV3z0jYE1MGeaIOtEyGmDlF14M+jXbS5FOMJJbYYdWbBg2DUf26r5QSIohqrs63X0/Uste7mBCVDmjbX+GSeys/yWMuDiw9RNTpQKSB3aIZa4hWoJMeVS2iPiIBKCF4ZaLIrocJ7vkSHB+gg5lt+2DYOQor8lSbhHZV+79vWqy+ZO27byK/ebgD+jP2SbvriFO5G40wEWaTczcSb32uhQT/XeQP0RaJu8FFOU5dGopMaNS9J3qJqPhYGf+SCpLiwn6P0F10+dk5rNf54tla6Mhbsbk0FNFJGtA4BBi0tK3smuEouBaZb4+z5BxKzRsSQ3YmrE1PBG4b1MVRB0E2VwbU5FTJ+EQjaBn8AE6PDsf3jZu1vxtP/G2UAf9hbF7lMlbq/qKzXzDZ3Ix/S1QIoDTcLns9fnedqnWshoB237c6QW86rkGxQcH5x+urh74RBfh4E8ATcA1qUz5Xd8Vw8Q6mze/KXhzBbtG2Hz9BVR+CK1X9l9GfxJUCBRHsSAN4fC1hGEXkpb/xaQ0gCHqmvTNEzD2Tz+cffxRGl54YbfO2meSOcXJE9LKJLIy0Ml5MG7D8Do6UO3FEJ4ObGDf4fx22CJ6tGrPz9K8pnjNlSE5vvmPNEpFE5f4qttLcUsUjSc9LZVbi8oTESZb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FoUEQWxR8IpE7FR0K/ZCV73qL6dZkkcs/3RBITlzHpC2vZqHty7pn+RPkyn0gAvj5QFHNwHLQAJRm9J+zDb+QYDkI0gogxuBIjZw9PSte2qEYZov5kJUmvX1GrEC61rfVUyC5WRqCr7JxRYvRIH6z+YHw7/gbCSwnjwaRrdUEnj/baxQZYrqb4M12f4hLXWQIQf8jDbquZnLv28wQNAxZOU4M+2Q5sD/ELUCQXQ8TfMZZKdi/JZmu4wMD0MhstIUQWvya8F8FJ75V0CRzJd9/HXNg3TMAKesD+N6GnSMoT5DZS+efEY2bwpyivDYayeHgAb0jwgtIuyjsX9YU8nn/3FC4FvXrxHbVLGWqDvpsrKUEjpo8w7SiKn1BR1/G8rkKuHl4RuM/096ESm2aMw4FwhVta34eR7xMrfOQsZhIeVKltq/yd1qZvvgYRgoxrbxb3rmy+T7ff/7G0P6rE4J3m0LXmxjp6xt2Wk7jUsA5/oOFiyFQppcw7ElqRF+6BSZqtFQoQUdwEv3iLt2H+gRnK8SQ77a+2HOsMA5YEu/ntJi+tijNcOEZLmgCJAgAkexRJqwKAEz2Y4SZEPBG3/Fc6bhBkK6sSt0K7EMf4viN+gMx0yd74ou/AClpZ6UDDBwiWUbpRx2yR5sgGC+eB6DFDgNy+1LXEHl9jY8kDRvrXi90nvIyKzEoq5W9C2ykIc8igJjIN6itmP32k5KiQY/chnN79lghUsbWfm6NXY+QQ8hCgpuDUdsprZb8OivWie+NeR/5skZOlemYWDkDY6iFX0qMMTlVjHHSKQBNgDlGlARfh+ZSOrg1+eWt3G2srmQN88om4l4IO+xFpbmIH0I3XFQ8UmlMA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c15f59ee-ba55-4bae-3ba6-08db57b01f82 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:55.8744 (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: IiXRSixjRrXbVirfuEsgnoM7xS8LA6DaNJUdfMqmdZj9sEHKenSl09rDIuFgTIViGoLfcI4jyfD0Z0JNOhoGMw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB7427 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 malwarescore=0 bulkscore=0 spamscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: K3Yhsaq6t0yxrW9A1ib2ngAPTLH4j8BY X-Proofpoint-ORIG-GUID: K3Yhsaq6t0yxrW9A1ib2ngAPTLH4j8BY X-Stat-Signature: szbbdybdreyzay1czho95kkhrwo71rfo X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: D0AB8160015 X-HE-Tag: 1684421819-820630 X-HE-Meta: U2FsdGVkX1/QddSdlUEkdlS/x4bJmWodG9IxXIH4tCsc2CHaACQMWTL1mJAwisXMeO3/895jFCMNkR8glo9xmEmSjvDpWATYBGm7LmuRVfNRx/uKjmZpNNZ7H8jKTbsZS2WnJqWSTXZ86h8ILQnuteutSrWX+gyK01lUBag+5n/8ObK0yw2SVXlyO6f7pjA3JdA9qFDMelZcI/PzyUlrlIftiOBCEAhbPZjGvRkoRaToKeVFLjzrktgx+GAonS6g+Q/RJ66nflyIuMcEh0uf2Fd6Sbz3VwNZZ2fSPuweoy0eC7i+T37BdnahcpZWU8jURtqQgScS9LB6vSDR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4= 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: Sometimes, during a tree walk, the user needs the next slot regardless of if it is empty or not. Add an interface to get the next slot. Since there are no consecutive NULLs allowed in the tree, the mas_next() function can only advance two slots at most. So use the new mas_next_slot() interface to align both implementations. Use this method for mas_find() as well. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 229 +++++++++++++++++++++-------------------------- 1 file changed, 104 insertions(+), 125 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 580310741d89..860f82e16166 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4606,11 +4606,10 @@ static inline int mas_prev_node(struct ma_state *mas, unsigned long min) static inline int mas_next_node(struct ma_state *mas, struct maple_node *node, unsigned long max) { - unsigned long min, pivot; + unsigned long min; unsigned long *pivots; struct maple_enode *enode; int level = 0; - unsigned char offset; unsigned char node_end; enum maple_type mt; void __rcu **slots; @@ -4618,19 +4617,16 @@ static inline int mas_next_node(struct ma_state *mas, struct maple_node *node, if (mas->max >= max) goto no_entry; + min = mas->max + 1; level = 0; do { if (ma_is_root(node)) goto no_entry; - min = mas->max + 1; - if (min > max) - goto no_entry; - + /* Walk up. */ if (unlikely(mas_ascend(mas))) return 1; - offset = mas->offset; level++; node = mas_mn(mas); mt = mte_node_type(mas->node); @@ -4639,36 +4635,37 @@ static inline int mas_next_node(struct ma_state *mas, struct maple_node *node, if (unlikely(ma_dead_node(node))) return 1; - } while (unlikely(offset == node_end)); + } while (unlikely(mas->offset == node_end)); slots = ma_slots(node, mt); - pivot = mas_safe_pivot(mas, pivots, ++offset, mt); - while (unlikely(level > 1)) { - /* Descend, if necessary */ - enode = mas_slot(mas, slots, offset); - if (unlikely(ma_dead_node(node))) - return 1; + mas->offset++; + enode = mas_slot(mas, slots, mas->offset); + if (unlikely(ma_dead_node(node))) + return 1; - mas->node = enode; + if (level > 1) + mas->offset = 0; + + while (unlikely(level > 1)) { level--; + mas->node = enode; node = mas_mn(mas); mt = mte_node_type(mas->node); slots = ma_slots(node, mt); - pivots = ma_pivots(node, mt); + enode = mas_slot(mas, slots, 0); if (unlikely(ma_dead_node(node))) return 1; - - offset = 0; - pivot = pivots[0]; } - enode = mas_slot(mas, slots, offset); + if (!mas->offset) + pivots = ma_pivots(node, mt); + + mas->max = mas_safe_pivot(mas, pivots, mas->offset, mt); if (unlikely(ma_dead_node(node))) return 1; mas->node = enode; mas->min = min; - mas->max = pivot; return 0; no_entry: @@ -4679,83 +4676,106 @@ static inline int mas_next_node(struct ma_state *mas, struct maple_node *node, return 0; } +static inline void mas_rewalk(struct ma_state *mas, unsigned long index) +{ +retry: + mas_set(mas, index); + mas_state_walk(mas); + if (mas_is_start(mas)) + goto retry; +} + +static inline bool mas_rewalk_if_dead(struct ma_state *mas, + struct maple_node *node, const unsigned long index) +{ + if (unlikely(ma_dead_node(node))) { + mas_rewalk(mas, index); + return true; + } + return false; +} + /* - * mas_next_nentry() - Get the next node entry - * @mas: The maple state - * @max: The maximum value to check - * @*range_start: Pointer to store the start of the range. + * mas_next_slot() - Get the entry in the next slot * - * Sets @mas->offset to the offset of the next node entry, @mas->last to the - * pivot of the entry. + * @mas: The maple state + * @max: The maximum starting range + * @empty: Can be empty * - * Return: The next entry, %NULL otherwise + * Return: The entry in the next slot which is possibly NULL */ -static inline void *mas_next_nentry(struct ma_state *mas, - struct maple_node *node, unsigned long max, enum maple_type type) +static void *mas_next_slot(struct ma_state *mas, unsigned long max, bool empty) { - unsigned char count; - unsigned long pivot; - unsigned long *pivots; void __rcu **slots; + unsigned long *pivots; + unsigned long pivot; + enum maple_type type; + struct maple_node *node; + unsigned char data_end; + unsigned long save_point = mas->last; void *entry; - if (mas->last == mas->max) { - mas->index = mas->max; - return NULL; - } - - slots = ma_slots(node, type); +retry: + node = mas_mn(mas); + type = mte_node_type(mas->node); pivots = ma_pivots(node, type); - count = ma_data_end(node, type, pivots, mas->max); - if (unlikely(ma_dead_node(node))) - return NULL; - - mas->index = mas_safe_min(mas, pivots, mas->offset); - if (unlikely(ma_dead_node(node))) - return NULL; - - if (mas->index > max) - return NULL; - - if (mas->offset > count) - return NULL; + data_end = ma_data_end(node, type, pivots, mas->max); + if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) + goto retry; - while (mas->offset < count) { - pivot = pivots[mas->offset]; - entry = mas_slot(mas, slots, mas->offset); - if (ma_dead_node(node)) - return NULL; +again: + if (mas->max >= max) { + if (likely(mas->offset < data_end)) + pivot = pivots[mas->offset]; + else + return NULL; /* must be mas->max */ - mas->last = pivot; - if (entry) - return entry; + if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) + goto retry; if (pivot >= max) return NULL; + } - if (pivot >= mas->max) + if (likely(mas->offset < data_end)) { + mas->index = pivots[mas->offset] + 1; + mas->offset++; + if (likely(mas->offset < data_end)) + mas->last = pivots[mas->offset]; + else + mas->last = mas->max; + } else { + if (mas_next_node(mas, node, max)) { + mas_rewalk(mas, save_point); + goto retry; + } + + if (mas_is_none(mas)) return NULL; - mas->index = pivot + 1; - mas->offset++; + mas->offset = 0; + mas->index = mas->min; + node = mas_mn(mas); + type = mte_node_type(mas->node); + pivots = ma_pivots(node, type); + mas->last = pivots[0]; } - pivot = mas_logical_pivot(mas, pivots, mas->offset, type); - entry = mas_slot(mas, slots, mas->offset); - if (ma_dead_node(node)) - return NULL; + slots = ma_slots(node, type); + entry = mt_slot(mas->tree, slots, mas->offset); + if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) + goto retry; - mas->last = pivot; - return entry; -} + if (entry) + return entry; -static inline void mas_rewalk(struct ma_state *mas, unsigned long index) -{ -retry: - mas_set(mas, index); - mas_state_walk(mas); - if (mas_is_start(mas)) - goto retry; + if (!empty) { + if (!mas->offset) + data_end = 2; + goto again; + } + + return entry; } /* @@ -4773,47 +4793,12 @@ static inline void mas_rewalk(struct ma_state *mas, unsigned long index) static inline void *mas_next_entry(struct ma_state *mas, unsigned long limit) { void *entry = NULL; - struct maple_node *node; - unsigned long last; - enum maple_type mt; if (mas->last >= limit) return NULL; - last = mas->last; -retry: - node = mas_mn(mas); - mt = mte_node_type(mas->node); - mas->offset++; - if (unlikely(mas->offset >= mt_slots[mt])) { - mas->offset = mt_slots[mt] - 1; - goto next_node; - } - - while (!mas_is_none(mas)) { - entry = mas_next_nentry(mas, node, limit, mt); - if (unlikely(ma_dead_node(node))) { - mas_rewalk(mas, last); - goto retry; - } - - if (likely(entry)) - return entry; - - if (unlikely((mas->last >= limit))) - return NULL; - -next_node: - if (unlikely(mas_next_node(mas, node, limit))) { - mas_rewalk(mas, last); - goto retry; - } - mas->offset = 0; - node = mas_mn(mas); - mt = mte_node_type(mas->node); - } - - return NULL; + entry = mas_next_slot(mas, limit, false); + return entry; } /* @@ -4844,10 +4829,8 @@ static inline void *mas_prev_nentry(struct ma_state *mas, unsigned long limit, slots = ma_slots(mn, mt); pivots = ma_pivots(mn, mt); count = ma_data_end(mn, mt, pivots, mas->max); - if (unlikely(ma_dead_node(mn))) { - mas_rewalk(mas, index); + if (unlikely(mas_rewalk_if_dead(mas, mn, index))) goto retry; - } offset = mas->offset - 1; if (offset >= mt_slots[mt]) @@ -4860,10 +4843,8 @@ static inline void *mas_prev_nentry(struct ma_state *mas, unsigned long limit, pivot = pivots[offset]; } - if (unlikely(ma_dead_node(mn))) { - mas_rewalk(mas, index); + if (unlikely(mas_rewalk_if_dead(mas, mn, index))) goto retry; - } while (offset && !mas_slot(mas, slots, offset)) { pivot = pivots[--offset]; @@ -4880,10 +4861,8 @@ static inline void *mas_prev_nentry(struct ma_state *mas, unsigned long limit, min = mas_safe_min(mas, pivots, offset); entry = mas_slot(mas, slots, offset); - if (unlikely(ma_dead_node(mn))) { - mas_rewalk(mas, index); + if (unlikely(mas_rewalk_if_dead(mas, mn, index))) goto retry; - } mas->offset = offset; mas->last = pivot; @@ -6108,8 +6087,8 @@ void *mas_find(struct ma_state *mas, unsigned long max) if (mas->index == max) return NULL; - /* Retries on dead nodes handled by mas_next_entry */ - return mas_next_entry(mas, max); + /* Retries on dead nodes handled by mas_next_slot */ + return mas_next_slot(mas, max, false); ptr_out_of_range: mas->node = MAS_NONE; From patchwork Thu May 18 14:55:37 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: 13246955 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 B09BEC7EE25 for ; Thu, 18 May 2023 14:57:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6E3C7280003; Thu, 18 May 2023 10:57:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 66B6B900005; Thu, 18 May 2023 10:57:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4BDCF280004; Thu, 18 May 2023 10:57:08 -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 3A6F0900005 for ; Thu, 18 May 2023 10:57:08 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id C11B74088F for ; Thu, 18 May 2023 14:57:07 +0000 (UTC) X-FDA: 80803678494.21.B8F8AFE Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf13.hostedemail.com (Postfix) with ESMTP id 3883920013 for ; Thu, 18 May 2023 14:57:04 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=lnva68kS; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Hc38volS; spf=pass (imf13.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=1684421824; 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=0gyCDIKC93BPQ76stKJ0o4Op1QUgFXcRfpAud8qjgE4=; b=zPQKSgDPK2xdYNI8vYwDT5QeGU2Eu9QaVwPpHCPSiwr1MKhXAfyJv89rWdgJz1cLfZu5Zl qsHXbNmXtQ1dumcUFcGQpdstOYqvjX6q67bE0sWPpGPotFWspgD6f7yqXCGl7yaPeTTvYH T1Gn8j/Z9YzFcvXUZOkTAeHkPTcSpzs= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421824; a=rsa-sha256; cv=pass; b=T2yfS/HDEFOz67LXl7yzjATUM/s2/GG9FNWsLigmVjh6fuG/HlchmqaLYQv75N7eKAKj7f h/bAqANRfJCjNMCginh5GKxrg/5GTH1d0XJT54W+i/Bg9L2B3n9lXeC7ob2U/6ZMY1/bBM OUVFy0B7L+LP/0ZkQ3g6TWzTSHHKw4M= ARC-Authentication-Results: i=2; imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=lnva68kS; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Hc38volS; spf=pass (imf13.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 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 34I6JDTm018335; Thu, 18 May 2023 14:57:03 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=0gyCDIKC93BPQ76stKJ0o4Op1QUgFXcRfpAud8qjgE4=; b=lnva68kSo21o0aH1JC4h9OJcPhe4YEmXRna2qQc17X2kH+uZJ2I+9MBFASoysp4nmZmr sXd/qcH4NJMp9WglDrDdmEz8lAxZ+PY71XW5f8X29s9MZjbVchc8qWECT82HDkGzfuXa orUXMJp7V6sMykGM2eY7sg/iikJoPzfl3Wr0IZH9g3YFNvB+k/Kp9YoWjGKFeQdfTOmi jlOINMd67+OYwPD/OQuh7ilm7KPjqVs37EQ9kpLBSyIIQZUWAyBkjAftbalXGMtmYKWO 9VvNu/USi5zSyt8Iky3hHlyyhtNgkceDLRdvx+1Gp5cix+uT/iB0hyt5lP2qOxI/TBmq jA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qmx8j2vq3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:57:02 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34IEXVLW036331; Thu, 18 May 2023 14:57:01 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qmm03w47f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:57:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eG/qlrq12kr7tuLTEsnLYA5lDsQdb/2xIWtjc7PV5BvtHapUAUuULiE/zgsSfpK6uqKwZ5UWq6p8W08LIlBrNzmBeezNq1e9EdDPHxzya5zYl3lXwqJe4NvawaOpGs4y16MpYJ/CZx4vlxtxANraTqvCHFrn401xx7ej6gV+1gjGl0MPTLfkUda3hbP4Kd11Sj9zbZp4hQwfzsspjXm9IrqEUfIkiKwjhdky5RHbjieqCV7qDhjaq8lvPBSAseF3rfptHjy+o968rf7pURiYqsMhKPI/jfzNLczz0hAQUs+C2vkhGB4+LJAslr8592cQApQ0qTZdE0viQcr6n0CcCQ== 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=0gyCDIKC93BPQ76stKJ0o4Op1QUgFXcRfpAud8qjgE4=; b=SDU71bLJpLY9Ai8VL0KbUu3FpnZ3qBpNEjmm4j9YdaZO3iJ/QzMIHGiovEkPYARDZQUv+GsAD6O+lM1InQRLy4NpBoqs8sq/JPX6CJezmCvX4OQnEiIOkzVVfk4hMAKcejAdhAxUVZAInjn5Hg0HRDStLT46K/vO9rb97Rs5LVa1Jz/rYPWeXp+fG5/Vkwjq3MQogBbXbiGJqxuKAiLsoKm6JYwm4CEi9OXQIDGDcYZfyW6XK8j4M7iKhafvU+WonZkGuLl0GmzNPeL8yruyJBhXSQrQYdzXNhP5gPdSkQlPtU/MCHUV9WKp8mlwB3eHQqvli8hs/Tm9sgkV/1S9OQ== 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=0gyCDIKC93BPQ76stKJ0o4Op1QUgFXcRfpAud8qjgE4=; b=Hc38volSE3m+xSa2G8uxF+5yONa9GjHd/qOXYS8WMssbR9gnPVnlEPRdBCJuheRrQBGD4xHOCz/x8liv/AilIQx58deNK8pXCNLTCNDCEP7RskYg7xgePTAJvOtRPyB1E9/q5u9wP4TXhRgEVBD8dGpBM9BFaA0kzv/8mSTiQtg= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM4PR10MB7427.namprd10.prod.outlook.com (2603:10b6:8:181::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:56:58 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56: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 v4 28/35] maple_tree: Add mas_next_range() and mas_find_range() interfaces Date: Thu, 18 May 2023 10:55:37 -0400 Message-Id: <20230518145544.1722059-29-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT1PR01CA0122.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:2c::31) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM4PR10MB7427:EE_ X-MS-Office365-Filtering-Correlation-Id: af7d2979-f9dd-41ef-0f9e-08db57b02102 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XzCI15xzlLLUNsHzoZ0bXkP7Ip4oe42g9nbJ+4i49BTxzA/O1mWAJ/P9UUHckOigBGAtSYbNT2ID22FX3oPyNAZ1Oa3k535JYQLgQoP36JG+dPRiQ67UOLbHZD3yz1cf4zfsyAGrVwAOatPgY3FhpnXbNM47na8boT3DKNP2weowJUpqOtsUs8QM0Cy4RjyzOMowMFELumJOG8+d/4ajVXSp+tPuUZp1D/4iW5/eUrqLGoNBmdCYEPp+ow7Ha2DDip3G7bGWiyXaM0lp1V0vuY1tor9N/V/v4kwvnYYJRL/ndF/YuFk10YfmxS9C1/Fl3woXzDDY0p121hGwj+Bb70JC06kbzekuPa8s9mxIHK1sXxtV0D5vdE1OpRgqoVEbfORZkVts1cqbXFXPHhaZX4RW1wUIZC+I02kj9X+CgisFj4miNxhM9b/kKVLvwoJjon44a5f3KfJsxmcwc2NX5oB+0whb8zOFuPMC+zXs5urXXCh693RZ7tzPzl/XhcKk3xZmv0Tq71mTYtT3JOMNdXKCW84DTmRwuI8b6mLs23ZpC1x5qZlBTVdCABxZou/Y X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(346002)(136003)(376002)(366004)(451199021)(8676002)(5660300002)(8936002)(4326008)(316002)(6512007)(1076003)(83380400001)(6506007)(26005)(107886003)(86362001)(186003)(38100700002)(2616005)(41300700001)(478600001)(66476007)(6666004)(66946007)(66556008)(6916009)(6486002)(36756003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Q8iw9Ka/PnVEh31if7PG0pmilDgQb97az3is4ylGhJ40dENa43CCER1GPobECiW9T+4K65GNyNYlXwISDKjdSC2M/D/Ei9299DFS/rS9uPrfZwZKFD+7CrxkyEFFVCPx91gWRf38Zdd5BkuY26BieSWonVAKTxDm3CN4Mhgr704gS/kPMOR2ehxVazv2HmgrxvX2rb6hzGxZ1A0j6h8pGKxOV2PDISzhTTcbOvr6wme+uf5CathXfgHyPjaLzJd8FTL028apOHVLCfT44t7ehwpzlZ9gdOiISu9igef0FrVwJmM4Vi0f0DWXkoC7ZUtZD/ypSTRvJ3tBCrf+o359uCkZpLnJnt3l6z/HGwzkTjnBON1LMgRRcGO2dbsVW8HszYoiQlGgT1CpnMbDNU0Tva5ID7hq+bWUVWRRgeSMWJa64XU7mmfvhgVc6ErpFSKNzMw81M7FOvIt3S7euEx0grO4QB32sKDZLSdqT49yySINPOduWRDeDqyLzZokWkglyl2CoBfuHOSZXUJiir8vglliY8UFIUTmfGcdALaVIOgXzSYeY7CpwFwlbf3LwQsAmVKhXBVZht0Yvr7WFnlEmuvHoq9QQwfLNVE5VMtuV+y+cL6/sylEtDZFFakLo/+icyn8LjNf8tL0YvKivYm7kHYGrXIbACEDTByEBwwJznOiMoyi57v1svYWaaBXattVm1V7tPX7qN1I/c6BnZWAp2C99XdphOBoVerR6LGS02IaCwHwBRk5oe1+84xEf9u24ukIRJMoBDbHGAN0Gq/1tahsk/62TV5q73JFybWQTEkFM0zLunMS3ORt+26A0mAAL/lOQsi8UnV4f/lZWXGbtcsG4g4Rr78NFdNkwqDmMVLpxniz9YYCLr+o9Hv3+TzI/7U/2aH5F9zNLaOC4nWJcmv0GYxGvQn4nIbiudlQyP/yozfN6ls9YD77swVE35tzYCjR+o9ZRP6fM4vgvEq8JD3TOLNfZ2ycuCiRP7fHW86mVrxbRdMNk/Id8HlxEqJtVPRkQvFHE5BmLuNOECVjMGAkXZNtnY3pQK70lKw+fxHw45hJ2OavtqksTB0k998RL4IKpYh422do5IUppLucfB01LuZ8F9YZ7b+o7b0BkbMo58oDrRFdyFlhX4tWJQX4yB2JtDn30K0esqowLxi3FLzNFtsACzM7z9pTkfSiGtaj1lUt/LvzbamCAVUde00woJ+7bmfzq/IixV29P/Cf6EiKlQhz49LtWw0Zsbx9kkXf8+ySjfTQQVKMcWLJVKwJ3Ect/GSvAFsign48RPKyWS/rxHyA0yd1hKZYUsTJK20eOxXv0tLEQQcE2PVjtBxjhFm3jZQOIXIZstjdH497Wxj0FEP9nQRMAggfN6D4SKr5NYqMvQMW16EqyX8DFzwLPae9AmFk45fR5aa9YZF+Z9ue6d1+irEguxf2z9EkNCiB9aWyLQV/nL1OKZ8WM14h353yt2dU7dYc70zh2hABMNDCIbckMwIpRjPKZhL5spilMbZrvdB2C4olt4L95clDDUijQ9sxNUmVGwhlk0qT13RN01NjhmNktofANN/P7BAK3Ut625tooOG1BqHJ4PTq6EWhra8Xdq+pC4vI9Mpadw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: fQL3GSMfXf+ULnGzcaUIBOU72maZ+L4eetJiHDNOx3V8DjbLvd+YC6XUCSB8XHJQRbEPPcob6qU1E6XuRYPfvJCNFZAdIKls58jH1ZSLw0DOLJy+42SB9j72mftVSErb6aagGqzuLYeupIHv2E7wSMgCK/hOh72T+Ffm7NN5cLGXeFRcQK2H0jIWNrv5xDZwH/MUsM99yku+xz+Cb0c3nznhip9bjL026c0ajxxFzmYo5xBTdx5v2tdjCtrHp7EY323gc+EiWmA/APELA+N89gp+7TLtadu1dQXXiJEWBwMTyUZyEIMN0swBM4sOR7cIa0B9XEL5Rjh2A1XfuljHdo8NaygPzeNQ4QLXjVbKZFA1P5+1UqjW/R7UfOA6+9V0MgifTP4rS+MH9jaAX6Tj34wWxOPlvaahob4WLjSBg6c9IdxdQP8kemiCijn+jLHp6AXueyAAcDDgkbPPOjCmlNQ/hLIRsiltjCFT5hwmU0MwK3vA4gMC0SD5vdNcZqhmzEWYJf/pPa1d3HeiAVxAFelTJjwI8rqVqvKEFUiyUpwcfO1qywNnKhEoSN0SSHiBp/l8fQYsMwLIOJGZrGtVvW6RpwAQwRh0shbcSlte0udOdYdARbbwVqjnb04sg8Bj1Fj7T2TLn3ZhExh7t6LlkgP15oFa0fVaMbVkl4XcYOPBeR9j4C4cnrhK1LqVAEJxDi35bkLXIramew8yjIPznU/ULx+AspxVOCWELQJRSr9NIjmgUZ9chCbJ47B8jybJTo03tnQlxNBXrgJSp1Nc49QhW/riIkGtFdG/xhCyH/bH02kZxQSQH/xsYtLOrvoBZJRDER8SnqZQCdSz7yusl+vzjUWYrPjStS87+NuwHFCXyi06HJU5ADSKIC2/ZVVBmRvKmZ2Oue9o2QsLYR9B2w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: af7d2979-f9dd-41ef-0f9e-08db57b02102 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:58.4505 (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: u59zC5DxlY6DI7lDhruYJlarOksT2kBpmwcrpMrJ5kTX93E77hLBH4bmfAeMGE8yRbO8HCojeAhP2F9VSKnuDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB7427 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 malwarescore=0 bulkscore=0 spamscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: zRrZvx-ozfeRgEKek_FlX8EficT-XQxg X-Proofpoint-ORIG-GUID: zRrZvx-ozfeRgEKek_FlX8EficT-XQxg X-Stat-Signature: 34ehwtttc6nis8i6abr7kqaus6xshp14 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 3883920013 X-Rspam-User: X-HE-Tag: 1684421824-374455 X-HE-Meta: U2FsdGVkX19qf8DA1p73ARFkKioBUHM/vlsxnD31MKEHhIxMrZnvQdN/BGm3mQ7nJ55xujCASUQ6t1+pmYdRn3cuH1TNxSWJcwqLEzkX9viDfnvSn1uSndytlUuXADkKbfSmCkMSjCuCo6WeQ7oZX0FwSvRbXnW76xLI/Kcvg2Rn5Bqt/q5/rSgWqnh0FFh+RANit9EOKCAmF4g4H9ZL9XGGN5g3aQGb38V7JUGGR6I3QL2cbsLDAvVbYYxcUVYsvN6WMnRe+sk3XqPDIwMAjJEe13BU80S8sWpgOTwbRUNpIwK6aG0FaSltWCGihDM1/XCT4wJYjBieUi67mQk7Q8fdKlw6B5BUaA5TsRup1LinrCeQzrYVzMh3DgtrOx4zvc8Zd7xw2Fh+1JUaYoodAdNG5rZorZ/1k1bh3AYSaziL0vJevwQspk2SFJjCgK+4J54cDKz84Y0/CAgXqZMAdxLQ9o3oQ3K87SfgN8xaVyYki+9F81EwR0W8I8+xNg9BWkefF6UoC78+xemp3qSGIH+sgcLfdaeOxAzgMoBc+uO3iY+zMYFNWjBKkL0RnW03Du6tRg+CwNEigC0TPYXIMXNt4QOTWoZwDpF5jKgZtfS1C9rhwvy2RycjOut2Ulqs/jvF9hH5thYhD16y6M57rz1KmJkpyzYforhjHZbDWjzINKSyy03oKugWSIwJS8bo4AJbFGrK9Achd794H1++1STmimJHUIaAFX+hgB4TU4YXHt6r4SeZnyFonLwi5K30Npr+WkkmH4OElx+/VYD9i+ASI8lzfYq0yRY7woiL8DZjO0TsVPi27uK9GFhUnUnRn8zIL5hur5Db0eiAmDOhUqDIdsALHS7XQ+oBRAr4Ib7sHWsSUaDlewSC7pnHZItJO3GfePCKGRNrDdKROB7c5BL448dXP+YqIr705ycr/ZjUcIeBe+4CPc5vZSrVE4LSvFqraQ9rYw2ku3s7O9G vJSOdKpw 3vuWsd7LqDh1dFlBatvaa9OyUDojEQ8h6l1uNmDXeY2RpvLrXqzxRIxn2fOC7SzhJd1UM+qzYPXWvWF4UtHQyeqJCKtrhcTJ1tLRiMBPd7Ktk7qoUXyPPtbwL50aGMBanAwCUvGecgREtH2dvWaUpl7Stw6LJ3+bNJGiq10vNbd/T43yFEcA2p32fSRKdgEGXLA+AUPxAlsvPQzxIP4pHxiUTthhuIPeC+94GAsi+W0QGka3FgE2UHmKphw/AhqkpXCb7SGTRIRlQfY3Rf4T6fXrp79vWdP+IfO+7lJ3V8uBOpBagqNlnnYMBbKUmrCbKOx9Vj44C9sgLQz9SmNUuIbpREqhURQNgm/CqDl6cJD4K7mq7WG3RNpKTElbz/Fd8F5YKA+uoCDR//N8cgL3E65QzdQs7HR9s+/J2yVOAG7xiG6c= 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: Some users of the maple tree may want to move to the next range in the tree, even if it stores a NULL. This family of function provides that functionality by advancing one slot at a time and returning the result, while mas_contiguous() will iterate over the range and stop on encountering the first NULL. Signed-off-by: Liam R. Howlett --- include/linux/maple_tree.h | 3 +- lib/maple_tree.c | 172 ++++++++++++++++++++++++++----------- 2 files changed, 124 insertions(+), 51 deletions(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index ed92abf4c1fb..9d040043858a 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -455,6 +455,7 @@ void *mas_erase(struct ma_state *mas); int mas_store_gfp(struct ma_state *mas, void *entry, gfp_t gfp); void mas_store_prealloc(struct ma_state *mas, void *entry); void *mas_find(struct ma_state *mas, unsigned long max); +void *mas_find_range(struct ma_state *mas, unsigned long max); void *mas_find_rev(struct ma_state *mas, unsigned long min); int mas_preallocate(struct ma_state *mas, gfp_t gfp); bool mas_is_err(struct ma_state *mas); @@ -467,6 +468,7 @@ int mas_expected_entries(struct ma_state *mas, unsigned long nr_entries); void *mas_prev(struct ma_state *mas, unsigned long min); void *mas_next(struct ma_state *mas, unsigned long max); +void *mas_next_range(struct ma_state *mas, unsigned long max); int mas_empty_area(struct ma_state *mas, unsigned long min, unsigned long max, unsigned long size); @@ -528,7 +530,6 @@ static inline void mas_reset(struct ma_state *mas) #define mas_for_each(__mas, __entry, __max) \ while (((__entry) = mas_find((__mas), (__max))) != NULL) - /** * mas_set_range() - Set up Maple Tree operation state for a different index. * @mas: Maple Tree operation state. diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 860f82e16166..b5df37be7a15 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4792,13 +4792,10 @@ 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) { - void *entry = NULL; - if (mas->last >= limit) return NULL; - entry = mas_next_slot(mas, limit, false); - return entry; + return mas_next_slot(mas, limit, false); } /* @@ -5885,18 +5882,8 @@ int mas_expected_entries(struct ma_state *mas, unsigned long nr_entries) } EXPORT_SYMBOL_GPL(mas_expected_entries); -/** - * mas_next() - Get the next entry. - * @mas: The maple state - * @max: The maximum index to check. - * - * Returns the next entry after @mas->index. - * Must hold rcu_read_lock or the write lock. - * Can return the zero entry. - * - * Return: The next entry or %NULL - */ -void *mas_next(struct ma_state *mas, unsigned long max) +static inline bool mas_next_setup(struct ma_state *mas, unsigned long max, + void **entry) { bool was_none = mas_is_none(mas); @@ -5904,24 +5891,71 @@ void *mas_next(struct ma_state *mas, unsigned long max) mas->node = MAS_START; if (mas_is_start(mas)) - mas_walk(mas); /* Retries on dead nodes handled by mas_walk */ + *entry = mas_walk(mas); /* Retries on dead nodes handled by mas_walk */ if (mas_is_ptr(mas)) { + *entry = NULL; if (was_none && mas->index == 0) { mas->index = mas->last = 0; - return mas_root(mas); + return true; } mas->index = 1; mas->last = ULONG_MAX; mas->node = MAS_NONE; - return NULL; + return true; } - /* Retries on dead nodes handled by mas_next_entry */ - return mas_next_entry(mas, max); + if (mas_is_none(mas)) + return true; + return false; +} + +/** + * mas_next() - Get the next entry. + * @mas: The maple state + * @max: The maximum index to check. + * + * Returns the next entry after @mas->index. + * Must hold rcu_read_lock or the write lock. + * Can return the zero entry. + * + * Return: The next entry or %NULL + */ +void *mas_next(struct ma_state *mas, unsigned long max) +{ + void *entry = NULL; + + if (mas_next_setup(mas, max, &entry)) + return entry; + + /* Retries on dead nodes handled by mas_next_slot */ + return mas_next_slot(mas, max, false); } EXPORT_SYMBOL_GPL(mas_next); +/** + * mas_next_range() - Advance the maple state to the next range + * @mas: The maple state + * @max: The maximum index to check. + * + * Sets @mas->index and @mas->last to the range. + * Must hold rcu_read_lock or the write lock. + * Can return the zero entry. + * + * Return: The next entry or %NULL + */ +void *mas_next_range(struct ma_state *mas, unsigned long max) +{ + void *entry = NULL; + + if (mas_next_setup(mas, max, &entry)) + return entry; + + /* Retries on dead nodes handled by mas_next_slot */ + return mas_next_slot(mas, max, true); +} +EXPORT_SYMBOL_GPL(mas_next_range); + /** * mt_next() - get the next value in the maple tree * @mt: The maple tree @@ -6031,49 +6065,41 @@ void mas_pause(struct ma_state *mas) EXPORT_SYMBOL_GPL(mas_pause); /** - * mas_find() - On the first call, find the entry at or after mas->index up to - * %max. Otherwise, find the entry after mas->index. + * mas_find_setup() - Internal function to set up mas_find*(). * @mas: The maple state - * @max: The maximum value to check. - * - * Must hold rcu_read_lock or the write lock. - * If an entry exists, last and index are updated accordingly. - * May set @mas->node to MAS_NONE. + * @max: The maximum index + * @entry: Pointer to the entry * - * Return: The entry or %NULL. + * Returns: True if entry is the answer, false otherwise. */ -void *mas_find(struct ma_state *mas, unsigned long max) +static inline bool mas_find_setup(struct ma_state *mas, unsigned long max, + void **entry) { + *entry = NULL; + if (unlikely(mas_is_none(mas))) { if (unlikely(mas->last >= max)) - return NULL; + return true; mas->index = mas->last; mas->node = MAS_START; - } - - if (unlikely(mas_is_paused(mas))) { + } else if (unlikely(mas_is_paused(mas))) { if (unlikely(mas->last >= max)) - return NULL; + return true; mas->node = MAS_START; mas->index = ++mas->last; - } - - - if (unlikely(mas_is_ptr(mas))) + } else if (unlikely(mas_is_ptr(mas))) goto ptr_out_of_range; if (unlikely(mas_is_start(mas))) { /* First run or continue */ - void *entry; - if (mas->index > max) - return NULL; + return true; - entry = mas_walk(mas); - if (entry) - return entry; + *entry = mas_walk(mas); + if (*entry) + return true; } @@ -6081,23 +6107,69 @@ void *mas_find(struct ma_state *mas, unsigned long max) if (unlikely(mas_is_ptr(mas))) goto ptr_out_of_range; - return NULL; + return true; } if (mas->index == max) - return NULL; + return true; - /* Retries on dead nodes handled by mas_next_slot */ - return mas_next_slot(mas, max, false); + return false; ptr_out_of_range: mas->node = MAS_NONE; mas->index = 1; mas->last = ULONG_MAX; - return NULL; + return true; +} + +/** + * mas_find() - On the first call, find the entry at or after mas->index up to + * %max. Otherwise, find the entry after mas->index. + * @mas: The maple state + * @max: The maximum value to check. + * + * Must hold rcu_read_lock or the write lock. + * If an entry exists, last and index are updated accordingly. + * May set @mas->node to MAS_NONE. + * + * Return: The entry or %NULL. + */ +void *mas_find(struct ma_state *mas, unsigned long max) +{ + void *entry = NULL; + + if (mas_find_setup(mas, max, &entry)) + return entry; + + /* Retries on dead nodes handled by mas_next_slot */ + return mas_next_slot(mas, max, false); } EXPORT_SYMBOL_GPL(mas_find); +/** + * mas_find_range() - On the first call, find the entry at or after + * mas->index up to %max. Otherwise, advance to the next slot mas->index. + * @mas: The maple state + * @max: The maximum value to check. + * + * Must hold rcu_read_lock or the write lock. + * If an entry exists, last and index are updated accordingly. + * May set @mas->node to MAS_NONE. + * + * Return: The entry or %NULL. + */ +void *mas_find_range(struct ma_state *mas, unsigned long max) +{ + void *entry; + + if (mas_find_setup(mas, max, &entry)) + return entry; + + /* Retries on dead nodes handled by mas_next_slot */ + return mas_next_slot(mas, max, true); +} +EXPORT_SYMBOL_GPL(mas_find_range); + /** * mas_find_rev: On the first call, find the first non-null entry at or below * mas->index down to %min. Otherwise find the first non-null entry below From patchwork Thu May 18 14:55:38 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: 13247256 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 04E85C7EE23 for ; Thu, 18 May 2023 18:50:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9203A900004; Thu, 18 May 2023 14:50:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8D0A6900003; Thu, 18 May 2023 14:50:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 74990900004; Thu, 18 May 2023 14:50:21 -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 5EDFF900003 for ; Thu, 18 May 2023 14:50:21 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 31DFA1208C5 for ; Thu, 18 May 2023 18:50:21 +0000 (UTC) X-FDA: 80804266242.26.B6B5D0E Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf30.hostedemail.com (Postfix) with ESMTP id 9E3EE80018 for ; Thu, 18 May 2023 18:50:17 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=N02zp6fb; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=eV56iaNU; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf30.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; 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=1684435817; 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=1TdNAGujIkL2WjS4gl/cKBZ4VuW37YWu43lI8MFgl5A=; b=pFvXN/cggYk/Fny49Cm4D+sQ5WUwD85/BKUbf+Rq490dDvVrlQV0u9zoodDPj7wv8f4dEj f1W5puvFuQu8B40GcxoHwJNjCT+jonhMU2hIVwfQj3yd9J/lOPdegqcNXnUiPWFtAKcyBH vnzaW48k0IcsGqwPwZU0FVyBMvIZWVc= ARC-Authentication-Results: i=2; imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=N02zp6fb; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=eV56iaNU; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf30.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684435817; a=rsa-sha256; cv=pass; b=satFLCQGNhlnSbDBcdryhC2ev64KCURR51QtYs5+WxiBBvanR3O4yCySaD6prdVxtxQ56D MJpAY8rf3zk5257AwY+I99MVUB1y+8I6sZrb7PVxjYON47+VHA/+lLVVfrii2gxWdc8LlI jwm0/y38uUeqO5NxmJ2TLNoXChAQKyo= 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 34I6IsjN012432; Thu, 18 May 2023 14:57:04 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=1TdNAGujIkL2WjS4gl/cKBZ4VuW37YWu43lI8MFgl5A=; b=N02zp6fb9JGl3bXqiGkEXAQc0P/B0DjFegf/APscMbwKfPIe0IJBuBHEPjrSVhK14GGQ wRQxWqvMerQkMWYotsl1dEU+LSPG+vFLScW/BEk/M5kl2TOZKvKz9TU5WzdPOGwljh2t 5wA8ilLYihx5q8qNE0As99Tm1vGpjYECV9+oxkpeXDNYG39Eb+q2EtrX1JPEDDDxxgI4 fKAVGltzmkhkCQ5Di3E+q6lHo9wWhdBY4SxgRlYvJLzI2sVEkLqfLKBViCLHGoUyWfE8 mpe09RbDWiE9hDzRNQvGNbRybK3ox/o+d6su2TEBCujVmTq/KgU5NgLg+VWSZ0HRXkZ1 NQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qmxwpjrc1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:57:04 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34IEc20P033902; Thu, 18 May 2023 14:57:03 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2109.outbound.protection.outlook.com [104.47.55.109]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qj107c9df-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:57:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OcAHddjApTVvAMitlty2XWRPeyzPDENcJxM2Ii3HsDpG1BbkA3edlswsTGiTO11PeDdeA/ov9th1ZdqErEV876FB01nJD+DUibNPk+uZxRH0eOo5qKsim+cCVSKbWV7cPW7GNXT1gCTqRmgH6RMZ4Y5jJCK3CNRD/S/Hal0yJc8FTgkd9+s0lcTrjg1a+HkXBAKY3RNdbO/MVO86U7kjgzxqmHmmaliS/Lmalwf30nhNDIL8dN62xq/dKRHdIuTnNGxDz2z8phIynlLilU35wzr7x+2sc99dC8PTN2GasTbmx065u8MmGBr1B8cDmzUKzi76dkjWMB0NUEbNXd84yg== 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=1TdNAGujIkL2WjS4gl/cKBZ4VuW37YWu43lI8MFgl5A=; b=Btw3d+CWLOSE2mkHj7OHDBZ9kCuY3So8Xv+Gj5TqV7FigcdXYBOLC1LaL3dwmpJbvOsVzd9QHqZplDxqHJe/bNyoPCYHZdGq/PFyaQ9OeafR+n5BOdtmMISRc2sJeN6qPMv+4g8uBv+j75v2jPQZIoTd4AEA7CeP10KbOAsnn64KjbmnPbor5Mb72Q9oF2+/1PPU1qUDPBMnD8HqSXFuwrI8bqVxpNuM/vQ/qShipA+brdarCi0jId/+MENIyLOONeE9SRa7C44uHfDVS90l/PM/5j6b0cMG5CWlAi6e+4TCa1dCBAO2bZt6AUGafb1iy3e7p+wAvVrxAggnO6ESPw== 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=1TdNAGujIkL2WjS4gl/cKBZ4VuW37YWu43lI8MFgl5A=; b=eV56iaNUCrAnbkKRfr7s+xHTDSa+U7VX2pARgVDbdX24MdyJSkwlaDmYMQ+UC11HFOEH0zEeNpz2cx8fm2I2x1a/1yPBohDfEjxJ1deKO1hV6cS8ukQBUVDrIHZEEeoyLN77all8GThjAfRoho/GP7ZhQwjWV73QIwSDuNSYlAY= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM4PR10MB7427.namprd10.prod.outlook.com (2603:10b6:8:181::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:57:01 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:57:01 +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 v4 29/35] maple_tree: Relocate mas_rewalk() and mas_rewalk_if_dead() Date: Thu, 18 May 2023 10:55:38 -0400 Message-Id: <20230518145544.1722059-30-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0002.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d1::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_|DM4PR10MB7427:EE_ X-MS-Office365-Filtering-Correlation-Id: dd711551-0b31-4383-f603-08db57b02294 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lVTT/Qc0ChiVrnwiYIG7Nz592w57fbzIRx4cEHEfYIXd4aQnFtW8xGw9yN3i7Yb3AHYxnO3vGenD6byUiMYLR0hyG/V9PijKGcjqOawU2Fcfx8vP69/7OIn7lG2UqB/N9RUCzCKV/Kqc2yhb3Y6C0JXkLT7RFnorovGCxgYlESf9QW/duP6LLAI1Q650GPEN69uwCVBmrLT4EmYUGd2uxH/Hf7xYDr2P+28jjc6Zy21DTU7urssKFP/sJ/OyZIk8uRTap0zxRN5wF8T1oXK/0fynZC9Q/zBvO5WhapoK8gQj7TQo9dY964t6UAvXs2zVmE9LaChiKMhoYu37Xs5qlkMgu6XflI209//XcVpgJVjDt44ApHcB94TDWetodU+Xp+cqJBT58Wi7JEBLqPJpx6S+tkgUXbc/mGPWXEnte5qmf3UJysuCvTD/7iyZSVj0F2VuJ3votp68XUxOAMt7//P1Mxjfjyt/CsB/MaBrBjNnBXprNlXZC0OhlcAjfhx/xeNaNixdN7QSuJKaAg4d0WmOMTlw46PJTyhPXPePNs69z2FHD6q1ybsp0AAXzBLS X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(346002)(136003)(376002)(366004)(451199021)(8676002)(5660300002)(8936002)(4326008)(316002)(6512007)(1076003)(83380400001)(6506007)(26005)(107886003)(86362001)(186003)(38100700002)(2616005)(41300700001)(478600001)(66476007)(6666004)(66946007)(66556008)(6916009)(6486002)(36756003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MsKkEMMUPAnC7kqhfbzLuid2joXAkuK/2l+KWKmeVZtEd/pZDddD5yRdpLBIMb81e/6sex3ne1sUwC9uUiDbfCXcmr4XEfCn0wgB4pZ/NgpqAETK5h0492k2gsNRe3ErDMgtzKj9lP0mNACrSf+6YEOE9WGTb0qVblStVSGWoSak9+Yh2ndTSybNyXqCeLekrgzOXi/1LUyba1UEPQuyVvGjKuRarxcyEIKOFcgs4z5UtzaUSWcJsNHqwsGCEFQLstSL8SjtjXiW/6G6I5RFo0xvbX1HIeenhWjweNeuly3XoLd5Sn3/RcvZka2/Q5a2Q47rUrzFbFLQd+Th/41NU+zO9m/Qzdg3t35FjP7Bam0eMnfRH8TkJszfltZ6S/4fm2IowGB2sLlM4xv3tBlpO02CtPG5kCZzLj16Pw7izlmCO8MVxCNQtymwy7t377LTKyPmicw4teRipyeDO6n31zmsAr3x3zD7PGyMTE8OBnWI+OGAw49E7tQABKLs2Knhtda/9IRMHKt/WYv7b2blGOBs373aKNsBv2dG16W817J5Gw+ydyX1LvNWoRLRKS8hjQYCphDyaHVj1nTvPSZo0agrH+iGPN1Q/FvhlQgZSvVEN+MmsZu76lDKMPaFECywLvkizGSfLIEd9MtZYmxhZHzo8h9nRqznmDA4uvCrYaz/wrElynFW3RlRq3Vf3IjrcAqDU6ZcRPEZ3La5/Wyyj1GqCYG/Fb/pm3HQmsg00o92EUECk10TtBOMYYswXxSdpHwDA4iKJPzWCJNoRiwvuqEduV1d/YhlOL6rYz2wLzjjBohNMRzfLmFQkvZgA0KcEHJ/adw32QUAqlwV9DI1ixQw1lE4u3lunv96jpfBJOU78mpopCsep2pP7eGiit5fhFdGdvST5N7o1wnfDGn8K4zRLcXnDOHt8w8F77TcL5uvcgpqcwyt+3cOJD72zfK56H5yySnJZ3jQxs/lhcQEj0if3JlZelgzl849iGbxSckt9JNhIc2SKlBwIulETGf5Ra4ytvI6io1cTRUTg/kwzV1/h6369s4HxLhwZBOzOc8dCbvn87iEvdPPc4ygk1asduO81rhCBIBxR01EoVonakPFn8BG8G07hZzx9Zg1BTw7j79EwNBq2Y/A/7hXwMwOuKDHli8tXDwQHYQEP8iKZ3seWfPIXKElqLcO6I4kIhFBKZDFxfbuqA/0QBOM6m8PCwejNk/KkH7ENcEopccx4Oa7eSOrFZ6E0ifdxUTxskIs5EX11eNzvYlseROxdhhi1Em3qIIEsYIhmNnkcIayqp6iHwttA8fO3f4farKD/TM1g8un3cWrhel49XNIY/ZNHtN4k25eiLm2iZiaWupqtVmjOz4fDQo6MJnlCGfF0bFTHidda/gAI8Zz6i6qVVEDXX0MuItHT0kiS+gbcJTn73jNBkICtzUGT5ChnIRKc2zAmJbvYWvOrSsNQL2eAZE9eBnxj4nGmWOFt66zae25drLaaO5d7GcI4zhSmJcZuWHyg6g7DNQ5Ut5Fl5W+JodyVhE8rkjLrUrW1j1eJ7HRR1I5a3Jpjq5sM+UDSPgHwj3GTqJqxb1QmjP/fhsqxOTG2GlmZ96mjr/bZmq5NOUanA== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: YqM7WHgn1DQ5swKStdlEp2d5VlzZ6pN7lWoyjdkxZQHYjHc0oII7B5lNRqyLTC/OKw0rxSgrojtuel9vzahhkzBj749dtdab19wgtGCqGMM2FeFUtYGpIP71EGEm1vex3GuaAa0p+aXSdQgq11gcmVDYAiOHX10FT0FopM3fWcfOPiDjBP+D0KuVZm7w7HCMK0EjExuwyTrGc/FR+SUN9KXhCFhTUwYWta7bNFEYW8OJpAEBj+R7PXj6pUWlcq1JR67R28hkrjvdoLOlUDYkeJBJPQOaiQpQ/sKOkeyUnziIYFOYdRr2PX/qlR4onX+5DWFq43j06+JQiHfYvtgkYtIX4rMFKP/g4QBAr4EFgvCNr6tpb41KWogYSWakwdiSLULoN1aoyaRSkMd5zpqknXp5q7mFCw/7Bl/nLxMb24HdWAx0TL5iAGxouhJ1Wa/tLPPVxUjrLDzy7njv6muIIegoUIkUAXNnYLv2KeljXkiGWjWl8ndwMWgrMsXg6r1PxOXbb1LYr3wcIN2E/7suErepYA5SgvqXPIaI/b5XhAtr9TKRb80sIQw3hCUIo3wd29raOpxJybbuQdgqsV7tuV0fKqWP2ECgCpzeqW741DTUjKb3LfQRmG27UybdLSvsnzwNnTTFADHhutfaS72Fp/idOBCEHH/tcw92P8umS7rhsIrWVo76EKZfEfpxV1XHk9pWs5a3xT//op5irqIjsROeTjFWWRtpOR8GbwcKgnsfKhcCEGE6OdPTypNUgFFg/dvwQVtjDP34utbR8h5FqlLxZmr+2BwvXuyd6oFv6AfbnXwVt5YJohMUrl/XgVLELFXIrdPOF2XobIHhigkn3WncrsoCjc8ZhWJ6asDiLX33gAeUUA42ZNhq9PSpbhtFZjm2TLxrTA/CFtxLvFemwQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd711551-0b31-4383-f603-08db57b02294 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:57:01.0235 (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: cMz5lKPJnnUtDJGjwhj4Eo6SzNRkN6UdiOiPBkUCs7gtLept1isA7gQSoBmC7TORe9lY/Csm9IJo9ez+67UJRA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB7427 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 spamscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: 0lz_w9n5r3UYf7QH4OwgEWtPkTAYBtYP X-Proofpoint-ORIG-GUID: 0lz_w9n5r3UYf7QH4OwgEWtPkTAYBtYP X-Rspamd-Queue-Id: 9E3EE80018 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: e68jxkxxoun6sf4p5xeinmqnix9416c6 X-HE-Tag: 1684435817-691997 X-HE-Meta: U2FsdGVkX1+2cZmd6xxAMxN0vt+W8zh5ZWeAkTpanU3FpSvKP1TDMmAZd43+fWtQEomlvPxdmaghMsvYdL2xg3INj6punAmnPipn2gAvJvlToYSbFp7JB23EIKpDshd7LdylXi+NOhzKBdGCfUBGuFWi1tZOZibKygL7DIAN7sIB6pTlZ0vj3iSrF7dH+s6p2DnrhQ417/UbFvfMwXLn0bZBkXqw4x13ZFu8eC/BVBhqMz+zGJA6qPK+W0WGjpm8tTnbEZ+k5vfWLlDNilOyH3CMmXH6DjKaGwycpq0OblsvbrGWWwj1FsrC2fap/c7nSCA0CCAZl6OV9NY4VKA6Ho2myXG69P22Nj6HcR+o1Fi2Wjxz39yEVt0CrDdys/lcCrhiuDL6dPOSucHEGMbMi0tYj5rVsPwpnuxO1TP9xVPYTSGss0wL1/E7ztZnsxMsUUt6ifPhzBJvzOR/49XgRTc3YYRNdzYaZfuETc4hfbce60HpGRclpq1NV1HXtIvJkDpXhGcKHJ/BHwXX1TTM53YdrcUTU1mBaHAua618bcrZba1u5PJ4S9qxEX0Vy3YwNoY20JflxzicSRbzTifrs4CbEqXm+BhPpC2L3u7j5Ygj4w1VXkpxSALBGfdjKQZcPW3CACZ9AAuo4vlbOcUMvShBHUn4VidPaOBtc0VOGQjIkGUg0ncACVBs3r2JrMYW4tm3160bHb76P4/sW0XP0oQakVTb/rzMpaAyO1Ikx8PF2BmokXMFrkBZyz3BCadgB9y1AAN4PBBdl6y/UR1S/NPPw33MCek/7McTU6e1DRZynRNKnYVXWq3muxMBgC1Pv/EmzYZ6u+G/ysH5nngwW0W1rTnp3ozvsGWrEm4IHa8GB1BiU7T8GZTRweYu1WlIPW66roT9fffTVlJIfqw2ipFbHbsCUnoa8+yZfQ/5QfTfM4l676sON/nPxEAgULZjRGn0ANdkS5DQen6EPsU kHmTvESV V+k4du+CQ2D5Fp/JCd4VxHmzSVwWFSTwAhz3xcPkDIcClTPkpIvHc0pOZSyPKPgi8k750fluf+flMmXrb5tbf9NxgQ8+C/vOLlyLHAYDrL+923YeuUceOKUjK4X8hpNLiuYVKKyeKOGa6jwJiX5Rvz7o5mRYNSbX/VQ2As0XRomrm5sHAmFlTb2cG+sN0j+EkJQPSCAOm2gelD2OM37iE4HxETpRaatRjeROQ+mIiGpEFttVjUB9881lLcGk94e138cTyFRiEyhMHIoAxrDxBU2CTWrHhyHTVvYbOS77fw/U6vjRkKYUlRn4OsIbGRP/AymgOdkpo+SR9KpupJKHGwRep3jnL+pgV475oUQ97U/dWU+39o7Ft55A45TWfWwXy1TFO6JqMZDhxo16EVoweLrsASlomvivMg9dImtdjhAoOjC4= 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: These functions need to move for future use. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index b5df37be7a15..25748014fe34 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4497,6 +4497,25 @@ static inline void *mas_insert(struct ma_state *mas, void *entry) } +static inline void mas_rewalk(struct ma_state *mas, unsigned long index) +{ +retry: + mas_set(mas, index); + mas_state_walk(mas); + if (mas_is_start(mas)) + goto retry; +} + +static inline bool mas_rewalk_if_dead(struct ma_state *mas, + struct maple_node *node, const unsigned long index) +{ + if (unlikely(ma_dead_node(node))) { + mas_rewalk(mas, index); + return true; + } + return false; +} + /* * mas_prev_node() - Find the prev non-null entry at the same level in the * tree. The prev value will be mas->node[mas->offset] or MAS_NONE. @@ -4676,25 +4695,6 @@ static inline int mas_next_node(struct ma_state *mas, struct maple_node *node, return 0; } -static inline void mas_rewalk(struct ma_state *mas, unsigned long index) -{ -retry: - mas_set(mas, index); - mas_state_walk(mas); - if (mas_is_start(mas)) - goto retry; -} - -static inline bool mas_rewalk_if_dead(struct ma_state *mas, - struct maple_node *node, const unsigned long index) -{ - if (unlikely(ma_dead_node(node))) { - mas_rewalk(mas, index); - return true; - } - return false; -} - /* * mas_next_slot() - Get the entry in the next slot * From patchwork Thu May 18 14:55:39 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: 13247255 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 46D98C77B7A for ; Thu, 18 May 2023 18:44:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9496C900004; Thu, 18 May 2023 14:44:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8F94D900003; Thu, 18 May 2023 14:44:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 74BE9900004; Thu, 18 May 2023 14:44:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 630A8900003 for ; Thu, 18 May 2023 14:44:43 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 291FC1A0935 for ; Thu, 18 May 2023 18:44:43 +0000 (UTC) X-FDA: 80804252046.07.B8E473F Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf26.hostedemail.com (Postfix) with ESMTP id A65A5140015 for ; Thu, 18 May 2023 18:44:39 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=CSWqg4nU; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=GBFkYnvA; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf26.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=1684435479; 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=or0gvhiuj20PZDjQz2A9EQ37j0qVAfTsjFswHLJTGPw=; b=1WloDKRLGKca3PzIdgJTpv5rTDG881H9lRN5kwTb3tTF2f09/Df1S97SWI9cG1NSrZMDPI QCs7k/RMGb3lr1ftChdeoGzwugUZwlqqgpl8+IO4FPlnu7wQv5/+kSuC/3C9YTocpRKf0P mIONzgH/W4Xcf9Jm3b/cK3XFxAZUYLI= ARC-Authentication-Results: i=2; imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=CSWqg4nU; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=GBFkYnvA; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf26.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=1684435479; a=rsa-sha256; cv=pass; b=i7gy+Oh5SBSA5I5DwYNHKPLqkyXTd0vLIKLQjWM3AIGVES6K53NpBn9v/i710075kK8EXH u2H4szsN9vB9V9hQEBkRY0Bh1/WbKTTuj5AW49r/ug8RIRtCFIv3PJYNfqLZgtHK2uRBU0 iQblozlwO52hQZqFRSJruLy87YpR9fg= 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 34I6IrcY012408; Thu, 18 May 2023 14:57:06 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=or0gvhiuj20PZDjQz2A9EQ37j0qVAfTsjFswHLJTGPw=; b=CSWqg4nUL6VOOAxgLKYWBJUqPrEMgnAi30X2s/XfZgwf69fT2F7vGduGLbollPkTQc04 B37U2yN/d9Wd4oAEANtNiOvXyoXs4V7NsNhXBjqMwtpj4MvVUdDMUZtnI1pCYEorRbT6 uiNGrzv1zPGKghZBf7o42tJXzbTPogPGuUs7wVcBvHt011e9Sn5ZiCRgQ9xofAjbH1+h BBRnPRjsUdO9ApLRrIU32JdyqzF4VUGVGtSGpU4HCcay/Rbmpia3I0ob7jPGNlPwrtfW OSG/Gx9cpfN0Hbd1+vnU/ASNqlRa/7AyJt5mKnksw8+mXsIyXUXgx3bjOZGggOZwANu2 Tg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qmxwpjrc6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:57:06 +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 34IDRG4I040136; Thu, 18 May 2023 14:57:05 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2108.outbound.protection.outlook.com [104.47.55.108]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qj106mqvb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:57:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kivZMgiCADNvPP/bnLWhfr3RKRkyLFoapxV2Ia0qdKx54mLmZ92WIISyr6zNVK6uoJ1m2MRG7JJZ6KsGrGeskg1f/CbWwWG5yVwic1Z9ZQHexDkGBlGd5hTGCiALpRH6ePF/IddfFPIv1hOPgPqHUNpcKZXdNt4TzHa2hHpp6VuA4yHGzTrkCTvppOuMzqfJqlCz5dJd2dfzi6KnF8hZfQYYBnHW7Vli8QCjutqi7shIEHUwQqLXxfn2iNC89krov9LSn10nUWRwmm3Pr0K7wCev1tuA+946hDndRGBbAwzxZxCOPwxRsFpZ8ngf/DJNrZ+G9Myhm6nsR7P4CmuDng== 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=or0gvhiuj20PZDjQz2A9EQ37j0qVAfTsjFswHLJTGPw=; b=NFkpgovCiU5LN0OIWHjH50j+Jd8suDj0ot/Tm3b4qAUwEaJhtjJtKX5pzUkrwiG+tPlH73t4IxmLyUUg67VJQt2B/Zx+jZrXKTJ3fA4a//2cE12jvhNtOoNTVNfrt5VJIXlfvuutzjbvIjR9UlFg9YzrolxHL4+IlYzYzJXefxilehcY9TF5pjxwahX+Hy9uSWIeV+EtPSkIE/VZVqwiTCkpbNmklIt+aIPWT3SbigvMxDYd765YewT1z2Tq278kewyEkZ2Sns3gSuZxbhoS/0IrXsgdJYdZ8QV/4Q/EwbknlFLlit9tbULtkcQwkTdc6yjNC4az2XLXjboQVAPSwA== 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=or0gvhiuj20PZDjQz2A9EQ37j0qVAfTsjFswHLJTGPw=; b=GBFkYnvAIxBjUYAhRkSwprKBJZl+rmv07s4BnU34WE8lqSFPG1OvycKvzGksrsAE3UzCIsF/NM7mNqY5/N9GwFfePYIQQO6+zeEDwg232V2oiG/FEF3eaj2UwtIRD1pCNr1o0BT79LVKRbssqFZGOZoFRKpwgO0zwr46mNb+1No= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM4PR10MB7427.namprd10.prod.outlook.com (2603:10b6:8:181::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:57:03 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:57:03 +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 v4 30/35] maple_tree: Introduce mas_prev_slot() interface Date: Thu, 18 May 2023 10:55:39 -0400 Message-Id: <20230518145544.1722059-31-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0302.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10e::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_|DM4PR10MB7427:EE_ X-MS-Office365-Filtering-Correlation-Id: c9479452-a750-486f-a4f6-08db57b023ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G1yDEz2POcDLDu7IMjvaVrCiVWrmpyY/N0zDxhKerde7AFqJwsERgEZ8LaMDmN/ViJA0PkbOCPgV56L0ro2ddqoooBwVQ1Rv7kcypCiONX+dbSk4tg8QT95d5FnTtMeNbs9DUhF0otygo326vqySKXC7ngp9tReKos1EI3jEnJqRbp+anS2itGzp/dq/V2u5Ttp5ySwSmeosF6oZBFNUBq6XX4jUrG1vq5zUri4//bGVYpka9+kWlOZEONXxC97Hp4evM3ASXmDXd5X/t6syiYF3kabjsLJ3ZQimXNYGKzRoRfOgwsRG8qKyB+24+m6lVFiaIypS50FHebLP+pMFd3Cvs0b1mbvGQ6WROz5crWQQmlcMNmR+a8ntad+KVj3ICRzeWM2n6+sxreu4Q8lwO8T2TdkjChrgjpgU8PfV/axZqRvXr5FOz4JThWUK2JIgwaZdPTpMuCq2v068r82/kwb/xYZfaXyZIypbQ90Fan+4v8F8n2uCLkFA/9wty/x3A3V1/FehMliG7ZgadJREDBmw+Yh0qaAvSeDszm8p8uKmC62jupp6rXBMyIVegUk2 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(346002)(136003)(376002)(366004)(451199021)(8676002)(5660300002)(8936002)(4326008)(316002)(6512007)(1076003)(83380400001)(6506007)(26005)(107886003)(86362001)(186003)(38100700002)(2616005)(41300700001)(478600001)(66476007)(6666004)(66946007)(66556008)(6916009)(6486002)(36756003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0MCPEWLhyEsDB2Or1zso+damDL0TbbPnAZxqgVEbX8nUL0cMMstfE0Pku30nuLQx6QfoFURk2C9VRdnY8nQEwu47ufXCTmdCVV92TxNai8g/Ypz6AE4gQbq5KZ36vPTxgOC2dALj9NAFefNc4Prr8TjcCm+lXj+zdui+Yt/53dTkMQXqfUA6itkW4cKkzjCbAnR6mO9ojWAQ8/wabtraWaQW9YpE+1Agvfqw5NGpg/OgZca9RKkZDY/FJunBw1uGIx6lnGqv8sBBIzsGVLKdBTFXLpJmWIvt8tuxo9k9JVRqBNoqWY42wJ7dz9+8wThNQrZ9936MlvYDL0BQENIiBuBvIP2uTmTv9/aKJLJJBGnvmu9VLKFRcWGWyF3jpDLy6IrbFcE/k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X/DkouPfIMAezrjNYyf4wYcG36pG4KLHSyn0atGJMZGmRl75IH1mRpKIauzLQG13qP31nnOMxp4Vw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9479452-a750-486f-a4f6-08db57b023ee X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:57:03.3059 (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: 0sb/Jw1i9iI02wjT5fKPEVvblSp5Lb0K3oiEzPRWzvDQXE6TZb8PINUk/mRrxhzPooWRRTKMA1M9x9YYiYYJ1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB7427 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: 2FMAuV0vgW1Ao2acIbNdOwHuF27khLAr X-Proofpoint-ORIG-GUID: 2FMAuV0vgW1Ao2acIbNdOwHuF27khLAr X-Rspamd-Queue-Id: A65A5140015 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: zxt3wgznrbhu8dn8cntzy9695cpamcw3 X-HE-Tag: 1684435479-734159 X-HE-Meta: U2FsdGVkX1/6gMRdqwQyr1r4+dzSO0qp8lAssLLDNXvx5sjRa8EYT4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ZPCat+yLzZ80LxRZLTV8j9frV5yaupSMlMUl8S14JC6qklq928gsLe0DgMbxlD7wSj7o+uGAi1iChTew3RaD7xwuK7RI7jKgKDuzaKJBuWOTuiv8NMmQEdBb9w3SRlt6pRKZtYvMQpmgh6UwBZoLHhV/r20tP8+0XlpFCl0MZw4b/dBEIADlnNcpVyf+JWvyr8Vl0LtUta08CIS508rfWMQ8bUFgwB7V1L8PoGbXBthb0kpLQ8hoYFK/huusTrIEiFqIU7u43FHfk2aBMUGrCKjKLnvUJFe4= 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: Sometimes the user needs to revert to the previous slot, regardless of if it is empty or not. Add an interface to go to the previous slot. Since there can't be two consecutive NULLs in the tree, the mas_prev() function can be implemented by calling mas_prev_slot() a maximum of 2 times. Change the underlying interface to use mas_prev_slot() to align the code. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 232 ++++++++++++++++++----------------------------- 1 file changed, 90 insertions(+), 142 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 25748014fe34..f0e9ce5b0515 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4531,15 +4531,19 @@ static inline int mas_prev_node(struct ma_state *mas, unsigned long min) int offset, level; void __rcu **slots; struct maple_node *node; - struct maple_enode *enode; unsigned long *pivots; + unsigned long max; - if (mas_is_none(mas)) - return 0; + node = mas_mn(mas); + if (!mas->min) + goto no_entry; + + max = mas->min - 1; + if (max < min) + goto no_entry; level = 0; do { - node = mas_mn(mas); if (ma_is_root(node)) goto no_entry; @@ -4548,64 +4552,41 @@ static inline int mas_prev_node(struct ma_state *mas, unsigned long min) return 1; offset = mas->offset; level++; + node = mas_mn(mas); } while (!offset); offset--; mt = mte_node_type(mas->node); - node = mas_mn(mas); - slots = ma_slots(node, mt); - pivots = ma_pivots(node, mt); - if (unlikely(ma_dead_node(node))) - return 1; - - mas->max = pivots[offset]; - if (offset) - mas->min = pivots[offset - 1] + 1; - if (unlikely(ma_dead_node(node))) - return 1; - - if (mas->max < min) - goto no_entry_min; - while (level > 1) { level--; - enode = mas_slot(mas, slots, offset); + slots = ma_slots(node, mt); + mas->node = mas_slot(mas, slots, offset); if (unlikely(ma_dead_node(node))) return 1; - mas->node = enode; mt = mte_node_type(mas->node); node = mas_mn(mas); - slots = ma_slots(node, mt); pivots = ma_pivots(node, mt); - offset = ma_data_end(node, mt, pivots, mas->max); + offset = ma_data_end(node, mt, pivots, max); if (unlikely(ma_dead_node(node))) return 1; - - if (offset) - mas->min = pivots[offset - 1] + 1; - - if (offset < mt_pivots[mt]) - mas->max = pivots[offset]; - - if (mas->max < min) - goto no_entry; } + slots = ma_slots(node, mt); mas->node = mas_slot(mas, slots, offset); + pivots = ma_pivots(node, mt); if (unlikely(ma_dead_node(node))) return 1; + if (likely(offset)) + mas->min = pivots[offset - 1] + 1; + mas->max = max; mas->offset = mas_data_end(mas); if (unlikely(mte_dead_node(mas->node))) return 1; return 0; -no_entry_min: - mas->offset = offset; - if (offset) - mas->min = pivots[offset - 1] + 1; no_entry: if (unlikely(ma_dead_node(node))) return 1; @@ -4614,6 +4595,76 @@ static inline int mas_prev_node(struct ma_state *mas, unsigned long min) return 0; } +/* + * mas_prev_slot() - Get the entry in the previous slot + * + * @mas: The maple state + * @max: The minimum starting range + * + * 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) +{ + void *entry; + void __rcu **slots; + unsigned long pivot; + enum maple_type type; + unsigned long *pivots; + struct maple_node *node; + unsigned long save_point = mas->index; + +retry: + node = mas_mn(mas); + type = mte_node_type(mas->node); + pivots = ma_pivots(node, type); + if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) + goto retry; + +again: + if (mas->min <= min) { + pivot = mas_safe_min(mas, pivots, mas->offset); + + if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) + goto retry; + + if (pivot <= min) + return NULL; + } + + if (likely(mas->offset)) { + mas->offset--; + mas->last = mas->index - 1; + mas->index = mas_safe_min(mas, pivots, mas->offset); + } else { + if (mas_prev_node(mas, min)) { + mas_rewalk(mas, save_point); + goto retry; + } + + if (mas_is_none(mas)) + return NULL; + + mas->last = mas->max; + node = mas_mn(mas); + type = mte_node_type(mas->node); + pivots = ma_pivots(node, type); + mas->index = pivots[mas->offset - 1] + 1; + } + + slots = ma_slots(node, type); + entry = mas_slot(mas, slots, mas->offset); + if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) + goto retry; + + if (likely(entry)) + return entry; + + if (!empty) + goto again; + + return entry; +} + /* * mas_next_node() - Get the next node at the same level in the tree. * @mas: The maple state @@ -4798,109 +4849,6 @@ static inline void *mas_next_entry(struct ma_state *mas, unsigned long limit) return mas_next_slot(mas, limit, false); } -/* - * mas_prev_nentry() - Get the previous node entry. - * @mas: The maple state. - * @limit: The lower limit to check for a value. - * - * Return: the entry, %NULL otherwise. - */ -static inline void *mas_prev_nentry(struct ma_state *mas, unsigned long limit, - unsigned long index) -{ - unsigned long pivot, min; - unsigned char offset, count; - struct maple_node *mn; - enum maple_type mt; - unsigned long *pivots; - void __rcu **slots; - void *entry; - -retry: - if (!mas->offset) - return NULL; - - mn = mas_mn(mas); - mt = mte_node_type(mas->node); - offset = mas->offset - 1; - slots = ma_slots(mn, mt); - pivots = ma_pivots(mn, mt); - count = ma_data_end(mn, mt, pivots, mas->max); - if (unlikely(mas_rewalk_if_dead(mas, mn, index))) - goto retry; - - offset = mas->offset - 1; - if (offset >= mt_slots[mt]) - offset = mt_slots[mt] - 1; - - if (offset >= count) { - pivot = mas->max; - offset = count; - } else { - pivot = pivots[offset]; - } - - if (unlikely(mas_rewalk_if_dead(mas, mn, index))) - goto retry; - - while (offset && !mas_slot(mas, slots, offset)) { - pivot = pivots[--offset]; - if (pivot >= limit) - break; - } - - /* - * If the slot was null but we've shifted outside the limits, then set - * the range to the last NULL. - */ - if (unlikely((pivot < limit) && (offset < mas->offset))) - pivot = pivots[++offset]; - - min = mas_safe_min(mas, pivots, offset); - entry = mas_slot(mas, slots, offset); - if (unlikely(mas_rewalk_if_dead(mas, mn, index))) - goto retry; - - mas->offset = offset; - mas->last = pivot; - mas->index = min; - return entry; -} - -static inline void *mas_prev_entry(struct ma_state *mas, unsigned long min) -{ - void *entry; - struct maple_enode *prev_enode; - unsigned char prev_offset; - - if (mas->index < min) - return NULL; - -retry: - prev_enode = mas->node; - prev_offset = mas->offset; - while (likely(!mas_is_none(mas))) { - entry = mas_prev_nentry(mas, min, mas->index); - - if (likely(entry)) - return entry; - - if (unlikely(mas->index <= min)) - return NULL; - - if (unlikely(mas_prev_node(mas, min))) { - mas_rewalk(mas, mas->index); - goto retry; - } - - mas->offset++; - } - - mas->node = prev_enode; - mas->offset = prev_offset; - return NULL; -} - /* * mas_rev_awalk() - Internal function. Reverse allocation walk. Find the * highest gap address of a given size in a given node and descend. @@ -6017,7 +5965,7 @@ void *mas_prev(struct ma_state *mas, unsigned long min) } return NULL; } - return mas_prev_entry(mas, min); + return mas_prev_slot(mas, min, false); none: mas->node = MAS_NONE; @@ -6232,8 +6180,8 @@ void *mas_find_rev(struct ma_state *mas, unsigned long min) if (mas->index < min) return NULL; - /* Retries on dead nodes handled by mas_prev_entry */ - return mas_prev_entry(mas, min); + /* Retries on dead nodes handled by mas_prev_slot */ + return mas_prev_slot(mas, min, false); none: mas->node = MAS_NONE; From patchwork Thu May 18 14:55:40 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: 13246956 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 049CCC77B7D for ; Thu, 18 May 2023 14:57:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 92B84280004; Thu, 18 May 2023 10:57:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B443900005; Thu, 18 May 2023 10:57:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 706F9280004; Thu, 18 May 2023 10:57:14 -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 5FCD9900005 for ; Thu, 18 May 2023 10:57:14 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 3F272160860 for ; Thu, 18 May 2023 14:57:14 +0000 (UTC) X-FDA: 80803678788.06.03A0F46 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf10.hostedemail.com (Postfix) with ESMTP id E7600C001A for ; Thu, 18 May 2023 14:57:10 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=iXBVlSKh; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=DhvHMG4a; spf=pass (imf10.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=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=1684421831; 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=+Mxye0KY7tWYyadVwkLe4uGBperlmwR2B6BWsR6giWY=; b=kgxqn3sj8a13nhB14zfuoT74xO5StswtcNQ2JylK7SgkQAgkN+zYMD9cVrSHjbL5CQjxA7 fVQ8FWInm+SAIvDZoQNu9gmblnJTEFNycDLtTuLd9KxnNO9gH20T8/duyaFQm6QnoKjUxY nzI9Sah+AcVHg/PLgefGkSOknTd4lAk= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421831; a=rsa-sha256; cv=pass; b=lWZW1dTcehBYDx1pShAsTuDAcG8GEFzfssViyMPKr6GXFtEjaOiyzlcXFmOFAXimbIKXNC FfdajnCCBYkIVNcKNU3dMxUtbU4EhJzfSU2gPx46XS5aW/SSSvz1DwKzMdLwZZ13MsaDV6 BtVxx9xuzZtRSUte75eJaR2yOf7ybCM= ARC-Authentication-Results: i=2; imf10.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=iXBVlSKh; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=DhvHMG4a; spf=pass (imf10.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=pass ("microsoft.com:s=arcselector9901:i=1") Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34I6Il19012457; Thu, 18 May 2023 14:57:09 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=+Mxye0KY7tWYyadVwkLe4uGBperlmwR2B6BWsR6giWY=; b=iXBVlSKh9H7S4lCnaEMQGylVd3Ai1LbYcccQ9POcDtt8Sl9cYtR2ZJojZVFexyfsLuJy D4nfQZQK8ykPvXd+hl1+anC3AC2saZOKhubsnApoWdolG7H360y7hxrohhcpjFBMI/RQ WMKjXdElNVkwkXuRIXSt2Htm8N1/GV616WmMGovOThnUBQZ1xBu/aANnyQ/OB+7q6OYW OXBWy+8xkziBHfObbUSqZVhHYbKMsVexMNuFGzAyX03r0DP8JuhqtbMsyOUquctYVr6P oXjhcKAElh+HJj+wodSzG1stPjzYbHK9hsmdFSBTCdBCSf8La3XtJRFgHERr6qa5C4YR pQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qj2kdrh1c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:57:09 +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 34IEGfoF032234; Thu, 18 May 2023 14:57:08 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qj10cwt6j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:57:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DNIZiQXlliBMTjk0ldo6Xkct0QN7w7wEiQ+yK5M8INGYYO9UJFrwETd6xlrQYHWdkIDodCi6paZDLPXnZiA4czW052k3b7K2FA8MOC4kX1iQNpvZKNZp9Rbm+duvnnE/yMZWrfvih8q0xAQnHvIQYdLvOrimoqgz+Zxbms/m03Ool12dcDcWk711xtlQ5mZ00hdDzkCseyUn9e7F0ZpMs0/fF4inkkVMBk9+TcRX2qO+z6VmbZnsY83FMOjLOyBTIpSGMWuOf5UMsPd4sZWBgpPGJPEQ1mu+Rlf0EyauhFoXtHBGumrDRaDXa30CRFauduKnyuof6J+wbLZcgCIT0w== 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=+Mxye0KY7tWYyadVwkLe4uGBperlmwR2B6BWsR6giWY=; b=KKyTHl4YTHAIKlKewEfLi3B8/9e/CIDfNTcRswcNrzClyRu5IYqtVIhgbuhTrCa6qMX9mD0Skogu/6EqBdg5zvm58yV2/I9IGqtW4n/1hLjILkZhHJ6hHqjWvusKhN6mTps4hZxbvmS0ed03lnaWJs4/ce06d220guUegNzFOa2Gqj+qbeKdCNkKKW7QM1zTkOqcXQVgX8qlQibrfuL+uT/5zBSzqayFMtmnkzsDBFJrSlsPkK7RiKhOb//1rlqOeDsMmQVMNSxX5ySdLWiacnI2+son3VsYVmjEJBANl9JbgfVjc6eL7PF5aDePyUEYRddCrPRGER+WyPtbHy+A1g== 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=+Mxye0KY7tWYyadVwkLe4uGBperlmwR2B6BWsR6giWY=; b=DhvHMG4aMS+E1SxrEonO8a1ezGo+FWrSBlfjQliP7cOI06kZGgK0lfNZ8SqjVpIHz2PV2IzsMf7Gjrtz+KMH263gVaoxSPsjLhDITgm3PEl6KLmqUpM2bZxXjuzJC7VEQ0b5fs7kU31lM6bw37OI0NUlJOeGQfkCWJ4Solv3a6g= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM4PR10MB7427.namprd10.prod.outlook.com (2603:10b6:8:181::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:57:06 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:57:06 +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" , Vernon Yang Subject: [PATCH v4 31/35] maple_tree: Add mas_prev_range() and mas_find_range_rev interface Date: Thu, 18 May 2023 10:55:40 -0400 Message-Id: <20230518145544.1722059-32-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0015.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d1::22) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM4PR10MB7427:EE_ X-MS-Office365-Filtering-Correlation-Id: 1194ff93-a61d-4110-c2de-08db57b025ba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P4/Uq0rU3e+p6aNviz0xfoWAvLrmndxGqhfgFnpyXr8gAG3VUxDst5QxuLwKOyYn59MW1su/hbH26HHrAJCnhSFyBEPdKH9g5ZjZcVflOALQnpgx3wBh9yRy26rVL6Zke9vif7lYF4+w09n/85tX9QXXOYETixv2ZzWy5jc0GpLg0KgPJxz/bIK0fe3QBPDNqxcDqZbtE+qGB9NjRyRaIczpjw7Izc9jhySoHu+8m09Y2g3MYFc/lm7WFbWhznEvqQKiRQt0NtjNhDk81h3tvhosEZoKrZlPWCkHSr73BKpIVuoox1TM2LR4C7aA8lbpefsslt5HRjZ7HHZPYtS/uOITgY5yoAm9oEO83oQpXNUjlBfYIpI+T5wNVMrDiMIE+N9EKXk1H/DPuJ3IYveH0HDezuOeYl5vevcrVIpPyiJ6eupH/h52xMIzBgc7SNhLhA8ccQ9HwkkAlOitygBiwhS8r2MDfisSe7FQYf8L0BwbEGoXPXY0ERTmNbvPJGvkfOvvNif4fpk1YLF1XhcD4cffje2iEiuzvRvyN9HSaZ7/U6RyEgMIrUqGZAb7eNiV X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(346002)(136003)(376002)(366004)(451199021)(8676002)(5660300002)(8936002)(4326008)(316002)(6512007)(1076003)(83380400001)(6506007)(26005)(86362001)(186003)(38100700002)(2616005)(41300700001)(478600001)(66476007)(6666004)(66946007)(66556008)(6916009)(6486002)(36756003)(54906003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mzMiPLPXa5rF3pyEZ/Ehh1qHPPv4ibaOjBXggGe8pO4Ox3tWxeJFbN3/fynZubhk57TTjsx3ZnhehLekp2ifowP6kRdaPSKwRIor0xmm6RjScoziutOFx7dCFdubjDBpF7tZ9o8uyFu+l2udVlmEyliGE2yVbIdxaje568JhTFoCaH3TuICXbNi/RrNDnrXMpj9OgAmGZSHquGy6uvBHVp+jZP6Nsn1APq/xlxsv2qdzSh8wbK2W5m7fqxqQyZjCoW+sxcitP7uaIOqf7bT+b787PNjQ6QjTdmgiRKBHDLLxdMMSQjDmUREnWop7E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FhPjwbfN/M0l3v8ECX+lZD9xXllfVhgWP9Eolv4fgyfxA7Em5EKohbH8Z09afdbt2UIq6UC9gfPUq18/lD0hqg6W7LW2yPELPhvFojFPNCxrhCGgxz7KHknlvIYWP4LMQFDqgkdSAIjA2cYPLnRDV7q53HkhZY9zUiaG56SIncHQA4EA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1194ff93-a61d-4110-c2de-08db57b025ba X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:57:06.2924 (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: ek8qF3rooOtXOUxdVmLAgV1SaJ4uEhPgb/3qGtThYmA88X9R/PfxgHdHWeQKQXd8D488ksjzeLZe+vDOyjjgSQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB7427 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: M2n6dt1vGknjeqWWHdDHZJEkCgmqfMpb X-Proofpoint-ORIG-GUID: M2n6dt1vGknjeqWWHdDHZJEkCgmqfMpb X-Stat-Signature: joe53tbo56pfu6tt3deb1a61jjgztqtq X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Que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yiYtZEr3BxEPxkZw4UVDBiZGfoXp3zQ3kZGp7argtisAKJSx+6jGuVJTtoFYgdUrOkt7zdyTTrDzQI6v6I8H61jeu1h/tOwArI9M1SyIkXwKPuxxKKEullSO7InbCI4VywMevZGUPbvrXBRhgevmAAdGujkEPq4fS6A0wKZX7Tp2UaMeKNXR7pasdc2h9kYsoow19zXaX7e61yLmIacgsWjeFtnzumfwDeLtafYCbuhRUcC2NrqC7w9SA1KtgzqGT/Gf7Nax/5eQOE3oZE0I3Ihyj9fK/UgecOx/6So1Igs0C8i3RSwmKDju7j+tVpkd7SP5gKOutWZmPyb9iOhVRUiQ/2BT/WcsTG5bhrAFIhsZUCFvJ9CaxkKAF31ooNGcmsvdeJJxft2uS6nZgCCl3Hc= 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: Some users of the maple tree may want to move to the previous range regardless of the value stored there. Add this interface as well as the 'find' variant to support walking to the first value, then iterating over the previous ranges. Cc: Vernon Yang Signed-off-by: Liam R. Howlett --- include/linux/maple_tree.h | 2 + lib/maple_tree.c | 161 ++++++++++++++++++++++++++++--------- 2 files changed, 124 insertions(+), 39 deletions(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index 9d040043858a..541675229568 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -457,6 +457,7 @@ void mas_store_prealloc(struct ma_state *mas, void *entry); void *mas_find(struct ma_state *mas, unsigned long max); 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, gfp_t gfp); bool mas_is_err(struct ma_state *mas); @@ -467,6 +468,7 @@ void mas_destroy(struct ma_state *mas); int mas_expected_entries(struct ma_state *mas, unsigned long nr_entries); void *mas_prev(struct ma_state *mas, unsigned long min); +void *mas_prev_range(struct ma_state *mas, unsigned long max); void *mas_next(struct ma_state *mas, unsigned long max); void *mas_next_range(struct ma_state *mas, unsigned long max); diff --git a/lib/maple_tree.c b/lib/maple_tree.c index f0e9ce5b0515..fe481d4e5e6a 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5924,18 +5924,8 @@ void *mt_next(struct maple_tree *mt, unsigned long index, unsigned long max) } EXPORT_SYMBOL_GPL(mt_next); -/** - * mas_prev() - Get the previous entry - * @mas: The maple state - * @min: The minimum value to check. - * - * Must hold rcu_read_lock or the write lock. - * Will reset mas to MAS_START if the node is MAS_NONE. Will stop on not - * searchable nodes. - * - * Return: the previous value or %NULL. - */ -void *mas_prev(struct ma_state *mas, unsigned long min) +static inline bool mas_prev_setup(struct ma_state *mas, unsigned long min, + void **entry) { if (mas->index <= min) goto none; @@ -5953,7 +5943,8 @@ void *mas_prev(struct ma_state *mas, unsigned long min) if (!mas->index) goto none; mas->index = mas->last = 0; - return mas_root(mas); + *entry = mas_root(mas); + return true; } if (mas_is_none(mas)) { @@ -5961,18 +5952,64 @@ void *mas_prev(struct ma_state *mas, unsigned long min) /* Walked to out-of-range pointer? */ mas->index = mas->last = 0; mas->node = MAS_ROOT; - return mas_root(mas); + *entry = mas_root(mas); + return true; } - return NULL; + return true; } - return mas_prev_slot(mas, min, false); + + return false; none: mas->node = MAS_NONE; - return NULL; + return true; +} + +/** + * mas_prev() - Get the previous entry + * @mas: The maple state + * @min: The minimum value to check. + * + * Must hold rcu_read_lock or the write lock. + * Will reset mas to MAS_START if the node is MAS_NONE. Will stop on not + * searchable nodes. + * + * Return: the previous value or %NULL. + */ +void *mas_prev(struct ma_state *mas, unsigned long min) +{ + void *entry = NULL; + + if (mas_prev_setup(mas, min, &entry)) + return entry; + + return mas_prev_slot(mas, min, false); } EXPORT_SYMBOL_GPL(mas_prev); +/** + * mas_prev_range() - Advance to the previous range + * @mas: The maple state + * @min: The minimum value to check. + * + * Sets @mas->index and @mas->last to the range. + * Must hold rcu_read_lock or the write lock. + * Will reset mas to MAS_START if the node is MAS_NONE. Will stop on not + * searchable nodes. + * + * Return: the previous value or %NULL. + */ +void *mas_prev_range(struct ma_state *mas, unsigned long min) +{ + void *entry = NULL; + + if (mas_prev_setup(mas, min, &entry)) + return entry; + + return mas_prev_slot(mas, min, true); +} +EXPORT_SYMBOL_GPL(mas_prev_range); + /** * mt_prev() - get the previous value in the maple tree * @mt: The maple tree @@ -6119,20 +6156,18 @@ void *mas_find_range(struct ma_state *mas, unsigned long max) EXPORT_SYMBOL_GPL(mas_find_range); /** - * mas_find_rev: On the first call, find the first non-null entry at or below - * mas->index down to %min. Otherwise find the first non-null entry below - * mas->index down to %min. + * mas_find_rev_setup() - Internal function to set up mas_find_*_rev() * @mas: The maple state - * @min: The minimum value to check. - * - * Must hold rcu_read_lock or the write lock. - * If an entry exists, last and index are updated accordingly. - * May set @mas->node to MAS_NONE. + * @min: The minimum index + * @entry: Pointer to the entry * - * Return: The entry or %NULL. + * Returns: True if entry is the answer, false otherwise. */ -void *mas_find_rev(struct ma_state *mas, unsigned long min) +static inline bool mas_find_rev_setup(struct ma_state *mas, unsigned long min, + void **entry) { + *entry = NULL; + if (unlikely(mas_is_none(mas))) { if (mas->index <= min) goto none; @@ -6144,7 +6179,7 @@ void *mas_find_rev(struct ma_state *mas, unsigned long min) if (unlikely(mas_is_paused(mas))) { if (unlikely(mas->index <= min)) { mas->node = MAS_NONE; - return NULL; + return true; } mas->node = MAS_START; mas->last = --mas->index; @@ -6152,14 +6187,12 @@ void *mas_find_rev(struct ma_state *mas, unsigned long min) if (unlikely(mas_is_start(mas))) { /* First run or continue */ - void *entry; - if (mas->index < min) - return NULL; + return true; - entry = mas_walk(mas); - if (entry) - return entry; + *entry = mas_walk(mas); + if (*entry) + return true; } if (unlikely(!mas_searchable(mas))) { @@ -6173,22 +6206,72 @@ void *mas_find_rev(struct ma_state *mas, unsigned long min) */ mas->last = mas->index = 0; mas->node = MAS_ROOT; - return mas_root(mas); + *entry = mas_root(mas); + return true; } } if (mas->index < min) - return NULL; + return true; - /* Retries on dead nodes handled by mas_prev_slot */ - return mas_prev_slot(mas, min, false); + return false; none: mas->node = MAS_NONE; - return NULL; + return true; +} + +/** + * mas_find_rev: On the first call, find the first non-null entry at or below + * mas->index down to %min. Otherwise find the first non-null entry below + * mas->index down to %min. + * @mas: The maple state + * @min: The minimum value to check. + * + * Must hold rcu_read_lock or the write lock. + * If an entry exists, last and index are updated accordingly. + * May set @mas->node to MAS_NONE. + * + * Return: The entry or %NULL. + */ +void *mas_find_rev(struct ma_state *mas, unsigned long min) +{ + void *entry; + + if (mas_find_rev_setup(mas, min, &entry)) + return entry; + + /* Retries on dead nodes handled by mas_prev_slot */ + return mas_prev_slot(mas, min, false); + } EXPORT_SYMBOL_GPL(mas_find_rev); +/** + * mas_find_range_rev: On the first call, find the first non-null entry at or + * below mas->index down to %min. Otherwise advance to the previous slot after + * mas->index down to %min. + * @mas: The maple state + * @min: The minimum value to check. + * + * Must hold rcu_read_lock or the write lock. + * If an entry exists, last and index are updated accordingly. + * May set @mas->node to MAS_NONE. + * + * Return: The entry or %NULL. + */ +void *mas_find_range_rev(struct ma_state *mas, unsigned long min) +{ + void *entry; + + if (mas_find_rev_setup(mas, min, &entry)) + return entry; + + /* Retries on dead nodes handled by mas_prev_slot */ + return mas_prev_slot(mas, min, true); +} +EXPORT_SYMBOL_GPL(mas_find_range_rev); + /** * mas_erase() - Find the range in which index resides and erase the entire * range. From patchwork Thu May 18 14:55:41 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: 13246961 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 A01D2C77B7D for ; Thu, 18 May 2023 14:57:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3FAAA28000B; Thu, 18 May 2023 10:57:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3AAE6280003; Thu, 18 May 2023 10:57:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1FEA528000B; Thu, 18 May 2023 10:57:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 0E332280003 for ; Thu, 18 May 2023 10:57:33 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id E364DC02B0 for ; Thu, 18 May 2023 14:57:32 +0000 (UTC) X-FDA: 80803679544.18.8E3BC2A Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf15.hostedemail.com (Postfix) with ESMTP id 7BD76A000B for ; Thu, 18 May 2023 14:57:29 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=G5Ar9Xc4; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=teoqPESH; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf15.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-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684421849; 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=2YVRakESH/s1ICwCjt2PceIsUR1vzhFGi+kMxu5HLEc=; b=3WUFPpId5nJODuy1V9BTX8O+cubkZXKFVTFLlDi+MDeUVmKmYMlb6bLNnHKgeAFX+YELEV 1PI9iy7eNooFgn+Tcb4mJO7kmEre7zAXrsSa+NjZeJSTtpkrP77aqcjU5Nmzbzg6KaaXvf cTZilI0KWWet2YRVNxT1Ib9YM7+GSN0= ARC-Authentication-Results: i=2; imf15.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=G5Ar9Xc4; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=teoqPESH; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf15.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-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421849; a=rsa-sha256; cv=pass; b=Q2zaaKFhVZGDwJnGfRx2qi9m1j9n8ckWYozj/sf4gIgKcrdaT8JBT37wa5CZWJL1IMi+Sd +z2RHe/FsMjBbvSETtdJTXA848PXTLjahD+MN0VTSReotmryYgMYS+UF4cxjvLeEYzrKF3 ebi1JXLi2q1qAfwF8hiOAu+aMcgHFPI= 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 34I6JQvD026628; Thu, 18 May 2023 14:57:13 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=2YVRakESH/s1ICwCjt2PceIsUR1vzhFGi+kMxu5HLEc=; b=G5Ar9Xc4wZRZ+JDgd9WLGWNeOaRPt8sBmEp8/J/T4KHHswRArG3PiOtcro35uu/Mdw3p L+W97fqR3kg40yd/oMsxLyQIyooMpHe56AFtfX8rlEcUfycYTFBTE3y9PFKFTxyDH7Cl CjLMTk6GEo2RVRbxVfbQ2MWVIrM1qpFNwy/m0lmNMNRWENcW5W7uiX+NqoZ5Y3V8KG08 0EQQqy79Sb25pgVrE9z9muoZPXc+RlCUPnJeT8uYfeS9Haa4wX2dGEBXt3UCHz3oBchW GBLf1FnDmk7W/4O4Q+OxYwuRHeOkUJBQufz3TiUf2RKpL4Obx8ZLz9ZTloBSNxypHNJy kA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qmxfc2uff-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:57:13 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34IEJepY036702; Thu, 18 May 2023 14:57:11 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2043.outbound.protection.outlook.com [104.47.57.43]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qmm03w4f7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:57:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eRzApWUsXmPv6VbTzVgd+0sdldQnn0LBKiXPdrtbaRcBE521GlS4JPl7LQYxrnRxzn71tE80rd2658JGPjnUXfTKATwGBc4t7kwMZhWyGnpHhuSwKw3y6lEea5gN4zYVhSEHc8x4an8K2NYnkU4EinI4qTABs8UpbiWarPBYFHhVpLit/tD25Q8LdKRJhO+hvwrVv0mvL/EsQZkVEjXArD+d32l5fqDV73vP6PJWiXioTSVxtQ9Emtk8VPO4VdYucSUHJ+XXp6XxuuXc7cnLk0wzS4NVFvBFBHrb5Hb5QDFoW6eD5kNn9PS1bP1n7tvE6aTav/Q/h4+HWoRJpaVmsw== 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=2YVRakESH/s1ICwCjt2PceIsUR1vzhFGi+kMxu5HLEc=; b=ib1nMNbmmL0yfPTXaj1Z9DtQD/3cjuDPSVT9jNYK1lJZ9B9PqucNRZ1Lrj8t3c5gNiE/qZk5AfPNUzxW2scJEgJEZXne6fLLRXa6hi6bK9eHvibTmQe9OKjcib2eGi7svvxkEqQs/7M2CS+A3SwVc0ChA3LgPO0k+xtMhDniI1vjXOVnRxq0Ed6UQwL09gkNwwr6V24p0BgQf1KWirg7tXf5wt+iBkk0NeNb61XFJKTWAT/zFJVk3IIX6DSCOZrmWXyAAdCqGgrLPJF6P6jEeq2n1yU6EGUBq0t6UWol1plknKB2aiX94NfBpHASlyqhOJ45pBfLTWx1HyycvNWQMA== 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=2YVRakESH/s1ICwCjt2PceIsUR1vzhFGi+kMxu5HLEc=; b=teoqPESHr89IHaOWwEAKn9MUNOy8cBPHm4jwYztUyup4INjMYIMlfNxpQ2ZJ2hj4/8HBv1DjBCP80biENEHPgt+LSMnBytgTU7xc37TguJAsMMmFFYAhzz+c0TzsWp6BtPRY1moo5N6eFIeeJaDIWY30nuvaS/oJGJVqCAoEaiQ= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by IA1PR10MB7261.namprd10.prod.outlook.com (2603:10b6:208:3f6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:57:09 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:57:08 +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" , Peng Zhang Subject: [PATCH v4 32/35] maple_tree: Clear up index and last setting in single entry tree Date: Thu, 18 May 2023 10:55:41 -0400 Message-Id: <20230518145544.1722059-33-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0131.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d5::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_|IA1PR10MB7261:EE_ X-MS-Office365-Filtering-Correlation-Id: 0ab5f90d-1f66-4183-a940-08db57b0274d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RRtO07/Nhzy++WCs/z/sWpJbwp67XBt6QC8xkfzh3LXdExubo2lrsQmVsE2UNktvvuPm22wliZNLwYX+7x4STrRHSvbHlOkzRkV18EzhvIU4xLhzBFk5s3pa22EPPDyA1K6CAUvqtboHeD+PcKx0n8tol/ZWDDRcyHK6atHgQEzxgmEgbiJ5PNrvXFxT9BGKjBKl2A4biPWU8P+cEIpmXRcl19XlCI27wLQQsSOYjCGAmdKF9OAGUE7CPbZRg2vSh/+chKf1Gwx3k7YKw+tgy3TherpElk5o9XuXzAgHzXfWC84QAh32lZ+EmNDu59alZouKOjB5hDZMG2TmBhdj8mWEgkmh2sS8/GSjkbY4jyVS93QsB1J+oygYxq93rJ4DCuTRglAF/E9icp7tiXcPW0+i7R+r/GRJDWdSnKMq46CurFw3MOKbFjCO71qRCZKuDTjooBS4Whyf8p29rW9cr90LsXZ7yTaJHSeNf4IH2TOrpTjiAtEhD6+YT+cuCGTSs24a4K4oJfzz92IPlIO/6VA5+VDhj1AE3XUm6/MshnVSiWiMSjzGEmhj71n1cD3E X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(346002)(39860400002)(376002)(396003)(451199021)(54906003)(41300700001)(6666004)(316002)(66556008)(66476007)(66946007)(6916009)(4326008)(6486002)(8676002)(8936002)(478600001)(5660300002)(86362001)(26005)(6506007)(6512007)(1076003)(186003)(2906002)(38100700002)(83380400001)(36756003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /VVapN5yMF50l9fFsQevuqQedAsm3rR70BvILbkl9XkHot4uCk9B+6AUXNcG61KST5hPGONTxy87acc+mbX6al/eE7IGVhGDVmnQ0VLG6+NFqKP6K5U+/Hl91Vn8G0ukZ9YL5J7pMkkhmd6G+Z6V1TaVXM1mMx3JSS1vkjNbW7CJ5qF2uLBF8VQFhT7DAqJiVaF+TuKZrXhs0X+zJk7dNQKJT2qjDHklMzwbVxLlbiYkVAovb8AKtQet/ia1NYW8RtA81pz8Zomi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AB5spNPwjj+sajUPrV09aqQuAec4piEllbyZYveDmdl7LyXrrXGkc28M8w3NflbqXmncri0yjTQOF7K49qNPuPFKT4dOjHGRQF7fBJU67sYb2LlUBaG8c4u6NtuHnk9/e0SamT44C8PXilfJO+AGgikhZhIS3aJe4+JoN0DkxfauXGef0KxWJoa85su/Rpbd+aSpDVB82tgnVbRdDq/tDTsk8SVCf0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ab5f90d-1f66-4183-a940-08db57b0274d X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:57:08.9360 (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: XSSGbwBLvcdE/glxqAZoH8DR+FTceS1v65A4Blie/sgsNLpyDDLkEMait4NP+KHng5y1K6SZdaWLFphqbejlmA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7261 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 malwarescore=0 bulkscore=0 spamscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: -je11Ztu6r8Uiz_XU92f1zpGVMhmsl5F X-Proofpoint-ORIG-GUID: -je11Ztu6r8Uiz_XU92f1zpGVMhmsl5F X-Stat-Signature: mbzhfopixap88eigytqozt4tfrd7prdk X-Rspamd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cuKBOGsMWaLTVRVWG5MYbD6dzE+set/s909qJyVVIMedRpJgvkGP8G356eXww9l7lHRvrS6sYmi0vlzhO8981Ka4RB2TBDGGvTmHJPAJLEeBtArBtpyLB0pXF2UW4USLAQn0UlVHl2/EYj+uo3aUL8ZekTKtnFvatTvebIThGiSuChJa2lRu2V+3iIypL+RBVtMMNZk44OxDTG9Q+od3/ohfk3qPT/Zq1HrGO9yRrPyH5ozCIaNF66M94cjvNj8B7frtGPcRflu+Fpz7cf3vMqkkTHoVjTRtzUuYIwlx78st8unCz2whn3Z2eAS72cHBNws9O88+JnKmbCozoPRzkDMB3HLx9Ur7VNyICZzCzUaC+LpQp1jqedLkMMiz281s0s89lqxPcgGik2vp8FbgcYy0Pde324R372q6rzWjthe6kp4dlqXW1DsEJrp5d1sH+0p9ORov5oVztbO X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: When there is a single entry tree (range of 0-0 pointing to an entry), then ensure the limit is either 0-0 or 1-oo, depending on where the user walks. Ensure the correct node setting as well; either MAS_ROOT or MAS_NONE. Cc: Peng Zhang Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index fe481d4e5e6a..1e70a1b0c6f0 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5022,24 +5022,25 @@ void *mas_walk(struct ma_state *mas) { void *entry; + if (mas_is_none(mas) || mas_is_paused(mas) || mas_is_ptr(mas)) + mas->node = MAS_START; retry: entry = mas_state_walk(mas); - if (mas_is_start(mas)) + if (mas_is_start(mas)) { goto retry; - - if (mas_is_ptr(mas)) { + } else if (mas_is_none(mas)) { + mas->index = 0; + mas->last = ULONG_MAX; + } else if (mas_is_ptr(mas)) { if (!mas->index) { mas->last = 0; - } else { - mas->index = 1; - mas->last = ULONG_MAX; + return entry; } - return entry; - } - if (mas_is_none(mas)) { - mas->index = 0; + mas->index = 1; mas->last = ULONG_MAX; + mas->node = MAS_NONE; + return NULL; } return entry; From patchwork Thu May 18 14:55:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13246958 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 9A9D7C77B7D for ; Thu, 18 May 2023 14:57:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3859C280010; Thu, 18 May 2023 10:57:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3356B28000B; Thu, 18 May 2023 10:57:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13AB1280010; Thu, 18 May 2023 10:57:22 -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 01E4C280008 for ; Thu, 18 May 2023 10:57:21 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 62AE9C02B0 for ; Thu, 18 May 2023 14:57:21 +0000 (UTC) X-FDA: 80803679082.10.864AD35 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf05.hostedemail.com (Postfix) with ESMTP id D0D93100018 for ; Thu, 18 May 2023 14:57:17 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=2TxcilNN; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=XP2UxOoG; spf=pass (imf05.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=1684421838; 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=t3fMBW05C58TmvbN+ox7McplGzPRCNLchTHdzirfeJQ=; b=4mHQXPJnujW8+w1LtoAPPm7B3GrQ97ga2JvCmItfbNzX8termifNgrpncoMOBxcKLiVxsx 3QTdvf9kPmONtiE8cTZyTDn1XOsr+2i6lNPePMfHUWi4Gt0uKvx8+7x5XDtnC28f9cWtR9 +lSh4mUtpjPEsIuPWiQruPBowpAONjU= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421838; a=rsa-sha256; cv=pass; b=C3O94qB9qyRhqMA2wlAzYN4/lft/lmKtrJgPV1dhfdPGHrhj3Z+ilgM2Dwp6YOAlXqnufG 7c1HTxAETF0GVqwnPHJUxr5OVwt5oXQ0WGHi43TaaqsxvyC4fyqWwJpJ4uadACp8GAsDSo GyESGY6phA/1jVrude1vuuvnRz0zqlA= ARC-Authentication-Results: i=2; imf05.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=2TxcilNN; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=XP2UxOoG; spf=pass (imf05.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 34I6JD6v018341; Thu, 18 May 2023 14:57:16 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-type : content-transfer-encoding : mime-version; s=corp-2023-03-30; bh=t3fMBW05C58TmvbN+ox7McplGzPRCNLchTHdzirfeJQ=; b=2TxcilNNxO5FOb/4anGBBLZmGIhqjyHWC4D/quif128BapvMb+RRQRr2LCYrmkR4z6rZ Gej2xVeLL8byEAZPqjDJshpVkdDU/9Oj9WZjFF7NmocJ4ji4qy+xrl8icVLnkLXe5HZz 9Ve9w62VEUTfDBhTSPQX5ilyBh+afkHN0XG/HZfR7vKTu/bVKHtEV7VWHnD+pnk0nStG FCcKoUVu0pqhlSXa6fbqNbM0DB+/bXUbPHMeb64fwjyXs/JINslUn7gCyGNxWJ+ZAyZY aTHbZ5tR/ZyVDWGnxwzXdPytX1PZq2mOQA1VaxozPDENKM4kucNKA942v3UKbhMU8Rs+ 8Q== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qmx8j2vqq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:57:15 +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 34IE0xBg004186; Thu, 18 May 2023 14:57:14 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2042.outbound.protection.outlook.com [104.47.57.42]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qj10d68rx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:57:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BvzBLhA/H9LUphLuIBOIHt0HHB4/Y+aaqD3Xcgy1HPznEhT9ohuTdY7xpzEL4J8Chp/MH8gXK06+Ny3k9C5FHYfy++DVZvywni1wrXN+G6k4UtIPE0/fI+V+K0z5QyvmoAVyHTEM637KGIpzDS7oPPA5MwoWhFYnYmJYvBC2vcJ7o/FuLMqwIOXP0AiP0coNvixuAXB5nuP0by0kZC3vjwPyvGz+1YFDKIoMaYiHQdWpEfainncudkcozn/HQSL1hQtFHE+1e/CP3Gflpue0/8vpHtBcTVdZn0SZQv5LQ4HcYDXpbxIYrGxpZYpNL3WfMwzvqWoKotI4bVGWWn4L2w== 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=t3fMBW05C58TmvbN+ox7McplGzPRCNLchTHdzirfeJQ=; b=czZTgSzlG8XsTkqfOAvcjYoeOuQJUdYqHkeaIsOAcgC/TueA57C3NJOyZnOQ8Qgv/cXiXpkpLTRXK7CSYtcvSB63sOm2QgP6Nqm6s1dA1fbhyAuSmNUH5VkSxGIRVI5Cv8RtMp9Dg+uNRbteVvNAh9UBqcLOUhHmGVqkjQnLEdrIOCBihgMKowEJNVTavjCNzuUT+d9cHEx0vnJE13367A+1FqaEoh4boXt1axyil45VyF0F1GPAZdCpVyJFLmjX4irgTA+m/jM+RFVTa2Hl2TnMpSufgRU1grdHcvC73NVj4rjrlFSM1cj73hW81ukcWMwecSJM26Is/A36ikUbgw== 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=t3fMBW05C58TmvbN+ox7McplGzPRCNLchTHdzirfeJQ=; b=XP2UxOoGOhlachBBxmc5YZI8r1NJgcKugs+RUOChbNXRDw2iyUi80GemrhHlSwr3RBCpojqXLiVtt5ZjeKvlsJ8AM1ldTFp5BaosR99Cf3rzyhXo1td5MfQQDbNvnEDTZ+DwEpglVPmeJc/BuyNcD42lbOUtBYbiVVZpGnzCL2A= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by IA1PR10MB7261.namprd10.prod.outlook.com (2603:10b6:208:3f6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:57:11 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:57:11 +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 v4 33/35] maple_tree: Update testing code for mas_{next,prev,walk} Date: Thu, 18 May 2023 10:55:42 -0400 Message-Id: <20230518145544.1722059-34-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0144.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d5::10) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|IA1PR10MB7261:EE_ X-MS-Office365-Filtering-Correlation-Id: a66dcb6f-8f0b-4464-68b2-08db57b028d9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O6ZRT2Vn6Ncz4xwnQD7eyoDNBdveVnnDPP1MnVP/DYGpRvLhRvyPM1DqOxiEIE78qQWaKRI8nmu0+Tje53fT4cLj+2InJlNqzm+YhZPGA8DAFe29JuGrCsy+JkEq+lUqh8cp7ZV8b+eNuQ4JQ83kj5WMF/XupVyCoFiuRhgeFZvOQ+GzInFdy3pMEf7G9MQc8Nl9XXcOqQOhK1DLEcmYjvfpKZKGzy843q9MAwUfwtA3hGr5IC8PRigFljni4RXhwhXm7C/fsy3nY/w8icKdBtsqWeFPSdmLuNfqAp4NcJ5G2CGVIzPr0c19yLVP/EJbzt4GxtSVyoMo4hm3h6BMeDKy92gNKOhDWpqMLuAh+DO9AsAabtf9ioJE3hjSq62REfK5klqIn0mgE7hjH7MfzPGux5yn5MwatrMVGOl9BGrdqRYx9ZAfC5gqguS0acOFhwzFrQ6l1sIRY7XwtCJlpiavJ46Glb71lLP1U+379F/Tlu7OIwo2K/Gsw04rbwe3RgPPJrP4SxKfUc0bjsY4VZ1bXTUt1ry1gJlQzabBfdPWAgpF8X4PmPiVR/aoBzGS X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(346002)(39860400002)(376002)(396003)(451199021)(41300700001)(6666004)(316002)(66556008)(66476007)(66946007)(6916009)(4326008)(6486002)(8676002)(8936002)(478600001)(5660300002)(107886003)(86362001)(26005)(6506007)(15650500001)(6512007)(1076003)(30864003)(186003)(2906002)(38100700002)(83380400001)(36756003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?TrE7fYWGl33wfzdvluLy0vB4VIkB?= =?utf-8?q?oyuv42/1cfN7+iAHBLQPxjw68345zbBRI1iQCfOnznKKtya90ejUO4rflyXwX3seX?= =?utf-8?q?+aogwEE21otB5kDkURBZOiWVmh/8wf79sGZN4n0gWCRQgIZ/WIImb5GaEbaNrEmsy?= =?utf-8?q?rM4dkItUo2RaXGJB9zR/M7O4LLI8KtFfGTxBhTBKri6STm8/XF6UgLLrqPdqgU1BC?= =?utf-8?q?RzIfpchoBNCHpRb/1J/PwBw06EHGxz3g7RtI8wPINYCp4QLdvbdTxWLXtQX64mSrc?= =?utf-8?q?mpiARnwGVjWVwIWhUrLBSExdR709XEbCevG6qHSpd8tB/gJ7U8SiNES+Ly+W6dMLS?= =?utf-8?q?8lVqW+w3na3JzSfMpU1QEBqVj2Im5843Jf2Z5wl1/7CeXpgsdwzMbQyvh/JB37kG7?= =?utf-8?q?Gpl8OzRopDdeNgqzsK7tta20NAugqgqCcZe+XFBeeTYJPRPgjt/Ik3gBwKJEnFHbs?= =?utf-8?q?RXhJrLTT4DXAxhP17XZ+8jZqPI/foZ64yA05fN33O0HaGsX18vtEIVU/xQ1lHD0js?= =?utf-8?q?UegVUaewhNWftEwSYGe8i1sCKDGUcsqJ0hP2LZYhYK59d1PcQ2ouJMiebhi/zyZaC?= =?utf-8?q?Y6o5EAMqPlYDyBwBt9u0iu+hcT0az8Qpbq0dqxFxIUmCBldvyGLHtmUKgMj0yMbRc?= =?utf-8?q?FaaXjBaBIKyo7P46Z72P8Os7f51T0MgMQSH9uzat32MMxt+EJr8D2DKSc6tg0KVre?= =?utf-8?q?vQ4XUqZuXJYP1a8nbb88P8wAbUEkdd7czhJt+Jz8CyIub6emi01lpvaByLfqYOYRP?= =?utf-8?q?aZCA2Si4z/eYEtvAFKglAIGe8fwlam9RR65i4Gtj3VwB79N1sa6m0fVRCAbNy0v9B?= =?utf-8?q?cO0j+DmalJzmcpnJNQZYjXBEz8BeAE40e5qbr6rugnqa/UEBHQcxFphpzp/FZ8+wy?= =?utf-8?q?E9aVANWHyA86tRevgK1VIm0+VavN8iItatxBavimSuid4kekumZdyPU+BR9ayjD2X?= =?utf-8?q?4nHRwBpe+Fl6hqcibSxIFlflUJHURD7Wymu3c8FH2m+rrlq1/kPXMT2bVd0TOtVUr?= =?utf-8?q?dI+KaYBHJcI9vP2Z9aAXabwScPz+/jt9gA5vlcN/2kPdZRVa74awMxR6Vpzh385jw?= =?utf-8?q?b/1C1ByQCgFMRgbKGDRVQeV3Ql4FHatnbxfdEkeoi4JBkxbHQpAOG8vlfbukupIjp?= =?utf-8?q?KavtuosFu0hCpaFiuPGuWbVS46fTmy8JuY3kz5qtPvVqE4KwRL+bBRJxh69IFGqWh?= =?utf-8?q?lDlUbgYbvKq2Fo3AaDthxukT4FzJPHYX6owTQM8+pjXwsNQQ/Q8Q1fwq1zQhzUXNW?= =?utf-8?q?SLWBoCasw+hgsk+TOl/cwcsnrnFZh8gGX5jQL+YiJUPigXQklzE8sm4KrZhNmb0SV?= =?utf-8?q?ixd4VbFcBIwNaGqEV12TfO8JLBXCil73CWh9U1sCPo0PFlcToECLbXWrKD618eXLN?= =?utf-8?q?Qt/IAKdSvJBOqIosiaySx2JbpbRIoe1v/VM5/7SOXPB1MDC+6ViBUdNjtAok0nZg7?= =?utf-8?q?yNFkyEQ6wkp47DxubMIquvUbdqVstxxpbwG30qIieZE3Jisd3MNdq3b2xQ3og0s5S?= =?utf-8?q?+YDFK01pIjA6xPEFPPVegnQtAAkId5niIg=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 0L2TgwAHgybs/Y/UFHbw1j0VIjPpr1/n4WJ5cUXH93go5Z7BOdMS+/G2kcKMQaAzj5nnTtMXs0Qq4XjZKP+2ek83l+/feuHicUFIwhoT8ngGVQfbUk/K9E7nsf3DPyhOFG8LB9d6BKfkQ9quzr5TRjJLrvLAnGe7IjIVPbgh6sAmfBD/TNWipjrXz55JHxYtdxq42qbqdghh/yDF1W4k/qwF4yD1zgXJBnXswrAnHmKeHmVz8fXbQs2QOaSGopas+cnbOvPGOssiivl5ngM4IzHn+rdS1oAw5GkXJBNmFkwlZtmFX7/b/AUgZh6dDFGBme1F9JBzCMVZNqT4kdgHS/bPYA5PFjm4EqicdM1pxeeJreVK5vEWbdc7FvA32hH+zLf1/e52IXSOTJazcJhlxW0gcC+eyFLL/9aZKgxvntcAgBLwIZ8PYBFygX3tu0gY7E0OnlsCaXX3m/Hu9BKanUEBJ65fo2zI+jvNfLDThzxfnqa1dv0Vy8NB+ayRyolcEollmrsh7Mauoxe9ShzUxBM9T/VTauT12LDBzT4utwBfDgpA4lWgJKaciP49EQZNoYyzWD49v5Zvvn6F3gmyv9riT7ZKnPnuuF8yCv8r8S1e1xSTkRgY02PEIKw3GaOiOpmGny5vP4ykVCFMacPzUfjuhmVcD/v0eTSKpRwGOVswqSCwOsMwzI6ZIy+DZbrEH8KcYwES2avm8sG+esbLGTUycsq65ieM2XhUVupuDwf1i/pYaWHqec1xQkSnot6MYtrh7LQ9r9StIZF5ndY2JbLdS1PbeRi/hDC501nD2Dwb4BXwNn7m0jGWDsUpDM7vqTS3uhZbCwYwYm/6WeO9kKeYTEK8OXUqEni9cJDML75nACDlTdIowydfvnmFvbNVfYNnNkAQXRN4xJ0uV8mrPA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a66dcb6f-8f0b-4464-68b2-08db57b028d9 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:57:11.5731 (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: Dzqf9NEvvBGi5iI4hfz991/BDahs+DoOgyNnlu8ZeSlIRhAlRWMvl6iVkU+ihnftA8ubIZy4uHn3V+E1vQMBDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7261 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 adultscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: Rtr1LnFISVkvoALC5cIXo2bb-HdjRorr X-Proofpoint-ORIG-GUID: Rtr1LnFISVkvoALC5cIXo2bb-HdjRorr X-Stat-Signature: 7ozuq43yjhg7xbn437s9ycm4mm75s7xf X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: D0D93100018 X-HE-Tag: 1684421837-790874 X-HE-Meta: U2FsdGVkX18WrkIz6I41PvUwN9NuvpSUJJmKeS51l1plTFKeWNg9IQug7Sm9JxN82jFk5We8DlnNMAlaceHjaWjsZLraz1tjIQDPNEDgwMrh/hovhHWCW9398qZtF6iXQvBOIRLUxE5D6YREq9NVMQv3gPFQKvBfc001DstvABmdBHNq2GQ9RM03nT/UmmkJzwEoBhZko2z5VucGb16edu2b2VjA+Lq/HOcBIX6pk7IKIu4/MCZl1wYEvJDxpW4LFFHYLz7tMSyG/m74ngEyZO3PgAmsdZcGbgscWKkUZEdqQnuX/73BAg76PL/lk6vGEEFRXo63oQdf8L0tjIJHD/uEEZvcq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ity: 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: Now that the functions have changed the limits, update the testing of the maple tree to test these new settings. Signed-off-by: Liam R. Howlett --- lib/test_maple_tree.c | 638 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 633 insertions(+), 5 deletions(-) diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index d295fdee2fae..9939be34e516 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -1322,6 +1322,7 @@ static noinline void __init check_root_expand(struct maple_tree *mt) mas_lock(&mas); mas_set(&mas, 3); ptr = mas_walk(&mas); + MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, ptr != NULL); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != ULONG_MAX); @@ -1391,7 +1392,7 @@ static noinline void __init check_root_expand(struct maple_tree *mt) mas_store_gfp(&mas, ptr, GFP_KERNEL); ptr = mas_next(&mas, ULONG_MAX); MT_BUG_ON(mt, ptr != NULL); - MT_BUG_ON(mt, (mas.index != 1) && (mas.last != ULONG_MAX)); + MT_BUG_ON(mt, (mas.index != ULONG_MAX) && (mas.last != ULONG_MAX)); mas_set(&mas, 1); ptr = mas_prev(&mas, 0); @@ -1800,7 +1801,6 @@ static noinline void __init check_iteration(struct maple_tree *mt) mas.index = 760; mas.last = 765; mas_store(&mas, val); - mas_next(&mas, ULONG_MAX); } i++; } @@ -2011,7 +2011,7 @@ static noinline void __init next_prev_test(struct maple_tree *mt) val = mas_next(&mas, ULONG_MAX); MT_BUG_ON(mt, val != NULL); - MT_BUG_ON(mt, mas.index != ULONG_MAX); + MT_BUG_ON(mt, mas.index != 0x7d6); MT_BUG_ON(mt, mas.last != ULONG_MAX); val = mas_prev(&mas, 0); @@ -2035,7 +2035,8 @@ static noinline void __init next_prev_test(struct maple_tree *mt) val = mas_prev(&mas, 0); MT_BUG_ON(mt, val != NULL); MT_BUG_ON(mt, mas.index != 0); - MT_BUG_ON(mt, mas.last != 0); + MT_BUG_ON(mt, mas.last != 5); + MT_BUG_ON(mt, mas.node != MAS_NONE); mas.index = 0; mas.last = 5; @@ -2047,7 +2048,7 @@ static noinline void __init next_prev_test(struct maple_tree *mt) val = mas_prev(&mas, 0); MT_BUG_ON(mt, val != NULL); MT_BUG_ON(mt, mas.index != 0); - MT_BUG_ON(mt, mas.last != 0); + MT_BUG_ON(mt, mas.last != 9); mas_unlock(&mas); mtree_destroy(mt); @@ -2750,6 +2751,629 @@ static noinline void __init check_empty_area_fill(struct maple_tree *mt) mt_set_non_kernel(0); } +/* + * Check MAS_START, MAS_PAUSE, active (implied), and MAS_NONE transitions. + * + * The table below shows the single entry tree (0-0 pointer) and normal tree + * with nodes. + * + * Function ENTRY Start Result index & last + * ┬ ┬ ┬ ┬ ┬ + * │ │ │ │ └─ the final range + * │ │ │ └─ The node value after execution + * │ │ └─ The node value before execution + * │ └─ If the entry exists or does not exists (DNE) + * └─ The function name + * + * Function ENTRY Start Result index & last + * mas_next() + * - after last + * Single entry tree at 0-0 + * ------------------------ + * DNE MAS_START MAS_NONE 1 - oo + * DNE MAS_PAUSE MAS_NONE 1 - oo + * DNE MAS_ROOT MAS_NONE 1 - oo + * when index = 0 + * DNE MAS_NONE MAS_ROOT 0 + * when index > 0 + * DNE MAS_NONE MAS_NONE 1 - oo + * + * Normal tree + * ----------- + * exists MAS_START active range + * DNE MAS_START active set to last range + * exists MAS_PAUSE active range + * DNE MAS_PAUSE active set to last range + * exists MAS_NONE active range + * exists active active range + * DNE active active set to last range + * + * Function ENTRY Start Result index & last + * mas_prev() + * - before index + * Single entry tree at 0-0 + * ------------------------ + * if index > 0 + * exists MAS_START MAS_ROOT 0 + * exists MAS_PAUSE MAS_ROOT 0 + * exists MAS_NONE MAS_ROOT 0 + * + * if index == 0 + * DNE MAS_START MAS_NONE 0 + * DNE MAS_PAUSE MAS_NONE 0 + * DNE MAS_NONE MAS_NONE 0 + * DNE MAS_ROOT MAS_NONE 0 + * + * Normal tree + * ----------- + * exists MAS_START active range + * DNE MAS_START active set to min + * exists MAS_PAUSE active range + * DNE MAS_PAUSE active set to min + * exists MAS_NONE active range + * DNE MAS_NONE MAS_NONE set to min + * any MAS_ROOT MAS_NONE 0 + * exists active active range + * DNE active active last range + * + * Function ENTRY Start Result index & last + * mas_find() + * - at index or next + * Single entry tree at 0-0 + * ------------------------ + * if index > 0 + * DNE MAS_START MAS_NONE 0 + * DNE MAS_PAUSE MAS_NONE 0 + * DNE MAS_ROOT MAS_NONE 0 + * DNE MAS_NONE MAS_NONE 0 + * if index == 0 + * exists MAS_START MAS_ROOT 0 + * exists MAS_PAUSE MAS_ROOT 0 + * exists MAS_NONE MAS_ROOT 0 + * + * Normal tree + * ----------- + * exists MAS_START active range + * DNE MAS_START active set to max + * exists MAS_PAUSE active range + * DNE MAS_PAUSE active set to max + * exists MAS_NONE active range + * exists active active range + * DNE active active last range (max < last) + * + * Function ENTRY Start Result index & last + * mas_find_rev() + * - at index or before + * Single entry tree at 0-0 + * ------------------------ + * if index > 0 + * exists MAS_START MAS_ROOT 0 + * exists MAS_PAUSE MAS_ROOT 0 + * exists MAS_NONE MAS_ROOT 0 + * if index == 0 + * DNE MAS_START MAS_NONE 0 + * DNE MAS_PAUSE MAS_NONE 0 + * DNE MAS_NONE MAS_NONE 0 + * DNE MAS_ROOT MAS_NONE 0 + * + * Normal tree + * ----------- + * exists MAS_START active range + * DNE MAS_START active set to min + * exists MAS_PAUSE active range + * DNE MAS_PAUSE active set to min + * exists MAS_NONE active range + * exists active active range + * DNE active active last range (min > index) + * + * Function ENTRY Start Result index & last + * mas_walk() + * - Look up index + * Single entry tree at 0-0 + * ------------------------ + * if index > 0 + * DNE MAS_START MAS_ROOT 1 - oo + * DNE MAS_PAUSE MAS_ROOT 1 - oo + * DNE MAS_NONE MAS_ROOT 1 - oo + * DNE MAS_ROOT MAS_ROOT 1 - oo + * if index == 0 + * exists MAS_START MAS_ROOT 0 + * exists MAS_PAUSE MAS_ROOT 0 + * exists MAS_NONE MAS_ROOT 0 + * exists MAS_ROOT MAS_ROOT 0 + * + * Normal tree + * ----------- + * exists MAS_START active range + * DNE MAS_START active range of NULL + * exists MAS_PAUSE active range + * DNE MAS_PAUSE active range of NULL + * exists MAS_NONE active range + * DNE MAS_NONE active range of NULL + * exists active active range + * 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); + void *entry, *ptr = (void *) 0x1234500; + void *ptr2 = &ptr; + void *ptr3 = &ptr2; + + /* Check MAS_ROOT First */ + mtree_store_range(mt, 0, 0, ptr, GFP_KERNEL); + + mas_lock(&mas); + /* prev: Start -> none */ + entry = mas_prev(&mas, 0); + MT_BUG_ON(mt, entry != NULL); + MT_BUG_ON(mt, mas.node != MAS_NONE); + + /* prev: Start -> root */ + mas_set(&mas, 10); + entry = mas_prev(&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); + + /* prev: pause -> root */ + mas_set(&mas, 10); + mas_pause(&mas); + entry = mas_prev(&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); + + /* next: start -> none */ + mas_set(&mas, 0); + entry = mas_next(&mas, ULONG_MAX); + 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); + + /* next: start -> none */ + mas_set(&mas, 10); + entry = mas_next(&mas, ULONG_MAX); + 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); + + /* find: start -> root */ + mas_set(&mas, 0); + entry = mas_find(&mas, ULONG_MAX); + 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); + + /* 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); + + /* 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); + + /* find: start -> none */ + mas_set(&mas, 10); + 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); + + /* 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); + + /* find_rev: start -> root */ + mas_set(&mas, 0); + 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); + + /* 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); + + /* 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); + + /* find_rev: start -> root */ + mas_set(&mas, 10); + 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); + + /* walk: start -> none */ + mas_set(&mas, 10); + 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); + + /* walk: pause -> none*/ + mas_set(&mas, 10); + mas_pause(&mas); + 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); + + /* walk: none -> none */ + mas.index = mas.last = 10; + 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); + + /* 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); + + /* walk: start -> root */ + mas_set(&mas, 0); + 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); + + /* walk: pause -> root */ + mas_set(&mas, 0); + mas_pause(&mas); + 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); + + /* walk: none -> root */ + mas.node = MAS_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); + + /* 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); + + /* walk: root -> none */ + mas_set(&mas, 10); + 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); + + /* walk: none -> root */ + mas.index = mas.last = 0; + 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); + + mas_unlock(&mas); + + /* Check when there is an actual node */ + mtree_store_range(mt, 0, 0, NULL, GFP_KERNEL); + mtree_store_range(mt, 0x1000, 0x1500, ptr, GFP_KERNEL); + mtree_store_range(mt, 0x2000, 0x2500, ptr2, GFP_KERNEL); + mtree_store_range(mt, 0x3000, 0x3500, ptr3, GFP_KERNEL); + + mas_lock(&mas); + + /* next: start ->active */ + mas_set(&mas, 0); + 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)); + + /* next: pause ->active */ + mas_set(&mas, 0); + mas_pause(&mas); + 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)); + + /* next: none ->active */ + mas.index = mas.last = 0; + mas.offset = 0; + mas.node = MAS_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)); + + /* 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)); + + /* next:active -> active out of range*/ + 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)); + + /* Continue after out of range*/ + 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 out of range*/ + 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)); + + /* next: none -> active, skip value at location */ + mas_set(&mas, 0); + entry = mas_next(&mas, ULONG_MAX); + mas.node = MAS_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)); + + /* 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)); + + /* prev:active -> active out of range*/ + 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_active(mas)); + + /* prev: pause ->active */ + mas_set(&mas, 0x3600); + entry = mas_prev(&mas, 0); + MT_BUG_ON(mt, entry != ptr3); + mas_pause(&mas); + entry = mas_prev(&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)); + + /* prev:active -> active out of range*/ + 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)); + + /* 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)); + + /* find: start ->active */ + mas_set(&mas, 0); + 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)); + + /* find: pause ->active */ + mas_set(&mas, 0); + mas_pause(&mas); + 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)); + + /* find: start ->active on value */; + mas_set(&mas, 1200); + 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)); + + /* 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)); + + + /* find:active -> active (NULL)*/ + entry = mas_find(&mas, 0x2700); + 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)); + + /* find: none ->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)); + + /* 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)); + + /* 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)); + + /* 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)); + + /* find_rev: pause ->active */ + mas_pause(&mas); + entry = mas_find_rev(&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)); + + /* find_rev:active -> active */ + 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)); + + /* find_rev: start ->active */ + mas_set(&mas, 0x1200); + entry = mas_find_rev(&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)); + + /* mas_walk start ->active */ + mas_set(&mas, 0x1200); + 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)); + + /* mas_walk start ->active */ + mas_set(&mas, 0x1600); + 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)); + + /* mas_walk pause ->active */ + mas_set(&mas, 0x1200); + mas_pause(&mas); + 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)); + + /* mas_walk pause -> active */ + mas_set(&mas, 0x1600); + mas_pause(&mas); + 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)); + + /* mas_walk none -> active */ + mas_set(&mas, 0x1200); + mas.node = MAS_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)); + + /* mas_walk none -> active */ + mas_set(&mas, 0x1600); + mas.node = MAS_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)); + + /* mas_walk active -> active */ + mas.index = 0x1200; + mas.last = 0x1200; + mas.offset = 0; + 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)); + + /* mas_walk active -> active */ + mas.index = 0x1600; + mas.last = 0x1600; + 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)); + + mas_unlock(&mas); +} + static DEFINE_MTREE(tree); static int __init maple_tree_seed(void) { @@ -3011,6 +3635,10 @@ static int __init maple_tree_seed(void) mtree_destroy(&tree); + mt_init_flags(&tree, MT_FLAGS_ALLOC_RANGE); + check_state_handling(&tree); + mtree_destroy(&tree); + #if defined(BENCH) skip: #endif From patchwork Thu May 18 14:55:43 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: 13246959 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 68FBFC7EE25 for ; Thu, 18 May 2023 14:57:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5A948280008; Thu, 18 May 2023 10:57:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 53412280011; Thu, 18 May 2023 10:57:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 27238280008; Thu, 18 May 2023 10:57:22 -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 0F5F028000B for ; Thu, 18 May 2023 10:57:22 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id BFE12C07F4 for ; Thu, 18 May 2023 14:57:21 +0000 (UTC) X-FDA: 80803679082.05.EBA4DD5 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf11.hostedemail.com (Postfix) with ESMTP id 5785940016 for ; Thu, 18 May 2023 14:57:17 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=J3HDBfzo; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=LyCFD16l; spf=pass (imf11.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421838; a=rsa-sha256; cv=pass; b=AaZugoQmlHtIa19aWqTJvrv9OzgAG0gMwqULvVhxSLYl5Sl/8Vuw42Hp5pAlfL4KicJOWI yE9VQv3g/mZic2/rrtGL4RPlu0PmY1MNiZWzZfD006V9QNnERUxtouqvKhnIyxMPV6SDY9 AguJTvxsDAWQ9Lh3uA+u5A2I2Q9ya48= ARC-Authentication-Results: i=2; imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=J3HDBfzo; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=LyCFD16l; spf=pass (imf11.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; 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=1684421838; 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=H6a0kxqv5ze3H6E5XtAeQKjpADPWF+IvHJic3aVsz5Q=; b=v1GmcVvvKl5CCPhN8YQ4/zp5LAHxL3aE7Xja8zxy/tYwT7mXxRRag8Fu4raPwTQPMeydvS 9gD0YyUoyiln0oZBNgLsM8JD/r/Vy8BccR+bSLdpC5UEeKilXlxvEDrJJUGEz0rGmLdL8k M1wrZcpMxPlIThRWbqdUhhrPvtPsQvU= 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 34I6JJW8026300; Thu, 18 May 2023 14:57:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=H6a0kxqv5ze3H6E5XtAeQKjpADPWF+IvHJic3aVsz5Q=; b=J3HDBfzob2tK9yqH3mws7MMU3prpSynvoXx4DJen3IvjFn7kVgO/461unJYAOELES3WP aY4mJOe5OYQn8stj7IAffLqzi/ZGsHA15Ynw6WrUAif9q/ev4S5OqUk1Pjfooj3Ajx3M SCmJ9drjBEAiPheL1tNOZiQtWA/3HbrDlZXTYa8X+Wt1HF3vwKnChEQQdbdBob89jaPT axtRDJY3xAEzmXNADnqNEnOykGbBjm6cG5jYpGVQlgaSWBdVmJPq8aUH0Lq88XJXhjJR T1OGtiUjVyWnDrs0A7GwCNurC5XQ2GL6BZHUzXT35Y59G5FHCsQI05U7IbonupTmRJVo OA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qmxfc2ufu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:57:16 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34IEEv2N034079; Thu, 18 May 2023 14:57:16 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2040.outbound.protection.outlook.com [104.47.57.40]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qj107c9p0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:57:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QMtr+9YqJtKd+8MoJ7JIoBsF+hjcFTUYqtTc+Nv57NhWamhOBYcfviG/Ump9v4V4N8dT7pfUKqvZIPIFUdOrCK535dDuVV4kqdv0Dla9DwULhejGADiLV7crz03yzxeC9IJden5NawDUynZ6pCMI9kbT9GyCX7tunjC7NGlCN7NQO5V61dgeqB2SVx8hIqyjgOQV3gRSeWTSdMHOYyCUu491IIaNL1mO/sqCEKvNbOTpnmMcPnLY8qG/HehI/6tMw5CNrAOfwug+E8zGvHiDuRV+mbt2mi5a1anQfMf4O87znAaSupO4ktzKyU31taRjS7Kz+6U10rV+dnpQwMuSQw== 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=H6a0kxqv5ze3H6E5XtAeQKjpADPWF+IvHJic3aVsz5Q=; b=U0+HZEa+UG5ykpZeBbcV8VzlewYJjNo6n22U7wbQmBDYKeQwIKcsqzJL/khCUVwB/R63fwkgmQt2p4hfOz4m0PBSk/tTTjXQ3PdEWMir2wimHpbwaRkBm5px+L5EgRgU94T0mGsAz3QZ1nNR+YgBkadRNcGLaaiAk4DyWlldMHUXScP9YyTJwJogvT520M6KcQ9J4CRLd7JJfsDOF5lFxiVdLshbp6FqHQqTraz6VP+loJLX3yNhA4iXtp5DsTTvTWGBt8ikj3SikwlYnc2s1udJLz8lENFAHThphI0D5NNWRqbU6G/LrIfVnGcCWg1iV0cHkkc6/dg+i4uMgmSsrw== 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=H6a0kxqv5ze3H6E5XtAeQKjpADPWF+IvHJic3aVsz5Q=; b=LyCFD16lus7PXuT+Bk1FuLyhB0gYUWjhiyLXmVCf+3CkSstl83gHp4S7+9sLS6CeIOjxDaoNs2DZ1rvXKG6/Qa5Wsr6dXpYb9FrUqWKWg2Fe4KbMLJUsDxEF86T9+myqSAHA/pye39VXHHWlx2m5gnWFhG8kv01SryIqRAso10o= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by IA1PR10MB7261.namprd10.prod.outlook.com (2603:10b6:208:3f6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:57:14 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:57:14 +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 v4 34/35] mm: Add vma_iter_{next,prev}_range() to vma iterator Date: Thu, 18 May 2023 10:55:43 -0400 Message-Id: <20230518145544.1722059-35-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0409.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10b::14) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|IA1PR10MB7261:EE_ X-MS-Office365-Filtering-Correlation-Id: bfe4fdd6-4a93-4f83-9ef2-08db57b02a5b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qnwz1px650VVmUFvKr6kvKKBxeziT05w1+GzwQK9Hv1Iml/gLxqsJClfZjWSnGW+M1WmncoNgkAO+ddVHG259hh8Smf3zIlJDpkgsR3cm5rwg6q7kaX09s8GQjR4v1KnmGV1KgxAyl0zqN1XtBGRqNGp50jHMeWEtufw3NIpq6N1Dceni8X6pLpXOwXiQ6MjarFHVBOOPE5YIsh+/U7ldxdQHkeDth1G3rwo4nQoHOPs6Ga4CRMq7dqqCcZVphCY/g4978llGbaTYquBs7rF66ociJgIkkk5xXK1tAPLRUOSFEhbkCgGTc/K95kwycsJawHF2B6qkqKXPKhGmtkwt29LeGV/pT69NEvvJLaO9E88pUzl2GARuxNdrvlsAWBTFa249toeYeHK9tg9JjEtNyK2M6Qj0r9CdbtpowWnTggi52kFYI3/UQJd6WPS0NfKotyMHruVXAms4K8jhv3xDeeBoIaXiUPiJyzy0mDyWlZLKLPTMg7fW1ZbX6QUQaLof6C4bwegwbRzoYUEMAnV3Y7cxBrZKEj3F0OWyyOxqBd3C9PXzY2FJPx3mzZK5iBU X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(346002)(39860400002)(376002)(396003)(451199021)(41300700001)(6666004)(316002)(66556008)(66476007)(66946007)(6916009)(4326008)(6486002)(8676002)(8936002)(478600001)(5660300002)(107886003)(86362001)(26005)(6506007)(6512007)(1076003)(186003)(2906002)(38100700002)(36756003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: p70Kk2AQHvE37DAeXDjCCXTqvIPGfvmcVv9IjqnwuPIEjzJO/tgBvHE1jk2bY1zhmqLOBDuxXirqi3JeVBe1/yow0IfFhCpxfTzNAfuItr0gA+rNOLh3p+0XGnOAfqzcBz7nLKw3uQMZw3BNiHRyhwCYftOk0v64sNNKRkt7oajB3t1QE8hhZifpJYP5Xt7etlaBzpd9eshaZsBxzaUmePkP46i9Pm7a7w2GZYVZNCEohnP9xqQ/+mMh+mWMSnDWAIraiyV6RahnjvmYJdDCMasrbLDVNcQLCNW7TwbxX90SoglQwKCATDC02kwnj486wBR/RR0fqS3CJILbjqNwMhiBrydShen3s66wYi08aR0OEmKlWhVP9JjBYDSQx5JcD0sTOmOJ/wJTWTgo2YzRmDHIX0VEbzoNhBJRV/sPsep8NLpQq6TojuJFwt1kTjfnUWosOcvybMJ6bS10HqKm6z4Vh3/hVhScyBtFidQx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-Exchange-CrossTenant-Network-Message-Id: bfe4fdd6-4a93-4f83-9ef2-08db57b02a5b X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:57:14.0653 (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: 0hvnfBSdcjKHXweiF1zZ4CGx+p0akXt/QFuw1vSVRO1vwvZu9srsx0qj21BmSGmCPj6C5EI7AQ/haAHv9ojx5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7261 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 spamscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: U9OW2C5RdSbPKMUYnNfEMCI8XI-lXY-W X-Proofpoint-ORIG-GUID: U9OW2C5RdSbPKMUYnNfEMCI8XI-lXY-W X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 5785940016 X-Stat-Signature: amcib5w9hgg4zg6rd1txu5ye365nojir X-HE-Tag: 1684421837-841369 X-HE-Meta: U2FsdGVkX1/NcM6UMZU1anMWRiL+IUCjI3zbzjG26GdepH/Mag6IT7zzVBXgScQfkpoW2fnT0ZdSquhUDkcSfxNwtte/CDy8RPwaIFlMUMMsibeIJjc/W5QkWSWQ53k3bCelhtoUC+UOvSvI8l3du2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DxNxnsb1dKzq5xUGoYGBAEme0f7Wc6U0FJT2SvwO+wQaM2AtCu9C1SJSs2iWlfgTr2H0Wi+VmOOTM6eciq/Wc3j2+APO7pNu/oT4EWt5pEVeiDNjFQImtt8IB05YH40HzFAkBRVoEfxT6QpjZlCgqOQDLOgadHn7PWD02t1TThKl8kcCFVRyzjSIWRC9GG2WE= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Add functionality to the VMA iterator to advance and retreat one offset within the maple tree, regardless of the value contained. This can lead to less re-walking to find an area of interest, especially when there is nothing in that offset. Signed-off-by: Liam R. Howlett --- include/linux/mm.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 7b1d4e7393ef..1bd731a2972b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -866,11 +866,24 @@ static inline struct vm_area_struct *vma_next(struct vma_iterator *vmi) return mas_find(&vmi->mas, ULONG_MAX); } +static inline +struct vm_area_struct *vma_iter_next_range(struct vma_iterator *vmi) +{ + return mas_next_range(&vmi->mas, ULONG_MAX); +} + + static inline struct vm_area_struct *vma_prev(struct vma_iterator *vmi) { return mas_prev(&vmi->mas, 0); } +static inline +struct vm_area_struct *vma_iter_prev_range(struct vma_iterator *vmi) +{ + return mas_prev_range(&vmi->mas, 0); +} + static inline unsigned long vma_iter_addr(struct vma_iterator *vmi) { return vmi->mas.index; From patchwork Thu May 18 14:55:44 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: 13246960 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 142FEC7EE23 for ; Thu, 18 May 2023 14:57:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 88F60280011; Thu, 18 May 2023 10:57:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8401128000B; Thu, 18 May 2023 10:57:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F552280011; Thu, 18 May 2023 10:57:24 -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 515F228000B for ; Thu, 18 May 2023 10:57:24 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 2AB461208C8 for ; Thu, 18 May 2023 14:57:24 +0000 (UTC) X-FDA: 80803679208.16.E70640E Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf26.hostedemail.com (Postfix) with ESMTP id 8103C140016 for ; Thu, 18 May 2023 14:57:20 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=M+Z0CJUh; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=UBVKT9Yu; spf=pass (imf26.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-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1684421840; a=rsa-sha256; cv=pass; b=u9t27UzDchmrzScejKCox4+bt6Yn4KjUYuZlImC68ZzU/FLxV6qTztwGtwEOsQ2c0BQSZM 6IcV5q4k9HpdovaHyRA/AWCgZmO0ZMGdDf+RF3BYVUrJGJNjbxJGQ4VHsm0FMxDrwj9V6F r9sInYITB+VPpiaU4MWmvttI7+B2scg= ARC-Authentication-Results: i=2; imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=M+Z0CJUh; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=UBVKT9Yu; spf=pass (imf26.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=1684421840; 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=9UABu5yS7r9cjV080JpQK2DakF6E8hWKSmADOcCJ2pM=; b=XmkqL8tn+JDomAMh2rymgcmo48F+fCdzjgpcZp9z3BA74/cRs7EwtjFuvoPn8VYtXS4HVg 2VurqLw6bGsGF+j0ohoxN0nViZwOgdG73NUJWxJjZX0UdHtjV3WUoBb4AiksL+dKh4aa1s 93r9zlU2RrM9hEKvJprcN1ZWZI9+P80= 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 34I6JDwr018330; Thu, 18 May 2023 14:57:19 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=9UABu5yS7r9cjV080JpQK2DakF6E8hWKSmADOcCJ2pM=; b=M+Z0CJUhN4t0RML6X8PUATVfzQiu8n0JzMeIns3LvAvA+xwz7LSP509VzAfxtA13tsh8 LFR+M0rZEB2B8EZ21HcJ24u7ne2eKJ7luq9c6meSzoMvOogZ9MHrEMJ+h0NuAHXsasq3 hV9tiJk5aeFHiS8BdY4/884oGi/zvM7qSpG6I9QnZbX+GkiIoJr+8b3lXjmQ5liyknCC SYDjh/DC0cebeQzE+H7A52RH8M10BaoyAkjMOFLH1U4bVruTU8knFNWImrdt6xDhLBB2 wNsW35AtKnGlfHO/1CtlzRck5WkbLBVoDwgln3XASBtrV/rsaUxlguh9mV50bGA+M9p4 Bw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qmx8j2vr4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:57:19 +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 34IDUidF040023; Thu, 18 May 2023 14:57:18 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2040.outbound.protection.outlook.com [104.47.57.40]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qj106mr5e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:57:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZauWPGiJfal7jN5lGYNJCdguZn50BteXifs2orPmA7SU+VVOql0ROkFivnQb9S5d6MHgC3LCniOIVHL+FKlEuw1pahYiJe7upHSFaEtuizTHrpjRtw+A5amVq6Y9rrq1zganomUhM1cKCgNHYWkM/CPAZHRv+wGdqx8pxVIMrz4krLgvNeBoVfhxpkv2uDCckJxYLkyoB2rhiCjMb49NABiTer2a5azySGyhJFs0PeAnZhDJO1VgVpogR0IsYXmjEe6Bu+AF2k5+ll0lWO9yhC/EyBa0WA7msb3iPPp7leEI4MasCtDAqHUgfP/PoL9iZhJUpK7rvNnE6ixGvOMpIQ== 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=9UABu5yS7r9cjV080JpQK2DakF6E8hWKSmADOcCJ2pM=; b=bsDwOreTZppXYnG1nFDOmpO6jNTzsul7FILXlC6X9qYdWDImcZl2aeiXs8qyF/EBcIzmRdAzv2wtvxEfstTeJqaFCYFd7ljBpOFwGOhSRo3g1nrQkxRtrS0m+MffCaBY7wqSFpX2qZdrHPF11xxj+Fu1qS0c2SuPdLapIL2TT7kuPUAXD/MqxCmhmfmM2GY0DVU75IVGXlQJ/LqLKzMROELkJV9RQawXAW/AfHZODYxr3hzbHVViFbw5qEiu0CdvmM/RTzCTKnRmU+HkTBeSIjbQNmjtoPmBnVcJwGIRJSdcq6w6rn7LebVMvHCPzoNedC45jfMUKxnjpUH2N5m4Hw== 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=9UABu5yS7r9cjV080JpQK2DakF6E8hWKSmADOcCJ2pM=; b=UBVKT9Yuko3L/IoUjTbnJ4v7nYtvRIVx0Jg8aKU2N3Gd4ufGVcGp/WbVwncLjeToYtq8PtldYIRVJkWFpbN1QLskEVfQVTs5on/PDApTwzGhafqe600OlsV7X3HuftT9kEmQ9Et4/BOMWH6131SX7hUwPQd2c8oE0u4GNvoEiuQ= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by IA1PR10MB7261.namprd10.prod.outlook.com (2603:10b6:208:3f6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 14:57:16 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:57:16 +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 v4 35/35] mm: Avoid rewalk in mmap_region Date: Thu, 18 May 2023 10:55:44 -0400 Message-Id: <20230518145544.1722059-36-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0105.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d7::14) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|IA1PR10MB7261:EE_ X-MS-Office365-Filtering-Correlation-Id: cfce9cb7-3697-47a8-2504-08db57b02bcd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sYSbvrK3Z3yK8R0dRCBEBK+zu3wYrU0rnLqQDPZtACHV883myCCKp9TawSfArSiu2s3WGR9farps58k+UlHaPbSdvi6g/RmXCK1skY10OGW759o7J5qVby7vDWu+bKLrndccwlC1KfytOqcEpf/C4oS84QJb6qpUn4OxlNQxQ8bklQS013y6H4RU55ZfEp7bkk2Xoy/FqTCy2qliUqJ1RHzMz84y9JNLRR/tAjJDjmlqGEvvLX0n6bZutPXBCuYJaUPweKchdS4LYpY8TyOIUnJnvWEMCyBMAqSpimzLg8wjwC0VN6KxDVFnwD/18vdu/3ZIjVRH+EuPRqeZBba8bTs2ks+ZupP8nbCWXhoKjSPCmgT9nt9O895XyraDn3DvyyAK2Nr5Gc36FnsMrWxyxe6BODE43dxGXsnlIrhbgbM1YM63ea7mJnRTqYArSLLzTgOrCYDcYQVVw8QAAzjhgYQc5ACpZ9CCpCu0egILBYpxD0yqmcAybaiMjufZwMdO7yTh7Qa4HysmxH9iJr4iy2/PUV1K+nsKlRb7RnzhvJfD3sL8clgpwO80qcE310hj X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(346002)(39860400002)(376002)(396003)(451199021)(41300700001)(6666004)(316002)(66556008)(66476007)(66946007)(6916009)(4326008)(6486002)(8676002)(8936002)(478600001)(5660300002)(107886003)(86362001)(26005)(6506007)(6512007)(1076003)(4744005)(186003)(2906002)(38100700002)(83380400001)(36756003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iTFJeA5nVfF8YWLAR3rzwmwyei50FAZOoDROR+n/IK5D6TGOl6/ZZBzRRJSHjHzGfCPbo/zhoZuVRhoKUDuDEToMy4BHUa3PsAdGVt6ah08/hSe56M/VflnOTZdWabVVWeYdmxOWkoCOztG1r0h2YW1iAM5IJxjdfD+KLxEmMI3GeGHC5HgovU1nTg1qOOfWTiymkrioidmemnQJkqxZQF9JSghkThXJCYajzYD3IaC7pkcAXn43ZTGqZmvXL+rfvPFBy04SoZZ8mOw9nSWA0b6QGgRKieuvQHm+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S6wFMDHBOH1NcV2G/p7kNimdp0K+71owyesb2jLYxW8SGcDpTMoplskipLVixX9t5pulXk3VZ0pOUzSylWk8AmdfS4tIpwjMJpOboxa/TOmRUqQY6gbQv6BppXeFXJiNiQp3KjppFwXDLRIPDyyjvvyx2qvh4mWSv35XlLmaZFzfEgnPLrjA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: cfce9cb7-3697-47a8-2504-08db57b02bcd X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:57:16.4847 (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: 2LumWk34zhWU21TRFStYO3bdXdfi+nz5xcItQcnxPedXT2tZPA8rodAStO5IvjB9Z4bIj69IIJxlj7FJEjUtkA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7261 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: 0Eh3hg7uWpi64GPgX6TGKt5oOf-HzJS0 X-Proofpoint-ORIG-GUID: 0Eh3hg7uWpi64GPgX6TGKt5oOf-HzJS0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 8103C140016 X-Stat-Signature: jca9xgz1bsf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t6rTaPxxA0a2csdICCAu4J/vbT+DTDcZBIZcuwA+Pz17zKinQnvq441qcbwTA87Su/eAJ7po3Bgs4q8wOJEL4dF9iMUv9pMH0SFaprAQEuf3wm1VN3l6ZyO5X3yiZ2sR3QR2omgfw4o+M1W0Zob+ASS5OxSPli5FuBdXski6vM6zJd2qgBNxBhtFkubN3JAU/w7j+geBhFeh5/cwMJSRPhIDx+nQC91G/nuKjC5W1a15dbRaUeTFg2/oI3nrXE/C2ocD29khQ5Ph6rdN5JQ50PMS1P78NucRuFmaUKiiFfRaYrl48oeK3SBkUmqZs4KdRRm/00wAF7IjJFQnTohSb+HN5Nww3twfpjopeH3xJS9exifSSQNmUmisCseLrlYsCy+5vA+CVkmiIje1yQ4= 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: If the iterator has moved to the previous entry, then step forward one range, back to the gap. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/mmap.c b/mm/mmap.c index 1602c854133a..71733953ff83 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2636,6 +2636,9 @@ unsigned long mmap_region(struct file *file, unsigned long addr, } cannot_expand: + if (prev) + vma_iter_next_range(&vmi); + /* * Determine the object being mapped and call the appropriate * specific mapper. the address has already been validated, but