From patchwork Tue Apr 25 14:09: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: 13223370 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 372ABC6FD18 for ; Tue, 25 Apr 2023 14:10:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C6E916B0072; Tue, 25 Apr 2023 10:10:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C1EA16B0075; Tue, 25 Apr 2023 10:10:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A71416B0078; Tue, 25 Apr 2023 10:10:33 -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 957AA6B0072 for ; Tue, 25 Apr 2023 10:10:33 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 509BF80219 for ; Tue, 25 Apr 2023 14:10:33 +0000 (UTC) X-FDA: 80720098746.06.3B4B81B Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf17.hostedemail.com (Postfix) with ESMTP id C522540015 for ; Tue, 25 Apr 2023 14:10:29 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=w6ehkow8; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=W2AZeCa8; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1682431829; 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=aIr0SwrMirH0Qok/1cx1PN+5MY4i1PWV/gGH7bHH8uo=; b=EzVJtE9R4rDm+HcsvcmxxjhwkZemQPRm74wnvz9zWJ+yisxJ0de52kcCDtd+oRy/WMjAYa kCRsQnZEKFC7nkC/rSvlwORTXCSin5BzpFTih7g0W26Do/ll08alVEOk9zrHnpDoqeOgcO nM9y/Xqq2FzFiIsJph1F6pgBfRlojeo= ARC-Authentication-Results: i=2; imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=w6ehkow8; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=W2AZeCa8; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431829; a=rsa-sha256; cv=pass; b=pxrkV+403q3MTa+MzX0ZvedQqejGikT9VlOvjKI048BCoz2ZPRK79RENe93eFVnRQJhof9 cQD9A3JuTBkielcr99tZN0uBaCY1BmnzV8L43EXWwlstO1yK6v4VBCaRm+eylXlgq/98f6 yjku8suLFUw0kPQ4SGHDcmMwbkGCOf4= 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 33PDhpYZ001836; Tue, 25 Apr 2023 14:10:25 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=aIr0SwrMirH0Qok/1cx1PN+5MY4i1PWV/gGH7bHH8uo=; b=w6ehkow8R1SR8F+ygXYJZkPySYjYPG+/1afnxxRSX377Tf9PZ8D38iFIP3r17ldQFH9K 8tFG+BOt+iZw36bUkLG2X2F0MmofyaAkN/ChBxnH7LYpypfLmivVFjcXStaHL3qNrAVE xmIOQN5S6HhDjeiTkkuhU96oFdpajl+1moAsP67hQeaRYZgMjgsa5jrPW2rqRcXAQc6F MmAJP755Lt+ETDs80F1i0gttB3SiFEfI6W5dV8fjGZV/WJB7zgycEwm3DdPuJ5urUWNC JW3jF0y++hplB03W2inIUHVxfbIOPBYtWicY1hDKibb8VknMnmuQrCP2oVh3x74McSlP Dg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q47mcwfb4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:24 +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 33PCeSeI013280; Tue, 25 Apr 2023 14:10:24 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2176.outbound.protection.outlook.com [104.47.57.176]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3q46168ct8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D3ShGc3rqVcmlKgu+w+idzBzSVJ9B1wCS+0iSuVEXpEzvS1lut+Hay7Fh1GlqjXX/hefMzHLwbblqQxtkggTYIapf8H3HBduc6XLlTe10UI+l0MCQx9pjmdqV2vcJrk5oLNMaagS8wvkfCSlGZNJw/lhfQ2Qcc7Zg2rAnNpt/tNTc/r01uB2kR937BMqayZe11Xmm883Qy62mFBTC8pilC8WTuxaxNHhutQXgV6r7nZgETsX++/eN4o1JGukAtkpieiLRO5HAUidRFCSnkcu6PNyFmjdSqxhWk2Krhlvd4yp9nhIrnJ0nTburntQm+fb6i4x8Zg02UtiRoYk2kHcvg== 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=aIr0SwrMirH0Qok/1cx1PN+5MY4i1PWV/gGH7bHH8uo=; b=NcvMssJbbbw+X3nFVtJAhCJtA8pB236wAbhWE/Qf+nmHpR5OsLDkpOkVTVdwrE6xccApLK6NZNFcubn5C7Mszwj8MZcaCCNUfOJMo8VJWQNp43bzRiWELvguRuS1C4v6E5tS4RcKKDe1sWCwppVkIM3VLmf7uaioduz2QAyG7NIh7RwtXG41o2mABfvVZtHZhInqCCKFISBhiKLrn/ki2OerlwHwAW0P8gfg8X3uMp/Lr8zCTI6cesqF13GMheFympSNasTREgU/c5sTOg32YimnLmbwPMD9oUMMhIZg3sfRqzooS5flfoPkmEMpJbFUtdYpzEq1aMKyl4zTmjI0pg== 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=aIr0SwrMirH0Qok/1cx1PN+5MY4i1PWV/gGH7bHH8uo=; b=W2AZeCa8JD9sH4oSMSbNLQ5BoeILw80XAeMSwVqry446PWGZ+xxTWWV9kGYaUV+HK9NgzxQJptD1dbw2FDa+HWoO5A0K4tAXQx991usTWBzC/BRPSuyPm697qxNsrxPAxBtcMuAWLdtjNcEtRhvPEG75TCq07RZsUGZH8yProqM= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by PH7PR10MB6081.namprd10.prod.outlook.com (2603:10b6:510:1fb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:10:22 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:10:22 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" , David Binderman Subject: [PATCH 01/34] maple_tree: Fix static analyser cppcheck issue Date: Tue, 25 Apr 2023 10:09:22 -0400 Message-Id: <20230425140955.3834476-2-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4P288CA0025.CANP288.PROD.OUTLOOK.COM (2603:10b6:b01:d3::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_|PH7PR10MB6081:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a7fb81c-d2c9-4fe8-cbfe-08db4596cebd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n9HaFYKdMsxxAXORa4oXLQxpHH36Qid3LWo5sRaEPtKrA8zoT02/XoFrwqdXNsgakHe3uS5NZZ1MieriXYxVXIhoV+cz72oKCrHz3st0jNks71VSrfz8d1SbGZNCFbW2ZqeyiPUruUbWrmxIHjNfT53tXXomHYsTd+4qskKUQ/5jU4NUAtbxwFI7UreWkifwHZie78VQKUhrTDjo5yvviqLcMxk51BJ/BwiXCN9TtokHzVy/1scTp1tHuaLe7ABzLwpaSNqF/ETdvIPiWN3Pl+MjU+UtJdW03aRk+ahPHpJgD+0sRe5579wsjn/ixT4rng5UGcR1oC90dVjCP3zVIp22AHuFRkDLd0AuJ51Qv22qzIpP6A3pwu30TZaEPktD545evMSUr6KjST670C1jJpgBsWIrpd/dsaYXMU0+mMDvCmJF3Nej5D/SjpBrqiWgeODqG9gYHhGNx3So9zwvhJTDkHeW8K+MDva7N3Nydeov3n8TJw3+m2hISlRA80Jbq6mF98+T/yfZoY7RJ4U/MRqgMx3322mV+rJLwgHfm96t8nSpYaToJy8itpO4vFBB 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)(396003)(39860400002)(366004)(346002)(376002)(451199021)(4744005)(2906002)(66476007)(66556008)(66946007)(6916009)(4326008)(316002)(5660300002)(8936002)(8676002)(41300700001)(36756003)(86362001)(186003)(26005)(6512007)(1076003)(38100700002)(45080400002)(478600001)(6486002)(83380400001)(2616005)(6506007)(54906003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mEUttXhEAE9/CT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iQzNcj9DE2EcK7ppDc7Fnva27fneg2eB6AfKD+a7rnFyJliBzgP47AJ63qAXKHkWYqFsPRt9q3mncfXaxRsN3F6iYr8NKHgaCkXvVSyedH1ces7xMl7fUC+QLJB3XGgFawmtdbLHi6tu5XS6KGQ/nw6GRZzLpNURhSOycw+9r2s9RS9rbezEGpwsHDK5ZQSKau8kcpQM8w2ShysI6rDZ38L1MqID47Ziglb47mylOwG97KwBtdEVzDyrVMl9ORJFdsvJINSj7ZxDgm0MM8URRQX2i6MKixrWBI0GIAo2wQYc/xxahjwLRVu8BpMxebhcJ51xHKewxFB90eQ8f89kasfDZPa6e3oJGrEuPkeFxFfavD2yQ6xaxPuOXtAYk4le013Hk+fDg9Uu6nK1Xi3izfumuKKFsHQnuwg1yg8WCy+pxaAILNrOOt8kBVhDBN49+EjWotL/J9Dc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a7fb81c-d2c9-4fe8-cbfe-08db4596cebd X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:10:22.0358 (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: Qfv5BDzKLVYS7/ePBMx1Jb9JRrGHFfqtlH20XDHP8Nxq99PeKmKZvf6JgOqX29SToDmeJ347HaUrcemy5U82Jg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6081 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 phishscore=0 adultscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: VrUNUeLR3wUhKtWgBg6yepI8Dbjke9q8 X-Proofpoint-ORIG-GUID: VrUNUeLR3wUhKtWgBg6yepI8Dbjke9q8 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: C522540015 X-Rspam-User: X-Stat-Signature: ra8aqxb9tsqhdu1xuwj69519asfs1kyq X-HE-Tag: 1682431829-240103 X-HE-Meta: U2FsdGVkX19W0MHjrPKqfU+LKcVTCgoZZrDpu7DTFfmbmlTLFoG3a5rSGVwX6zIrVTZ3gMKLVctD/XR4g+5XpFmDf7Ex9CECBFbA9ucbpVtVd1UhxnxQs9UDmpesCtBmhMnbY85V/yJWbR7YfdHXLILZADClx2ZxSnGAsceGMcT3gi/7WK6Wz3LeuyxsXwjycx0EW4v3suqxs+u0sAlqRe8umt7EyddijYVnEjDXQOjJlBOgwdS9NfQ9wbMmNArrzx0wgzgUu1xmflVxJE0C++qoVM8UewvAxh3J9Fi1Y8uFTFyH8FxM2ucdlZ7usFpj2UV3EbSJIJ+TDbXNIRSKC6YOMKxIkZriGau7dcgtRCiruzixJYtFi+FHh5RarAIBMCSgFAtWa5QEVLccDGWCbjVU93SG5HgWYFAV+IeQaVz8IgxPLKClYFNUZ4YlNcu+qBYwfU9bLgOv2g+x/6PSr6c5pkp9MUKirorj1BFA0AghJ2ZzyMMNuWur86O8KGYAabxPpUMaeow4J2vxeLdoz1y1SJ7nqJXOO4zeS9yRjyRydffeUSZt34Yn/2LgZvlKIs51enHWYfOYJQuYpjoMfLSnws+QyWr5TtwfJhE5L2Hw36S+3/uM1G3iazfxRnJ/m8skT+IMniNYZIN5hZJvIEH3zDdHe0lbIpgd+qzcpUResnHX9ys6n5VgwevWM7wFNxOd6+DVTbB9LThLdp+O44+8zhapq6zBWmpoQWsZFhp8H+CGs8C8CT/LqWr62UqTfYv85/O6p9mU6sCeFiM5Hrd5pSr2NwHZ+Xp8IcV+LjGYYQ/+z43AMLQYTxnwEv0yOPn3/oIqwn2Fa8AFph9ZQUpCCcVYDZUfZ6I+Bd85gT3hP+N+X1qTeldJ0CDybafh70cFyYAycQWPmzJlNJ/31i58NS40BZKgCYDpR+pw4x78r8QsAF0ahwu2XBeF/Cs4PgiPhQJCKoo5JMKTX98 op6cQKi7 2d9K2nasKOz/vYd1Yu0yRFuVKeaC9eGProlBsaPI+lds2HmVvCGqDx1zVayRt09h8hA2noEcpNDK5uisxEIyy3gM5RNh+O48gkvFc6ASsW7FDMihEHZTsN+z0T1EyZvDaDbr+xbLavFwk01nEA3Tb7gb98rO/m7IABJVINP3T53FS7THZfEYcDpOEnv+C3fqa6oaIE/Ty5fZhDroPo9RAniZo83OnYx/FgaAY0eQqUCygJX1208Geg3TZKe9EpRRVuYONYjF/BW+aXZ8DIkid+WhZaFmuY0S5O1MsMkfiJFvd3X7TPC5ktRsmMBoxNU5JKXIYfltCVmj0XMR2SVOSmc/yEsXyEotZzjAWe1qDNrUiTfOALkbqknm8n6FtqM8TKYudwAeYQ9GeKxGSsGwSRJAvQLgXDaWs8hzuwF/P8SNIhJulaTPv0aLrnsB0PvnPXMCa 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 110a36479dced..9cf4fca42310c 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 Tue Apr 25 14:09: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: 13223371 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 83C75C77B61 for ; Tue, 25 Apr 2023 14:10:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2AA8E6B0075; Tue, 25 Apr 2023 10:10:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 25B816B0078; Tue, 25 Apr 2023 10:10:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 038046B007B; Tue, 25 Apr 2023 10:10:33 -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 E38AF6B0078 for ; Tue, 25 Apr 2023 10:10:33 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id BCAA5AC907 for ; Tue, 25 Apr 2023 14:10:33 +0000 (UTC) X-FDA: 80720098746.02.5E0FCCB Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf21.hostedemail.com (Postfix) with ESMTP id 55EF81C0007 for ; Tue, 25 Apr 2023 14:10:30 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=a0+PAvCL; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=mVmyAEmI; 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; 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=1682431830; 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=p8bYlVicQX60f75L1bnEUO3IOESeVNSC3YS+Zx2A1Tk=; b=NC0PP1BR5Up3u+ZxQrWtTTRxL9dxNKRuCtFWXprECxLcLyRtngVG848Jk2oHuT1fmKYCqT 6VgbLj4lcqdOxvlOKuY4sIC1PV8yOOtSImn3HwFVMUinwFQCO1WdOexxU08BgpnRKJy94K DgL97W7mxqyBkhNbr/I+lub3nosZ2UE= ARC-Authentication-Results: i=2; imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=a0+PAvCL; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=mVmyAEmI; 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; dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431830; a=rsa-sha256; cv=pass; b=5dSab00U4tmAHKok6lMbUoTN48Ct7XIVRq0EenFAtL/ICHjdYh/dM8YdVf7hEmvJT/9xgk vz/HF7taolw/gr8DNfQsRz1EYr0aiPgSLtNsFSmaHvLzXT+3Q8qTmMsjDNCN0kqQAK+Ftz fEhq9AMHFjPyDyaxBJCiLgLnFYeWNpQ= 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 33PDiYpM022658; Tue, 25 Apr 2023 14:10:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=p8bYlVicQX60f75L1bnEUO3IOESeVNSC3YS+Zx2A1Tk=; b=a0+PAvCLqVGO12lOtnY6YW3evh7AjfNdXSQ7u0q5uAOIfsDhEgFpubv7UU9IjkTmIRyg kOOLHptlyObOO2cdV3wLNglmqov4t4B40YpD69xJ+ivQbaeNFa4VW9DG89ux1tsA6bgN aJZdGvT9qGPanvuoO7IIDszI4Y/FKvmaXhTWUZFeae7ojH2I2WBIXsGduv7+QPkFmLhF 7kBBmSyKcTKAEGXnGftTZkQD0OeM+ro6OjbvEBZa2FMqc3MMTCe6otDJobh9iOnyuquw 3bjbxc1t8ZRbHLCsdCCrx9x5OpkBzAUDf3GAsCnX6ftZKqVD4r+XcoGzGxrngZwXVb78 rw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q484undrh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:27 +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 33PDSKCP007654; Tue, 25 Apr 2023 14:10:26 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2177.outbound.protection.outlook.com [104.47.57.177]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616gcp7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=huN2vwlftAx7dUnrkHJxW8vADu/kqzmgrXdeYubBGPpDbB0AfeLxFC788CMs0u2Tyzz7wopY/kSBEo2Shr2WeHL5rM7SizoaWSuIuefGLbp0JbcIDi7IUBNzuhmcsrEhkQ9UQwRprfoTC3zNo8xNQAs7Ppl68IfLjCR9NpLfRtd7jpzAUBwCBGPo5zAp6keLhwQbOfNRgqXyMH+8bHxpzWiNGIf6XzdElMXedyRyVvzU4RHqCg45pLsDN43QHi+VBFmax/9vAsQnF7bn9FLK2q+19T1Du4ausG6Np9nzRThb/GVDwzF+GEJsj0oNHC/hzKZmLbEL6jNg6tuKDoerVQ== 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=p8bYlVicQX60f75L1bnEUO3IOESeVNSC3YS+Zx2A1Tk=; b=LzlbIagqO8CNwzO9e7cYDHi3e+Usey20RFwlHWehuWfniYnHDxbZWAqP1nQSgrq3bELFc9vBl+EcAFOKDVQfMTkB9FZ53AsCljhyEW275Z1BJE0u+u18nAT875L4A/AriRqLwDOY05ktamgn6XXjltEHE2VY1fpqdpTT8yzm21mlf8/UUK6oEADXiThw4btEw2UQmHmREtXDPs86N40Xm3pP3pzQh116CWy7W5HNrA1Xu2xGMb6iuJH4lzCuxwQLKrzUmglSx9F963V9X9fPkvoRnOchPTj27/2GDEjCblohFrb8z3r9N1sWSCalHyQXHoYIa5QLMic4Tz+P+qfvAQ== 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=p8bYlVicQX60f75L1bnEUO3IOESeVNSC3YS+Zx2A1Tk=; b=mVmyAEmIdO3bhQ+uziC8cS+XIeanSbjiVDZzMSeZQTWqJgu56qV5xfTYaGKxutz1VCkkbEhacFDxS+MNqF0JJhFAZX9HEz1gEGJNSJ2X5ZI9saSXsma/ZIbXSRRsQj4N5A7o5l6nCJRN/mwE+Sp2GH9W50ld15eMl78PU8tiyx4= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by PH7PR10MB6081.namprd10.prod.outlook.com (2603:10b6:510:1fb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:10:24 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:10:24 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" , Wei Yang , "Liam R . Howlett" Subject: [PATCH 02/34] maple_tree: Clean up mas_parent_enum() Date: Tue, 25 Apr 2023 10:09:23 -0400 Message-Id: <20230425140955.3834476-3-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0108.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:85::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_|PH7PR10MB6081:EE_ X-MS-Office365-Filtering-Correlation-Id: c9f6cae1-1b02-44ad-540d-08db4596d010 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NvmkUF+okBTuFvhmt1zxExWSbMZVI3hSg5z6PlRwAlYMXp8bR9M6C54PQ3l8YJeYt4gdvIkuRWSeChLS0bgrx4kbRzTmvYWG5vk5NZPa36xzjo6v5Sw74eSvhetvYOpF8ayEk9fBtD1fRWo7YuXXqhPqw3Q9PCKH0eZLRxxmEa+eTZUyTVeYEBHDeUn0cqynjtELmGANfMcFCTrrjiieTWot989M2BNmQFcVwcbXwVJwG6V9nAnihMAZmhjblC8+vA5toWNIQn9rzhR6PjhhhoKLtEUUkvUQIk58wPqzDMTFjTvEvT/H3YK0OxfWpfQWfje6f9qzZcdcAmam3qZyBZojzp4kIcvbOmsNvfYgrbkSKKvU5ihlwNY2QSruIo0/sykj/RpJoOG6Yi7w8np8Y3AFn0q5TnUQ32vGStxNrp2rH8V3anoCqjSKYhcYDc1aEmavKq+HyUH6H0ERD+Qi729BE6/tBcG2qLSI9a8qi7wfDfA+/oiXmmQv0cyARDdrlQyxACE9oiw36Xw5JidvoZ6jze+VV7TaTdmYNL2Dxl86XwOrgOnBoFjmHS3MgSZY 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)(396003)(39860400002)(366004)(346002)(376002)(451199021)(2906002)(66476007)(66556008)(66946007)(6916009)(4326008)(316002)(5660300002)(8936002)(8676002)(41300700001)(36756003)(86362001)(186003)(26005)(6512007)(1076003)(107886003)(38100700002)(478600001)(6486002)(83380400001)(2616005)(6506007)(54906003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7zwgsBbXTWSrlWtkl+jeiZ/gHTyoOpLFRDRL/Kg9t5qdZ3W4wM7UuChET+EaapbzxZKXXTAIrouHbgdXimW/QhCkhDUA9JdetqNiKNdiwq1/C2s09KzsAfpKfOT2WLlIG7MFAw0LjuK2hLG05z/p76Dh+J9sPRFWdEiq5SWZfyp7zYCPLdfz9YW5eOI3pLQWqN5rMhmjsdigM5Wd4IJR6/Cj4vMLya2kaBLs7Vw9mt8TX0RRe2qEGeAldzJBX1z1YEdn8qwfciMJzqwFCcO+/TygJWfnGCzXASk90UzGspteGzp0B+eyLkqf0ZsXDiEhXHCb46tMRtgApp7+PHZIq4ePqHVaWssGbTk61SefzVwIKkQxoQC+HHvcHM5OyNCsjXqNQXy0NZJDmHh81f9/4AmBGaWFnZYtXOjbRlhHwavaJ8t0bOkRqt/byUwcCQmoVy6Hbja32GM0zZffJ6RnvavSsPyhXiWS2LpTGQjhoa+GKk962GKDfEapuWq8bJFiqzZndadNahLrUl9VMlIGmR2HXtLxXJKYkn5GTeHk3XWqF4lNJlYUnKY7KjqZ6lgye5CDA9bNFJccVPJTdBZ2fK6LPj53PggjQ13JkIIeNrbZ2lIZsTiR7RoijkG8roEbMOEhRlshpvwlheuuE7mVmxaFnGZc3OsHqdXzQyXniaP/C3tlaWW0flIoiAcfElxXph5sd8pdhT/F8+8577ZLVaJVboT8byJYodP5P1ABwWQ/ODpidpvXp76/xAVyuzpcIQ9C1e9cFoT014qvn1lSuNDAcC7gCAzAf1z3pZvVRLa8524a2tOnXr0QamkG0fpblRocsWap0U9qAvAzjAo2qAiWO+ngATv7m7Qmt1/HPJ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BfXT+vYwYhlZhU1x+HTrrDIkUjYdIVrSMb0kVtLjAl83nhIj3JNd5Mi4xAq1xWhiA61FG7NBMMuU26g1GXIKf/mB0lDNrsAGbPq7ydqfSREDb7HeXkdvPRuLFf03pOK3aRquaAjmThswcyrsRnNcgAnf/BNN5PUY4QD2pm/5DZb/JelbtlFmkcf3PnW6bNrI1PGPUwNoaRzd6vDTtXFkSLB0lbIXIipncPCuOl5UNmXjumcTjjNdafojDaS4K657YRu8SId8dHolZgGxiJ0n0iWWtyfHoiE503Ypzaew87kcl37C1uWooItxJP5Xq6jZseovkllZDdmaUxPlR8ZAQDNmYawJqJrisaTNGzj44Bcz8iqmz5ped53WZaM3vbw+4ubM5ZqOcjw5NegjYs+tP2s/+dvFDFH3c4la0sATd3a5bbfVQEE4uHOBSiSMZRm081L6v3LXLUUj2t9h5N1Hro1vnF3cYDe/0nCfHfg0F7NpY7BT1K+XwGkCL2Fcd2nXD2tHlhWYtrUMc3DDxq7NdTfWTCe7DLh6lS0vrzvvahZyxkof4bgkQlquMJntChF0jtJ3sjZlwy5pmwpwNCJZFoy0CxK8lPBwizGr20pHacvZnrDxLYGeanvE/Mkpig+TnHfSO0QnS4s7kUNcvQsViW77dUhCHALkwsiexhI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9f6cae1-1b02-44ad-540d-08db4596d010 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:10:24.1920 (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: ALcmypgBA/367MnkhrdBJA1PxQuU12uRnhlt5kzYAbjVCwyjaThEaNtcavaZgFY7eyRMcMc8Mf1YfkEbv/YvBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6081 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: bptD89mFRTTn4pZQYcbisEMX_Wg-6fqM X-Proofpoint-ORIG-GUID: bptD89mFRTTn4pZQYcbisEMX_Wg-6fqM X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 55EF81C0007 X-Rspam-User: X-Stat-Signature: cbeu766ytr5puecsnh8y4ki7xz6g7pzp X-HE-Tag: 1682431830-341389 X-HE-Meta: U2FsdGVkX1/9wWySLlgnAshZ+3v98GnXP2VdyqTl03W1LGnQ2Hs3AVkncY33gPyM4IqdVOkbd0JhE/OM4UBdmzpTAf8UYCAJoOY7k2+VBXLV2y/2yKSPuxuOtT69+9D1BZsT/iaxUP7dlj+wvNHYQ1eIMrwoYw5aILCiY8ovmA0OxVAIGgh6l2moXC+PgfTbdW/rycbkAHFMJh8Q59/r/ZbiRpQGH4WMJ+DLRe92J3ETCwW6GHVCAOdKsTz74GjD+sBSrbpulbVGKNHWJ56Kv8yY8GTIs4XNUxxjHafUHR9l9sb0W49lXMXBc4sktumk9YuCsIAZOh4034fGT2Yv7E8CVa9lBwv8rMpspwLxF+nu+d6XPwcIlmMDLYf1yWpegwipJFunvnYNImJlbT5LOrEzNIFUnGeVuVMZub828GNyC9icoOLAvNLyuemSYjkwKPKrEL0ZufUaELch1oZquVrQNlVZWBdAwNKafM42ohgIbKC7qMI8Voe6dBEPTS+OZR7piEMJ4ckSm2kxHNFQWPXq90HIqqTkn0dgQhJINt6/yQKq6Sebi7dkFmRfmetFmatP6tJysVe9z/1GdhugWKb9l/Q4ntSaeGY0evMvv61A0UwPGoYooSerckiAgyHFQY1312n7gcHf6CS2bVG15tK87I2Cvy3p2nJJk3FyssCnvEGdGodt6ar/78ZK64V909HQArJgWPGYH9ByM4Nt5UyHenN/qsvtdE33Ese8ccmm9J2WlqHEkgrIFKjhS37ljqDF51UxrbKtUg1SldilXX3+A7MDOWR/FZn5a+dwbVpqWCc+KuhqlfvxBefLC2CrELBdcR4EhEP5PmnlB64IP8UvmPnDHd4FDo0spD/BlVs9/SiwY1OqJ3rNdwldAnENNJu/Iev0kBrip0+UkDZNmXkO/5lkA2KKU5wuDUTdCF0j9yiP47knM/ZEBnkF3zsfWzvfJCcY1Qf/qiMp7Jx 96R5cEg2 O6yhc5/WOzduoZM8KAO3TD8oYY2QbTSoNLu96IdZPgn9aPMrGXUvYAa3kI29tf6a/hfg/Wqbwdft5K5dfZ8EVr5Y7UcCV7+7R+UYwEA3qCO+f3YDc3akEvxr5YyB/VqfA+3rTa++SkoEnJZ9X1R3V1ZvZBE6fgJOXXjdtVwRLlREmBoW7WdJtzGRbJNMToyJGxAKzZDcQj3PXEjTrGyCLgcHmlZO+uWHEWdZShfy95NHTBvDLYt1cYlCe3chcXWukOL/yQtK7bakEV23D+zpuc/5ktqTc7GnstXUhwXFTCqZ211GzfKk2GYy8H77X3Wpc6UAfC2QHCSGsjO89D94DlcvH8xVpK8JEQhDzqjPUSlGWS8zOpmzUbRMQVs+3SasMgrCNacPSn3+l6FFWTHN2o3//E3OZOFAPrmkjKWbUCJfS9n6Wo6dnOGxyt9f1CNMnJuSLKO2k2DFOSJyBH8kx1SIsL0NV4QLb+SgyING9onqHnJC94ONjZBZfRPwuTjs7Bwba+9N1js/WCp4= 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. Reported-by: Wei Yang Signed-off-by: Liam R. Howlett Reviewed-by: Wei Yang --- lib/maple_tree.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 9cf4fca42310c..ac0245dd88dad 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -428,25 +428,23 @@ static inline unsigned long mte_parent_slot_mask(unsigned long parent) * mas_parent_enum() - 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_enum(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. @@ -7008,14 +7000,16 @@ 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_enum(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 Tue Apr 25 14:09: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: 13223372 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 227DBC6FD18 for ; Tue, 25 Apr 2023 14:10:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4320D6B0078; Tue, 25 Apr 2023 10:10:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E0DE6B007B; Tue, 25 Apr 2023 10:10:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1E7D56B007D; Tue, 25 Apr 2023 10:10:35 -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 109006B0078 for ; Tue, 25 Apr 2023 10:10:35 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id D98598010D for ; Tue, 25 Apr 2023 14:10:34 +0000 (UTC) X-FDA: 80720098788.08.D970229 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf02.hostedemail.com (Postfix) with ESMTP id 6D6EB80024 for ; Tue, 25 Apr 2023 14:10:30 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=ANGz8p4D; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Ya+RUGa3; dmarc=pass (policy=none) header.from=oracle.com; 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") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1682431830; 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=S1JH+3ln71WmML3vmtjGYSigdHsRHRx6Zm7HZXEzXVE=; b=aom86HSJRbxN1VIPr/VzZUHvh06VdfqylZoQG+mS0xeLYAwJW7YeQ+U+tfzCoaEH2cCqjr IbPgWhANZO6RAZma6uF5PcZj2CENCJUU8rWp3OlQn3l7r/JF3QzdX/kNtm1yaBjsI98G9B m+7urypEwVl8tS0KlONFjeE7UoeNy1o= ARC-Authentication-Results: i=2; imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=ANGz8p4D; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Ya+RUGa3; dmarc=pass (policy=none) header.from=oracle.com; 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") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431830; a=rsa-sha256; cv=pass; b=IHOSaLq+gp7RNZk1ttP4moP5Q4HPU38/84yP8/e8BXvlxvhBJAcw5CvgCDHXKnoghgf2g1 9j4Rp6nK9W5c3AGEBl2qzklSZfrOKV6tEdkG0Qni9lDf2jX/adxua37RIa6BRXAnaaUuwf raeHOiBMyun9w+FeWouEH3/PXQe98ps= 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 33PDi75d024299; Tue, 25 Apr 2023 14:10:29 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=S1JH+3ln71WmML3vmtjGYSigdHsRHRx6Zm7HZXEzXVE=; b=ANGz8p4DnPINu7jJetT1Bt/GrvETIyOpIGZrZVHQTDsoPDuE9hoA7ICn3MpC8PhdHIxK TZJ1wtnKzwUU5PaPz01bqTkOhecNQlho7D/unhpiIQSIwAb/YTMvEFzJva4rMGvOzbXt pYskYa1US/vjiVEKHgNecV6HkElfS8MDyAQF27qmU/CoVwi54oR+6KfMER2XfkO1N9B9 e3VX3uvTQLedIEfZdEklpHzhWa6ufT/MF+9H18K01SYOxDfrYda69thCjaOX8O1cNNqC E/zy08vA4+ZEQTpgm8tt5tvDX8G65gh/6taUHqKDCzAL82y/pmZ1Orredowt3fOGytga vw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q46c45ftn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:29 +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 33PE6WY3024885; Tue, 25 Apr 2023 14:10:28 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3q461crb72-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CXPH+xtRDKSQAcA7yVmH/2IlsHcFFtyhPievjCukigTKvBEG49aXHHsrCTTnPwjr4wbNwIAyBT1Y6YpQL+RfEw5O7hGrOFExCW8HB0ri6fkZ4D4qQE/65t9Rw25FV97S3S0nopq3TF4xo/EOlBEw3Gyiy7YKytEoFXOnmbt7TE6CfyP/1GY4f58y/MCcJtt115+PSKaOEu0hURbgtOTIiPZ5ffBt3cEoYY9lUZrXBHzknUTAP0HaYWxfUEB1umLiyXlj+4NfLsjtM3xcXTTJRb4w8fs51dy5eZ8J+CaBGeXXK7F3UVkImBoIcrnGOWM0aEeMRnrLLJmZSGUF+CeswQ== 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=S1JH+3ln71WmML3vmtjGYSigdHsRHRx6Zm7HZXEzXVE=; b=herTiNqlPbDyiXELaTU0NUQujSgN6+mrv5DsH23+JrQUaHN0vB+i2QUXxteZdaMhedcmw8gqhmL/vlPKRO+lVeTXS2PORZEUoxhs4Q69ToBlQdut6S4vqOEduE4h7cru9cjGhtq/vtfknEBjtX99qL14z2Fg7qFxZiunR8LC+sKMFEXw7Pa3NMleCKsPOxZQVP6Gqwft7PhDwB6e1Rs+FzTXr2J27gw5kufK+C458ONgGZ2Lgy0tb7GfV+ed7+yYQhguREhu+uQ4/fXRQH4z/AYStnc8atFc1OOL8C00KDIDIfo3oktvUhpI7mlXbd21ER0WyqJZcapg2gznigTZrg== 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=S1JH+3ln71WmML3vmtjGYSigdHsRHRx6Zm7HZXEzXVE=; b=Ya+RUGa31znEW6TsQACf4GDXT7YyooXMTM7DCY4/J3poSyKxaJ4P39/5JUmb1tWJmGzt78UH4sY4TQcNMHbo/3Wi033i34Yros47SAoRVKwFzb5gE1OQvB7oznyNZWQgiGH0ermvW6ni6cn20cnf0H0kUS+5oznSvNtYeaWvu60= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by PH7PR10MB6081.namprd10.prod.outlook.com (2603:10b6:510:1fb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:10:27 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:10:26 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 03/34] maple_tree: Avoid unnecessary ascending Date: Tue, 25 Apr 2023 10:09:24 -0400 Message-Id: <20230425140955.3834476-4-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0107.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:85::20) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|PH7PR10MB6081:EE_ X-MS-Office365-Filtering-Correlation-Id: a81f3f01-5c29-4e68-75df-08db4596d19e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GG4wsptvSoMON9GaSjPnDm+U+ikYoZ3QdAYd/oG9W7GH+rT1gxVoBS2kI6P75i6ZJDGOC6Q9Cy6znpwGiSf5MG6vLlrPaq8dgUBB/pqsqGqidlsyYXEJCOVezwvP7cNX42i0N8cq7t146iwZqbA+kFvwW3wjcztu+FynijfQUNvNkNUUWJKCJoDZvNBrAYDg0G8+0MruRmrU3m/uQGapkWB7KkwnVbRkmhXOJWFg1PX+8TbawENFvz/DWfo4vnPzmI35rxcPT6XJDa37GBSvYM7kmWqf415MPt5v9sGrPUI0/omNOYs/2/A7dhQAbG4Xmx7R8pQo9mZxijulcMbQEMUINh+hLGQBgdH9pLmxJ51zmTELdiyBtdSpkzYp+Wx6w9H28EOakNbqvD3CSrpzgppwpLQDeJeBfLC0VK2RE5P79P/frgMYw3DgCUb4fjVUllrM6G25w/tqjs4LnSraXKU92N92dZK5q0Ranyhp30LOONRdA+sAc5DuoTKU1cUiHPKybTf/hkhrONiQZD4RTENK1ucC7OuloDbWe2LEClrtIXg2hGpJPxPVkkoXPTP9 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)(396003)(39860400002)(366004)(346002)(376002)(451199021)(2906002)(66476007)(66556008)(66946007)(6916009)(4326008)(316002)(5660300002)(8936002)(8676002)(41300700001)(36756003)(86362001)(186003)(26005)(6512007)(1076003)(107886003)(38100700002)(478600001)(6486002)(83380400001)(2616005)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: b91YwAQ5UuSY5cCNYnNGJ25TspR5uZP2C70DZrJXyw12r/10Zw5TVplMg8sFB/o+ctZwDAmme9rqBF8pOZaMCdrM2TfaDmcoXFa9YOGubQib/Kuk61l/rciEJvLQV+zybIjqk1Fkpp9LP3pssEkcldL0CPDuFjJpADf/YeWgO4vGkswk/BWktSYzxfG2KibT5Kn3uLIJzvVgbUi1wXd11MrnwrczAXQgxuS7ci8jMhYzeEsGJI2rmQTPntxl0NegDR16/IMNdwivPMxW1q3A4V+YAkGlgktPV8weLG844ruEdDhmap2/DucfnonorgMFtD42U7m4sX7Le74n7TSbwU51j7NtJXlrqaops5/P7gC+TCwf+FIr09dwICoukn/+k1q6dygccPKT3cPSedOMZPTAaMMu0Sv9aihZ40xeG+HPloh+mozKECT2CYKUdH36hrkhUzVzn2WIbECRebWAmfn8VV53YM9zYXX8N9btCThVKw3PgI+8BzX4kl78J5C9iXKgvZraj5Lg4/22aLyZ/PkJEtTPcw2POmn4otwyq2ko7mCJlXliKWhIv97TdArhSyF0vzQEScrfqDBY9x3cwnv8ucKe9M9D1JUVTak5yubJCzecTIznS7oJCp9Jkpg04Kloy9qCcslTUzPTIn1pU2UPibeGeiolIQa9LAAbns+KYiY4/zkJbVQd9q/41psjSSL6KHKyG/wYIOH6LhKoaGFz4vW9tSaGVK8LRjpu9qGxEZsrFSakl+P84DiRKEkP9DqKOE3SK9Z6dOa1CUHh40NykY1dHtOAGV5qqPUGxBcdtnav24BFIMocmfFwX+qGJ868K5JuGeqw+bouW3LxaqTnRsWsv9KGgoICGGUSf3fjidqpJiCypdMemO8222yIz1F4ztuK1rC3bKwS3XkK0h5h83GR0cC2h4oNcwcrALdMhU9o/qsqlGjCpTiVPcnzdrAe+nH4NRdF59NxQZiYjK3AmtYm2QsdF4NqTvRCMCQeKBaa6hpeU/ZrF8Yc41l/14ucSl+tRIpIjS3r8erzgbd6LHXpvoG+La9IsBJPhjz07npXhJs7VwSS0fXrWqoK38dHE3fdTCQsEA3KWAfh9WuelAFrst7yCEI27wiIRaiJ3xemLJ9TlcDryefKqmebMAfiu7yKVxj4/Ty7oO0wsQvNJf6FekQRg9o27xe921SI+Vjz7UStleXITk+ygKP6ugdS3Qclx9wo9Ua7KC2xH68ha3xMxMEBQ9kdt5LIRDnl52j8dpiKNh4UDVofAUgx0BxOYOd80pXi77BJmNJmsPmuWI3ANt0Fkqow3zwMJ3/ggcfxq0JiMuf9fTaKGZowHvQzX4n1aJvxKOy5gXha/uIowCnE9la4j9GKtIpn4xPqQUAzV5QrDjAwWz2hLflxD4njgNaGzljwPyPKBRvuFtvRNqxeVVifPJQMW/NNN02pMrUKr/o7zvY8ByVAWX5KKoeVftB7svCHlHrE7j4MLGJRuFyHLdoPoCOBaOM4om/isHT9g04lLgUi3eFflE722t56wweRCytbEK4GkJH3M31aeMJ1HOQi6IOkx/mDlpcHP8bZHj/sMjlpnfg1JFFdO2smPMn+TPZBxvAGQ7u92Q== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: gIHCGXUnHjmKk/Jb2mlDnzO+CheBkKU57YISaWftZv5UaZS84pjgZVydw/WnRtXP6RR9WgQs8IFNme4YodVKCFYDmkc5GoYAmWskuHqjjccdLrBTtrjtRNn/K7Rcpg9DubJRZlM/PfVZhSJ2UorSQY8B3hRliSGGYun6DwWsZba7nIVuM0KN/lFQKzLwcyQrVPWCt1GSLK30W/LRPl9vDeaKNHGrK/pyfffu6A0Yo9JEJUKsxlRNgC2/JO97t2FaZrmAR+T+Z+TQvv6bEua3xY/L8iNRSaflrx3kkpvHcLgs+pod1MDgYOUJP2ct2+dO8QSXXGjv9IqlytzKeSD8nNRgYFOBzxIIX+Go7kPIECq8K9Gc95QnV8+s2joEwW8cCwKpvUVp9aKZTNrBjM/r+8P76YcAxh6T8GnebDO9vKGjL8zASVepCXCxsu4krMkpQ6vDV7gAi4m+fx0sMTVpHuAMYwbdmpn4q0sSQ5HetKVrJnGXa2bWS6hk+l66A84EUrVA/qeKZqzoVy5GytiwzYp0Nt8FPmQmEQ/hmWz/4ziiyRa/z69Tfxe1KgCjwoCRMCXLrEJpGyUxo3mwOOUJfdjZ12ka7l60FcCDzGNjZWGNirdVqkm+Vx+3rRZ2N7GQpf+p+VuFMT5E1jEdPo2nJtHDVPe21SUTrqtN7tylYZgCXtfe0w4mSMmNnCyS9DtXJA3Aos9aOsvvDphBUIoQPpYOUYSB0iPyJwIORDhPx/PVCmFDs36FDTgfn8VLh43HQIr0cmU5KaLxQbtjdqexv2Tty3YMfr76xysc+n1fDMbBYPGLbGZ8PMF3hJImQuSH1CdzwqNCo5JsGszZB7gX0hHboGJVkQY2ZpKltslBLG/fKr3/DUIE2Po8WVIGtE6hgBv83LvIGwCDNKn63n+pNg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a81f3f01-5c29-4e68-75df-08db4596d19e X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:10:26.8503 (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: bJRBxFBekFYI57r1Perx/IMNDMbRE4Hwi2hAAN+fufLhyzINPTp4KpDzU1i26itHvQXPN5TGB8+7yZjx0F+bQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6081 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: V4HQp_Vg_rE5oW5qzKzDHo32QKjSFKXn X-Proofpoint-ORIG-GUID: V4HQp_Vg_rE5oW5qzKzDHo32QKjSFKXn X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 6D6EB80024 X-Stat-Signature: i6p4qt153dp1ki3sob19rxkkuopzf57n X-HE-Tag: 1682431830-340822 X-HE-Meta: U2FsdGVkX1+toBFx0dnis0ZbpQ3PH4+RKxeHcNvny4lHwWp6Kr3alax6GXWxFPingf/mUCkFZLo3V+JxR+fR7W9V0Z+DGZvxEWoIDrSXwrCp0TG8T9TaDgxqdu+7DLIkGZC+W2xqPd2yQXipWWgNPcqjXzNYdf2IryQwKnaMTbIDnna5uJFvBPCDzK/ePXtfhoI2tTw0GzGekQxYJIac/kAZmYGYWhyj24Rbh8Fz6e3UcIsfGnejRoQYSpcPlTL/0k/lkJwgxB1vWokbN3Ec1OSjqmGVfK9PJD/sHdIyXVYwu5cOQshYu633nFJtyqa/Oq0H0FJj6oBM4gAcv7iDcU8d6/7nZU1vzUf+UoTOaOGHmvVY1txU5u0hBBU8u/9uPTaEijIk5g0NjNXzKFZbkhffmSiZxtu4hNFgDLzhrKDEb9OTmcilDjPJ1JknDtJmHTtx7lldD7KRi8VLwvugr2rWkyeLX7qusVJ/FLO0iSRI1NLozuMgFMJgL5Y4J/3hfwvgP2EZkvrAeprWPAr+Jx+jl+LQByjXjVd6XdKlWyFqjhUGNbCYcL9RUVveJW0z10xFAO063H1Hw+YDChjlLX4TSPGCLUFtS8LsIUPn2hArD9x2v3i1/GuRculZBIgditvzV1M47/emixURDVk1kzi46JSQU1U0y6d84kKsL6hx2eG/LqsIyNaJkGcQKynhBNqOlgKn/TNVJeEErTFixGCEU+q+x4YbqLmOgj4uq2opziH7TJF9gXkm9wseGfZh4fgGBB5nJ4edRPZvgY+jfEF/cDgF7aNNHXSs39aCmrRh6heUTnZqO8UQUDmMPaxihsPCumLf+PYRg7qRVbUq23Cqy0S0oAsILcmVj1fy5ZyBjKMejZBkTxuRyERrmMmf5wnPgZ1Fw2bb9+WdH8yanBsi7x1ba7hP128Lbm+fJQNIh8+nFGr+pj16YMNdpfBd5kCUWt8i4d3ENSC2pQB 4eBhp+oe uOF7dtDlqMeE6EWOOG1mDI6yxH7Ul3hJB93njllZ6cqw571EnMq3kLAM5S8w19zxMmdjHJoKMqTyCs10h90zL9kiOgh2EJZNmKOp+jqdywf4lgpkqCxnfvWR9L0rgWuC393UPoDSJ35CeLXuta/y4xrfQJA/pUh50zqVUu4v22EEedLgnUW8PyO/wOh3ljw/H1sM2cwyDSElYFtzp0GkE1Tn1L1vaFoO8naU+MQ4g7Vp5uzCRn0yOuJBWZ/1LvzffbE2+k5iPoSpvZHI9WxQOrwE9UdHaLqGnl1ks8VLFSRE4/PmTK3CsE/u0BK8MOBZBinl+GUXNTVcHvNKCS6Y95BeGKNcqEOgIfL2I/I//X4tOOLHOVb/lJUSkCdlSsj0wEgGW/zc/w3599Zp2qobjmLNs5jwbtRXVroLgVeeExdnhJ2I= 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 | 6 ++++++ tools/testing/radix-tree/maple.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index ac0245dd88dad..60bae5be008a6 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1132,6 +1132,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 9286d3baa12d6..75df543e019c9 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 Tue Apr 25 14:09: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: 13223373 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 3C562C6FD18 for ; Tue, 25 Apr 2023 14:10:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D0AA46B007B; Tue, 25 Apr 2023 10:10:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CBB8B6B007D; Tue, 25 Apr 2023 10:10:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AE8836B007E; Tue, 25 Apr 2023 10:10:36 -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 98C476B007B for ; Tue, 25 Apr 2023 10:10:36 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 59513AC906 for ; Tue, 25 Apr 2023 14:10:36 +0000 (UTC) X-FDA: 80720098872.22.3BBB3C0 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf21.hostedemail.com (Postfix) with ESMTP id 06DD41C0011 for ; Tue, 25 Apr 2023 14:10:32 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="e8KX9c0/"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=UBfHVgDg; 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; 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=1682431833; 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=hnIf8rM9FwgxfifBfgv8ptwUanorf+NhjcYAJVOIWxg=; b=2capRBwF35NLS8Hu854HP1OLhALjJhJewwZPT7kzvW01CmmDG/L6zx2o3HusPogh5GVAlE Igpeor8YldYSI+BkKZOdDvZ+AVKSjfUXI/Jrnt4VWEbmBk0xp6aiEjSGMpSVsK/aECEh9y Ept35dO6gCdFFEz0s38/REXrRM72wb4= ARC-Authentication-Results: i=2; imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="e8KX9c0/"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=UBfHVgDg; 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; dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431833; a=rsa-sha256; cv=pass; b=XIc1IxWLVwfGuVeqFXStc4FMo2ji3QrnQ92UeTJc8u3Y5nAZoeDrACsCURMLaC8OAeESYA Pc+84zYQU3LqCuHWSKmPRy4QSaetXy6TE+EOSI6zKnOF+bMYSL1eoY0JL0nSV9r2xruJKs pXWD0nkZ/XtUExOszJnF4IrO3B3aqr0= 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 33PDi1SK008675; Tue, 25 Apr 2023 14:10:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=hnIf8rM9FwgxfifBfgv8ptwUanorf+NhjcYAJVOIWxg=; b=e8KX9c0/gOqqHLZHmn926OWJ4lRQQjDQDiLmL883PG3T59LQJtqBF++mFfLQ/GqpkhGy euSZiqIph9Z763XLyN4wXN+Z714veYNsA77RXTw0xBL+9M2SjZMCJBHMIA6mGF+qBBA3 +lQI0GeU3H3WzBLkM+iyxUMnRpAVNWy9lVFrFrT5qm9zldiTS6NNLz/AgE5SuAcpd6nY RB4V/N9YqIwpoYP82mXZtVWsfgCQV5Gpjm1Og3SsQKX8ELrmodpd16xigShXE2bcVGQ+ 8VADI/46h8mcUOKOpPzCe4o187AgnJOQmuOEYIYJpsUD9EC4q0NmoxsoZtSVc90Z+3M7 aw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q460d5e3g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:31 +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 33PDmQnF024975; Tue, 25 Apr 2023 14:10:31 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2174.outbound.protection.outlook.com [104.47.57.174]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3q461crb9q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CL/Ex5UXRL0RitVuIHkSmY9Q/YPhbyyBaW8J8lfLvniu4m7E0AGIXZiuCAo86dBGBQi5KFneJy0eT+z90vwH3tgO+diK4BjpcT1QqClphqZWx59R0+RzIvUYZ2EHnCskvuKSdQHZfH1I7UpH8pYPN8KgEIeGdyZf3vaF0qY0hmeRIjrIvlAQpdFieu5S1WF7EM6DZEoipQEkDsh2R+drnf+G5l/HrLuwc0lDLns3zRh0gBporIPgh90caaO9UJ9Ggc3YHQc78ZhDzz2nV/TAk96YGTp/FZoEMKvN88YtIQS5HheYNvBl2DQwmAjaI1/Mwbbduwbn19FBYi1gEAtiCA== 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=hnIf8rM9FwgxfifBfgv8ptwUanorf+NhjcYAJVOIWxg=; b=col8EehAXIZEUyzzPH4M9BG4GLm4C/xarTZzoXSEj24Mffa93BQPTeg5IVlEocgNN1ONuyD9Yf3R4FZ1QKdBxTrnXDyEVUaetET6PXWVhswwmLm6EsUm8sN5upccZ8eYsf6TtRoPvRNdLp6iNKLRza7YoG37wA1O3oHu9q0hWFIz1LK9aMeiMCuTEzzXR+C/ZwO3XMnmB4EkTOiD79qAXULEMrMF6QLjHyITYjiyDP7oU9gT16nZURLQSacTgzHaqJZA3KcdTHWfYY8bl/EirLT+RO67sEIeOqbX185QlJvwPEDDN0mqzbYbFPoEK7Vz88VXKHWRkBSY+JQl7+o+QQ== 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=hnIf8rM9FwgxfifBfgv8ptwUanorf+NhjcYAJVOIWxg=; b=UBfHVgDgb5s59gRxvDLBdEUYoCPrlj8dzfx/RzKxIGr6H2314vAJSofuvytQ9Jyk6+gDaIxQ5r0dySiMufJnLR0O8iK+TKovsiFKb1mwwBI3MdfWO3CzJSmt1qUZ7MVMO/5l2HEb1HfgwZXY6qxL65fNGoANZj8/pbVtAQIt9sw= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by PH7PR10MB6081.namprd10.prod.outlook.com (2603:10b6:510:1fb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:10:29 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:10:29 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 04/34] maple_tree: Clean up mas_dfs_postorder() Date: Tue, 25 Apr 2023 10:09:25 -0400 Message-Id: <20230425140955.3834476-5-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0010.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d1::17) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|PH7PR10MB6081:EE_ X-MS-Office365-Filtering-Correlation-Id: bedcb2c7-8e45-4c4c-e780-08db4596d31b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HGz5brbAfEGjFh80UAcD51aj3SSgTAVCCPnv7m6n0spcwjtzSup1SwDGYlN1rwUhwL0DrwWbcUhPZu0XsdA1MJm30FnqUvKTWQM4/zA6t45JL6lDXgsuOo8ogy8zZMvy3NK5YX9RqBdIG+Dbzjzan+U+BvjTbdhvKW/iG+W99q8U0vRWD6zCvd03ugDjuvYxCO3htukCyaGp7Qzcmg0B38dGsqme6nrKiIDse1LxieGksJC5Ni7GzjJ+NFG/7W1f6d0srn8aY2onwuz+RRHCw1O7KoCseHTT8uuzc57YDKaZM6wQYYTd7NokOzuHjixEewBAdO6qEo+ivFYiOZLvefxGnVEjZjIQgaON5S8Lqq64dhq877SQNWqukf1Zw3QKCP3nE2uZcDotla4AM7OnFsx2FsdIKbMYOIH6RGK7k3r8CJWuzzOuGKLGUKF1tpD8wekBZbOocKpZ1P2UVzyZS6zlIUiHkJI9lKr5PHWbAvRMBglDtRL/k27P6+62vzLA3MMSr4nTJhX2d/ZmRtKZP/43sQyilio9wCDataEMPyWCBhEa6X9IhhK/+AmGFNPD 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)(396003)(39860400002)(366004)(346002)(376002)(451199021)(4744005)(2906002)(66476007)(66556008)(66946007)(6916009)(4326008)(316002)(5660300002)(8936002)(8676002)(41300700001)(36756003)(86362001)(186003)(26005)(6512007)(1076003)(107886003)(38100700002)(478600001)(6666004)(6486002)(83380400001)(2616005)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kxyCAtx+u8Db1QzuDyL7Br5xmwLX4sHD4G3d2HZSQLaYaDDyOrGg6V2cRKhklnZlOPV3391M9G7AaCiA/6Tu4EYAqXVAj7vt+JncbrBKfXqS4dpqkEFzfyEQXqB8JvSFryYlliBQVDaaP9bllRC1Rn+pvNbN4cJSOC8UnCISSrDHWDs+9ZyAWrFgDHjZc25DhSbsIqjbg1JWX9VpoYeAQ+vSITxb38cyEwzACPyPKGM0MEnVs6sPU9iTSxHY8Z5bJwB0P6kjDWXYMFNFlGfg/ENyXj73VGWZGMdG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HptWIs1P/cF7p+uMTIVT9IUi2E+hTO3T027yskvxzmiZKAbUJ8MecuujyP5v8T6w5/lOWq4bRIfr9DynqEAmFp0fpT783fIkV1qfzmi7QXLYOyVfRn3Mrst2lDdvIDOGSqYDycmZCvTtWwP0Zm+wucqI2jXBrLuycQdH9d/WGIyTWcUkw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: bedcb2c7-8e45-4c4c-e780-08db4596d31b X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:10:29.3438 (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: 1x/9hgqpXCuPycVrWTFYungAKfTGUMHhm+bHlta51dPidddZwVsTIVK1pF4Y0EB0+GGo629QhVF6dUEjCtRWYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6081 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: SL-jpWtxVeWocq1cX4LrM9CCghPJsP9L X-Proofpoint-ORIG-GUID: SL-jpWtxVeWocq1cX4LrM9CCghPJsP9L X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 06DD41C0011 X-Stat-Signature: kgdzqzn6c3saibrwsymjebtzeho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lD23sX5FBaIZia1x/lhNb/8TdfWl702JzuZ0TJ5TrOhcpU2j0W6WCA66kqegcRmRMWK3iSZ1gpHBcJQ0SFMZbiQ0h8tnf4VX99Vjgi5I5fPr686T1J92eX3jjlrXvSaHTfICoduNK/16N8QsFiRVxQ0QYBZjQiE0rqgOoQ0LRgSz+fqHekHAS93dYLw9PPiaPQJuWVucJt7OjhJzIXUN8yGg/mmLdUxRw6yOonlqqcF8G02namE9UoQy6Uz0CHKkWly+u6w0CCJXZK6VQJD028GS5Xlv4G+kMbR2aAx3ii89FK7lzvkTbHC3Wtt9PDSfclmAhZN8ZtezByCmlOymJo1OULwrDM1r9aM1hNxswyfWIi54IYk2Nws0I2QckPVGBTo1C5bCfeEg4CMW 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 60bae5be008a6..dcab027b73440 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -6740,15 +6740,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 Tue Apr 25 14:09: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: 13223441 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 81FCFC6FD18 for ; Tue, 25 Apr 2023 15:46:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AC5F46B0074; Tue, 25 Apr 2023 11:46:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A75FE6B007D; Tue, 25 Apr 2023 11:46:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8C8006B007E; Tue, 25 Apr 2023 11:46:39 -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 7AE896B0074 for ; Tue, 25 Apr 2023 11:46:39 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 288E18021B for ; Tue, 25 Apr 2023 15:46:39 +0000 (UTC) X-FDA: 80720340918.25.7FE12BC Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf26.hostedemail.com (Postfix) with ESMTP id 9F27F14001C for ; Tue, 25 Apr 2023 15:46:35 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=zDDUX8I0; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=OySg8OPT; 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"); 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=1682437595; 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=M8UMuQxpQmvbH1W8NeGhIKkIYQ2+Q7fgiPOkD745LkA=; b=ixrcHvlhmhVvn1i43QCGhYDPQBhmcBa9G2sUQnQ3qlnOkJBuiniEydHJkbWXpfGTj3jPKu S2apD+QT7TnYsqWCyUG6LAivNcA7SrgE5/cQ923dBv0Ig8Q2UtlK9FgE0CJBc+k6IMou1Y xk9/XUDozAmQv3hk8qH4PFs7qM9esHM= ARC-Authentication-Results: i=2; imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=zDDUX8I0; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=OySg8OPT; 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"); dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682437595; a=rsa-sha256; cv=pass; b=dmHpKR34eGrbUd+9OJ5fZeKlBuhvKDDFZD9ArluWYtPixM47RKAXqiQNT67a3xrJx8JMYG M+jkMz8tewBoLbpoM2qrBzPUrL/jFCvFqKZFq7RAF8taWG43G/cCj14TrBd7zMOOrwMjtd lYf9Sp1BFQFaJUzmc0GQ017dM1hwRvE= 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 33PDhpLG001868; Tue, 25 Apr 2023 14:10: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=M8UMuQxpQmvbH1W8NeGhIKkIYQ2+Q7fgiPOkD745LkA=; b=zDDUX8I0dvdmqR2Z8cfLgDPykjIpEq7q/Y0X7FDW6Sboi7CFv6cu0lL1N4yvNRGFNc2w RMlENCVU6HfXKHOc7TwUVrdmVknwdj2u5C+qefDmV1Jl3jBZtM0ltTibeQVO/EaKkmWJ tgAYUFVpHhnK+qhcyiS5jD7ZdfrfdUYMYrxpjJtcDgwf4AchjNNlHYwahBWpHHtREXB0 OjieQUWgsrjAP1/+UdQjaExF43EcZ3hyPQCfTMM+yK68pI7o7lYA/H4fbmNBhGEINsVU Vgk8Gkaq799jR3+UIxyPcE897XnOlBE0ZzhyE8HfK3d2dqyqtNGkGK0dHVrB4v5g90zi ZQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q47mcwfbm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:34 +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 33PDUgY4006656; Tue, 25 Apr 2023 14:10:34 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616gqrn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZbbehFnbvk6eBAIVyatUDVfOjDMQbGy3PQKMo+qMe5Bgsx/+3R+yM8AWXDk+p0ckLC9Q8BUo8iapW5r/Nb4abrUiwf9P1Q7Wbk6p5Ho4ay+ve2/5y6ab5dqa3TAJLuyZh1sPgIJIHzGZxxnWOpMh3MSrqSndDuEqYDVZqtEw33DB5baBGcBItBUVKundJSSsMQ5rxSrJxPOjX/iePu5EjZMvUy3aBGJZSHkgOJfQfyNhMO7SMKOEdKjmvimnMtbtbp+7nsCHHmV/vfFcKYjrBG/THMEwfgy6m4oL5z8yC6r1KdwXmCN9FI7UWPQeMZf+l7tum88LPBIoBYh2JpNYlg== 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=M8UMuQxpQmvbH1W8NeGhIKkIYQ2+Q7fgiPOkD745LkA=; b=Uatv503g37r57w+NHiafBOUCgTq6w94i0vrtb6gH7/EQqQ3ZPgGHl9IIE/hCDV+NBEALE1o8rE/oh2bgerwez3bhU58demjrvO9RHj45/yIBsEN5V8L40g01UAXKF8jzkq69MwELkaSRznuzRlLTvaDd/00bXMdx0K8ydkRuz+mdhRKNHg0EqxFb2EHVvMZUB3m6maFh0Yg/6qT2ouRw+4SwpJuxQjc7G9+PM+BV2c2mBJo2KFptbM4a26Fb6wOAsFb27uUwFflBxYUhT8D/w7ov3yzjdokubajOOv552Fh1hvKk4y43q7VEqJ/4bFL4VOhm51d7TYyoTHLyuROOJg== 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=M8UMuQxpQmvbH1W8NeGhIKkIYQ2+Q7fgiPOkD745LkA=; b=OySg8OPTfCYs6HbSKhfdQ1UvwBHVD0Gwf9aW+/r3OCy7N0DDgQyKSi8UpoLXqjDGGKm90LdO5Aclk1QE5Dek6iEIgHQ5xlJrbqcOCCdFeTMBJCliFOOp2fKrOHcuTvJFxs+LON7wdxz0FD7PYG16Gls+FDN8BLCbGLZlp+sQxYw= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by PH7PR10MB6081.namprd10.prod.outlook.com (2603:10b6:510:1fb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:10:31 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:10:31 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" , "Liam R . Howlett" Subject: [PATCH 05/34] maple_tree: Add format option to mt_dump() Date: Tue, 25 Apr 2023 10:09:26 -0400 Message-Id: <20230425140955.3834476-6-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0408.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:108::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_|PH7PR10MB6081:EE_ X-MS-Office365-Filtering-Correlation-Id: 7549c03c-4a94-4ebe-1fc6-08db4596d47f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +zD6YHC4n6X4FW1zgHBd2GGxxXlWByTT3+bUMJsFGCBKq4dJmbRotU1Pe0d1lLO3U6iLI98EE6RNgZuY7r+NaGGgcwoDaoLMEu2glxXOcynKfuZt/KTHnwKw/6Ude+gf0hzV9KgW4hFQ2/6L+Zvp9/yzVMIrg4KjF6aSL7GCudpcEHWsCiamHrZBVyzdvfonyYp2Za2rm78PKDLboYvTmBKTuHubqL+mPl+sUGnRScUZw5FHS+uHV6gY/4pOs4esC2o6kVRQQL59UkXjxpveNHS0rzqd8NHzzo9f/U1uaFaZxpzkJmgm0gwYCD4UEv3MLt6e1hTsgZL9goh53D+Luzh37+GxFaO4sTgu4bEE/G8cDFtq22fdpKzsUhyjVnJ+foobjiGNWlN1abzpD2pQYet3N1zc9VLIq6kaAqsRtE6OOYr6MYQxe+CgiBrunjkXfxmjcPTucIHUBQe9hKvgz8sHzz13IOQ6gKPunO6MUX5WihjRgkAtjxmL0m+tvfXvcBiojcldAxKVs3fYNUpTlAW1uQzjsLtBfGPOM5WrVEJblMBJzdQL/mSRRuhsRZCQ 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)(396003)(39860400002)(366004)(346002)(376002)(451199021)(30864003)(2906002)(66476007)(66556008)(66946007)(6916009)(4326008)(316002)(5660300002)(8936002)(8676002)(41300700001)(36756003)(86362001)(186003)(26005)(6512007)(1076003)(107886003)(38100700002)(478600001)(6666004)(6486002)(83380400001)(2616005)(6506007)(54906003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2ddw+8nDZOfLu/eO6Q8oS72I3ut+JpJrLyLT3kYvh9fxVfMTTnLCzPpbUnLlKmkjIKQ4BiSW710G/jaouvtqeR5+2aLMSBxSsp20GemHAcn/MR//Mv3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cm44bSpj9jcHjiRQ/CPCjOYmMU8ywMScq3UqqilWrIicerizZWuga5Gu/1ffdhUXVUY1eb4AP4FVB3VIsPejLsCrAdp1Zj/eAKajoox+HuTVt4glekFtLYVdR64CYoZv1QPkeg+fzS+a792Xg5nXwSzKn4jCow28b1e0jUUAb4FM595kHSt0i3sc1MvYOnRNwyADbsbk1XsN9/psIReSn+DamF1waAAAXQfbHxELCUcAKDyqfx/8LA18Ngja0iBRAH/wsJCvGqutdDq/s+5RwKpXPxmTPE1PgvbK911f9qq7skcYolB2qa7cw+PiObTMPzpglSGlrM7sOJsKChrz9nm8Weg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7549c03c-4a94-4ebe-1fc6-08db4596d47f X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:10:31.6773 (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: zNqghwzQnwcKOpV/h2jDRJAv4gTvNJJu1MeCYgLgPnfj16VCoq15kv0IIBwoHZ/1qhd6YzN26kb4A9B52TOIXg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6081 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: 3xO9_bMCJP6cWinIR3pQ7wWK6Ec8R1b9 X-Proofpoint-ORIG-GUID: 3xO9_bMCJP6cWinIR3pQ7wWK6Ec8R1b9 X-Rspamd-Queue-Id: 9F27F14001C X-Stat-Signature: qiwz5frx4k6mmz5es9yamkfcpdufgpp5 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1682437595-215432 X-HE-Meta: U2FsdGVkX1+1miIaP6FoJT/+hR1kIPamLNhF/boiqVp8hH/NlnqD9ZVrwlscu3rpQz1iKad4MIod7AdB0iNN4x9i+s0xYuAZqLSiWUyg2CsbILXdUWzdlQt4HwZ8UXYiOrc4oasBE238lMqSe0kDW6ediJ9khGQucfjlUEFOxG5suya3jiuGnBffSWgcOhb+1zAtyOK/GvYs06rdxF4wYhLDjQAG9jGotcPYax+L7ACEshzssr1QWwLvaC7955W79Ikd2guoCbkncgYImtVTYeJ7VOEAboOvK6RN5HyPaJXxZKAIBc1HJod29gmuCKkZtRoGFwvh/p4y5c/CvO7zVfmikru09uxD0LGr2wklMoojj2NBDX4xO0Nv+emOQNQBpgbspzq64GK1KLIZ9PK7LWRVokwI3ClwCpQQRP5dnz8BMplk1UMrrhtJYvj9viZV+XNtRN7hL90YvaC0Rf6292oin4ZDJsMXwWGvq2qtyJcs9GNhb1E68gKhNk6Ep0mQdFdu71clitryWVgTur/8UHIJ+BNiej0iPuxaO2jCnOxmMi5HwHArCqI33bWTalK0Y1SdrJmtx/whd5H+rLCEVNqxzuL1C15l+RxZWqjy71f8KsJOBqGPUOdbfmgOko1DwNkClWuwFOtsuhjOq9OD7CxlCrKUqyByEAzyRYyBkgpWCM0IyZB7qXGWyEDGRRUTfJ6N8XL7f7wxcpIF1iotRM9FFrFj2jNR6KoRfN1xQ+hLsg3XbALYumjzrWA/WSsfOTW7tNiQ45fnENs5qec9u2SdVVGuYHxTsTKl8pKFWKxvijGCeFqBK3c6UyONQKkTNbDJWKqai+DB1xCBl8T4n67NGgj1x61co6eizHXbYH938SOcDj5sK+vwMLpnPcu0c0vBHl4v3iMVF8CjnCHu/0zKPHyaRqjieFVZvrBGaMGah7+P7VikdGEslOMpxwrCOxlNiJRuoR6eU08Vx4J 7oSEnIKq bh3ScfNWpSYuDsQBWrbaYmzOOk9+lWbflGHXlD7HIviR667yhaJdeYJKY3hXdHjKR3OnJrBkkeNLh8gIm7bueAHvSLjqz7F5eCs1SnkRFXfplwRPfRbEmcWj+6CcphU5PbsiKrDAAfEwEYInKijlEycZtbI/iKVFWs2DGsY9k3LBGgSbqFCCPPNgLvUkaYJHlb4WdZMvbtAhlvMO/gtoMlp+P+sJMlrpJioxXX2zrihmo8j+uHV6SAqtzd71lmcYhtbstNd0qBLwV0QhUWdL0BTskMf0yDazLJ5lrx/wXagISddEs3PQaKbNR7M49TNx6Oay6m8cTNGvBsOxsj/K9WXAALcavS6KVkWCGZlRNT0ASfEaQYy/LCnx30PEL04Degg1fB7Y/A8sz/Grs8ogPVwCiZGmN2b2o0zXfftqBz+UD6ws= 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 1fadb5f5978b6..140fb271be4a4 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 dcab027b73440..535efc39f7758 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5700,7 +5700,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); @@ -6754,22 +6754,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), @@ -6783,7 +6794,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); @@ -6791,8 +6803,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; @@ -6805,24 +6825,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); @@ -6847,10 +6875,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; @@ -6864,13 +6892,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); @@ -6881,15 +6910,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: @@ -6897,16 +6926,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); @@ -6959,7 +6988,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); @@ -6992,7 +7021,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_enum(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 f1db333270e9f..d6929270dd36a 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 68410c6d97aca..4c195920f5656 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 536bbb8fa0aef..1554f90d497ef 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 75df543e019c9..ebcb3faf85ea9 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 Tue Apr 25 14:09: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: 13223446 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 92D5BC77B61 for ; Tue, 25 Apr 2023 15:59:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0D59E6B0083; Tue, 25 Apr 2023 11:59:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 086CE6B0085; Tue, 25 Apr 2023 11:59:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E1A3B6B0087; Tue, 25 Apr 2023 11:59:58 -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 D14BF6B0083 for ; Tue, 25 Apr 2023 11:59:58 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 9F7E51A02AD for ; Tue, 25 Apr 2023 15:59:58 +0000 (UTC) X-FDA: 80720374476.22.505BBA2 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf27.hostedemail.com (Postfix) with ESMTP id 053494002F for ; Tue, 25 Apr 2023 15:59:54 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=iLyayOwR; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=KA7ddovE; spf=pass (imf27.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=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=1682438395; 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=0I/GuI5QEyZWq7urrTdN0//wqkgqXn6YNERYZgyoi84=; b=R7VqntiZcnj4pPddp0V2gE6nF25hFNAjE928auFI+j/RYcdJwxNyVscSwBDZDVK/aArffU nsFsyxdPQg6uJd8vWl+slY+BuWCIR6CxO451Ex/+Bc42S67svuesWdntFB47rZxyTBUIMx t6M0OpeKu/5TGT3/M/6qrxKcxNgHvRg= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682438395; a=rsa-sha256; cv=pass; b=hXkafzT8LKeteQFuvUzN1EEEo0l4DeVAgg/RYfON5AFdy8UXETyk5JgdGZmotPWuKQO620 +IihsS6+66YKKDWobCYc6hH7dxdWNzZvbOXC4+fL7ir5xfpwqa/0SnXuZHn1zJHlr8KGKM KdjzIInt8jfU0sv6FCVwEZZSPrsK40s= ARC-Authentication-Results: i=2; imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=iLyayOwR; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=KA7ddovE; spf=pass (imf27.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=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 33PDhpHA001846; Tue, 25 Apr 2023 14:10:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=0I/GuI5QEyZWq7urrTdN0//wqkgqXn6YNERYZgyoi84=; b=iLyayOwRgaqS6VULgSi32LrL6A1Mi8rl6huCf3y7GWxqOLIrw5ZC5J7qEH/URZ3lTFnM N2y/kN7LreERaikuNH4Z0pCRXVyndz0oHcTOkRMOuuxUiqk55/tpgD+vuBeLlMTZOL9J ZseDr6sqXsu0NqfF27X6Og9znvm9SJjPT/6eJWAWbd6zKjkq9gPb3dLGyBbX0mMUAIPe E0etNIk94NnAE5J13cGdagPVd65rFuZxSpBxcJQotTyQfbg+0yOqhlbb/7Zfp/C5rvvC Dhu9HlS9Bn3U3W58L5SNE3SLRw5doMyzyT95Ip5qw2wzf7I13e2vUEw1WXw/YoQKzCk6 4w== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q47mcwfbt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:37 +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 33PCfTaL007440; Tue, 25 Apr 2023 14:10:36 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2170.outbound.protection.outlook.com [104.47.57.170]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616gcxq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lMXnJBzPnofTcYXqWSlHwybKNEiw6I2O1qcUGfXmrXL3up48zAaDpk2eoRKUdUiVE4pSsgNR8QUfZjCspxofQ68Me+FmEGsqcMFjr4tZzjzx5MW823vGkBDKpyGahO6ecJa//4nUHWFqYILb2qoOe1/lrVDePOOwykJgRL1TyruCxxTB8UH7udhUA3WQkxbikeK7cuJY7EYie1b7ePZgQiBJ7B8NMm/IvgOfeZjbldNNlCxVRV2zeGseCUZRncW5XeWRYx69Hl/F1n1jgo3WQ4KicX75bm+w1ul/v/TvStxL7tBhCfSxD1EL695kXvwKG6Fyt3IYoMMYrJ9nfuvvkg== 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=0I/GuI5QEyZWq7urrTdN0//wqkgqXn6YNERYZgyoi84=; b=b19jTnzELAqQLnkwXB9aVBVeR+RkoQPKo0aLN9PjUI6p9BK8IUxdl8bpeg+2Ik2tV5SB9bMCz8iF0YU0Mtket5WnbG7PZf6/DqunFrzhU0AC7C8Nh5hP1KvSiazzym/SmBIBgrJ1hsgWmsqHKgKEv5a7twZhe7ic1B48ODThdr8ikQvKzOcV4EGkP7H9zhjRR1sOZDGqXP3is+5xAfbdV5ME1vD4oQ1dsIKF21ATnfOUMC+TWmzSlDKPSfDwZ1Ud7Fu+mYRVQbiBplpyXYAxsTG9URItwGth12xt8D8yXe8inVLOefy1H7gPujE/Djqc1dC73d3Ls/89DhNReikvBA== 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=0I/GuI5QEyZWq7urrTdN0//wqkgqXn6YNERYZgyoi84=; b=KA7ddovESqbI9ZuXrtfo1TdXU+A4tTLFAgnH5Zi9KIPpyJ4Eqp95kyWa591+CFgNisoX571ZFtryhW+g0vS0552C8bje0BZTNpspBPgY+jiT8CpcutyQwfWocQOR3VnGxxqNMv2HOQgOL/E7uZwzVUvGi3itIgyN2G8eZj/bPuk= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by PH7PR10MB6081.namprd10.prod.outlook.com (2603:10b6:510:1fb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:10:34 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:10:33 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 06/34] maple_tree: Add debug BUG_ON and WARN_ON variants Date: Tue, 25 Apr 2023 10:09:27 -0400 Message-Id: <20230425140955.3834476-7-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4P288CA0087.CANP288.PROD.OUTLOOK.COM (2603:10b6:b01:d0::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_|PH7PR10MB6081:EE_ X-MS-Office365-Filtering-Correlation-Id: fbf0ac81-85cd-4a43-e343-08db4596d5cc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xg7OOZqQowH7pqFKAVgIKs7LNJmas3GB35pehmUQvcdlRbXzYG/GhMcP1iwK/8vzBUuw6syZTlHtJ4XRNp91UgRkGQQ349uN3lfIji0QMvEOcZwHMw4lId10GYmyddIDNhr44tirI0xdIb8+F9kMvcgBUHfQQT62voEx5Va7xRvwRGFHzB6VMk/mIQAnIaaN86nXjcd3HjNiZfYPcWmjiVHxK/jYBM+6dvWeqGkJz9uFpAEGwRGGb+KQb14quUh5QFBbkoDe7/pFOPPgTiacrxRwB0jMBd3V73xar+1dY6QmHmvIEkCIB/bNOce3JviCqB48DDBiTptSlcVp39uOmSFofsgrFOm+XUf5lw1KJz2G4zEbsMLLo6BPkrT9xE6fCWthtPKf7+whfZQN+VabhoF/+TWlz5NroYu6ypMTASJ83bA4tt5XE1hj2kU33I2UMx1hL6ZoNyWqOzsGhjbi9HC9dk8JXYyfSJoSv0uVcvHunASoaNxcCSdZHYeALTk5klBkPNliRtrv6LdgI5AekV20wu5mqDEDgK4aUtk8qytgXkcuGSFZy/5fQXAqO6ou 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)(396003)(39860400002)(366004)(346002)(376002)(451199021)(2906002)(66476007)(66556008)(66946007)(6916009)(4326008)(316002)(5660300002)(8936002)(8676002)(41300700001)(36756003)(86362001)(186003)(26005)(6512007)(1076003)(107886003)(38100700002)(478600001)(6666004)(6486002)(83380400001)(2616005)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oToTAqOtNx7Z/cUzwYfPBJxf5vCQ8v+proE5dYh8bZtPbHzok4lwcYlLYoj0gmbd4CGSv+DqwzdEUjXOozOg6JOD/OS2pbhvaSWJ3HImDP/H9Z8mN5EjENk7YqjwrTSUZmfG8qUzxmP3c7BCj01cO8Q0NRy4MFkZssERcmv9jRXHwft8bOTsokcRQw/nfsKAS9uRMPSEVjG8AbxWvypViGCERWAmwIjnBckzBKzpgIzgVZJRtXFj68ID/7tlusAD7TZuhVTU7G23TugWwspkxuO8w4UF4MVNT02MF/HRbzbyzFf9K/v9IzItDcxn1MigP192FepBPxOMDMaFLcsuIXLK8clu8iklHHBLSkqd0G1VUJPjywBhq6Kj/PHCTF9QFcJvAgwkT/fx7s72Txf+WauKU+776t2QQpnp7RoE3LTVIcwdZFPjI0Pl2VekViorwgSCOBCo7tmK5iRqYiCgqiq6U73UxFGItsZA28byVl/VVkDJM9/iZqTu3uwdgT5WoBwX2whaRani0TLLJJ0V8ABwVCuxbNlrUfCBoHcvT3/6sQEaqGZS7UadzGd9KYarXL1zeqmYo5D1IV+TCTE8Akt3Kijv1p+C++sotjl0YNVrShq+ZvgheJJ049uRswFF4T5dO8d0YGIhsSj90t/sUGJH++Ojx2YjpnjcVKgSwK3g4IuyCNMEuivUAE9NlD7UZevJUXFDRTCOR4JuvVkGiW2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Yknvv4IlsahRKlL5r+glmS7Er/d5WjtZGWy1bcETNANVTLL+NDzDIiQAtXgmHvdU9svUPb9SctKYv+GK7OG48hHfZMJ4Te9q2memJIFxqw0mPU2Po79ViMaX6eaBQLyLJdz0AZhTh+TFmdeHGgFIEULWuFKT0MO10obijyTd244W31IImGVBofiIbGO0xbCzQbXJLAegvLiRiEHJ8KQWJT2BoUHIqEkDy1Ow1+SGrp+yj+uIYnR/Wr4c2hcLaUCaDgKt4erhEaOT6D6+b+4U4hlLy7kRyop7lvFDJxrxm/p4wcpQMpvl3M3faPds6AKvwQKOn9Mz1TujMVW0qGFTVvkjvZmAZ7Ox0zNAvWsZF1Bel2TSu/u1iTTbJigINKhf+ECUJO+QiKn1fDOOMy0reLBvd5Geeko+q0lsf8UyEXKqXy2vCbfK68tKT3mMQXVMEfUOXyZvkL3Kzhryi14UXqcVRchrcIOQJmp3m0/sie81YHG/eGL3msctXJLlNMmNHe0JGyzV7ZAhuNFPFmi4pb5ncHCqB6mzNjRcnemDhp/MG3f3nIesKWGaPYh5BjfzkVIRNJNU96oqUB9QqE+VY3VuI5/6A3sHSMAQUihg2R883rPMGw9cjL6aKF1uwNASDlOsBnTggZ/yzC45HeOVbioYTiz1JxxBTGhi4YVhUaqZ+SJUnMOdQcnSOzL/LnxjoHb3VCKkFIR+4Dorf34fL0PIc6I86g6OAWZLh1MSYnEOfWlmfXT3dLVmSvsPJcRClwwreOBFdoY2V9uueO4pRxjgApBPkoywljrFl3S/EB6jUtEGFarDvByEyw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: fbf0ac81-85cd-4a43-e343-08db4596d5cc X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:10:33.8184 (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: HzIrNTi0dWFLv6FVqxqap7zExmmphW0gtvHOsvjsCUd4I6ufNF7PLvDNxXt/r1Z+oz+Fy7oK7okJ6msu6A0kTA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6081 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: V9ALBE7ECjArrnrEYKvFk5M2NUIC2kRi X-Proofpoint-ORIG-GUID: V9ALBE7ECjArrnrEYKvFk5M2NUIC2kRi X-Rspam-User: X-Rspamd-Queue-Id: 053494002F X-Rspamd-Server: rspam09 X-Stat-Signature: qukkzix9um4utb1ont8p5suiqe7uf4ny X-HE-Tag: 1682438394-776809 X-HE-Meta: U2FsdGVkX18GffnfmLx9VmDdyURE2MbrpmyluSVy+1PqAEBULDezglY8V5bS3NfDeTPHCiGN6lfB0ZWr2CiGftCWtstJOk6XUhUP3c2g5kotP3gM9ftGOGkRJkIidyTEDtOhxaJUXCWppi85+WxlRCDmULsuwQJYtMsfXVu5XO/Do7+9nLNbkZqAeGBGDwZ6inwR2x5eAkZ6gvkoD1j10NKuFtbW7jvaGlyMUUiKAvXx7NgO2DjAymkeOh6eZDz9EbuQKaGyGCS5LBUTAi8NZzGNn8M8NldyhVzuVxgsc5SQwJYAjkOdbQGaBMNN05dnL/0BAydkAipoKMfJrmPxMAxr7kPiUBZnq77BMlhSnnWDD8Zt3bgDSLNDOcdx4MA1+xf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ner-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 140fb271be4a4..204d7941a39ec 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 535efc39f7758..a4c880192333e 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; } @@ -7252,4 +7252,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 Tue Apr 25 14:09: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: 13223374 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 BE569C77B73 for ; Tue, 25 Apr 2023 14:10:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5DEC36B007D; Tue, 25 Apr 2023 10:10:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 58E756B007E; Tue, 25 Apr 2023 10:10:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 408736B0080; Tue, 25 Apr 2023 10:10:45 -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 2D8606B007D for ; Tue, 25 Apr 2023 10:10:45 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 6226D1C6621 for ; Tue, 25 Apr 2023 14:10:44 +0000 (UTC) X-FDA: 80720099208.26.5521CF9 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf20.hostedemail.com (Postfix) with ESMTP id D7A681C000F for ; Tue, 25 Apr 2023 14:10:40 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=hiFJ2wYC; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=gHSXvMTk; spf=pass (imf20.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=1682431841; 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=iD0HsogRo+KasGO0aQ8MARS1o2FIoUvczcMPAOl56mM=; b=vPl1O7D410s56eB58/UJCtJgkjap0TlWw5V69NVPjEcbrLgtdzLl1oNTZVjwZWZJp7E4d9 BbGKmlgjr0/LGjpqFIg6J18uhtH34s67zRaNUTVKZYBfMGEQk4YZPciXJE0DnFvcGaOyEx 15nRMzZ5Iv5Qt0svahyA3nNdDpbNf3M= ARC-Authentication-Results: i=2; imf20.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=hiFJ2wYC; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=gHSXvMTk; spf=pass (imf20.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431841; a=rsa-sha256; cv=pass; b=ViaGXuzuZprRocCbGWQ8rTU0hTCtLAwFfQb4fLDgQlBDGiAxpzvLyMSGD8X6WAfMZUsRup 0+rypZzjqWAl7EFRnCGY4YDn08C/+OlMVA70LJgZuT2b2Nv8T5Qf68LIXSL+axi3S2PR03 R7EAmidNZ4fNTyHvMv0p1YtjeCnZlU8= 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 33PDiZav006059; Tue, 25 Apr 2023 14:10:39 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=iD0HsogRo+KasGO0aQ8MARS1o2FIoUvczcMPAOl56mM=; b=hiFJ2wYC+ZXqm0dwEd+7PtN6HOWAgq6RVPycl7IZuN6Ach2M7WfVZkJ9NWezRXj4+Uo8 UkX+smTHU7nvvc+kfJqfA7w3Y9PyzPMmbijIyg2etBkDYibmfbSUV89dlFfxDlma/Zwz SxlAFR9O1xliiDRuOi3QLwPgoFRtrHc3ztuMxes+Xit7gRopEVKIHH88lPzQjPIlFMlI If/SvW5aeV+P4/Vz2pBp19oO99zmEwuTnm6Ll4taKsi15P4qSgDWKmQM2xlZfyn5E3ga g8FGnbDaL3eEjzC8Ghh6CxWgbo9iYR5T3msFxcu8SNs+a510V8aOGDapyPWoDbfrzah8 sw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q4661wgmd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:39 +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 33PDVpp8032767; Tue, 25 Apr 2023 14:10:38 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616qsfy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l4QfDqlQkGjNJGs9rz82EMjgTlKeHuggT4/lHlZqFgDO8VYtN+b3dM52Tkf6Dkubms1HhAitdP6gJ+wJYik40h+vFdg4s11l4xDcgcstfMwVBRopoFp5vnw+Cw029cp8sitQMdYmwCKw2i1lXU2R2ZyJQvWKyC70uKYu2Hw7SxW4XgiuYk4vx9+cMF+u93I4ALkna5whARq5C3GCAExeqYHLCPEn+ocodZAgUiey8WKBlaFF40rSSrKBUpLKiwKw9BOtEi5xp+aaIzJw+3hwniU3huMdz2NtmQXoBDjpqINFatY5KNJYKvgCC0C0rTLLT185YY5yil24LuI4XIlB0A== 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=iD0HsogRo+KasGO0aQ8MARS1o2FIoUvczcMPAOl56mM=; b=A4KPQr8MylyTQlDkbSr7XTghgPbDeD/wi4DYeDI2gmu4MPhPc0KwG8kBoYZadPuW5qCvH2cdYdLMRu6mKbupvwQ+IKfbtG1iLGkDsFt5HQAVk/i+h8bGNnrD9HF+9847SqqwXgkigG3uj0bxKDbl5+h03QGxsfh0VFBcZ29vHuy7EZAUmITmrHPV2l4CBvjT61ovUN5YAbKlKXv0abHNWOGjcF9u/tLAz+onSno1fHWPQfLgCB69qraeaWBE9uzSqgN0XmczEU5qZB94AMDNvshVsrZ79q/ypoc93U0ZUQ8SSGx/X+KxG4Ix+xJeyjYP+25tgnRMriGBC2ZIL5Ui9A== 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=iD0HsogRo+KasGO0aQ8MARS1o2FIoUvczcMPAOl56mM=; b=gHSXvMTkozXEeBaK7Da5ellbUf4g1nTL0UQRqAk+M+sqz8plTRB7LJZ2SJuaQVfKA48d54ECURpwBrJaecXM8/pWg2+sdb2hdtifaDBbXh/0QicgXm3wb6NGRQjaTsU9ra09kyOA9nIXiBYK2YPaim4XjnOwArhK3vL3YxjTMvQ= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by PH7PR10MB6081.namprd10.prod.outlook.com (2603:10b6:510:1fb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:10:36 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:10:36 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" , "Liam R . Howlett" Subject: [PATCH 07/34] maple_tree: Convert BUG_ON() to MT_BUG_ON() Date: Tue, 25 Apr 2023 10:09:28 -0400 Message-Id: <20230425140955.3834476-8-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0025.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:86::29) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|PH7PR10MB6081:EE_ X-MS-Office365-Filtering-Correlation-Id: 2795938e-4c95-4e43-b927-08db4596d72d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5Bxwr4oJuEIKFrV0FOOqrkcHTzb+2RfEg//fEQq11ghu/cCk7dn1507AdEdsHXQcnd5MMHfL+F+2HZkogPRPPgwa0bHjoSizE0xpfcIgulqpa1H6BfdHVC7f4P9mdHO0pSLwedIUNXXaDgCTa+LIXO5F+kV6vj1O3vH+YfHAwLW2Oyq5qNrgeRPGzjfwqivKboASJafn8Y21vh2CgJn48TDhEsrjki05ymC+fou5nwvkCvkCeUZgbslDZY64HhAjhrApXU/h+sb89UXTbvMzTdbAUgimKkzlXYMIgn5tl4TA6tCF6SUqJcxd73rN752p45A0BIAVw2pcGXMDrOl4GFz7KTRnB5b5Puolu8yGfB56BH3XdOKWi59SnLL9umGBuKiQ3fKInCaBo9A6j9g+RgKV8sa0HyLnhqvwLMEiajtU7da5FBRgWbBBWhTP3O3iSCzraaJm/udPn4vIxGj7x1TUsXgoxTt9zs1JrFyMMYSTQtNEhQwHMVLDqH+LbPEBjCPdAkNBpHuH/L0pSxjOp9Ks6wxOKUOM5cBHH4CizOmcM5iEs3MBKsB7AapJimWf 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)(396003)(39860400002)(366004)(346002)(376002)(451199021)(4744005)(2906002)(66476007)(66556008)(66946007)(6916009)(4326008)(316002)(5660300002)(8936002)(8676002)(41300700001)(36756003)(86362001)(186003)(26005)(6512007)(1076003)(107886003)(38100700002)(478600001)(6666004)(6486002)(83380400001)(2616005)(6506007)(54906003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jjAa7HXxMWJakVdfJyVaub+Rkl9hwHnUtiHL0I/UYIYoWXx21a1FA6vLvzpjYVeR4tikYHklJFNYNB71OhXLdi8qDP7RW694+EGGT3h//h6kOWHnAr/wmcuBN8Njnf5G+qyeIUOHVHgfzaY2Y1q021rgsANI7yCIWUWG8S6sLx9b2N2DhBzirC11Ynzktdf9anL9DBwDziTl1KNc1gdekE2DYdIEp9PcKuReEs2iqhHdg7iPdg/BCzG7CFBtcH+3WCNnJn5URQcOjTrPwkSkKyj0DxRMbV6BKwuD6C5qMFBcYyTu8lkugm7HJ6QNrAE3z0jhVkcRBRkd1QnrFrbRpdQQ0YtW0R5C0/jE+rJtgeE6GBjjuF0NloG5uXaUcFtD8qzBRzI+WFsPvkG7Fs86jEE4QNe2DOL7lPBony8KDcBLjXgavsOUZCSGlJhYAqsOq0w98f+3BY+DgDbg0I+nldaQ+2gGhHKAXkvfYr4XtC8PqVSJm1AqIKeo0Hh/jop/f7v2kN/3GjFv9Nss8hU+r5JhIkNi7dESyk82NFHC6woR00EN7wZRiM36BGRwb/lWcXzEdFnJrnAfgd1TfvP1Ok/1w4QebyZPk1DPR7F+ZvCnVx3TFFgMqJ8029wtXkPOdD2un07AlzOjX9PpM6h621KZ+miWJGA9kR/3eTEfI4vs9IbNuPV1wTZGWI5GxKp6VSmcUvM3G7JMGwCKCGmi4ihSSq1YOE4CPS7GPiZPxRH8yPyRcOAiQ6xm6nutnvb4Gvd8dchWwMCJ47ZfpXO9byMf0wv3eGhzfiGqfUuKY63AXGx16xbZGtYbXh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lpV7zntqtsr2L1oE08ebDbudh1fWs33Cq05x/Lx/bgIX/nprXeNk3ZMyp1p1CvEd3kBXIIt6EQw8tepYtdWksKyGAHAUJs1t7d57Phx6gf1d4rpTWMymIyjvKD+hJmxS7OZNmJBpFAPB3MJ3Z7qAQhlVMoqwWIrsqi/sXR0QD5TEmjvlh5Q+qzhZrSSYXdSknod3fdaQ5GIFOdsl1zLC8KCAKHmA3k2JU+fjR98v2vlavOfrxwDX2aIzuaWk8NGMRvE7/K7lS6k29ULX1RcciuFJZi38OdSLfrycm2PQpf+naBOam8f8vW1DNL6HjCFSYmFqY+H/JMewW0IPq3rJeZYX5Uv92mkP0XX8ggpFeyF+Ssg8oavRQCsjiAYfsvSTPTpFp0VJ4Lqp7gyEvjxLRpiCWxZlr8o4it7iAa8/VNAksTV1bL9akXlt2vmOOxfEz0KMPoaQB03SETwdIqFK0FoH4DsNZOV2PW89b8zNlIRIYbvua05Ld0mqGZY2qlSRlQ9H4EWhCss4AOrquKwO19RyOpf3yClp7EAsNDZfuIcEhgoJlUohRamp+tL5//2c47XlnQIX4RDbumfLwnW2JO7iS2AKFTwrRcG5KSiZAL1qK1CklLegUkWU55VJwoTcVfkgUtkIeR/MuwdIQ1JzjIiGWMx3cHSoXFTnp4anqkKQwZ02t9w4hIIFluVnkIg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2795938e-4c95-4e43-b927-08db4596d72d X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:10:36.1521 (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: X9z4i23d+Y77iDJyEFJ1EjjypIh91MknPsmgXQuFBK0xQyP+mH2P4u1qfKWeVYw6C3bVIXoF4RU6EAt17CcT8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6081 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-ORIG-GUID: jEuX_2tBIcqy3DohtjKJ5jLbOoyCeuZN X-Proofpoint-GUID: jEuX_2tBIcqy3DohtjKJ5jLbOoyCeuZN X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D7A681C000F X-Stat-Signature: hj33qn1sd3oobo3fnua3a8nq1zjafhoe X-HE-Tag: 1682431840-737522 X-HE-Meta: U2FsdGVkX19gOo4buaLZmVuTzxNcaJhX+G2bfxXmmbOXbKz+HXoy7sVRRWL9qNDAWRQ0s4C4uUGDNP7PjMi5s3X3wd8HEBNDP1Dkzknds9lCHXxzZALp3owtvy557gIKl1l6ogXp2kYpRy9l+YXq0YONSBG1+KLV7QCryKUbSyw8SiSqYEzSOVeew4xrDWCKrch7tH/WyNkva0B8uZbyt7G2s6kmbUj5zLy51qngkjXaD4+2shm//vWxqVIhFzY6/tc5845w21ul2NOy0yBqo9tAsr56mT990FTvHhxe9yP0NvQysM96IdVh3uzSdtmXpG7gSKiWcRNohNj5IuH4g5Mvm0cmF+SkNtblyQ6wRzfRDRUpADocGLUqzfeUPJGWfIgj9pi4FY3ufB+2xyVGN9PlR+XBfR/ugFelnmilOefrSZ2I2dYZC2hiX/wQcik+FdAO3Bu/Zk0mDeLbsn75PDXsiRqvm9DO6WWbvnv1Vn+Ja1QoyATO0DYhvxtne3ZWRAssJsd3jp48Pw6HlpxlxzqjzjVypavFSPWN/fLiCSP08HV4lkAi8qDavOwSi45I3hfqv90mbPoEafnMFvOAaMjdZB/2PdLH8hmjD5A8k3Ctm0EsU9EqgjVkVX1h4rqzK3/IkhabahWiaUT27Au5M4qw/EIforHqPZ2OYxbXDHI69MPq5V8s2KoU6y7dnnr7dXdRWJvKdQcXz2D4fhzKxZee3mOTI6CR9qpvdmhaPWvzbh1exeQ/PMVoHmHpXoEMRp2X6NfrCFKm8aIdV9MSEIUnrIUfwj8ldAgNO0hOcR0rIh0nBQOo+vi3tm+j2rLeGxd+OSaYyZCEGM+gFqpUCx2gypt6Wkq4PT4BmYs7x76v6h2Me3fIR4QWb9oxqXzOxPrJ7HZQiwsWnkT6JJm8v1s4ygiNSoTqEFJGtyL8hvuLFbR5O1ezyFwILm1NC0ThFjnAtB/bqN3zpTWrcR3 ErfgVBft uvGQCFHm9+5ORiFhfzyyOxAxvQ6q+XbiJVH45zhgTLDgiwHvU6ssddOVQUSjmsqQfl4mr9aRuyCimHgrUXupzdhGt3R3RDlr1fEhf3zEa1qMuFwEmZPOTLGoSFWIc3U9BNzxUlwn+ggfkkejTZOKMp1HTIybnJ4sG4FVXu8F5i/X375zKmUAX9I1gKGbENTNnsuLrXVTrph1sM163tdVTNU43KdY50GtCa0haqWls5DKskIrAxay7fcK7DrKlE5ysfiU0FoU9/dbrGDCXzXB6BzULbVv7PgLIAo4Em34bOEsnXXdZSr3HbWVIL2iyzsL8EQFXWnTiH75dM122LvD89oQKS76o4i2Uun55R6DZ+aefP2UTruR6H6udayFBnRzIyIjTtsM/xJ+fUNe2vypamUt1QyepiCEgQLBLYDVCGHz+FmY= 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 a4c880192333e..662a9ecccecbf 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 Tue Apr 25 14:09: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: 13223449 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 79444C6FD18 for ; Tue, 25 Apr 2023 16:10:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1948B6B0092; Tue, 25 Apr 2023 12:10:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 145516B0093; Tue, 25 Apr 2023 12:10:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 00CCA6B0095; Tue, 25 Apr 2023 12:10:51 -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 E96156B0092 for ; Tue, 25 Apr 2023 12:10:51 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id B8A741C6756 for ; Tue, 25 Apr 2023 16:10:51 +0000 (UTC) X-FDA: 80720401902.05.C9DB04B Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf05.hostedemail.com (Postfix) with ESMTP id 76CC9100017 for ; Tue, 25 Apr 2023 16:10:48 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=lWCufE77; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=h0UI1LW9; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf05.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=1682439048; 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=W5VCQae/u+KrSguTgZokUl+Fxo+cz9ZckZBWA2If+Ro=; b=5DFfPpisjkv1pPCnzmuF3CWR9WGZ3Sd8+iJUrXtdwpJnhrAntEFWyA1OM0nDjPek54y4b1 IG/7Fo56WpMMVOsZ7k39Q+09bfaPKllhJFYs32ORdiydq1ITIucUaGU+xlGwxNA+XMRDya TbUif/0vtVffUkKV6OZU7/Jtvn+az/0= ARC-Authentication-Results: i=2; imf05.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=lWCufE77; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=h0UI1LW9; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf05.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=1682439048; a=rsa-sha256; cv=pass; b=6mDt7MzesHnlsinFyUIkg+peApG3J7hsxCjt3byHsvNiud35e+UdNsgAej/eY45DagKCFL o8Fy3imztYsaFAaztu8KgT+B8qPGI8H8gfI7Y9Axx0af6RRycf4a1iQ/3un1sR7mSNakFz K5fWn4bCB2isEGO6WINtxvFNNgZXuZg= 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 33PDhpZv001840; Tue, 25 Apr 2023 14:10:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=W5VCQae/u+KrSguTgZokUl+Fxo+cz9ZckZBWA2If+Ro=; b=lWCufE77AmGsxA2tWrVhV0M624iWLtyRFRKheBemUFQviJnb2lrOYtSXaHUU9xNjyIiG yxxt3Bj9ARGv7iBvUK6G9XM5WTYOcXEC8+4iZZtY+5P7Gz6dzPSadHRGu7oTirrtt4+k EE6uReHXzE2RQ1V85Z51RBZ0Q+e+wVa2OkTacrA+vEA/w/mYDufXCQ9b/G3qwe1ubzGy BpAsWjphbjB3f7DMmzORKZ9H19Lqqo7dMVthe9bITK+2dnKA6wX6elmv8cOHsksHE3f3 WhL65PaVbPxirF2tYEZv5rYuL2lOZbTxFnlwYwjkeqrcsqhLtWmZnVN20wgGfBBME8Ur Ow== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q47mcwfc3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:41 +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 33PDn4AA006793; Tue, 25 Apr 2023 14:10:40 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2173.outbound.protection.outlook.com [104.47.57.173]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616gqy0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YsmQml8gpNTVmOMsHMUjuRS9WBVlYGcIAYbr6jwwIt9koLOYKngEUBFBqn9ZKL+4sVHSv/ud3cUIBVTOgoi9zsICMbKszjQbrmvWzOLPupd6SkoZ9HYP0weex0g1NSWPlrECrjXgcMPlhccfIB7Rl4NHvbV+cN1RG1++SLTU4PzVgY2Bg+0uiRYyuhwdbnoQMvw00iGXDaDrsER+Kpr06U+7UbEOUtaZlhBAW7t6j6e0OeZulDx2/lysvgOo+OZ4jOjoXxEhEiqKUyOq+yFbniw8s7wioriBKYXEDV44v56UuiThwfugmF6ZO9UMeER3MDd+MQqtdlPrYCoVaCxzjA== 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=W5VCQae/u+KrSguTgZokUl+Fxo+cz9ZckZBWA2If+Ro=; b=IZ184cMrl/YvTvhuVCz1knmhrYVZP4XTzewKePnVfidTbioJbXfMcL9OmJfjA1B1Q9Dt4qMZAozlr6wC62LYRu20xqpPHAeKg5lIe6tXeKVd2pvhtBRyVCV9JI6AchH2kE55nVk/eR6FOxMrzUrTfxhaJRJwi7YBHZhY6dkJyI35aAYxHD270Tn1i5euaEEngsyNK39lcz7odvmWwvaJXTbYuxjVea5de2kdPbINMD/ZaEeIv1jWYr7UVtIHNsjUoO5jY50mbZgAxnrLUlGDGdI1inuHnXpTwvDAj8qkLFZsIKHjH2xV+aSxnrDLU1stdFSVEzeJXRoN/gds0ebSXg== 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=W5VCQae/u+KrSguTgZokUl+Fxo+cz9ZckZBWA2If+Ro=; b=h0UI1LW9JGpXzcCp5F8tl53iZNRwY7EI3/GEG/3dLjwR/adSCGQ88e7YbJMZUwoexZjOGWKmCKv6akCKOMGhnIjzDeLrU52HXefWEAJNyFDXUE2MQ7XZRDJWfiusGQq0akq1ZNDXAWmMnmgCtXJjGtX1IeSr21TqBk5jTJu5GIw= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by PH7PR10MB6081.namprd10.prod.outlook.com (2603:10b6:510:1fb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:10:38 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:10:38 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" , "Liam R . Howlett" Subject: [PATCH 08/34] maple_tree: Change RCU checks to WARN_ON() instead of BUG_ON() Date: Tue, 25 Apr 2023 10:09:29 -0400 Message-Id: <20230425140955.3834476-9-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0010.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:86::17) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|PH7PR10MB6081:EE_ X-MS-Office365-Filtering-Correlation-Id: 34799008-0dd1-4355-03da-08db4596d8a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R47gbpjty5yCeT9VWfB79v5GCXyKTzIapZWZ+n69fg3IhlLke3pLQ0l55bpkU0crinIw1Y8gp6Ix5VrulNH0w2iATiilce0WEMAfRrAMTEH8lAfg+o1wAwcZrup47/NfiMjgI35kxGvd7ZtjOVgMAyPgKfno4tZ/aaBvzNe5sNHpJ6p+hPZEfZKjEXm8Dn9LTyV8Rjf5W8WgYlGOcNlei5/wutk72UmsILSLhoCDtVRCsbWrOnilzeCur5v0pBGp+aswNP+j0z2OYksw7QEYdAr2hO8lk0rZ7M1pde8kCWbZfr+F2JSmkSJEhGeC5WEnOYNn5PjVq7oWOKFBSrfPS9/Aj3qxXI7o6R/icZfuA17ibtAjsa3nkY3DJBEMuPyuj0GnudqDdD9uRmEQZMq79Ll0EPLBb9REAWEs3oFSdLGI3RCMsfeEeyhgXwE8ldX8aizeusXvQbkeBzuooCigdmOKB2pqqIukuvAou0x5cmBz4ZdO3K9qkR7vag9/tVjwIDFG5jgFQukEBzjnMRbwwnWfu3id5O5q+nkJ73EC0Ypl7q/i6OGpKg0dsY4OtYD8 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)(396003)(39860400002)(366004)(346002)(376002)(451199021)(4744005)(2906002)(66476007)(66556008)(66946007)(6916009)(4326008)(316002)(5660300002)(8936002)(8676002)(41300700001)(36756003)(86362001)(186003)(26005)(6512007)(1076003)(107886003)(38100700002)(478600001)(6666004)(6486002)(83380400001)(2616005)(6506007)(54906003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NeQf7pFMZSmOiYDZDpOT13FSsEkYGyu7lm6jQfAsMmFvLxkRKb4JCwhWzUUdH4IRi4WdpKdBGXNUVdEOUnZckDNG9R1yTdZiWgPOK4GVHVjUNET4v/3VN4Uxl14aakPqZOiuFm5UDOd4+9bVjgpNMrI9UP9Y0ooYicxlCycovvi/KO3lfOTLkrz5AZg8cGJNQRH/36ocXPd5Fwu58Do8GRw0PKT2TFi3YiF5ChfQ8o68RTHnpTadwtsJO+RV9AP1441XM3JW4iSH/TrQgROePzFHR3tndqzAHmL4Pv7DATciNxw+FN3UQmGYZiIz7z/lnTJGTYoghdUNoHqpDHta0uXKDJGrihpluvj2+3wF48PHSZfqyWae2Kyh9M8iKzHziJyEmHu461fw2vUYz2cMfY7eIqj0Fj2f7R1GKDfQpRQNiQ68nbaJu7Wkph3y+7m4JcmxLvLTLQZ3A2TC1lg2Ac23AEjhROs1rGGLHI/2HIV/1vS+3+T5sWfXdrRye2/wnUARoc+tP20exutMfDH/KhdLDCLpLxcmMFfcLiWn6k+kqYkGXBpQrDA8aR+IUeeCF6xeEUemyX9EeslRUjJZdKpcA8OFubTL7mclYo3zGcbDo5tpVIB91Tw66YDbdLAC4XFrbOeNxLEwYMEKmEtENFCepN5PlztMIJZG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iPNPHA7vNXxLkY1ml/LnNT9Z2ud92aTCM6djOzlLRKuy2txfxN5PHCd51n/0ORgdeHxJolUP0C/jJGYz9dt9s7RoQm59StLRykx+KgsQwbgGWmD6bEauz7VRrccJhYUmJJaLodqvIKAgE/WpWxxJZGZKfamKGDwt+F5+8zxd7HvXLNWeMlFnWXusCHyewdotS0BadV8Artjwa2EMtpmo3ZFcnqmroI/liNskJydpc/cN3OI8mo6igM4WtwQPGoI5X2F2XuUixoobMdBH294tGx8oguJAsTzW1+UHlQPIdQ25ggzSZSV22VjQcDce4UaXGEAEc/o/KyM4hhuNFkX6FUM80BSBFrKY1R9wnvhP3x4WqDqoVUa5lNBFr4KhUigfaDa5Q3iQNX94l2cU8SCYlBQSzctNFv6Qf3+dPe7CpVLkBlPCWEPoat6Rsxuul5JBeTHe5eiqkj5XezEjhML3pTQKJ0TxpR/yMQHxzUEUCkFCGowbX/P000ZndI9zKxGkV5SX3vTL4sxFSFY9g7xIRvNSgwIPJJoJWmyA8pCyqCGWn7Uh9UpMUy5KV1GshFWf0dSnZ/nMELHTRtYO+2AdS8aMStNSknXKyaocWmm7CA6crPVroTqzZynUuRRm88RtwQ3mjBpr5vCWd5L6oTOrprVkENb5/zFdDTcR4dt2LBDdEL497yQ3QybGw9jHeAqQ43+/cuY1WkzBIOUWGq+DdMpOaMx9UfsDCPysRxUckfo74zNw/ByHFEfpCoafUT/cseJxK4K4/LPQToH2+WprtUQs53NNdPuH4lXDlmLFW5DiVrZ/ChDcg6RmVtBkOHKuiuq5aPV9dA3hZjlarkWgPfyVg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 34799008-0dd1-4355-03da-08db4596d8a4 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:10:38.5971 (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: Q+twtW2KcbmfUj+gUWNF0JtwHoxra9BjoROlyJ39AC8yMQLj/JtohWW2yshvpkPPRDoCSr09KCg9AB/m0g44Lg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6081 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: JxUufsA0INALTwPkJNWfSch5F7T54zMx X-Proofpoint-ORIG-GUID: JxUufsA0INALTwPkJNWfSch5F7T54zMx X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 76CC9100017 X-Stat-Signature: wgx53fskgsk6fw1isjd69k3ymj8hchd5 X-Rspam-User: X-HE-Tag: 1682439048-746471 X-HE-Meta: U2FsdGVkX1+1FVfpJw6TRwv84llVLFRV5qy9I2FgArdN/K5hk1p4PKOMq9s9YaMxK+DbdL1CDxnRMxCB2gmrSkc/du9F0vE70NEj9Zb9qH6kDaDgT7ME4Q3E+T+CU1CFZBZgEGk1c8BwP6NKeqCD5Wu0rf4r1uB+wXUWp+9E+8aZpqy0MTYeuGitl/ZY9Xj3VQJfgJQ2CpA5AkSoHTyf6RFBbsr+VJ6NhdIUpyJr9ztBuZoFO5k3Y/U/Q90GhClXERyQ4mIgGFLvSq96DCNKvErqTDThTAupt6Yic2CuJEMcp8U+JP/+HhOlEbWfMooV2HYbG9NVZj8gW0M/7qREIBQ20fnkSkPyUqa8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NpfGvUhAkRSeoRocg 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 204d7941a39ec..ed92abf4c1fb5 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 Tue Apr 25 14:09: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: 13223515 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 9C3E0C6FD18 for ; Tue, 25 Apr 2023 16:30:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 053766B0078; Tue, 25 Apr 2023 12:30:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F1E356B007D; Tue, 25 Apr 2023 12:30:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D712E6B007E; Tue, 25 Apr 2023 12:30:47 -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 C0A5C6B0078 for ; Tue, 25 Apr 2023 12:30:47 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 82A441202E4 for ; Tue, 25 Apr 2023 16:30:47 +0000 (UTC) X-FDA: 80720452134.26.E00BFD3 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf12.hostedemail.com (Postfix) with ESMTP id 108144002E for ; Tue, 25 Apr 2023 16:30:43 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=Hin2L4Av; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=PQPB2CdX; spf=pass (imf12.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=1682440244; 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=YUghTuunJgcPurK2yB3sYGEpr7hZME8pxAnTfemiK8Q=; b=ImD+fQlJvl2g6qV9OXkyIYraHNc2ZAsWWnvjYUbtg9SCrjAH8vo178KVjGiAABACJphsfd zZvUXdwVSwpvnez2qIW+ft4k3m08ePxuASRFHQtY6njSzZZLf8oAloeTwkAaHsqAY39gAJ yvcVfIp4OU7f2R42QmDPAKsv16SO8X0= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682440244; a=rsa-sha256; cv=pass; b=X6klzOULauFwZ90RndlOLxLySMjTUaweym1IQLuGP3HR13YTx0EbB0+cpBvu7uirZ75vhq 33mDYmhBecnx0QX/udRaqyO8pQyeFu3LI5S1UaHr9LstEpKtDgpi19NI2BwYLgz3bOJ0EX AHInmvn0weuTGpmMU1pc0Gry+6Nt6eE= ARC-Authentication-Results: i=2; imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=Hin2L4Av; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=PQPB2CdX; spf=pass (imf12.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 33PDhp3u001833; Tue, 25 Apr 2023 14:10: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=YUghTuunJgcPurK2yB3sYGEpr7hZME8pxAnTfemiK8Q=; b=Hin2L4Avha5hRrApUltqdITx5y+OjvHvVoPFqStk7Sybqyyhc2nHKKRe+4bKVhdcMmYr qjVQIKdf3SBtGZs56Xk/NJfjmCVjwO+BMdS5Vthwnatz5ELGJal+fRMsaelIbgNdrKgu yJl6nBCsoKrFIx+vFYhfdfoj7Gn2mtIJxxAMHPSJ1P2lhmzj8kQ/M7jP9w2UVCXn6ium 1lJeAlah52ZEFGGDiQfkMi0L2k4rKMfawzoHPf19orudkmP463JvpDhXEzPBuyN53YEB mDRZC+pTiLE3ppAyd4g0UoHkxtmN6TjThymkb/l+EfpW9YtoNJsEi6YMKGHbPjSnafAL gQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q47mcwfc6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:43 +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 33PDHQcq025044; Tue, 25 Apr 2023 14:10:42 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2109.outbound.protection.outlook.com [104.47.55.109]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3q461crbm3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SaUhzlafQQ9yYlccNTLHD4M0s3ccdDo1Nz29H2rFN4b3ZV9vTgpNhOCsgf8DNatz7lZ39YLJL57cn5Hcd6A3Ac28tATBke/BLitoDcUEWutOupP1L1lEpDzMByICrfhNu0UqLac+CtxWFUG/27R2xg1gZtQXAC6XbBAWij+r1g1sfI7VEaBdJ6hfKySXwNIAtrJ2i0kTwjyAZtcW0cPbyD2mwVCUGvApXnTbHkhYH9t6Apszw6rGpPyuNdeM/yTcyivCiSLTAwY99Clxs8Ff9utrlfSj/DISYvQAMIJd1GfKagfJRfVYccr9y77obolzZJC4r8RaTSoPHnoAyy757g== 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=YUghTuunJgcPurK2yB3sYGEpr7hZME8pxAnTfemiK8Q=; b=OFxMGWKsI+iJ3RlmcJ2+ljn27CQb1mYdimwLOc9Qyxwx14Y9oMnzOG0L1X1Hke54nWzYoHs4sEZgjxRqS4I6d1eZ2VCqP8zqV6wxLcPdXLrM1Y5EJxYfGdxVKaKozLhzFllXsGDFSCSEnZPYsY6idVhhZogFjPR9+v1LKDJvqNKvIGnE6Dt04iwDuxSXoAEoQbu70RpsvCFgnSsggd88MaZJTU5VGy+XtYLBtRcMPq9gNlBbWQvDx001eGJ+ccwFM3k6FbiJC8cp//QPvTrX7SbmO/O1RfH4HuDloCUneuoU3dSm3IzZf5Ldb+6Cor0syog/F942rew6BuAhHFnyXg== 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=YUghTuunJgcPurK2yB3sYGEpr7hZME8pxAnTfemiK8Q=; b=PQPB2CdXqlm1iYT9hz+kpjIO2eK4c6xR0uMPZCKkR2D5GhEqt0UeAGaAwSJtumD8lZ55rW4p0+lSg+xJrmS5a+LuYyxAA1Op74xV4oPuZphT7bzWNk2iOH6KYkKYDVUYfuYhoOGTfQU2tnbA5W9Jacu+H9AuSJPsNLIRrgRz5LU= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CYYPR10MB7650.namprd10.prod.outlook.com (2603:10b6:930:b8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.34; Tue, 25 Apr 2023 14:10:40 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:10:40 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" , "Liam R . Howlett" Subject: [PATCH 09/34] maple_tree: Convert debug code to use MT_WARN_ON() and MAS_WARN_ON() Date: Tue, 25 Apr 2023 10:09:30 -0400 Message-Id: <20230425140955.3834476-10-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-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_|CYYPR10MB7650:EE_ X-MS-Office365-Filtering-Correlation-Id: 02409481-c407-4bd9-ddc1-08db4596d9c6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0G3jzgU4rwtAw1RPHuNn51OpKddVO/zf0xpOQMHLzegv3KXJYG3UTzI2kIMzSgNb2+sq2IJklliS0WCBho7J2YhNQ0CK8NhH5jxDnZs2lApAP0tx6z4S5tNxd8dfn0Nl7Z8ba0poQ6xNF1Kjy7RLh8Qdm+YgFM1ZIVUIKtdx2OJNC+tHM7c9Bjlf8f/yQpseFy7MNe+nTbHUxcc6AT494i8Imf2+cDjV5gHx+kUjMA2T8TzKGXFTbjzmr3bQD4pW0U3Vn2651F8504Xdha8sGJ5rGLgeCum4+c25CpKbFubNok85PKHUjQG4td/GRBMFuKVMCul+yM6uQotOWK2Qw30B1und0Rnfyg5MXArReEYm3DEgMzYV/oiKfpSZ7a2RhU/9MP0JLlkzhBIEKLw6DElAbZ86ZaWCrILx5qLCBTz7c1TXStJ9jUbsnTXvZDgGbrDTbTDpY+YGfErCwn7Bwm7kYoqjFLnExuqK0OY/3m1wLU6F4kCAuDFJiTrghoK5t8huuv/xtV47/3xeUsEjF3wV1ifgrQl5i6dl14QmJTH2lxie5P6LHa87AVwPW3k/ 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)(376002)(396003)(39860400002)(346002)(451199021)(316002)(6916009)(4326008)(38100700002)(41300700001)(5660300002)(8936002)(8676002)(36756003)(86362001)(2906002)(66476007)(66556008)(6486002)(6666004)(6512007)(6506007)(1076003)(26005)(107886003)(478600001)(2616005)(83380400001)(186003)(54906003)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RwIIdaExrx/wPTlZG0dy2F5q4YrrjYEuz9AoLvH1kzonWfzi05zeBiJEjHbRkzVHv/hb0VIZxRks8bvhK9Ht1/GEzjrD8IXR68mW5ViwxGCiX9mT83f3nHKZrnyBrdFhpX6M/wBmZEfQZ9WA4qAXrqUcXi59c23UnxmXh4Xw5gRik2wKNRgAniBsGKS8EMY7cN567NuqFm9SMjir/TiKfrntehgeXEr/Kw+L5VlD6zObhmHThYSebCqkBo1eQpoZxCKv1+hIS5Mo9MhPZ3pqBLbbnuSnruhiD3AkYn2q3D91lPsiHjRP44OeWFO+iG+WLKjP+iX+RQvF65U2EV+ioUXtsIwSY+OFHpJJ8TojE/Ai9/CLVkc3ia1jBPXDyiArUVfxaWwa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zekFybmBmeN/U0MXwZQcjHCgwIc+AiQ1DRWCgxb49/nztUC21IVuoZjJkPk45up5mc0JAi2cyDw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02409481-c407-4bd9-ddc1-08db4596d9c6 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:10:40.5061 (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: ZcOeidtT3KyzcbJtDWuur7kTqo84HOUhF3VFRh63BCzbnECMmJeXgIjCaCTVJB34vnmHoZDI/lHYmbd2Vb0F+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7650 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: WOrgBsNIbS9dHqb77X7Rz5YXewIieZT5 X-Proofpoint-ORIG-GUID: WOrgBsNIbS9dHqb77X7Rz5YXewIieZT5 X-Rspam-User: X-Rspamd-Queue-Id: 108144002E X-Rspamd-Server: rspam09 X-Stat-Signature: yysdr67orxm9ojxiz8rjms6q4bxk1ucs X-HE-Tag: 1682440243-671880 X-HE-Meta: U2FsdGVkX1/CsBRIaafrH2DSDeDXWH37tH1ZGp/Ikjj5mpEAY0RY3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zM9auD0kEL08PVs2Dp/pPwNkhGaKvGGKlNFP7G9UMNjk3KotpDEbGV7EV/cDjniMh5tO2bssh1KipMoCKfwHMySh6iRGLGc1Is1c/wA9MKKVcOdZQA8SkogyQHVQFQhhVG4hsM6lmKZ2bss3uk07yGADQB4A6PY7kSpNWoJQEnDTZSRZJ5XlBm6WyL/4zfMJViCeUNwgJqLH9Ra9ucK/lwnm+P0SGqd1ZBtr9IZgd7RoejmQcLWqJ+PyCteFBEp2SkAR9V/6zFlIzRpvLq7GBST/w= 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 662a9ecccecbf..d22a337e9cb6b 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5699,9 +5699,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; @@ -6530,10 +6530,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 } @@ -6679,7 +6678,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); @@ -6690,7 +6689,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); @@ -7134,18 +7133,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) @@ -7168,7 +7167,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); } } } @@ -7227,16 +7226,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 Tue Apr 25 14:09: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: 13223375 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 AA8CEC77B61 for ; Tue, 25 Apr 2023 14:10:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4A6086B007E; Tue, 25 Apr 2023 10:10:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 456086B0080; Tue, 25 Apr 2023 10:10:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2CFD16B0081; Tue, 25 Apr 2023 10:10:50 -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 198596B007E for ; Tue, 25 Apr 2023 10:10:50 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id D0D57401BC for ; Tue, 25 Apr 2023 14:10:49 +0000 (UTC) X-FDA: 80720099418.09.D839C0D Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf06.hostedemail.com (Postfix) with ESMTP id 7C05C18000E for ; Tue, 25 Apr 2023 14:10:46 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=qSl09W8w; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=hovDSzQ1; spf=pass (imf06.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=1682431846; 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=aZS8RD999fUgHdsJnnn80kjdGzDf6FA1XiFSDSQtpFI=; b=5nPgWSI6SOKFn44LUjbG/FQkcCVTp1Ty4MITeQcYWLVApYP4ciSRNs1IrSBp8y2EPrIzDL kg5jN288BKsxYwtSzh6Z7HCW8nHK7xYjOc+BanVEOzQabPgqxzVtUt5Lnzq/2xv+kG6DOf d88/a65gFnZdaETZEtylLIo4fPCLo0c= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431846; a=rsa-sha256; cv=pass; b=laIsjUHwyMD30p0WZGQJgdgkGyqSfTCO/HEqsdg0IpvV+A1SW/I9TXP9XpQ/tpfd0X8wKT 4lHPcb36rxgy+LGTo8HaoOZaNlQbX4eKkuJJqbnKaXVQEkVNuvV2iu5q3Vee6RX5UTo/Jc VUz3ZHN8mLOsxPr69fSdYWf3AesQ9qs= ARC-Authentication-Results: i=2; imf06.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=qSl09W8w; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=hovDSzQ1; spf=pass (imf06.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 (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33PDi7CU024310; Tue, 25 Apr 2023 14:10: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=aZS8RD999fUgHdsJnnn80kjdGzDf6FA1XiFSDSQtpFI=; b=qSl09W8wn8ygealFzlkj4JZX1Pz6E7GJPZMWyvAHJt/ow+H9QOcNxhgnBhcq66P5GQBW s/IXO8Ti51FPvKCsm16LAVlc0roQnQ725Ursv85tczGnPRzoRtcEcV5CLE1cv6UtVigC /+zi96+u7+8QcfhpYnhHlQBJZFPnpB4c4yeoJQZkPKgLLBSxsCimzsCsLUfcM7+0a0EO wje1NITNOYuDDaqDM8/h2qagBaWsVqRUj6muTQ+4j3qrpHHesohcC9OCWwJw9DUaYpqR Jg0MVE+Tkk/uXIciS2sWs7xL5AS6GzdU3sLxK2I8pgssRKoDcOfLi+pYKl6SvF/ETnz/ Tg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q46c45fup-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:45 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 33PDXeU7032632; Tue, 25 Apr 2023 14:10:44 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2104.outbound.protection.outlook.com [104.47.55.104]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616qsny-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ginNR8HuvBZAVH04OcErruBgsBGzEYbAZ+EOiZqD3JxH6lE7mcl0P7XPqRVUx/Bf5+j97lEpqhuWlhB7CMy07zszG4p1Y4+3kXACU/EYXvK0vF0v+8I+f9/X/FNx/TbhahISU0DaXxAvaLrEAhrw5kwBy+SZerT1AAGnipsOKr1B/sKnN/R1hXr3eQFp2TB6IiMwYXGogCbOlIIH3bAEIbyhazo+ARXMD3ZK2b0SswqNH/TtOCBm6gXgeB3H4xnNl0MOYKG1ucZjC846F6oNBfmGD57NhX4X3BYTa+RGxAdg/wQJ5Luu7AEgN7JYe9mvoeo7lDEF+xiS69xOqa0NAA== 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=aZS8RD999fUgHdsJnnn80kjdGzDf6FA1XiFSDSQtpFI=; b=dtX11oAxCfvddo2Ll2Jc/Q5Ik4rZ21Go0dbzL2881/DUhfe6pxM6Ulb8B6ey+N8SB6plCKsnXq4NEpcsvD+6BL9fwX+7zM6giy193hGMemDeaTUTH+7eI8YAFq3mpnCHEsNm4Uv/oXdsflgcmDunyfGBKeYmPfStkgX3qiDExTJcwxh6is0pWmj3xoHz3YUYfDn90EVE/ENWdHA030DDv/nyF4hMAoxUliCcDn4NgQ/lbWwbZK/w1TnHbAWoLr0ZlxLQBmb+1yb+vRAlD+PlKwiXDQr8fcWNIiyvDEHQIIhDKVdjQVX1rzVGfTVAKuxR5IJsKlme7SMsCn2xLvvJnA== 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=aZS8RD999fUgHdsJnnn80kjdGzDf6FA1XiFSDSQtpFI=; b=hovDSzQ1v8EhmDQ1BJk3ZjZbiql72Uq8Zj+WmFgVsiIbr6jjeus3paq1PFRAJ+vY7aFfARYRGjKhYId6ejJ3hegQBjCyaAxo98I0VtCNf/o3SmM2pDLdhIfxtPxng3Bajk+vIAqTfV7KgWWgWGe4GcW+9OvvWG4iPqCv9E1abt0= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CYYPR10MB7650.namprd10.prod.outlook.com (2603:10b6:930:b8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.34; Tue, 25 Apr 2023 14:10:42 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:10:42 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 10/34] maple_tree: Use MAS_BUG_ON() when setting a leaf node as a parent Date: Tue, 25 Apr 2023 10:09:31 -0400 Message-Id: <20230425140955.3834476-11-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0103.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d7::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_|CYYPR10MB7650:EE_ X-MS-Office365-Filtering-Correlation-Id: d93acc99-006c-44ba-535f-08db4596db06 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sdJzv/Ff6UGp12bjuFdwmtH7FPD6WH7Cdb1Qi7UsoUGDmj/pYcKeDWGAGs+RpvlQGiXzo/uUuWDOYDDPiPDu3V+QjzXQULWGvBNAaHLUe1K+n0Sdvzx4F05xVH9xq/juUIyuGJp5YmGN3XewqBMaHHG3WPt+vbqBlED+mDYeZPF3rSgNLCGPp5GzJCePfaYregtI56W9Oh3cjKaIfwEtK0DPj4u6VkvnT3vz7U3oRC+EPmqLeioudsL7Z1DuDT4fGDYprQ1oME2Mr9Zjh+2tcNUO1dNU8QFm/fNQ6hoqGOomLSpfL5dZpadapXM/0/XvzNWAn1wz2a5PDiAEV/sr31DpFJuKNGllKKqf75b6bDmBNCciqTGHocT4s2FzxMvsgZbi6OhB2c5rRMa6gt/6mtBN22eEoVmKn8vslDbnHtmbHuuBpgoGtR3e30zZQpohwiqOKssCO2AjABsgFPVJ2xH4LrHXEEad5M9j050zhAwXwO5sVMz9S6G23PkUbKfRSdAHjUUakZtDoAcSAOzsjsIayeXWqvqe6eaGQvHzSrgVLqTBP+wu0L1/QToy5mZo 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)(376002)(396003)(39860400002)(346002)(451199021)(316002)(6916009)(4326008)(38100700002)(41300700001)(5660300002)(8936002)(8676002)(36756003)(86362001)(2906002)(66476007)(66556008)(6486002)(6666004)(6512007)(6506007)(1076003)(26005)(107886003)(478600001)(2616005)(83380400001)(186003)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: At+f95QINEROlHceWSzT+Csbqqc1ebgMRM7/V2ODqgOFnLoLmMMtklo62sROo3oE20IkeJS/x6Yq/d6HhXNu9pPqZ0y/Hz5h1jkK6TXUhq+74gQ0xEOCNi42pOo3HHCKgIMHIui92yJGHTZaQJLq6liiLVyx5Gp6+W1dVhXsReyQKDtO4lHTKOuHA4I9ItivGQgCO8ena6GbPCHph6aRL4mNHS7vtTWdyHXV8Vd4yt3oPE1m+t6JJqdyK3nmXiaP7sSGSFzHb331qq1rm8JB0ZAdoOaVngzyYOc2UCUGu59/U5hT3kScxd80Osu8XYQZOe1LOpa1LQN+LtkXujnCOlS6KlnuVCxMC4rsne4kHESdTwgv18aXQSfh3wiaBG2cQiEoI5I4c3b3FiL6zXWE8UoDeN29L32q1d1h8c1rd9pmqsG8vLDCnKF/ecmfbq0tw6bgUJ4BnmdyK6OKovGjMVtvTVfwgMRcHd0BDd8elw32cv2CsA/Xv86pEDsmrPojTguKzDGzyiUhuD0y/50Z/xnLIUH3wcBRdf6MRL/MXxsMFqkJgm9dotVwtm2Y0AvHqmGAUwQnPLu4iWevIs7e0BLYq83dfE07GkdKlHqnCCmLyLXol0k2TWcxl/OjMsr8vrWZPUGCKlPq+VyPAuupcGuIvT98PuQ9pP2Ov/10a92YT+e58F4JH6Jbo9gy117QlkMLQQvQj9KxDIRownbTLcM4JtBOsLyT92ooDP7DSbeRshz5YUBP4Hii2vmRJFmsbpQbgysgUeMhGQ1ZfMUcySJUPtABCCSMHgqWunHP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xnFLMUt51FEZD5m7Xg5tQUPbqqgD28w+euKOLEfmwUBQ4Ta7kPIR6+yBj2DhYBCU+SbU5BBahItnaj3LXybvSkn11mdBox5UISwOoE8C2UkmybE5QP+LgCxDbbCRyUdYBnJsbx0VnWM9XWeH6tQxQ4gL51JtsW5iAJZSN83yTWCMhqmWkb9mE7tTgT9XbT/7NUc7yKg8lX7Uu/ABbeO2ZBbfP15cjxkNodbdNUV4qSaw8Tg97NdbFUKCUAkcmzvH3C2MkwjOeChGimtHa4zNyT8+sOs2ZjyVhNRtiFDCuqoZ35CWPG/950j1voYL/tN7YtOy2+9pheL4o9YQAcr5LeAvTrk3a2rKw4ndK0KY4lRO8u8JM/am5khRnWWGXWYrI2NjnWfrw8sxNIkfVT9vZLPM+5DEW0qRsWr/SFlL9yBtAW7k6pkgJ8TwHJcTw9BJW2uxg/CJaT02veDiXQtb4HrkBXk7cjD6zMePU8G0BRNjTgqt0DaCLCwO9jubwJr4xx89MLsJUH8zIOaWzJMBZBmx8+UDVgfYry7HnehEpEmCJMYOGBXB6kHvJXJuJQsQnmMBplkypqnh2SBopSZgEEPCWBVOoZ2zFAzPiv8VgnEVaavU7VvaGhzBuqR3oVmcVy/cW0R29rptw417WIbNjKhSa26ZhhjCGyBopMsMt6FI55zN9HAsAQHPqyx9oAaxKs7Tih9Z8QJRhmm66Dw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d93acc99-006c-44ba-535f-08db4596db06 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:10:42.6032 (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: LSOynljhkeLzPFG58VUq3pVqNF6RNcjAbKMqlKlWLuBiN0TSKeIgdr4aB7s9VLteKasChsT7/Ki5RIyDrQHdvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7650 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: OHm_kFK_F9__pGBtlMlXIDF6DwxufVgl X-Proofpoint-ORIG-GUID: OHm_kFK_F9__pGBtlMlXIDF6DwxufVgl X-Rspam-User: X-Rspamd-Queue-Id: 7C05C18000E X-Rspamd-Server: rspam09 X-Stat-Signature: p98i5yczr3ko4u53owm8fy4s38ecdqna X-HE-Tag: 1682431846-49818 X-HE-Meta: U2FsdGVkX1/sCN3XAZrqSRaYHy4qYdh4Vwbu0Ojm08xBHwIrtvvM1WVWg85tgVzOF0H9DYreYKJcUTMwNS1uxHaQW7Dge0flk2JRrzbQZ0MB26uvxurlAb3gJs3I3oDzOjMuRNPVH/nHUydDkbwiuDPy/6PP5APoTWOA0K3xxrCeHQPrHvlFi5BxRLOYnrbKqpbV5QFrk8kjzXaYin3s4UalGCYSevEzlpr9Ptl8rJRvY9rzf7HgVqN3iyMCoP+K4UxMyTP21pZTgMlhvn/fsgRGfgh8VAibLYdXKq+0TNFlVYOV/hH4bDAQ65LXgjTkGMKjxIMjQ3qY00shtKYwLXLMP7Db1EvnNFd4GQPD8Axip/0TFNN90X4odbvuiM+h86SHlWhawDzFao3Bl4zFtM4eu8udeF7fT2JLdJYuQeL3PWqS6+oz//BkdoWo7x7dKqtKCmkb+kGcr27QSD1n/vZcqFt2dlhfGNmuc7dB/yeVlxiO7Z4gLhG/c/tF6V2Avxy4xyzzvohjMXA/CxsCUYiW5m+ZaPKl0CTmxSyVmWByTMygSaATnZ3NasffQ8CkiWRQ6y5UdRX6pGzGEjrMY5QE8J8zaRAD2vZo53siuNBGMTn7902zl8lcXYZJGVUq9X9Ph+WwUtSOKGL9GQ2o89omi19b65nYiy6nRJu2nJthJ3Z13g2JjN4dezbc8MsHel7TG5QAASGuzr2evtV+vBg0Z+Zxou0WAUMTQp/HcC8jDAv0IcZyfnlegWb0Zu1+K8AWRvRYmqDrCCpLX4xzFNGNfgRU06jOY6Za3OhEQ8EWtHIKslB4quT2GEutXHCUYWGfUdM+hYvZZEVzgSoVdRQ/F3rc1yVKQIxHvhjWqZDFyka1esHXc9VW/7SVck+Spw3biuWjVAAuFaGvbnSwKCU584WAs1Lc8mGeFcfzPYIs/r75pfzVHHR0+JUyAtCKWTTDIztz3MDhY/oeoF/ f8uhn03m T0NVRM/UJq+FfFh3WVCKG4IIKuZnwimhjSKp+ZndjzRlnQ3i/2W/h0g/qB5C5X8souy+PY8nrvMJSOLe+e1v/Ezb247N5mCAb9YW7zKN3pMjQGtlhPqTy6lBlRTq9VpM6iXERyRNaDD0sA8wEILDzF9YbDkSfMszEsW4JeURGqkoKsZhGs6cEENqhuSz61EAiQ4CakJkI0N9oc8aoHlKfwhsmy3MIMcyVvS8pvIimITp73AW2WQQn01tRjNdwJUXRsdO9+QJj42QmZZWWiCZEoCjHjlg8jzfLLljXBTFdwoMeEHgAJldKWYpcRjx5SnpHj1XKjN7FzNpVVYdQ2hgTT2I5XI4w+llIKQViUiCK4JekBRvFHYO5dhOEHMcP90LqXKsyukgQ0HzXLJtW75sUj2JkCNl20fNMfNexLZxJVwVyotQ= 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 even 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 d22a337e9cb6b..441592be039a2 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -453,7 +453,7 @@ enum maple_type mas_parent_enum(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_enum(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: @@ -1741,7 +1741,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--); } @@ -2706,9 +2706,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)++; } @@ -3105,12 +3105,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: @@ -3337,8 +3337,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 Tue Apr 25 14:09: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: 13223376 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 6355EC77B78 for ; Tue, 25 Apr 2023 14:10:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6C8B86B0080; Tue, 25 Apr 2023 10:10:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6791A6B0081; Tue, 25 Apr 2023 10:10:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4CC866B0082; Tue, 25 Apr 2023 10:10:52 -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 3B3C26B0080 for ; Tue, 25 Apr 2023 10:10:52 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 130B940193 for ; Tue, 25 Apr 2023 14:10:52 +0000 (UTC) X-FDA: 80720099544.05.949AEFB Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf28.hostedemail.com (Postfix) with ESMTP id C9A8BC0009 for ; Tue, 25 Apr 2023 14:10:48 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=zdAb5kmU; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=RMjzRY8u; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf28.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=1682431848; 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=Kft5REKonD4Srs2Rad0KiajjvtvFMzXh9RlWg1rTwc0=; b=4njFtyIm/rq0l9FUJ7f5iAYxnpaSVRiHzk+vV8OHS9CJCwmnfHH8BAkuA50giANL2EU4kf YE4La4yVZI4u6Dm0KMnx0s3ZJw8i23BpYCPlb06EBgSppxbHaWgniIVAQejjQyuO0dkmI2 VAyLOneehzYOSO1wnBghAm4ZY8yUiD4= ARC-Authentication-Results: i=2; imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=zdAb5kmU; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=RMjzRY8u; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf28.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=1682431848; a=rsa-sha256; cv=pass; b=FxDipdboPuOXvr4n8dnpZP1X72T6PQlWmfjBVQP8WNW/yTinXjyG8zdL+TQRNfOk0Ypb3w ogfQ3BMUMecbodXxxsa51yBVSmQ6QMhm2Dw5Yvx0+lIYznKL5XW9PONEZstnlhnjVHNQAT 8ERC4Wumiig83Ahp7n63wvf2vfivRbA= 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 33PDi2Zp008719; Tue, 25 Apr 2023 14:10: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=Kft5REKonD4Srs2Rad0KiajjvtvFMzXh9RlWg1rTwc0=; b=zdAb5kmUDIpWXTaQEWuke0WIsYGjPdIGzov/kjQ52yBXS5gd0ZZTo/c+c+9Kd9yTL4hV mBX3EajBSfOE7+CuNPxSe/ZZ9u1P/DZTJS48mixb7HrdHye8GHFXpB8OLDBMJQoBYON6 ExOxMIDzIuWNf3jYPcSbfu0Uj6hhB0+hEewSGGoMJmlGaGIGmNuQPLyFGWtqetcYFzCa P7+8mlzq/oFH5UJbN+xfiervmxSoM7UNceBpjBc3+Q6uX61oZVTB8iC1zEi6JtaG1mTJ hiSCV/A+E9E7URcvq79eVWrFPCW0dzAYJreGGY55sJzgQ9xepP90rR+DRL3ojDONTM62 qA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q460d5e4u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:47 +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 33PDJkRf032787; Tue, 25 Apr 2023 14:10:46 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2105.outbound.protection.outlook.com [104.47.55.105]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616qsr8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gMt6jEnHj4hTQXMbJXTjr6DMOYNSGu0xyrFe3DYLEaFLtgHeEzhbpkYSKMhUUjIXy7ZEOkksO6W2uobot36XaTpcbAEDuAavpxG4hqg8vZ9K9WbzEi7B0dKOWJzRghgTgsVWwf1Hq2m03OpZhhXngkTxgJRe0KwGdSov6FHeIIQvMsQRDwx9PgB/rwR1cHxBKK/HoBUNi5dy+m2ov77RkOrVM298YB64999VleO9gmmRzjz9mRsSAmTrqQajbyK+TP9Pnz/vEszqY+fMg4xWmkzWB3DY4VCnHFsdN0GqKQBYyzLqPJjxIZR8cyGvUPtuoX0FNA6lAoWfKOArNSDKlQ== 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=Kft5REKonD4Srs2Rad0KiajjvtvFMzXh9RlWg1rTwc0=; b=Fbc2K9JmgpIYp7C/KEkyTX4DuWHCg5Zk3j0KQ74cxCB5sTlf43nyIvRABFFt1ZBVYcL/W6ogtHnrG1jGgpAT9eN4UOs94xiG4jIZcaOzZewVqvskNViM5nrpGDoL+O0IGATkJrz4QaiJOsvtk8WM0FywPL5nk78QTRE1CmUAXIaeB56clmKii0DNhh6bgXVll9WD9693UMj3zgeDPxiuX+6XRFQzZZ7Z1tUCdvlyLxk7a2/fNnJeT9W7FcNoNT9OMYmSPjSAMdZ1g43SjI5NV0GHOLmdqHF1hFmZ400N55wwGDP/uYfSkJenOgPjh3Rt8lp22qbiXaRDY5GC8NjogQ== 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=Kft5REKonD4Srs2Rad0KiajjvtvFMzXh9RlWg1rTwc0=; b=RMjzRY8uiUK9jV2+rgDxH92+P6FtAg2QwzwTRdzmc5weyIF7YSmdRC/rPSQUogEjB0xcMjdQcN7R1aqHl9JgHcYIHJyk0VpeON1fHPAwoEMecrqn0rF50LpxyD9ZeTzn6XDOdYjpi1aeEZAJv79KwcdrKyFC69wcO/yqk1oSc+U= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CYYPR10MB7650.namprd10.prod.outlook.com (2603:10b6:930:b8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.34; Tue, 25 Apr 2023 14:10:44 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:10:44 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 11/34] maple_tree: Use MAS_BUG_ON() in mas_set_height() Date: Tue, 25 Apr 2023 10:09:32 -0400 Message-Id: <20230425140955.3834476-12-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0059.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:111::9) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|CYYPR10MB7650:EE_ X-MS-Office365-Filtering-Correlation-Id: ddda0046-44f1-46d1-7909-08db4596dc56 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JcFKy9KdOnTqTRWczZoXc0Wt9nPjLTFhWEspg7ZEVa7G0WZF59qX1+huAhHhB+JNVawYmX00jNZG0GLU3WcLqO5sPc6xGAmsTQJJFOXyuKisCpoUKNtIVIgEG0ExLwcGrlnKu1ltZ/e2iXsdT1HH1cQ4zmf6swdBaEe3ZSUyQqvTgvwQrHwwf+dkNuwN7G7kETAASKGOIJziqYQ7PogzgsioI6nFkYu7aY2QYExSIK0To+oEudN4QBoq3hutFSCK40K/6Pw2G1B6+6zrne80o/anyO6fOm/s7WWCz4FcWc/WtcWG8A0fFnppSDzykVKNVyBeClFhr2KDcMFtedC6xQ8EaMZm7PIpiYoXjpgdbFSvx6UCe/hxCxOWtPQ/aoFuTxjDayicZb9jxvEvgsPv4lPiVsTkvkv7K5VDrwAHZgqGO2YqZ3b2dqPtC4ydS2szosgIFCjsO8MgD5cX31O85vwuDPt2lBo6Scf3zBT3H8KD4aGgUFYJbxYeJwIjT7du+6V+cNzXkMzQ7xXZzBDjQ5bdQIGBPaMC8dToEl+C4hUpvFX7xyQ4aeHEvIR2eQ5k 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)(376002)(396003)(39860400002)(346002)(451199021)(316002)(6916009)(4326008)(38100700002)(41300700001)(5660300002)(8936002)(8676002)(36756003)(86362001)(2906002)(4744005)(66476007)(66556008)(6486002)(6666004)(6512007)(6506007)(1076003)(26005)(107886003)(478600001)(2616005)(83380400001)(186003)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qNdUQDsn4vejCg/kY7jl5scHa+z1dlQXv+wFUYUer0lY7CeVZVf7GgP6t8ZQIbpnZRU5Girg1RJXbvXnqtVKr43Wpmx2nNnkqB4uMLqy9o0fufIRnoco5U7s1pJFU2Vgm8UlFh3dLwqbew3b+yA9blqdc/QB9r8I/GBTolHPDu4I0xVeaODGGJXfu1fGi1i22NVh+qDwTa7f4ncvtufGsSO8aY6+ymeHo2youknKAo0FhUza5m5B3U4SBdagvMkkXO9fpt/bUq01jBNKPpaiEZuyBF6+EeLdX76FbNGJ34QG+mRcsBYx5kdE0Mf7whwH1nqZuHn/DwLK91BFs2Mf6h0SS3htgtDksTrGAYs13kEKpKkeRiZzKM0sqBtIf2R/4s6Pth80gROGl3w2lOuYdPByje3UzYHqqMP1nzaZwr0smXC3hetUDD1CubOSfEPUwTHVTGJ0VKPRayAW5sPKpMvJKmR+VVZ2Dlr8XffZ4FI+F1k4e24ye61Okc1v+gCXTNKas3m2rQWfxyRxeuYNH+/NuOhFB+6dd4VdNctlmPpzf4Uf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am-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: R6h7xf+iM/jVjHCn3ZnV3MqmEx69BW/X30b0+EhDcYyqUtYg4ck3BGtEu+mIviTP6WoJGCvhecxJU0WY2aoXZhDs9k0UAufEav+FH+CLPpgcF5jy8kzvxsxTrSdJuznmvO7ltwiBA3gLuFXKOTawzIEOFLDPqcLP1mHA6Z23aoh3QUfTHHqpMFA/9VyL/MmwaVy9t5aDPMS4Be4/lbdRSPtYQ9qajolBHRCzOEdE0z5yyBRFkLvQWNqFGmIGE1d1Cv2zi0jZx2nDIn9JhIl9T1nSWmxLsGKLbgKU+a1yTabtLyhdR9N4KpIMTd4vjciqBfVY1hGRWN6L+Edp0dW2DM7zaL76oF0jQvmxLTXSwoWvLAxiehlQmmQ9F8QtGwn5WnVibGMKhjUmy/WjV+UPFGZhwsLh5I7M91hVcLZNn2yhWJOtfABZQQvpmlqGb+xEpEPJuQ81qX3ZnhXMY7W+JshM2fA7GxVBEIJEmibX6M/rHNVClQO9h3pBbcflBTCF4LvC3JWRbls5WPTJeFua3QAicYUh6nwbhR0Lb37OtkDrZoeAqYucRmDiT47OPxPm+/jerbletBLjNBXkanlqSnf2qsnMCJKDXtHDkq/wQ11MM3KgB3v5ZaCI7HEEjlAOfvd2s110cG969xS6iqnaeXAq9WmYhkV9jS05HGpBDLOnqPLxjvN0xV0X++YuAliC+OiAGZagOsmEJ5feGU8tNwfAD0hzPxiKMuKaKODK/g3mbNv4aD09/D0zyueUF3UqgMbw/eGiXK8JA5X3FYrvH0Hqhe2pR3q/rvCm8hXGtT4lD7EH73faRDktIQfdzPJI27Nir8/FHHQ43zDFL7QmexuDBv0vCWJ2SbAxpM/bwasKkPhpA37Acd87VANFBc8/fnmJmublQEu/Xjjn8zh3DQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ddda0046-44f1-46d1-7909-08db4596dc56 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:10:44.8060 (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: iedxUfOvok6JOIKU0WreE0PJzY7ptoLO4gjIJn0NiwEsKZd0YUKDelWhG+Cw+boDTCynAH4A9avLVCRY9N2M+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7650 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: 5eCsCrHMlg9rpdwdkJZY6_BwnNgZGZVi X-Proofpoint-ORIG-GUID: 5eCsCrHMlg9rpdwdkJZY6_BwnNgZGZVi X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: C9A8BC0009 X-Rspam-User: X-Stat-Signature: q8m33i7y8ux49m7gsiz1xxgm678so4g3 X-HE-Tag: 1682431848-49722 X-HE-Meta: U2FsdGVkX1+p6CjoQA/+nX98Yif3E0+U/lG+wtaXx/7vDqpkXPKMaW0yA/urpis6q9UVSiKiI72/H8L0z90d29E1NphG0ZRplYmpuItk66cyu/ypGnhM7r+QpGuSrTs3YDYV4h3XWS45ZrlukRHAzCpNMsOgmJBv6qPBPXbZmcfKnLZRc4hrNgBQgx32Bz8mYPHS0ppuFQtt9KarQRT/6uxltuVT4CU2F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BetMpztj83rLbIM2W8KZOJb7Z/jZLZpHfNvcmjyzHbAu5k/KtL9U1nL48SCDxhHvYjHBi2F/z5p2lv6fGPH+zzS9Dl0166zcB+1TpKlY/L8xMoMpRZaNyq8LTLr7JQE= 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() instead of MT_BUG_ON() to get the maple state information. In the unlikely even 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 441592be039a2..f1ce3852712db 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 Tue Apr 25 14:09: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: 13223377 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 53936C6FD18 for ; Tue, 25 Apr 2023 14:10:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C1B16B0081; Tue, 25 Apr 2023 10:10:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1713C6B0082; Tue, 25 Apr 2023 10:10:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB81C6B0083; Tue, 25 Apr 2023 10:10:54 -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 DC0EC6B0081 for ; Tue, 25 Apr 2023 10:10:54 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 7C1ADA0217 for ; Tue, 25 Apr 2023 14:10:54 +0000 (UTC) X-FDA: 80720099628.30.517DE1F Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf19.hostedemail.com (Postfix) with ESMTP id 1B4001A001C for ; Tue, 25 Apr 2023 14:10:50 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=GsffDF5u; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=fYilZPNW; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf19.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=1682431851; 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=dQI17GQLfY51LpW9gZrstzngT29+VqpfaYKOYKfoYG0=; b=IVdA/ZSu5P90F/63dxZ2LgB4bzrQIjRmkoAikcKxWyCqcDG0FwREgV63s+S97mwpFgwQAR SYfR9bukGSb3s/LkK39XwCUbLDoJCSxIXNtUXsWq7msULOaqRjQFWOrBbHI47gWTIKvdUU x2WuScxiqf+qIWVyQz/JcPiWESD0jgs= ARC-Authentication-Results: i=2; imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=GsffDF5u; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=fYilZPNW; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf19.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=1682431851; a=rsa-sha256; cv=pass; b=frPjEhnmBP/EtaIQmuEUZq0HGR4MxfJUWnhhm3uFD/2F4irYnO57lYL7JRHQFoCLdp4APp 1ln9AGgMy5W7VtwwosNNr+RjE9RZYdpxa5XEoMGyqd1Jr1+UXDMutyutU5VISVVTWeppoT dZUb4LQaWSZxPsPyBPlHRpt/bayCveY= 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 33PDi75n024299; Tue, 25 Apr 2023 14:10:50 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=dQI17GQLfY51LpW9gZrstzngT29+VqpfaYKOYKfoYG0=; b=GsffDF5u733uUYrMFmn3waLnCoCz8dyoQQXj7n6ye8aAG2wQg59NhiIPZ7aPDOV8NMqK 8VJ4TUXGwcA6Rl55OaG6eNZhXXLq7wcsHLW6OTsTKQod+3K3qtiXTwVRldtcDK/tL76B r9zZOIQkVrIAJ9Pc/No5pQp9BSQ0HsbD50ZYT1JznHIACWJqElxGL7FyRh443zzVwkVU OV1eD1NguDPpr0uRPodTLretbg+vR/uWupS2kOyIk6lqXbq7D2rSqHT3sn35UlfB4Tgx 3hQh75fXnnUfVQXDsB7nxEGflAZhjf/2k0ODpGTf/fJtSDlmdmYx6VpSy75sL9B1aN11 UQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q46c45fv2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:49 +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 33PDUQRA007393; Tue, 25 Apr 2023 14:10:48 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2101.outbound.protection.outlook.com [104.47.55.101]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616gd94-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HHAOZlWqu1Ahfdh6eUUHYod0dVUHa+zCPyjG+k448PZvur5t6OSdjDlREo+V7oQQN+0UQppauruqVQ8HmshLM2k9WIfXGepQVHu/QndDMs4vQgc6dI3rTQnA5vXZphH9Xa9pCGEVIlOLw1YWkYhZP4MLT4s6A8f3hiky+Zbiq96+vdWuXwNXg4QbeR31RhtIyYylVgNXyS5mLO6XFiIj9/CHgOV+2xwi2fVg0FPk17A6fTz0CcSb10RX8Px8YUR9ighiT3zXNAdtWWj7huCloVK0XELDneLX32smk3qP4mD53U6bdvJ2zII2sD8mnwPWr3dPQ1S1qvHNLumybs7etQ== 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=dQI17GQLfY51LpW9gZrstzngT29+VqpfaYKOYKfoYG0=; b=UUJROVqsq47FodhDrAjxyp5sfocOz2HWFMNKbAEqF+rSvjs1VuQ5MnzgP/Cn03mGUcrGr/qxiKzi5H1kucJGph+7TaBk6UKs1sXTc6pe6zBPkKkftf5auWZKSobLOs9fzUFZP180Ieynq8+H8+Qx1Ygzt3AnJps7Qhg+JB0t5V85taCNXGj9PKucNKhEy8jsdE2kkDibrodUNEutrHjLF/68Hi0AbGbwB9etQSDRPhDB1+tBQi64SYi4WsaITjf6/0EhYi/BWeNssC2Jem5GhPVvcs1Bsxr/JkbRK+uRb2dtvy/8ucqchvgN34RCqaJ82oRjJ7H0LLOwjLAtNYGR/g== 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=dQI17GQLfY51LpW9gZrstzngT29+VqpfaYKOYKfoYG0=; b=fYilZPNWdCCSdvnbopIwggdXRNiJH0TL5rgY7Jp2NpqJRzOTKWTSlfT6Y9B4HiNRRRHwbrFBtmLGWbWTNYs9y0RtekIXfQD6x9Mj7TrTEzBGT3KEAQLAsR/n2p/TqSrh3+Mb0y7mQh3pbl0J9uHq/H9fmz4e2RYXbFnzrBl7M30= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CYYPR10MB7650.namprd10.prod.outlook.com (2603:10b6:930:b8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.34; Tue, 25 Apr 2023 14:10:47 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:10:47 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 12/34] maple_tree: Use MAS_BUG_ON() from mas_topiary_range() Date: Tue, 25 Apr 2023 10:09:33 -0400 Message-Id: <20230425140955.3834476-13-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0080.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:84::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_|CYYPR10MB7650:EE_ X-MS-Office365-Filtering-Correlation-Id: ce01c4b1-cc41-4e06-4efe-08db4596ddb7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4JjAe/a36ofjjEJ6UBXCShY+5zFfZdmJf3S1Kz75m8C6IN06UHVJ0DBEMzFDkIoxH06mbsbu9t3fKyshHumrMoaLywv+6qvrpsVLd+/baYc2N5G7ZUlB0VHpjEiMYNaKkhM03OoAi3Qy/o52o2k8yabopMEUZwoXV7NY+CTiG/GKCOX2TvRkgyQz7PvqID9kBoWJoJ6Pu1/uHNImvCLvxiz4XydWpLAaqF0Wd3ZJLgwrwlTegI0WuvDp1uD4HNOcoXuwgH8TvxIoRybjTQdeHOdgQa3Uxcy/nUTbRym/ampkEMAYABJTCxi+yce0/jWFrwpPnWxb33eQF65QWmKYOpMfhHY2yEEy1gNLp0DZBoONOJuE1jUtBoJ99ZeiDC4uxO2xj7cIWrX5OQ6DyXmd+KiP15HcgqYLrWSUUF60zznhOKvuAx/Tl640a9RYLB3UnlhN1gE+XnlYB0/utZQfO/Usmf+FzGKbZpjJ36vK00J7Jy0OeMPB6r3ojVdSsCgslGK2VohQJbCqWMx5UgJzf2x0TOnzXm8eBauYs7e8c1wq7MF+sHcCVqJz4v2Ajfxu 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)(376002)(396003)(39860400002)(346002)(451199021)(316002)(6916009)(4326008)(38100700002)(41300700001)(5660300002)(8936002)(8676002)(36756003)(86362001)(2906002)(4744005)(66476007)(66556008)(6486002)(6666004)(6512007)(6506007)(1076003)(26005)(107886003)(478600001)(2616005)(83380400001)(186003)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xbXAWEvXKBa022r1UZuprTP+Acwr8qBtCNQRvxgzT4C1EPNX+AEeZnEKOY1L6G9aKWAQS77dvo835yR34Ic+sXn1ZiMEAat0WX3U7WPTxDSBHmlRmjxh01yrUchvVpGUVkvJplJ6QrsKB6I3Si3uC4ZtdzHxy6TMQM5T9NtE87I65J7Nj7VCHAOLX5JRooF85hatom9MUJnRZ4VHJnwzKJKtVEUwU6OF6q7lgzeEAVz9cMEan1julFNRZycVr91WHUBH6+URAT32OH8PpYcFoYjwwIcxDdAZdImtxkiobdiW6xw/c9QKY2o3Lu1wnKEVOeg9CKPG6hpm7dG0NfX5W/0YirA7kL5loNKe+uyRrE8zx/HGJp0BSmdsZpVluT+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P/bjCEjDOgEme+STNVaq2zzdaBP1GKTWu1bS3TdyczhHlAN1NIBRpvKWQTFfhJbh+1hE06bLMCfozl3aIss7NldbPmOm3jCq0o/iu2JwyomM10S+mF/hy0ovJnnrWondOob4l3FsPGunk+7NWEm4Q== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: +IaQsyDUazjxhAPupK/sTBxWv2/oCiLPfQhpb+YKatAjuyUdaWSuPYlTOXmb14GBX86hOtfSi1YpC10NKp//1cMq2EJKxDP2HOHi9fNxkOQ2SfptEfknDhj71kAPGmV5rRbwT8cR5SdW64OpOWpHKuyspC1M9qD7UWQdACA9q+f2Sm1uuG+MB8BV5NR9Ypd4rYkA1DCmCgvyDA0/i2JJwHsKV+YRJD9YCyQsGEd6ruIBPRVT16CxirPKG931l6NHZ079NpxexrHv5PgCxLpBuxBJuhtk28ek2SsztiUaf6mxm7mbAcPt/gPygR+wXwegBQmYwIOQYYa1L4tffn2c5Yi33qaXsQlBD93Rx1rNOgC5w9Ad+7lveFCbiRydT/8/DqL1BWRPWUT3EX4UKr4crZyf0ndbxMCrZj7qmy/wkNUc/bod3nVGeGUM/0WgjbyR1fwxZP8E302DQpE0wCsueF/HMAwKFVoxnsRcLvwQfZB6b02Zk3dCpKFSvRuw4AFI0S/zjx4jczF4CNRMel8xB3ki+ltqgCN0V08McqmdNfQ4lqJKIkSN3Kl9dFLoCn1N5KUXDOMHaL9/bDgPTdaMagR488jBfUUbGZSS14IfpMqAesjVB8QqQ1aWY4EZh9ekU2VDV6mpDI2GuVrJBGURiNMFZKlW3M77uY0maSkJFvT39tzSW0/5FUWuqNs+1p00zhyix99733S3bP7CPb2H8d8geu4LkGpSRJ1rhKbzOuiEtuZwdPs67hqmXag4j0ZAEGQhJrsxnL2+po14oCIZZjTHlDMlU+pGs8cTD8fPLBWYQPignwQTOS5o21ac72qwiCmG7PPAszCGiSojMzK2s3hk88x3mBw1nNp/lSYCxFoDp4S6OV5w+KAsreZguLtn6SUTzfaaYdgEm3acz118eQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce01c4b1-cc41-4e06-4efe-08db4596ddb7 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:10:47.1100 (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: oyETaNh/Cszjiul96GjpYntb4vVfjtYnX1I2t6bXRYj9xoqEcfe30iHUWufMIxsQGfGmEfEjAOkkoHn380MkVw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7650 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: Pa0eAAczEWgPjK72jytBzlBsdpgjZomV X-Proofpoint-ORIG-GUID: Pa0eAAczEWgPjK72jytBzlBsdpgjZomV X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: sqmiypk8cnzujkky1x31kb378q4ige7a X-Rspamd-Queue-Id: 1B4001A001C X-HE-Tag: 1682431850-13348 X-HE-Meta: U2FsdGVkX1/yCJRQPdaa0qVogYAdoV9PHnIbtFL1/W3ywMhB3YllOE6ELT6eZmp9eIuWC4F6XlPxb+EMcwcul/z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X6gFa3OuxbiyoBPzGB+g9J7BYi1t+qE6SPBcNMZKuLYRixziuX9jtzAfGnLznFG/g01KKiMXLxaydkehRNuK9neb7dSQBqc7crhuA3t33bZpnMTK4Qob+39qBAs04fvrHUrDpdEemjf10eBfkU0nfaKprUvdkU1lg2P1DJtSSarGksUcob8/v9m3Beb3San2hytCgTSSbf24hGwIDIuW165WLFjQryMeAjkdBj5yB+8yU5Jpt9AaQp2QP2yTK0ScZCwhatIzfG6RTLreo10iOkL9fisIGrC9wZ59E8VkkRpoL9Xrc8Rp0NC0Dce3TUKQS5+Jg== 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 f1ce3852712db..b8b8e5d9ed7e5 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2346,7 +2346,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 Tue Apr 25 14:09: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: 13223378 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 83058C6FD18 for ; Tue, 25 Apr 2023 14:10:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 51D7A6B0082; Tue, 25 Apr 2023 10:10:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 431456B0083; Tue, 25 Apr 2023 10:10:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1974D6B0085; Tue, 25 Apr 2023 10:10:57 -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 093A16B0082 for ; Tue, 25 Apr 2023 10:10:57 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id D4D421201DA for ; Tue, 25 Apr 2023 14:10:56 +0000 (UTC) X-FDA: 80720099712.20.CD6F163 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf24.hostedemail.com (Postfix) with ESMTP id 67BA7180020 for ; Tue, 25 Apr 2023 14:10:53 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=dVn2vtMo; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=E14WM0GM; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf24.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; 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=1682431853; 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=vfyDtNVdaiXOS6IVC7r5v1wf5CbCuySYD4Pb34MHsQE=; b=2u0Nb7MZBvDALzJzthu393os0HJqkpOJQuDoEJ6tixXFnNXljESKS0N6CcGEBE2h16pkVJ x1b1iQI42uF/0SvhamZXcAXS/Vk0wAUt5SZKT74jK4nrfE6B7X6oqW8urZlQNJ2oUMvd2i y+RDVMyaNnsrX+Hn2XoTAb87MeLVzEw= ARC-Authentication-Results: i=2; imf24.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=dVn2vtMo; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=E14WM0GM; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf24.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431853; a=rsa-sha256; cv=pass; b=gWO4TZ3L0bWZGzv0ogEiedYSmZVaZdoXzZ392hOJ7BVrH3PbnJ8BOryL9ppA1vp8IRRzp6 C7ZUd25+/70kS9u5daFrJTQcBDFsCbiBxlOvqmnzd+VeaIUaCiXpE+7reNpbR4XdvfS83N C3qqgldcq4x652qY2bvptPHleDZFvJc= 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 33PDi7CY024310; Tue, 25 Apr 2023 14:10:52 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=vfyDtNVdaiXOS6IVC7r5v1wf5CbCuySYD4Pb34MHsQE=; b=dVn2vtMomqKAosKCqN3WwKI6GtbVE+uK0L2dIzNmTHxUp0emIwkNE9oIvPAiT417VSlg RYIkPNwiGTmIuD6+TUVKPiwfTwLpG9ofwtvo6n0Z/kMwiD8w96z/X897pN1oTIin0W/5 wrURgfFBp4nqVtJEbtlW1LkBj4tsT4LQ5vY69MeAhQmF7/bAJ2GDvesjEjz25ye0Qj5l uY+bA6cRHD5DIqOmsKuOvLPxclFjzjaw8XroEHRmLyxkOjj6PVcN1WyJC1LJqlSezgTv Xus22mLcNMppokaXqHXau2LV0pjNUxmp44v+W57vJBnMRngNIArApybWlbyBvTtRh0zM Cg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q46c45fv9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:52 +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 33PDGhel013616; Tue, 25 Apr 2023 14:10:51 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3q46168dkf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fw5022CHiGeRm1fa166u5E4nSJ/MzxzEhXACImzNAewP+1fZy0i79YMbACM43VIq7+Igv0sPrtSYibpDwmpQ+7xGd9PaxSLl5fXdHFesl52QuBYrUdEOznB5JLo99gWRyH5O5Gzv1adZ4X18K/SEdg97vEAWpqjmLklrREBuX64wFA05IS3632ztUvV2s9/fp67LgUIq1Y+7U54bVhg5dByCW3IPFM1m0nWhViafzgVECvfvzQ5YjSTwkxTP11GmlSczpaPcqRLSilquXKhhYxHjuUXvmhuZpOs4GUoiGg7DO6ajrOwBx7+HNT/g+Lt809xpgEDpI7Gq2PmXLLSNIQ== 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=vfyDtNVdaiXOS6IVC7r5v1wf5CbCuySYD4Pb34MHsQE=; b=IWjJCM+BVeMi0RaKRCyiAC6b4qdwIyCM46OV6hDcOJTX2t9mOAJKExJ6J/xkud36Z2HMO4L4gSD+rW8zhMLxRd9ZC4bH9Zmx8OkTBDYIi+VQM7OVc/NijMMKhg/yNOJTrDPhFLblp0E7Kt3TLnBQvySaSW8WnRg0Gwaav5r3UFiVXcGtfgIebfPSfFdDfKa9G9zKol0ETMSu8cpk4AGYEZpray+xnK3r4i4rJDGs+Q/h5YPCqJTMsb34lhx3AFohMqAc/jaPIG6RIQLXuP7exBmvqXIO83RL2jCLSyc4QbTV9/6YGL4AhSMERbmkO1dSezSack9NsKoA9CGyjj5S9w== 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=vfyDtNVdaiXOS6IVC7r5v1wf5CbCuySYD4Pb34MHsQE=; b=E14WM0GMEKJbw8vEAwUozSLZlpQWo+oxYWbtkQ4M2I34DiaKEoDe+SUv5sx/JO2/MS92h/ZiazWcnFfxCnJORq4533n5WWGwzhDCXJ2MRghNh9QDovc/Wj6ZhlrpDY5MuNy7JMVoQLE8i5MBcV4GZUqpwU4BovdSrgWr33C/484= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CYYPR10MB7650.namprd10.prod.outlook.com (2603:10b6:930:b8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.34; Tue, 25 Apr 2023 14:10:49 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:10:49 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 13/34] maple_tree: Use MAS_WR_BUG_ON() in mas_store_prealloc() Date: Tue, 25 Apr 2023 10:09:34 -0400 Message-Id: <20230425140955.3834476-14-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0082.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:84::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_|CYYPR10MB7650:EE_ X-MS-Office365-Filtering-Correlation-Id: af8f8780-4ed8-4c0b-fc11-08db4596df2f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ArNqEuaLqkYU6+Fb/KV6c4vfpUYMpyM1hPbQZgtDwtp4KJ6v65Xo/p5BiBRX9XsEXkUCPf8kLmc0zFzUgDBHWEItxGzAA/wntTf9W36jQEIfkti0KVlo7oHhGNBfAeUyRhoa9giG6GZZKF2rdrU+cpwg/mcW/Ebq9BKb7hY5UhNO8LYACkDUhPtntbzH+rwDvBZ4LKjoZ3uPKa1je9VR0AS2S6ywY2/+ueSof00kpbI3bUqcdhlQ2F/N58nD9d0k4NvwV57CG/63UFOz10Bjz2bn5Ek8h5PDZez1fJOGrDrhBSQHMK3SWaoHh+7BEeR7QS3wewniMyO4dwF0mpoPVS4if6jHS1FQVH/W6skJ8D/N9hRAKre+Ab1qB9gAPBuvniHMmS2hpzXrHXXHtbkabv9lWTvxQIkuqIRkypgzytQBUssSupoIyJCu11ADogC0o+hWqWHchOn7DJjF3yKHcY7eORVqioCk6XBnI52c7PWXlMd596F2HenXLvI8zU7Bjaj/0k1Gb1UJUeR4E4XDyFwYp+PJW+jWBT6PTmgV+dZfPBJCy6bfKRSbAZG67TQm 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)(376002)(396003)(39860400002)(346002)(451199021)(316002)(6916009)(4326008)(38100700002)(41300700001)(5660300002)(8936002)(8676002)(36756003)(86362001)(2906002)(4744005)(66476007)(66556008)(6486002)(6666004)(6512007)(6506007)(1076003)(26005)(107886003)(478600001)(2616005)(83380400001)(186003)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2lFq5YYX9PWnf3HLG5sl7oB9D++m91p8088gjNnSvFDMgcJLVkKXbXciyqoSBeR4OYhydm8V6MCWAvDHyPxKsZ/JWdjOakUw75fC8o8ng441WfFtohsgZj9xVl+gXye8eofuqoAGVuWbjVjjHU8GMGNnbZPdOa06QFjJGQMgfH1xy4AgRfwwK1Uj2MYwSKN6lzY+lPE3OMfwkx3S/3O8lXs1OEuCpNBM1j5Fx50Gh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Pk0bq/U7KX9kOGNV4N22KXDORNAx+TFipzjc7ZWLt6Cxg+ERmKhuxV/+78bJI3h4s8neU9AYHLj1D8OmDXuws5rLF3KaGC3oFTVT6TmNnkZMirAhfwZp49nApEQTPWI3KtTDCgl5ebBmQ9GZRZOfzz0BfH/XCr5R1X6p4YRimrt48OmWizOLMM0v+6UMWEAwixbe8CnONdyanK2iq5xWzJmHLouZ/r/Mg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: af8f8780-4ed8-4c0b-fc11-08db4596df2f X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:10:49.5911 (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: Ujusue6qwXfe72NXNjKIlRucHkFi5jA7UXaPmdMdnTGksPUB1NL42su4Fi91GQ1ZslyYuIX1th22ljjA+sMhtQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7650 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 phishscore=0 adultscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: YCXe04Qa-LOInenH3wgc7AjEM7OMjHEf X-Proofpoint-ORIG-GUID: YCXe04Qa-LOInenH3wgc7AjEM7OMjHEf X-Rspam-User: X-Rspamd-Server: rspam03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MZaQaU daVJ9r1I QqlOtIFvw8iAy79flAm86/7uko7ccwwHUZq5iPMYGp20/ssUOI/35uMob22YOkWc8qRPBaDLV984z1AACQX/xVGUJ3SyJR/u/CT8WCqgKJ1CqSqtTKDPm8QmI0Mome9iVg42h3IeoHrn/gJwGmOiyHU23Z/pe8223q761z45OvE3eWMzi+ISq7ZW0D4dUILUud5XAQgLWYe02JY6FKFBf3Cry2Bgqs2E1dTaD1Zi4KGCz2e/+heA8G/mcX0EFpc5DjbfgYDXFuP76U41UwaR5zrTvlGvZM3/FKhSgN67+WlxNiWZmTO/nGwh/V0nhQKmZQ54zQU40XqL8dRY6BQrCxOEW41XbLjKzPEOIiN/tDoxGTkKNoexfx4DEyBvCsj/lKtNStoqi6DMfNbJ+YgZXKyixqENQI5BngtL8LAKevT9ke9k= 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 b8b8e5d9ed7e5..28853ed23fe8a 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5762,7 +5762,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 Tue Apr 25 14:09: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: 13223379 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 CF88AC77B73 for ; Tue, 25 Apr 2023 14:11:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 913C26B0083; Tue, 25 Apr 2023 10:11:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8C2BE6B0085; Tue, 25 Apr 2023 10:11:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C77D6B0087; Tue, 25 Apr 2023 10:11:00 -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 5C75A6B0083 for ; Tue, 25 Apr 2023 10:11:00 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 1C847801E4 for ; Tue, 25 Apr 2023 14:11:00 +0000 (UTC) X-FDA: 80720099880.08.550F255 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf28.hostedemail.com (Postfix) with ESMTP id 99DC4C001B for ; Tue, 25 Apr 2023 14:10:56 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=VU3zdn3n; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=vD8C9MLV; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf28.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=1682431856; 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=d7fYXLb2uNdiDnmhWsfvxET+WevVsv0mGGSF+vPIia4=; b=XRFnJN94aiqiBC/kuaalTIC+qTKDJO4MxOLq7aK6iG4KNLAXVEMdrV3RaJbRYgaHH9dYVl 8CbUA0cPaEdMlHpX6O/vAj73Hxf+/MEpfInZv5h9wyZpLXjKxCCRlrKVKx3mc+Fe5I102k a0Pfi7seX834EjHYgz/pumsjEjjwq9o= ARC-Authentication-Results: i=2; imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=VU3zdn3n; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=vD8C9MLV; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf28.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=1682431856; a=rsa-sha256; cv=pass; b=h28dZSAj+8c/wEAeOb9ykSblsy8a4SfpZc4m6YRdZuBRo0zJ0rbKrG1vECfSKYufvMTrO8 crjbbMDIfpP8Yrys9Yve6q4/IOzSyv5mOE69bOdVzE10qraeAZPNIzDB2A7BgtFTx2vY1K b0uIk9FG1SKTIHIhOE8hAVKEMGntUcU= 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 33PDi9q2010211; Tue, 25 Apr 2023 14:10: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=d7fYXLb2uNdiDnmhWsfvxET+WevVsv0mGGSF+vPIia4=; b=VU3zdn3nVROKRaej4BtAnFkCKEIYAzjXg4Ym7gz2Q/bNpOHysmw9YO1vLKbnJZI43Q3c EyZMsLOM07Vv0ooI3jesu7V2TxQZHhspwUcsz3PT35zpzMPlxkiB5fuCJ5HK4gX9XMLe 7HqdpKWFxmaDRihFXNgGJ+wgYyd7+CcWmR/epPCntmdma6aoFDv0mPb1Xb5Bd9YoCiFI SxVlpNbORN1psXjkhXDegRR6X/5pXX4zYweabO1IDXjxaqBA3nw3o+z1fqTm0XgLWebQ NPe9nBUrR3u+vqrviuCZkjAbU447XmaNlXtlKtsmmoiMUz3KxIpG6lPOXnb1pa3eQTbv 3w== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q476twdfy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:55 +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 33PCgvXj008521; Tue, 25 Apr 2023 14:10:54 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616qngs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RFSr54KuY41ickFt3Chu614BWBEgmYmX7ewY9cRLT9VagUwLY179cf2D8huvemh8cLHLQ6BYocf5qcAFT/3DHkIMnzUZe8r3Rn967E1iiMKEfRGJSFbG7x6GAqnhYXPuvHPD7hb07xttO28m7NjxVazVblvC1YwLxUPBu3W0jUMNJjq8c9gzc2BEOo5lTM/PKmERQcIS57bSGQTGaxw8kFAYpv7TjJ/+K0Fk4pU/UmUSWBxy9YG5bJQra7qzYTstowjX3Cq0vHD2fbiJETqtyA7e03T89UAixU+G26W1H94+6oKCeVPRHlpfrQXvvN8HFsZDfL9PZ18RsQmPMWUnjA== 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=d7fYXLb2uNdiDnmhWsfvxET+WevVsv0mGGSF+vPIia4=; b=F7j3o6krs5FFITidDDCWz7a75hwhrpUkrFALSsmlQAQL8xy8LUMh2/FO09evFE2OHPWxAZwWgdIaRrjlFemWxAIG8QQuHsbHRZnJSLRvjpdIkGUUkZcGOt38ccs46oM00LXF0raVBNtdn9B5AU2jf0ahf79yOM7ah8KAbnJj6o2ItQaPxiIMxwftq7NBT0km5WDZhcA0LTGSlUtnJqb3ZEAEdOAFF7HEimnlcJhITWW8kSX+qeh9B7un1uv6fbJBEjxZpG17EDvrYgV+9MRullfVbnsYyTHsT/ZxBBjtfyodNM/HrFgy16Fnqhj/OpPgB1pM8r4oiHEezE3zG2ldhw== 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=d7fYXLb2uNdiDnmhWsfvxET+WevVsv0mGGSF+vPIia4=; b=vD8C9MLV2AVffOmr1xnYECAxxLPENHH/09wyhUfge8h5XyVnjeCQ+7qpqzzulhhr2cwfsTwKTF/CLmKpFwC13e19agyN4jnPBFYl9drirewDL4sFlqzTUMXtYIeafdhYWg06sTW9ulMVcfZO414IZyEleMk0mpDLCVNzLVgHp4Q= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CYYPR10MB7650.namprd10.prod.outlook.com (2603:10b6:930:b8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.34; Tue, 25 Apr 2023 14:10:52 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:10:52 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 14/34] maple_tree: Use MAS_BUG_ON() prior to calling mas_meta_gap() Date: Tue, 25 Apr 2023 10:09:35 -0400 Message-Id: <20230425140955.3834476-15-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT1PR01CA0104.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:2c::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_|CYYPR10MB7650:EE_ X-MS-Office365-Filtering-Correlation-Id: 787961ff-3d77-4645-3058-08db4596e0d1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KXNil1XXM7MxmqwOuyGMhiaQSgx2EtBgzXU6YSragX4JGzf5htQKqeO3hCKN/NRZgBKXdTPiOcHkh0uT6eCR8kiyyD2YMyc+2Zz5sMhLf3/LjHwvpcnNt0V4hZIT8qcyGa+b+ICRNu6IXq0GclrUxmozvZ7gR0JnZAQZJUGPpaaUCMnpb9L66SD+2Wpte+y04Se/Y/l0dAuoL57pP+B6MqYFcpRmO4Ccl9JmkyqsoASvpt96UABACGcqe11eFVHNaIHaVs76rTwXsR5ejRvCEDTPTfD9JC+KfOjVLFXJ84wIN31/JVr7vlVrDmPBh977cOwl+/VWpt0NwhkkHai+cN6TGMOAVzR70/k+SimZDMMXyhmNTEikDoMjJ9HxAQsSA1yb/MT5/4sWG2FMW/RQbn+IuBEnZFKZ9Cka8BF0LEZW9mMzpmW8smLDQVjkRY2/MEZGVqLyK4IY4/yqsueae518TdG3h6GP3SZgIPv2MEZa9oK2/+EAuizutT+X6Ze+fekI7WrquomcRr2nXsZOQZXMyQkbdJT6zPUS57zr3JcbP1+ZnghFVPPAwed6sEFS 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)(376002)(396003)(39860400002)(346002)(451199021)(316002)(6916009)(4326008)(38100700002)(41300700001)(5660300002)(8936002)(8676002)(36756003)(86362001)(2906002)(66476007)(66556008)(6486002)(6666004)(6512007)(6506007)(1076003)(26005)(107886003)(478600001)(2616005)(83380400001)(186003)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UmbGOUkjO35asDLl05C5HtoKw5m9gEBQAbf7ePlCVqKjX/bqUde4wysjY1QizBksmu60iE0Tbx4law75VJyZPvLT4yORd6CooBjPedqr5+4OKVmEnS+zGngLeWqj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7xBa+zKzVQrdWWZSB+kErJy6wGqDNFgCtxve5fPUfSMxe0V7/PoTcO1MP1TOxI+TzWmS11HSMGlxdosDCmykRtSwCjMI+u77pyzjcf2rcFVJan4uFkzDtQm9BmxhD63RmFeDCXa86oeD5AFOfzEgWwS6V5htII5c5dYunirsuKIxAL2AvAJE/s43q7UI564VaFcq9YGRwDAmLRHPKmAT2FaRvurJSQezURe5cSGTLf8+EoHmN7QNmbrNbmndMPoHHhAqK2cqWNg4/HoHTy+tTGL8EYn2UWABiWgBwdSQftw9NFHbENhY/oSTHxTdHrvjfQAVbQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 787961ff-3d77-4645-3058-08db4596e0d1 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:10:52.3473 (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: qaDuxjkW3De/VsMHPmHzaxfZb9YxyNYSsK/jhDcutjw5IA7caPf0b3/5UxYLAWTAUKM5sVrmQ6Tbjge8FERXOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7650 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 malwarescore=0 mlxscore=0 adultscore=0 suspectscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: 8tW21Y9JmusW-b4L1T7Tem2eKyufveJm X-Proofpoint-ORIG-GUID: 8tW21Y9JmusW-b4L1T7Tem2eKyufveJm X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: r4uefnnn1swu9w33b48ahidmy1pm8zgy X-Rspamd-Queue-Id: 99DC4C001B X-HE-Tag: 1682431856-388542 X-HE-Meta: U2FsdGVkX19HdigQYBY0xAPG3Hbma2t2plTM2sCoo9zZPNo5osmqF3dF6e5poeeRwDAekIewipU2TthBjC1aDoVZ3CeDAaeoN915IySJTg2xz3AhuzSvePooXkEj751xZbralSWhYLVIS4mwhHpRVptyWr6jvF2bObU/CByN4sj2hJn8d0x0fQLynE+2XNWzVka7Y1F1orBAZ+rG3hJVlpEdoYp8pRk0QHiQiFe1Sd2/R+IM5UuTnYXyrGZ5z8KIIjmUfQthgSX04lQ8qOIogm0CzVI4SnWBOaEIndEoOLpzt3qvqHgXTRdi4H/6q9MECzQQ0f0SCtsTifKiSz1dI8H2wFZHTpa57ITE+90kd26vrfdI/SQ9ymneibgosqazhn53BoxIlJzE59fKf7u8Q1w4hqsAZ4PgjObergxgeGGmB0WrBBG0JTSlXH9rV16GiM9+MXD14lRjjD5LF6Pq/Y/i0LVHkA1QbyoJJCxskbd8N3gs4FwB4ew9kMoaeXm3FfVISDMOG4/IArEgGBaHAzPIII8ohZ8zNIIs0/x1IQNNZuKd0tGlvDFt1uOYbkTMvWBa1rXJ97XfaiqdNhdfWDiJ2PBT0quDhzxWKCjLaw+rZSKYJDPqeeIHZpg+FKJFm1/JasjfdrRKs8A3g3hw24Z2C7WeePp8pzy8McjdTniTdGwyjAf4FuT0+a++Mjnhc7HkW9+5QVFh6JyEempM1BpMYINtG1CZFsV3P3AVsd6cvd6VbqsEcnLHK+okhZjnNff627c8q2EvZ42cbXOpyUDHu69aoR6saSLnrKrFwoBdnWYuLMWxTDHM6FZB+TuKRFEGBwurRG947gIUJoPi5Ll3ZShtV0gxEpjbfgwfmPytDSb4ofrxZ23LERmq0Os20AcsBwXHTwoJfvqBc1TMPoMuVcuSSN9USc51I9ATJB+rd5WbcH4N0HEwfQ2b/LKwEciD99xwLO61/IUFyRo Kgq8yRFj 84ack2+h4J3C7SYDCODWolrz3htaCaYArC4tSpa0vqEcwgkZuORilg6mfiEAO3cHfI/Ejb/w3VHbBRB/UgLJ+O/1xiIxmrrh/7Hyf7/fZAqJ+tL5segOe3qhpH8vpm9eKQeNbCu/VmTkom+ikZz8lxWgy9NahdqFU47WeUFzmfAvvnU+V6KmqzQ0W64XmOSPQfp0eaMsTXd+8G5kCwN4lD0R8kFrgSdnylWVioZlotq3oTDfjm9kMsL3nxSwg5kaCc56IHFaoKiQ6za/HHRjg7ef14ISTsD9Z2uc0k85ZRBmRNlbDy50mu6a7HfP+GjJsBzv1AQy7kLeX+HNCcars+ZxDmgOyUl1igPZXVovW4g1ryGfprxTDj0QMdyzC0tb4v9lPSJZM5cJfNs4u949uGsQvAlvOsYMZQrRa7JWDnGcZcBM= 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 28853ed23fe8a..41873d935cfa3 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; } @@ -1629,6 +1627,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; @@ -1662,6 +1661,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 Tue Apr 25 14:09: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: 13223380 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 3E5A2C77B61 for ; Tue, 25 Apr 2023 14:11:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9D6256B0085; Tue, 25 Apr 2023 10:11:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 986CA6B0087; Tue, 25 Apr 2023 10:11:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7B1FB6B0088; Tue, 25 Apr 2023 10:11: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 6DA4E6B0085 for ; Tue, 25 Apr 2023 10:11:02 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 27191C01FF for ; Tue, 25 Apr 2023 14:11:02 +0000 (UTC) X-FDA: 80720099964.15.F7ED4D4 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf19.hostedemail.com (Postfix) with ESMTP id D2D021A0006 for ; Tue, 25 Apr 2023 14:10:58 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=hcvXAqoS; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FRoxXJSu; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf19.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=1682431858; 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=Aq7cOJYOEZDek1MKEt0M3X1mC65LkWTwAvUR2CCJKTo=; b=xWABWJJLTp0eBuurxs7Moj/fVbNm0M6Vxqym66ZxqlNEdH9TgfUAeFegwm5aiigWtA/vsm e+VmP7TvbQU0WRE96/ZUcvZ7Xa5R2CLg0R/o/yjPbmC3FIHTkbkWzGhmG3rzMZEC89K8wt kNdsdXnbDUS5ej9KYyQYSDalA9MK8i4= ARC-Authentication-Results: i=2; imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=hcvXAqoS; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FRoxXJSu; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf19.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=1682431858; a=rsa-sha256; cv=pass; b=8PSIo6pUt08JjsAxoaK30nLNfVDrSgVS9RR9OAEpMGTvX+C3chjnnthdEUmiyAO8Tm+Bz2 vggCxeXhwPBfMK0/8rmOBcnBu3DBgDqv9mCNHRM+a5sG/xnQaM7obZ9h2d6StBsYNPH+rK 47OOWYPk/F+TZr6HbY1/inseJwlraac= 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 33PDi9iF010199; Tue, 25 Apr 2023 14:10:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=Aq7cOJYOEZDek1MKEt0M3X1mC65LkWTwAvUR2CCJKTo=; b=hcvXAqoSvHYwUqSMFTp8UWgNCvrTFL/0rZFjWx+3n4zG6LAHAA88bVWRW93RmfwcCdHi AzDZz0ev0KeR/HimqCFNlpc4NLQ1JX+lBxh2IfxFPwzLaDzyqWbWM40caf/qTfh31q3W KgXvbHGMCRn+5VqZ8+2eQOq/O5vcQAFo+JnG2QxahqHJiXscce+EAY2nFx71aw7zZAt+ 9MlCo0MUGTj1wAp5gx17KzLgQCJDlmYmMzegg/S2GqjXw6E+FAgTTYJEXBwqWKMKPI5m hiOH0jnjfUVU7QhKmDciR0TFL4tWWTc5HZB9dZYIFSXQE/nZtnuqlOurK+RymPUHxNUk hg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q476twdg6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:57 +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 33PD619K007429; Tue, 25 Apr 2023 14:10:57 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 3q4616gdj4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a4yeBkz3Svhmnf+WmXBTeRv3tymTT2BwcVF7AZT95ox+XUHoX/7vtuWCaA5MQ8HWGPFwcfSkkKDbxIkWAHm5Hu2+rPPx9i5VE7BQmuonO6T1rb4k//FIQUF1cShZGw8bh0LKoaMu/dcNbgbhhAsMNJe0y5yLHKIs7cjNV2yzZd5o7+EZy4DzWR4D1CtcOc8QaWr96LQo20gVUhfe+qDbeRuZNbTc8m9JhyvRMlEQk/fzimRfKJZoN36J1SCIxT49vF/9vRXYwlJR3U1Rb5xQjpGoopfi4PbtI/2fbD2GTMdo3x4UMikrHRpg99DhTdbjJicDO0NgJTj8qDvAEJgQKw== 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=Aq7cOJYOEZDek1MKEt0M3X1mC65LkWTwAvUR2CCJKTo=; b=CRGr5+ClLbKiB9oBFRjhdPL+KgifGvuySz+jKIW0bghzuBFZ//Uxy/G5maqKIsJighriraqjVKhJkMRjZxah6PWvgokYIzcuvo8R033D1vjm7It9ercyK/M8+sPplAirYtw2ZrWWdLdmRqE0vpi95wVPAJXyUPpF1pjATLMTM1JCRVjCsOjfihdbt9C5QFGB7J240Bj2S/VWn9zpBL2wnUeyHdDGgAseCJYmZz5Qkr4Tmw1RZ6Wk/HMefLVbJkczOyHwdoeFHneCc9P2Eowhsfaf2hhW43THIqHS7RksKo4SUV6v/hvHZ4idPGsh3OL1/qHj1vt6UJu7aO4VkQK8gg== 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=Aq7cOJYOEZDek1MKEt0M3X1mC65LkWTwAvUR2CCJKTo=; b=FRoxXJSumon6F7I+Nw8dG/GWmcXnfnf7ozcpUZ+mkSXwM7PM38D9S26U4mDaLuy7qF4THdAphRJb3vLWYMpi/gFTIJH5nlCCHqKk7d8p0t4xiQiJS+DYMtg7ls/cyGpoO9K94ot/yxGH68XMaEcmaPlQsCGxWX1I/1b+XJBM/ec= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CYYPR10MB7650.namprd10.prod.outlook.com (2603:10b6:930:b8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.34; Tue, 25 Apr 2023 14:10:55 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:10:55 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 15/34] maple_tree: Return error on mte_pivots() out of range Date: Tue, 25 Apr 2023 10:09:36 -0400 Message-Id: <20230425140955.3834476-16-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-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_|CYYPR10MB7650:EE_ X-MS-Office365-Filtering-Correlation-Id: a4385abd-aec8-41c7-db65-08db4596e268 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u/0TrPY4S4ia/9SpO525lh6BWPIFxOzHblePuj24VMKP47JAV7kv5C7EtlBR68jsTpX/nG+JUaOde3NZLrOkkoiMGbnHPnNjk7seARZnXIlcpvBui0MigPpdVmJatdX7EpbS57rbWtF9G7TlUGr8ld6nweOKaDUI3QfIjdofF+erkpOREmlc7UfiKZYNSH+J88VC+vgqi4v9Vnkocdb1kLq1avdIXeI7FnJXJ5DTZA5Wl0Owy3EdI6+C1bIV5sfwMck0UpDzY7TcUA0jqbi27evcgdn7+5QRozY7wQplkJQLWaJGYYKzxPY98B80ZtIvRl75h7G90vpqesqHFvoktUCeqBKiJ/ozWdnBFpRfcsrCynrzgrQPONXpAw5F5XRlIsFT01yaKAViaz6Q1dAxeGcUdVr2D3UVb18jk5JjmahaznbtujnCLtyy3sNuVvTr6Sl6QxLBoh1uiWnvQnWGA4fzVGgi0cOoIx4+uLTjC50lc6Vjb8tRXoRIv2F0Flc0wRki0vhNEFLQ5Lub3FL9g1dZKLBDPP7e1ACBvMvzMN4NETXgW03EMFJKLwWz3EYp 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)(376002)(396003)(39860400002)(346002)(451199021)(316002)(6916009)(4326008)(38100700002)(41300700001)(5660300002)(8936002)(8676002)(36756003)(86362001)(2906002)(66476007)(66556008)(6486002)(6666004)(6512007)(6506007)(1076003)(26005)(107886003)(478600001)(2616005)(83380400001)(186003)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /Wbi9j78pmU7kChc3u+U1S3Qmk+F1oASjQ57warXe2PhaZ/ccu3tLtaPMGRm4fzc70/+DxgANuwo74UTYxBru8nawm0fQjL6rvJoWUzN8N82I8Gux6kZqpriJqRZdwyT9KDrJJEr3DDlyo0vgS/BEfIFKYYtr4Udl2dKwiOTZ6O9SwUNSWOn2gOguliiyhJHFZGOiEprdD6LomIGNDGclewcxA4W/K06bvnBT+En1Lnc5/+jIlDnRKhQ/6Vxe5rlOwqsx4lBSeVDvExE0vcfPHfqSMjOKOsuC2z6FF3w9fpfvfWJMJ/OeYq/yNKj/E6yb/SpTkgt+qJRLlXweKkKfw63QLTZIlEPu7roFQcB5FxCo7Yx6Bh8vbgEUIOhLm8fyjn/O7SuW/2xpwjhrCXRxstxprIPJH05XWxOlFRgMAVtxLFw1r27JjcLLQv7VvpnY+k6gpHcCJcFPX90HJ7NWJhfzEQk5Q0slh2iqyj1RcOc/ZlwwPoTkaw8EZrwt7OT5Vj2/nSP0tHO1jxcfruE/lCzEzAVYKEZ3oBx3Hv7VWEVlF8O2FIgkEYscwxf5LFJw22n3f/FzWdlIbHoGyffwIuDNSMe2XfmWTH7hm3rD3KlSXuA8CeRcw6eGf0arNPTo1l+x/DALKCyD38Nj+HHatMIQfDq0+k3lMI/0ZsT9nv9v+wkHNGFJKTAvcG2PK3OJf8TYIX/2ZDT+/PSJHPCzQ5U8hkDYwb4314m/9tB4UNCFx5JdYK2rHuTg2ySkGDMJnjzLKBgltQNEZ05a5qC2InXiKpm1xsD2F71nnDVQJ/lpJHZ0Ii1VCWFjZulxiP2mZhCDrj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erUUVvZvkUKOMw8W8sW8IAT3PAUvZ1Bm0bYWxWArET3SoouHugYhKsBHQ05r+vjSxc+fv4uePF2MUTCwd5/4vNs+NytNFdl8WhTRbxesak/wR6RnRT3Txc4AnkGHBJkJLYQxz/5isKlDXYLCaITs0vf4EoGXevMeFCiJNuzwaaYG1yEbuMHGlorkfgEg617DXUysWP7aOfCO95vPxqv8Y4PUEdowKpOWEpXRXYE+wiIMg2Ux3YbPaRX7KC3kpASS9giinGOswVp73cFL9HyHbhaoOUkfqfbL+ShVy+4qy3CyJPaKnfNHYrJKn3AU/oiQPGMmZSy6Q3hUTcZmRmfV1TlOFBpTw6wEnc6C2OirDSaqSYxwrZMfq0GPpkzV8zhBswHnynRf6Hkn5Y7AdUv7X5EQT8QS9l6m1I0Co+eCXvNLtu5HMEb/FgyuNNPI0yjEBg//pVeltBfH1yvnsCuQvfzlPzdnXtKvbVVcIMvg/EbtjKbP/QYhl9tYB4xn8cMhmEJjrc7JArP1Q6+H/uyQK867m87pndYgDrvR+bgNNcNQJMx+C9AyFVZ8qK5giIFb2w5Wgt6kogqyODHY/lPrKzxN6xFlLvXRo0ihrqGJ9O3B59Pt1PmmA2FqtzzfTnhwrZuXHhq2WOY8KE1CaminG4gO3fuY+WwV9uGiJFQQpHmPhQZywIW+Mgg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4385abd-aec8-41c7-db65-08db4596e268 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:10:54.9805 (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: 2i6jh//QjStnlS4POgAajYLYiWojIJenShCs/yALIv0rDVSVo1vn7HiQiqDkFQ10j0gOwptjcX0WnhNL3Ti4sg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7650 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: FklFDom8mGTOD6g9MWzntqFDJ3R8RRwz X-Proofpoint-ORIG-GUID: FklFDom8mGTOD6g9MWzntqFDJ3R8RRwz X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: D2D021A0006 X-Stat-Signature: s9pms9m53mozh7k9534f69tzeaw1w8iy X-HE-Tag: 1682431858-242290 X-HE-Meta: U2FsdGVkX19J9ZO8u9CMdED9q+Q7vZxFw9S7HbB4yc2z8FtkjlYt3xV9ZKFS4ENv/JV64UQs+dDat2cKK2xYUGpy5CDeLQpBtGq8+JEOZrVuG641XvWo/00ksjcWFXdVI3plOFMpO6+MLbFlI5INR80UbDF82SV7VIaGgxnysXqL7rly35p/Y+e1WfS0M3OidG9bDMDjY9a0xCOG9pur5PWuf3m0B/7Ei7rrkthAwSTDMN87UpOJqVQDSj8aoo8fUfL0W+nZg2ebHCCcOMPeLKyWBV2ecdrzD/SIeDkEcoxI0/xOWNSUB7IrkYpx2vlgqW6pWlyEaTZKlb2pLQqmjQpiilec0PwEap4TlmKC3QlRSL2aV+wYm29lFqe3JtPL6/5nqXPtflqG4ECIfVv1ikD6xmfCORgWxu5SGi3E+YPC3v3B66amjcWpf3FbZHb7lZcB4xuQSi9pUSN4pAfqq2y8THBzYZMRN5d36AoLbixaMKW7JcjIz4EdeY2Y4XPqcqex6H3a41duLlwTTmnGCVT/N2ivwwMz9+HLJ1HOtjXLUt63ZEiNyobhYRvHxg43uqjdNhbtv7glN2toS/3Aq0Vn8NpsegeptQ6iRSEf9RSmDmmDpZenJfVacfWrkUQry2+1Ny4oqZGRHagtOf4w3TckLxUsrrOFHTxcNLNAwjTef4BFXE8ktiIHMF7v4FC/kFif//8IK0EA/DUDqZa/eVLbLDBbkw72Ovi/1rWgNjFKRZeCzdrrmdHx/CurrZNF9q1Oh0OhS6NRpoCPTA2NZ1XxoRt4F7ognw94o2I5In12E9cKSipUQkqlw2taQj9vg6alA2xYBnB4xsNTqrFayI2y2nhu41OHBKDuFFA1mtMCC94E6epv9cp7A2ICagS93YmaMh9xuSFPqIivkMJB/df71xY1rU2hVyEzG/lQQoGC8rXU6Yys2cOWyw644YNZkAdxDZXXQlqjuDzwpKF eeomZQrD xZXQYn6sqO2nTuX0Q8Xdex5kTqiBrrN54M2f+yfUKpg07L7okaVhBboUKd7F3FrGoXOgKQtbdTlIR7IFKI9Cb51PCEkW1xWHmAyIf77Sfj4BMmvnB03FblLLQb7Glb46Eusa8Ffj58zeB+SlJwgW03t1LS1kqhSbx7lUuoB6ncV47JrEzOLLonewjiiKbeoz+RPXjJwjDWyMztTePoW7I5KuQ3/EX1z+bQPki96ZzKs5Qtbb1tX1Lb//nHA/ivCjL1rMMy8ZYrw4MnSlWxqVKw8HX7DG3rCLcpp9S0dmSqXcmYZ3sKEG/mgNXDKUy4nJNvIPwyacC5R1zpccmA8hzYPcT7Rvdjvmtq2EQTPhxkVEtYZKfrUfCORlR5hxMmjHNoBv53xxKqhWcVR7q6sjUTAteGXqYkbwPD6L1CeszfUBUoHM= 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 41873d935cfa3..89e30462f8b62 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]; @@ -5400,8 +5400,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. */ @@ -5418,7 +5418,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 Tue Apr 25 14:09: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: 13223381 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 BAAC7C77B73 for ; Tue, 25 Apr 2023 14:11:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B41416B0089; Tue, 25 Apr 2023 10:11:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A97B06B0088; Tue, 25 Apr 2023 10:11:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8C3F36B0089; Tue, 25 Apr 2023 10:11:06 -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 772F46B0087 for ; Tue, 25 Apr 2023 10:11:06 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 4396C1401EA for ; Tue, 25 Apr 2023 14:11:06 +0000 (UTC) X-FDA: 80720100132.19.607FF22 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf09.hostedemail.com (Postfix) with ESMTP id 6353714002F for ; Tue, 25 Apr 2023 14:11:02 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=364wo823; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=jkQv9OVe; spf=pass (imf09.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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=1682431862; 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=+lpEg46sr39rnxF5o1iqmex/V43BTeuXtslxH1aiM7c=; b=j1CwYo+4cFECWji/6FFuaqnXwJM4UTzL5A3lBc2dMZFo9wpWei6Yd/MhyOsX0n0o6ba5I9 slEBE5COo2Vb7qCbsU2xHQVbQ84plbmKnli3OV+wpiEjjQ5n2pkqoCLNRI7UgJsAKgHucH nrrj6R2MO+tNxPFp4uMj/XWJhZBdNEA= ARC-Authentication-Results: i=2; imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=364wo823; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=jkQv9OVe; spf=pass (imf09.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431862; a=rsa-sha256; cv=pass; b=j+k2TXzpW0uhMaPzQZywkWGTfCWpUAfYMkp575TzYytr/rKEibO8jCuuhw/Kl8IU0wo2AL dX6CnsfqhVzhudhdP/inonq2B8YAkHh9pE2aPMHiqPryj591Cd++FUilvVqEX7wdTwURCF UBaY1SVCvDbECFA73YanERpxEumnmO0= 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 33PDi2wf008709; Tue, 25 Apr 2023 14:11:01 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=+lpEg46sr39rnxF5o1iqmex/V43BTeuXtslxH1aiM7c=; b=364wo823laCctebZc2Ct6YtWK6eq+n98+VXSoPV+5uY2EeYDSLK4EkMLif8Tg6EPAGaH A9KqUmUeUReQ0vLFzVWBfaKLrOJWPfOxzlkaTmFSUi2jmFVJHW3hWglOlQLZGShpo6eI EYlYUXRlciNCCWfEsdohRl5nKtoItqcl05JrwiY52F/ZddXOpqX7YnpBgMg04vOJ2dWg GHhnsfRAIoXv9EHP8Z9m0CcGOsmMZr+3XL1cVotOzQcWcN/4WRwmdsCB4955mQ6tcUTI kA2vDd1ogmK074RiW6+1SwtbHF/Y41N2xpHqNnbExtSd0KVa+KFTEqtr3yXjq2k5r139 zQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q460d5e5v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:01 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 33PDvWoB032832; Tue, 25 Apr 2023 14:10:59 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 3q4616qt59-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gtrm/1lryCkm3vm2jg3PmG35RyBJJqZ5051Xobi2VSP8XSErbVGozotMKwEh1SmJrTz1WHAun3PY6oP5uLKMdg9DKbCJw8gKv+75Ztw/FAX8suqRI90qo+GQ+7zvvTJ1NIKWp7TII3mS5luc2M72F6iWSVYz3DwSdRay695mj/oQpDoWEbL3/6UKd77hA+igD55Z2sgzXIWhgQGWkHxyPS6AxnS6zjFMJfSZk5gHs9qaNSXu+pTbap0XIqSG0Qo282I35Ozdy+Cjc1xZV2HxoJzIXgwYXSn2CCTdQhoDtH5x5IoHHD8ffbr8ji8adCijL+7iQi48ZRTJhgNyxM6y8w== 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=+lpEg46sr39rnxF5o1iqmex/V43BTeuXtslxH1aiM7c=; b=Odtfwnax1A0Ex7p4wgBA/vS2ibwB7PrSTy5NcJvotMO++lJm+HIrEHy7It2MPJOWw1nEJ5SEBi2azyAjU5hPwDhjwCTrA6OqAE1z2/U1y0Q1ooeLpl8MuwkwevBQvJ47GkQswwLXXEVcZ0cJp4Se6aNAmroO9L0/5/aCdeUjfNPsvHeaAxvgy1P7osJxzrX9XcAlMZnX7EvPOz8GpvKGp4GoUx+ISiu7qAu10zf0mF7OsH76ypXS1IHwMbDzbfJ5gW/RopDZ7UsT4nWRRgVjwhaqD+l+tzKyW9rMo/JF5O802fxCD6bwuvkv+umnrdsO3kFgqLaGsWsA9UEfTe/QWw== 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=+lpEg46sr39rnxF5o1iqmex/V43BTeuXtslxH1aiM7c=; b=jkQv9OVeYtjy435dBqw2d0UptetPgN+r2Qro1H0F43SSfYI3/MXz7GT0wm0TYW/ZTqIqtXOZDq8Sfg8iqOfVP/CjwXOl5KIy7sP9OgHuEaCSUMft9EEGqlIda32GzxNF/XZ2zQqsJWW7vuz/87P+677r/8ob1h827StE7owOx2k= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CYYPR10MB7650.namprd10.prod.outlook.com (2603:10b6:930:b8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.34; Tue, 25 Apr 2023 14:10:57 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:10:57 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 16/34] maple_tree: Make test code work without debug enabled Date: Tue, 25 Apr 2023 10:09:37 -0400 Message-Id: <20230425140955.3834476-17-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0104.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d7::9) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|CYYPR10MB7650:EE_ X-MS-Office365-Filtering-Correlation-Id: af704e12-0371-41bc-5f89-08db4596e3f9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MruODaDCX7tIhXFmd+jH7QmAD5R0jtw/XQsLQwXWluYh6yySziwQPPY8kW/83Xm3by9/LTZ4xoFfTwgLF6btpZU4YAmJLohfCBUN8XW63x3MI+R6O0pnA0+ISOikOZl7yeJo4AY+8NK1jaJZIDJ/xrx9MbBlcdoSNNYm6M1D8+aZLFnCfIHrVUBpJDnFrZgA3EWwfz5BKVDG4wkBXl//tg0OoiO7d4rjw/hkjmcujugii7vXpItWHPpTZXSpzD5UR6Sb6CsjGpvD/9zASVTeFxX+S6kB4bmrFTcrW4qkQNKXrzcvSDqf+UktdG86B7TPqegr1ojukY5IIq/+Hpz7ANyyQNZJBXdnBaWBTO+osqxc91kZhOSSHWbedLZMUfJeoEyedbERXAsBAWEIFA3L45WgKoaaDx694VKNNHadHAebxQ/qQpvyRpHKc5+4MlBO1cJfHH5vOBRkRGk5qYupUwEVRRRrLL7fkGEnog6veyCpak7wuPQ9CIQtM1cRoWg9zab+97m4i6p2hFnfXln7euGhxzI24HPIoZt0Gy5mMtfGsxaKz11T46930PZfiOJX 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)(376002)(396003)(39860400002)(346002)(451199021)(316002)(6916009)(4326008)(38100700002)(41300700001)(5660300002)(8936002)(8676002)(36756003)(86362001)(2906002)(66476007)(66556008)(6486002)(6666004)(6512007)(6506007)(1076003)(26005)(107886003)(478600001)(2616005)(83380400001)(186003)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SoO0ivU+/nGgqA2FYqeZ13fSoX3eGGKHbrvKC+qg1Aweh/4NcqIDi0f9gXFpyq9zQ9mVg7oKdpQ6Nc0rck92H0WmfITH1Kr8OzuA2+pNMR/3h59+FFWSUnUmmMnC3clq8t6ouyVuvm3Al3MXf4cv+fK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WaqiNVxP+SlM06kUa9FPBb92f6Oyqo1Bvsf+9SZn6wOf8enPmUcKS8rGnRAXKO3ZPesf4L9/duHqfmD1EY2sRd1NDnq/0Ujdq8UqTibop7/QBPTALMcbs/FtYb8je7X3msYek1lg0v36m3Npsh3FycxNxK1FjJ9fon4PZMZvgR5U86Go0HpIX22ruKHhkiLKfqO8Nh8ffgYWLvQaLZNGqYDElF+IECbIOOhMMyNtaKuNtO4+Ro7Ut5aWSZ8BI6w7WI6HqXLFWMg7FCyYBb76omm78rpI/1FsnKnx+JZIzgvgjxMTJs1BS7WVMhczBDF0wA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: af704e12-0371-41bc-5f89-08db4596e3f9 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:10:57.6140 (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: yUeAJVh1cI2x4Q2lc+k10dzXcCuBpuUMtvAffRdNwW4Qyp5sJZ6jfCWhYKDlQZJKqtk2UK8MSVcTGkYGf3/C2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7650 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: Rn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/C6iwGfpUcGxpHTHhLtvw0dFhtN/ZM1Ein7aS6SM01M23XwnfcyMRflkXa4vhu0+eg6woPQ4LolIduIi1Vg2wKyG2ztl4ffW2vD/BQGJNd7tr4 37p5JHeU RY0t73NRbfoHhevB43SbysGR21kXY74pPVCqRdH8JP1YdVj2TL9Ma/Q+j56WECoT8vGHkTA+M5m4DfjlePvS1O3vM4+bFlgiDf8rBW0krQR1Vl3MYDQzZ83Z7ckLJhkkJrhIhH7hur3TU8cHrqaZiuvMNlz6gqaUSsmViJW7UzPAu7mDuNHc07XLPjvSxdgPSF/IUsHl0ooC9AptZ7gapwdLmav2v7E2UO+oG2P3nqUtP8jcYDFsSlsuNNrKAWjs9nhb5JJnaLBqBrU5BVDReMG8RnKcvTBanN9/Dn/xvJnvlaD4x9dAkmNOrNVzNqtdsVPveZXpTCcfKUczCfqJd5XBeCPoo3UqFQekKFr670uFo21P+ohOOL7soPQYdN6YQORdMhute8TvOzmBEaki5prxQJ2fcL4cPt7LY2xMLl0k1dq4= 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. Signed-off-by: Liam R. Howlett --- lib/Kconfig.debug | 10 +++++++--- lib/test_maple_tree.c | 9 ++++++--- tools/testing/radix-tree/maple.c | 1 - 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 5cd8183bb4c13..11736e17a62d8 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -2281,9 +2281,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 d6929270dd36a..89383eedb70af 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -11,12 +11,15 @@ #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 mas_dump(mas) do {} while (0) +#define mas_wr_dump(mas) do {} 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 ebcb3faf85ea9..cf37ed9ab6c4d 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 Tue Apr 25 14:09: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: 13223382 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 4C025C77B61 for ; Tue, 25 Apr 2023 14:11:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F2E8F6B0087; Tue, 25 Apr 2023 10:11:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EDF276B0088; Tue, 25 Apr 2023 10:11:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D0AC96B008A; Tue, 25 Apr 2023 10:11: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 B56066B0087 for ; Tue, 25 Apr 2023 10:11:09 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 8A002A0244 for ; Tue, 25 Apr 2023 14:11:09 +0000 (UTC) X-FDA: 80720100258.19.60E6305 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf11.hostedemail.com (Postfix) with ESMTP id 1175840024 for ; Tue, 25 Apr 2023 14:11:05 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="F2/E3rgI"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=AAV7muwA; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1682431866; 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=IDIXK2KxMTW9l24QIc5A5LUq1e1m5wDTil92Q6ZsfZI=; b=HiurpWvUyUrOF0az6WE5p4+VgiM8+LDZ1UchbAVnZWK+Eke8x1X+EEKaf95HWkwLXdMXpM +WBm/tNBKNoB+zm5q1Qr6Gvv5lvwlHwEvMPnzkHeSzAin8JpyLqHMhkzy7Be2mABJHKPXD NnriwdiuaIKHWarAq02XerclxaI9Rd8= ARC-Authentication-Results: i=2; imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="F2/E3rgI"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=AAV7muwA; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431866; a=rsa-sha256; cv=pass; b=wrkslwnde/T/Rg1mF5c16wNFR6k41YFiprzs7Bazm4ZWqWtlo6RIS9P8pIf8SF8vPin/AG 7EyynNicZgMA7LVHgJvLSIWePhUm4Lc+dSdGxTUjqHyjpGkXJ9yNAdFtNhPhTBI3tnNfxo KVKBjg6bJnrRSAscW4maaOvo6+eTpAM= 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 33PDibUa006082; Tue, 25 Apr 2023 14:11: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=IDIXK2KxMTW9l24QIc5A5LUq1e1m5wDTil92Q6ZsfZI=; b=F2/E3rgIlRiQizG4c21HeLETFab/WJ+eGJ8MVfREY4zfZziejs51CgDZZMEsxsJV5weN Vl84MmXnviDckg6+eaPY2scxJdReAbfB9771Km5GWQ6kI19BWUVbKQTBm4vqd4SuxAbC KV6oEnB9QAkQetmpUEw+hlpb6qsMbP7IMdzbqKiIjq7rADIjRYLxmY/9i0yowT1naIDj a+VmNr7AkdtS+gWtm+o9ibK9HWbKySrsLy7bXSi5pcdIv0MyIq20gRrU5Dg5OJ05O7t/ KAX3Ssp1LHAhzU8BdcZ5pbtSOi1mYNSc8BYBOLcegtb/Z4Ni4MRq/bkJ52buGZ8RUjXS Ag== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q4661wgmx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:04 +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 33PDwhPU024866; Tue, 25 Apr 2023 14:11:03 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3q461crc9d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=amKVwWdFUFob1I2Iyqgj9RRw8l9fNDcBVcC4Obei0iwpIQ5tVml8I+SYfr3dYiE/fEd9dEQd4pUcaBxr2VTFXsMvfjRfFsjP7wGNkH2+8DgKeV9uukYrOefCYG2p7ToOKfRldmDWl1OGwesC8qkyCWxu69WIGe/bpzJMnDpBn97S12UJrmPmdSurIdGPN+NdOe93wtFzM99bgqH1zvRt3ROjDq2f5UdOhRSJu9tfc2ZneQuhNQoAUXl2iLeVs++3qeBaykS8P8MqGGUbK5M95ZGnFXKSxYqxtlNpyGcxiJXG/cHLphcXFM3g9wKZUgoYRdv+9lesarxy5/rN2KGRkQ== 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=IDIXK2KxMTW9l24QIc5A5LUq1e1m5wDTil92Q6ZsfZI=; b=K3bearJhH60opWe0a+9/PWPUuSuJ6MGULNlJNVgZi1DKJMZfwRE3XW8KtL+q/9us3YTBmDy20drFNioepqcI3Vi3SwklisdH1xk4LlGtyoZI/rDJDocOQgLG0biSKtm3U3IXfCzRD1C17xBLRWftlZus1yWKr9DwmLmkt5Di71LoQPuEDFXOXtmSy60dfzz2pV75F1McJuE1itGhLyXorKTDVfKbXZcL/vF+tjtvzolMT/SBDT+3VA4lmx1odCBRL1NGlHjYqeJq2PXQWiiVHf1KMsLSR101gzk/t4kJRFINDR11GGwIHZ7i9L3lLYGCej+hu2PLvOtSfsFPuM84/w== 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=IDIXK2KxMTW9l24QIc5A5LUq1e1m5wDTil92Q6ZsfZI=; b=AAV7muwAByXEyF1BmwFgjV/rqxe9ZcqlR0WA+71RcOx4ePFqHJsqB5mKixDY9+mynE9mhkUX9AJbkAnGwzt/c5p26WbSdQqeyKfYCIM2Li2rJyEWg6dBIUxjsnb7eb/XC/OUK1N+upZI4RdDHIObcdzLrRcX840nxMDOdd9VOJk= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CO6PR10MB5572.namprd10.prod.outlook.com (2603:10b6:303:147::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:11:00 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:10:59 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 17/34] mm: Update validate_mm() to use vma iterator Date: Tue, 25 Apr 2023 10:09:38 -0400 Message-Id: <20230425140955.3834476-18-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0097.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d7::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_|CO6PR10MB5572:EE_ X-MS-Office365-Filtering-Correlation-Id: 21f99d61-8805-44f6-c0c2-08db4596e544 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zN50abmjqPFUsd1eECoIUtesi08AqXyrHJjUdLbbp2b7nm5uDZmb4te90NF8ADPGu1ouftjhSxVph0RfGHkDFGuOdP4Hu8JSYCBrlYuTiAYCI7da8P3HnQNtIGRufkJs3waNe+CxKxFRzCUlzcpi5tZDJz8lbDftURo+VW9X4PtHrn02iGPTHytTiqz1zH041pYWKCqStCcE7ZIZ9a9hhfLsuLSTPz5Ijv72fYAzRThOGAbh1KaCdwRCPgQ9glda5QxDWs0DluJNvv4NHyRBspjmlpdU+z9v0ixM08oaNFv0j0vZm/07CdaFFJ2OjgucFUXmdDWhq7LmQJbZ2Zv+859lrcYCDDjcM7bfi9amcOWo1RgtTpGWCihyuhGq7MVfeNAwoz4bLNn+mRg/oTyqqyDN55E8yW6HbuCDYTazhAx9eEZgFnqgtR1ibAvenBmSlXOjm+0CuO1Ovv6TNos1ZD0sW8zFFEkIbm9xT7Cw3IMf81/Ld+5ERGPwRpF9eW8cv9aOltK6x7tlxmTjzi413hhlb1H7GkQgTMGHnqDElY+CO0IY1LoBU5w9/wZA8OFT X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(346002)(39860400002)(136003)(396003)(451199021)(478600001)(86362001)(36756003)(107886003)(186003)(6486002)(26005)(1076003)(6512007)(6506007)(4326008)(6916009)(66556008)(316002)(6666004)(66476007)(66946007)(83380400001)(2906002)(38100700002)(15650500001)(8676002)(41300700001)(5660300002)(8936002)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 396eJHgzi+KmyAzKCK2IaxSdWj9PE251K3Xby7Y9bkRRTJcWQVePTgjCDw2hLUxPSibvv/y32ua4tAyVme1DhZf82+XbSuPh/Dgo2r00gWeHoVb1MeyoNItzlSRrpYgnM7Ap7+KSw40NO2W4icdDovNWwULvii5rpg0aLnhfgd6/bOqfVQZ+FZsspISQRb/eK4fb8VKacgMQp/r0xhBN8KXIH5tztdNjrBlEREHVViTleWHdOU1nzYJbHyWfvU7tx+XcwLSweGs02tn7pq8pocBK5CVB9ex8TNoocWamJxXaYFAUhKsR39hHF1+SxNsF6QZ+IRMNO1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0hZtrjxWZ44o6mU7FdnyenhYX+EOQ0nhgPSo7cAfjUby1doXHav51QDYW3WJcOeebRHFCHKeFH+AzlkIFlChjIG8mja6QE2YBvUPImNNwq7b6W7ipJqOVDCitF8Jog4fSc4SSKloGgCEwUu2qnupf4wBdw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 21f99d61-8805-44f6-c0c2-08db4596e544 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:10:59.8182 (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: ZdjlA5LuokpkWLJQXJ11XDaSCPQcDQAYptHkI4yuxALdVWXJIYMJbYZ/Au+q4u4Xy/hsMkc6D81NKpqGTb7HNQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5572 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-ORIG-GUID: 1NM28iUJRgNdxufKwc_s7uWBcb8dcIq5 X-Proofpoint-GUID: 1NM28iUJRgNdxufKwc_s7uWBcb8dcIq5 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: gi3jcpdoxjzes1crjnxjypquahd4tubm X-Rspamd-Queue-Id: 1175840024 X-HE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3QzZdXpA/+uqpC+hSmnAIL9ct6t2Hy2f81/pTRm+dCFlajhuM8SnkIqgvIhCfi6YciiNST9jKSkdIg8zZbdZlnnRvIcddYJmGnFLHK6LmOB9hw63BvPP4DVMuWop4E4dNIQii83+m4sw2zsN6EJWFPmZ1+qybYyxSOHm3ENBB3M3bRvKE7ws7MUaF8tpvrbm1Fct4hTrFnhjStcVZJh58O0xiS3/WY4lply5/gD6Ha3SCVzOyXeve846Zg9T+Ttdehx1ISxQaX3vtGSLAX/nqDV5cl+vRD2Wq3WQi32eeaTcOvtoKAz0RTiC3NgB76AkedSBTVbwOqqP3piEOCtsZs6pWqX8OX4= 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 b8728d11c9490..7c3e7b0b0e8fd 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 c7b228097bd98..ee533a5ceb79d 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 4c195920f5656..8d1a8bd001247 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 1554f90d497ef..d34a41791ddb2 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 @@ -2234,7 +2215,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); @@ -2292,7 +2273,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: @@ -2301,7 +2282,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; } @@ -2936,7 +2917,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; } @@ -2958,7 +2939,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. @@ -3199,7 +3180,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. @@ -3258,7 +3239,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: @@ -3274,7 +3255,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; } @@ -3411,7 +3392,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); @@ -3434,12 +3415,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 Tue Apr 25 14:09: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: 13223383 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 92338C77B73 for ; Tue, 25 Apr 2023 14:11:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A4BF26B0088; Tue, 25 Apr 2023 10:11:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9FBB86B008A; Tue, 25 Apr 2023 10:11:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7B1376B008C; Tue, 25 Apr 2023 10:11:10 -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 6299F6B0088 for ; Tue, 25 Apr 2023 10:11:10 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 1DFB11A01F2 for ; Tue, 25 Apr 2023 14:11:10 +0000 (UTC) X-FDA: 80720100300.12.0BE937F Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf09.hostedemail.com (Postfix) with ESMTP id 8B1B214001C for ; Tue, 25 Apr 2023 14:11:06 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=sWlFQZ+q; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FSHJM6h5; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf09.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=1682431866; 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=PlmOS/szkQ4WyeioHt4vufA0c5KhqWY6gRcjYbxG4dA=; b=sk698bM7Nrax3MnP2ouv6XRBG4ahN2qLWTLo+Un3GOxqqwybifzOtQmHZGJyKNtncBMD4e O5SN7iJ91GJkfD0iqMgYT5tVI5I66j3sdGWInCL72Hoc8qP1MpDPfiQPAPYF9PRuT9atSA C6lM1jMGGgk7kh5TC3GgZOYQ3LSZuBs= ARC-Authentication-Results: i=2; imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=sWlFQZ+q; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FSHJM6h5; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf09.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=1682431866; a=rsa-sha256; cv=pass; b=IDcB2pqekdSnmMhgOoWCM1ddk4INi5FusILC9eGaoLyWO7boUKKPt+sgzpuDRmg3BbwZoi pe/krBBvjCW31lX3R587J448Cul7z6nkXLjGZrCq7Nrb6dU9KTr27JOZrG7DA6KtGbRuV/ oEARh7OAPdn/WJYeiiMVecSo9euPE2w= 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 33PDibcD005249; Tue, 25 Apr 2023 14:11: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=PlmOS/szkQ4WyeioHt4vufA0c5KhqWY6gRcjYbxG4dA=; b=sWlFQZ+qgJKWKvJ8tGfh+pW8GvG/RjcSdBYDhSwItekx3ppKcjEXQSJHgA7h9J1Jd8cn etVSO1TKCMkdfLJYb6o8cfA1MI0xqme1QNWs6SdwRtOjiq1lJnsqfYRh080koWFaFnfL hqEYGNmb+U0U6v+Ww/l1qcQ8cDtmmQ+nJ80Ef4ENu14CN0Az0WQvmCOVDjW1CMNblOsM 80O5S0GyFc9plUkZKKnX3h6sLnmHf8ca7pzCpH+6d4ciyzS1+o60An/dQ6D59GwmUU/h +/mUy52tHjDNFRQzzPKSY4kvra9uLmEiMoXq5mQh30w30S4eW+Y4shnAxre1Je8KN9VZ Xw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q46gbng8y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:05 +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 33PDwhPV024866; Tue, 25 Apr 2023 14:11:03 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3q461crc9d-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Duc0siHIquKObAEbhJEGKiN3+oqmvSqsPXpRaytDB/Y/CIYpCP3ZrQGP4UFjZp01ilzV0+EoonFAvQgpLeQ+QWHYHSetaBMxUgB4vpuT0FrPUVECEX6sIFD5GQu4jXOq71u1VaKbvPEdNe2oKau0MIKbpQteUeFxQTwpQMuDsCUhB0v1saGQhLhDhkGosfokBBouJJN9DLuHq1UFUHe/RoGZB9VqlfS9JZFpOO6fVIohcF+VJ90JcARpKcq9AqQ9XRmeiJYmvI5/vJsC38OUwgEL6CDN9mc7kBlh2gF4M2DdqRjQ0NhEliDkF2S8Za0zGrysaWFkf7hyU4orCW+Wfw== 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=PlmOS/szkQ4WyeioHt4vufA0c5KhqWY6gRcjYbxG4dA=; b=IWM2upYHMjrwqQn2c1zncD8A2P6YtY0AprQgNlUHRmkBNc5rgjF8O6ACh1TWQS/D17V4uvzKwYvggJ1wDzYlNB//wDrYcEfNTfrPVADQePT0knpMYhTya5uipGcNYHKg7FsLb8/6SH5JWW6S64NtDcmvPDFmbJ1HSUBlbJK2V7BvGG00yz/vEvTRiPMiSYxiBxOH6J9MPdwxLCJ9hQaRGB/ug60sDi+4jCUKqWluPOzz0RKd3GkWFVTStMKJpsnmn1k70inoi3sO/L/YLyKGzzLfS9OFSipO6Gw309sI4XE6JJMBaDNAzUtrC1I23GCKEJPVlbZHUJqceU2UVKmINA== 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=PlmOS/szkQ4WyeioHt4vufA0c5KhqWY6gRcjYbxG4dA=; b=FSHJM6h57HzUFZ9drklWs0zWsLNg97yL2mBotm2bxYxFfCkXyGioDeiZU7oiffCZtQDY/yYglWo1mtBV5zxFCOq0rdO3OZuOC/VZ6UmXpAnqqJpsVoPgz6x/HYgMAGxgRQUNpEsYsg60w2sTRNg9rm1+1YMRxlKvhIbIDmb2mIY= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CO6PR10MB5572.namprd10.prod.outlook.com (2603:10b6:303:147::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:11:02 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:11:02 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 18/34] mm: Update vma_iter_store() to use MAS_WARN_ON() Date: Tue, 25 Apr 2023 10:09:39 -0400 Message-Id: <20230425140955.3834476-19-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0083.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:ff::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_|CO6PR10MB5572:EE_ X-MS-Office365-Filtering-Correlation-Id: a4f1e9c3-6bd8-4a6c-8028-08db4596e6d0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: K9KKxVugNrc6XiVSyZVT5W5wWVwX8l+tOYr/1+B8LNt9j26cbNCe5b/GO2eKmTrq58VK2mUgzDB1tUbUsTsoFL3GsV+aBbq4Rkg6OZS9fcXbcFoioHCBGF84dsgo5HjXDcSO+kLYJQ4Xw1iI/2xd1Lgzb4/61A0DzC0XEgnWaXPbMw3/lBX11ZpRmjp1ioQF3jVe+jg/Akmbl8VSbpNRJkoJjy5UFlxafaQGN3MC9tVZnQti5o4FBg64RhJJyO6v96MIgcyde+xC3r+HBu8tgcVIbg1Ah5lU4eY2teqZPDJlCqO3SN5/R9fyemVcjqygTVOvOcQ+naZVn/or+Mu9PhrvwJWYH8bUlNq0ZmBt6oSvq6tnPnBeUrUFDNdC7VIMERr7XDgUaeCzAhTQ3kpi0h8mF+5Bx44ZcsgtCOTEhTURi/oC+WMgZzTZm3Kngn6jTVkjK+r9JMQFwzT8NcqG5w0jpklxCkha9tL+pZ6lw2Nx45XgnzJUXFmPEudI3D8NUU7aCZfrrYz93/gCD8dxiOSacGaRZSHzq9aULj49m4iybjaP7Il3av0Ir5tEe1pD X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(346002)(39860400002)(136003)(396003)(451199021)(478600001)(86362001)(36756003)(107886003)(186003)(6486002)(26005)(1076003)(6512007)(6506007)(4326008)(6916009)(66556008)(316002)(6666004)(66476007)(66946007)(83380400001)(2906002)(38100700002)(8676002)(41300700001)(5660300002)(8936002)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wXkWA8QArP4h1oqP5mlHlKh1bKVSo5bL//6/3iwPovBvD2vxVI62HV1I7HJtzTcdmH5aPPBopPiosd7imnB8zaeLO8gVhzGYW9kmgc91EvqIMoCjQbs4HlGhl5pXh1V/geoxn4IiFXHnmBiSmyNdjWLD1pVhAkuVKprMwCYoa5fB91uD8YWJwlvF1GY35hAWfKj9o9dwk/7mp9yfCu08CSnJsu4a7Y1UPmaU7R5MhZKhyvneEmF9FLdVSr0yukn8Syb/viaXjbFCsZw8W0hk02/oSowkB9GAYtlSXPuCNeri9Um28iv8L0kT6aBJ8Az1vvhTWDfbq9ofMhsBCaFPF/qU96Tb2xBVAwIqbKRqa9oVEZ0K2EkevrDi7KmnBBREXXLKTzUAbAobuGlOqEKa45h4jwTAU+ZnDyh2yLfLJGVzUdm0HmkNLZn8cMN7q8Of4Js/ohj8n7AwedS+mV2gTWUiQR8jjQIsoTJeyKVRpmD4T1zcEpZekEe+ot1i43mIapZVFyxuPl6avYNDaYW/NpguzxppakLCi6xTCh3BEfb3oMPj8gRpRx86fp0Sxih1wMn7lITwNLiMYNY8qUXkrM3f8hAbh64R6p1+Z9IFXlYDRwIRojPUT0wCzssGz+jnqSXakvF0dT7rCnxhVYPIJ+Xc+osnQiWtrDVYL7nDYqiG9dcum0Zqb/lP/LE2OduzlQci3ky+AJmMLqnpX4uR5TNGFl9ne38VCt1pdWE7rOwhPAfBUtzemG1SJFvsjXLM5lcQ7Iqr8xPpM6gNGMlMS9KfINBI7WjNiY0RjhNF190mzi2l6xpmeNFp/RlX77MQ/xTUQxWbK7R/St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bwJl7bWgtID3IyZNLY5+J0p5hwVD1mOSmiHrMU72XYGqDl4la6hOOld5dxJt2YiEya5TFYsGCNfVmaNmobe9dzYYw3nekEC6ztoxtiegIsFa52n/QKFjruyagIKvp3tHpPPW6LEfWL9Mt8GepPEfp0PAwdhvzBkEZg30OKs6bft8ynnY0lzYzIk3EZKCvo1JPHDtTDFKXqpQc+VEnBasSjSDVH3Kenh54lFpy9Uk+7QyEq36nrAg/lSeU2t7oEaqo5mTP4B1re8SeYXfVk1OwF+h3Ey3tOli4yoso8NN4Z0BvO1tjgs3rMFv5Y7Ro7YI6MHKDUeBv+53Z+fgAPkXcdFi6YkGBvKcqM8qG0rUIeJjN7qxm8aCU55nAKm4XJcBGgnPhRdHiEpEpqSv0dE9wSflmR+nxuz0+GedB064HOVa9C7k963oJ27XkMOiFB7WViuD2yvTIidEEuI2KAAyBwyjxk+ngJEcxKPfWW7MP8miBq0PGYerBGEI83rVURCJhGYd36/ayLMEOplCAX/0W4G/6JijNtsQr30v8Gu/cMdqzjxtaDJGT8nHhZ0TACuae0P1HXsSnZ3RJocCvhph4N+22Tvsd82SWZPC55TX6pILI+azfJ/AFK/krfQjvYizrMYNQfMJl7BDfLF+THZ5j7S7yguqAfcu+rfI2nEJ79qVjkP/xA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4f1e9c3-6bd8-4a6c-8028-08db4596e6d0 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:11:02.3701 (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: KJdyZ5pEjlo6FRLjYS77igpTZ5rH7HVUSMBqOBnxiDGE0GdXULqKiVyJ3jA488rIaH0gzxLhM/4X3oRy5+GUSg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5572 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: 13y978_N0BgYI3m1yxMH7up-_yVuiL7c X-Proofpoint-ORIG-GUID: 13y978_N0BgYI3m1yxMH7up-_yVuiL7c X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 8B1B214001C X-Rspam-User: X-Stat-Signature: gxps6eysg99azi1f77yijzphyzqff81b X-HE-Tag: 1682431866-66068 X-HE-Meta: U2FsdGVkX18f0Jb47M3frRsawT20Po4XmQE6rjoGfCJt3lLgvuKmLbojKyyoQG82/ntH0HugspW1hqGa3Jvfaid0Wetjux9p7MLVXaY1vQgZOLDJSlmb8rTmQaNR5UBKpuLoE9RbVvIbuWg8uQq8xiCREP1yJLNI3EGOjwknUodNgjUj0+gBcTG1S8OozkFIxcBzwYUpRLU0gykvSZPQZeI7bp4jTGJ1dBwrhumPrSTg05CYoZq9uNLL8oP87hgSBAcXlc4T5wCSdT9Yt2Zh1D0bi93RfCm3+EoHn4KocflXgDE9LLBfusArVcVvXnhy2qs++gan+xCLLKp5OzWg8oYwSfH8x2QeTZntTENdlhlyCB/VRVwlwPIXa3zT+P9s9pskeBE9xIqhN9w0bfmm5p2Jle9PoDyD+YA3cRVpvvNDM1ogsMWCkACMsgsVWQfw6kt9AyoHPYjgI7cYotcoGLwaR1XKcS6VYSQ4+YwFimQyrv02dTf8hBs1PvegAUoEfUHZ9SdqyBTbFtcNJrNl5GNtOyTr8iDZRBt7V8adizk/EgkcAQFLYaBsq2JC0pPlMSboust4FdhlyGXVOyrYtTKgB+Wi/7jEyXv7L3BfTe8uLtZ29qoEqzmgm+f7JhMyGlXY0j3BhoXYuuxlqtWJnUJhHWLSNNsxwNrC4vj6GRF56ZhBDdKyuk5/16TWIMZzeX7BgdiDNFXrVZFxmA5NtOMJJUgvSZTQFjvFKEW72duz9IP83PM1nLvF4h+InDgXhpVUXz/1uPjnTmahc6RZPGKraSuARHW7GBR6FJH8L6D3jNolESSDRdB2tYeyQEnsYZr0v3yj2YDWdDAVsAivOuk5MWUb4HKWN4ApBSsxRp1ekSjOxc/qMddPlUt6pK2/Vaq5TPcXT05j36S0kT1lzgLgJpdV++Ofn4/GOGvP/NWw8f4OZAuVWa70PxEhhIKSeHMHWPNCp7SqAjBXCnn gJckzbhe Hg91TuJXRp42Rt/jukWO2QRjAr5H1J8YjS7TpyWDF5uVH8Ut9wErjj2DOSog/A85IMKxWrnU5cS4bZMMSNX4jhle8h02yHX4ZT/JjgjZjzGhCJXklwEIPWDgBQYO02kw6hbXdHL6UIvlUKGJC1nKIPux4NuhrJXXStLeKxcGzi7BxblPx4QX3Nsphuia69QvpiYNW7W3JKnBASsM2P7SKDgR9+Ol0Lb+yYfNUAxl/p5JxEHlfgY5i07NdncJT5wUYrpZbLwMQw8IWyBTL7+q9U8JpIF1OwUo102DZtyWnSkTP5+mMica/bH16suSnW4WvY0+5qge5djpIoV+5Y7nMApyFnTMbFIoZ85Vh8+2sMWJBpuow1Vxgd1GPXYsCmsyGJnDTU3y75WQ/QSBWwxV7yC4KtcCiIrLYeS3Cfe6irNLHee4= 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. Signed-off-by: Liam R. Howlett --- mm/internal.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index 8d1a8bd001247..76612a860e58e 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)) { + printk("%lx > %lx\n", vmi->mas.index, vma->vm_start); + printk("store of vma %lx-%lx", vma->vm_start, vma->vm_end); + printk("into slot %lx-%lx", 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)) { + printk("%lx < %lx\n", vmi->mas.last, vma->vm_start); + printk("store of vma %lx-%lx", vma->vm_start, vma->vm_end); + printk("into slot %lx-%lx", vmi->mas.index, vmi->mas.last); } #endif From patchwork Tue Apr 25 14:09: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: 13223384 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 EB947C77B73 for ; Tue, 25 Apr 2023 14:11:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0D5336B008A; Tue, 25 Apr 2023 10:11:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0862F6B008C; Tue, 25 Apr 2023 10:11:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DCC286B0092; Tue, 25 Apr 2023 10:11:14 -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 C2A3E6B008A for ; Tue, 25 Apr 2023 10:11:14 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 6557A16021C for ; Tue, 25 Apr 2023 14:11:14 +0000 (UTC) X-FDA: 80720100468.11.9DF1D65 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf05.hostedemail.com (Postfix) with ESMTP id BD395100022 for ; Tue, 25 Apr 2023 14:11:10 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=dJROeIB9; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Xtt3BeI+; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1682431871; 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=LyTnByyQ/uRkrpAzi9MfH8841LKGO6dtdk4jEIaJp30=; b=nv4UwiiW2oDkK/hcFLFk0eUL9vt5NzCQYjlMtdbUx9KhNGRINTsx9UgXeVL1k8AkGpPvoD FnheWfTPjhHdkQTN0a3Yodzvg+2UV6s1VrrUULUVqHM4PFx5LFxrePQJYQhrzHzquzeL9k 0586+BrNOmWbYKYnSzVKWFR5PuiMTuc= ARC-Authentication-Results: i=2; imf05.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=dJROeIB9; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Xtt3BeI+; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431871; a=rsa-sha256; cv=pass; b=fXDgKv0L5dZbNJwU8lZMIrUMbTrdgR4ktJD5tLzFf/jrfVf6Q8EZ4JeJAXi7223oYHSqCx qO8kWnUjSht6bNAZxy7O3L9IekIN9rzw/Ee02u5/2yhCLQNGGZhoTqFSUA9CvA/PhXOqIq 74w+g+KoaUXDKJBLY+F7IKOQCD+Bd2I= 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 33PDibKb005234; Tue, 25 Apr 2023 14:11: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=LyTnByyQ/uRkrpAzi9MfH8841LKGO6dtdk4jEIaJp30=; b=dJROeIB9zEwpcqOk8ZWrHOkqQMYlacwf4RQZnk91vk6AEojOaeQPzy6e/A/PrCdYWwIU QGgBC8dULRJe5C2rICix66m1gHl9fTpBci4lyhik9cyINOQ1yXLnQoe0xVeGaW57q2HL mtgecbWahLGxBQ1Gq1W4Vii9BYYY3E087Hj0viVGDtcpNVOQ8f2qqPZFt0crswOKN7hc nUfk89y9DSwYV9eSNoxFSJUrVVgecBGVdXcKWtz0ZMIx6Ojkz/6A6TWmNjN7+kftGq9f WRv6pjX9ZHzjqN4IzDG6fZj6ezCO8i40G5yLcII4H4S8wQVMShVZCEr1tOi/Rn6ZgIf+ Nw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q46gbng95-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:09 +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 33PDStKI007334; Tue, 25 Apr 2023 14:11:08 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2047.outbound.protection.outlook.com [104.47.66.47]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616gdyp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nDziNX30JiLN685HPPEEwkHilidODjGkOE4oeOdg9pwSzFY0nA7/jndeHnBinxDlDrikOO4B7Pwj/IVltECJ2usvcdt54NNopFk/OMmcJ8P0l11/xYqyGrIE/nzG20yStDo2fb31v75lMvP56T3fo4k+RG8NHSkMpRsb2wl53MtbyzDveGhURo6ZtKNvKQ5RKE51S68PwqS26f3AS5L/rBYNTdEjLmDShKhHTyt7EA31xxlLklLe2HgcNKkBDkPOuSjY6/2GHD9Lft7bo1LUgm4jvbBXmbCMepGOLjsl2fwQV0miVnJLDmgmCaiwAtERO6NrV3+8NudhLGp7O5J3gQ== 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=LyTnByyQ/uRkrpAzi9MfH8841LKGO6dtdk4jEIaJp30=; b=B6IXxISqxZ4ybdbBqUVp/aIEwnYcXqehItiZC/tygHwDcJ2Wg3YRWQlINgpSony9ouvQiaa40eQGKPeEkNNCnz9G5RVU7V7S+BDoEl9ZLF2kHNSfuW6PaT/WfMfSXTDc6tsOyCBY3orUwTMya5WNRTECm0o6E6q2v3tDbAg7VrDfnfUoTr0Jnjg7z9Y9jA17bnmnh2e+v2CORQzF+zq5G2HArIX9DkkKcwvGyWLJz/wD1YyTgZdAnyhu4xHbtFYqUbevEjgY6BsRiLy+gx0034P+RM0iKBrqpO0cseEv/fgcMgwBMnYgBXkeqt10F2QgSrZSMqItMX+wJptxuT8waQ== 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=LyTnByyQ/uRkrpAzi9MfH8841LKGO6dtdk4jEIaJp30=; b=Xtt3BeI+en/oJjD5wV+h/wyuV6hq4+jQ0usnTG+pTK/+oFB2BLIqaPbxHyaJPN9W3J2z8RZHF0lfQlIKy9EAoc8Yk8oFIJcuGNbu3QKfExS8t40VLcasFR0LH0axB9CMdSqG9WjSiEy4059MSwsFXiqGLyI3yUgLtyK1taCANi4= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CO6PR10MB5572.namprd10.prod.outlook.com (2603:10b6:303:147::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:11:05 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:11:05 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 19/34] maple_tree: Add __init and __exit to test module Date: Tue, 25 Apr 2023 10:09:40 -0400 Message-Id: <20230425140955.3834476-20-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0343.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:fc::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_|CO6PR10MB5572:EE_ X-MS-Office365-Filtering-Correlation-Id: 1aee9f68-77a5-4a96-0645-08db4596e842 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: axtT1yCiob20CWh74C79FkUmlSrEPhQXDR6355vmmf1d29ClKlrMqtN4mU/Kz3xGtl8Fwo7CmL7SDHE/SBtYTjSf5urNN8ohbdctB/5KG8SnTqBNibPuXoCn31itCfQAFyBSP/vli16vSgI/jcJtf1jtD1Hstih1QruQpD9B4CdZ8cV2/vQ9n6fG34vos9CtSUg8Vi8JCeM7M81QZl98b7TIFVtNj9QudBNg7vtZ6PemNZCuUwuBMjnGEMOJjlL25lFP4P/RI/BjDpzzjO7U9cVcHO1SKSjkWADNJ4u0m7+VRpJtLQtNpQGKRmgVEFLbFv1TJgTyr4clfDQi94CGsobXgpzOnf5Ujcj5r4X62TmgTf5p3jb2Oy15IWDla4RTBzTFXKc8FA1EW/bA7cUJV8khSlbKIGU5rOIUB44oSdvTTZL6Sg8Q1KRq4RIHPBjv3Fbr3wFIJhdC4UoBSe4SH9WhrCJpxa+x1piolQDRsnkOzyyijFvXIF/6GCeHrBzbpZQCnn9pWfWHCIgrNYSekjMs3XZB4BM/a/3dLC7qoVH9fguL+lfSKEtabiplP4Im X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(346002)(39860400002)(136003)(396003)(451199021)(478600001)(86362001)(36756003)(107886003)(186003)(6486002)(26005)(1076003)(6512007)(6506007)(40140700001)(4326008)(6916009)(66556008)(316002)(6666004)(66476007)(66946007)(83380400001)(2906002)(30864003)(38100700002)(8676002)(41300700001)(5660300002)(8936002)(2616005)(579004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sQrjJPxs4SqO/cX6ICYlh1bFJijYi6nPGUsrjTP0WgkxW4RwEv88P1KPMlt8S79zozCKrGEg2r8SzJZzGgeb9mJhxcoUOVF9vkd2XHTaqP8m8Y0Dm3OEhR9gVRhs4ld2Csm1pKyFXiVgpxaS4GeMb1E1bhayVgWYNeph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3EOSNTEYhmk6lFzvwSwYi6eiKzaT+ULsFUI1hJ5ObGLqZjlUKTZhrcSNZ4+EmG+O9IkpWURDx4vz3alZ/2ATZGKDkOT2KKHgmmUw5SkHDwEFEEZ3/sngH9DqK50UCR7tmqLtst7TiqQqlW/pWI/AOG6U6v8JhNQa13kafc5BkimYYhzJ4TbFwWi+UP/UbpWwj5Um6PQzCk7pJFMCa+IjztLUoD1ryudt683n4PPDnDzgyFxosQl2mwMWEjDMudlKlL+RfMhhYKlVw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1aee9f68-77a5-4a96-0645-08db4596e842 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:11:04.9226 (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: k1Nn/vMXMaj2i/912FAtFMNBXIYxuMwCFz51YoGRzy7YaJHyYz8POIRFFvp7K9rFOQ3jDRZMRZgnXYHn4RyrUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5572 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: Ng9ADVzju73P3iXYLtnBrDhhnUCp0kqU X-Proofpoint-ORIG-GUID: Ng9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k3dKVZKdC87QivVWV0FTnEXTLRV7hIi2C4r1Fg5GrGWm15aH5F 2fU4YnL8 bD0LCKUr0lJBvdLphW8pEiMxbTu1EfItYfNgMXS5BXMQwdvvmC9wxiFnRTv6RyKGY/txfPWTYl2k3Rxfb4HIJKsu2jE/zwc0wb9hfoTwxYLQhlpdkyTsILhWfVPg0/KHA1igz1UBO2RUXNKYZT6NvbrEdzpRuxR7/E5LK+65rddjtGqkKuSXf6U97lLDjEQTTX2HfZWLAlW8Aqn86H4nO2X6EqlqNazeFqm4YaBlpqGgFRoXCaWimmlu1hKSePbuOxj1zRE0JJ5bky+FJhglmNeh56+O1LZMxoRuzMhDQ5evss05//e0Ijh/OwLWHCE3SPSn2/WyMIA98H5KEG2FmsCl0yh5lSKaIE8JZcgPp1zYnLaGS8lRrI6qSq3AI4fXXwlf0uX6YpSkBXt5POeTBx2rbZEW26aacpJ9/leg7sn0gjSJe0lRGaZjJy4xf6eynAwrTJfp0upMcwa8eAp/da97ZqRrCEep9nhQt9waykiljbrY= 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 89383eedb70af..ae08d34d1d3c4 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -33,54 +33,54 @@ #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) { @@ -97,7 +97,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) { @@ -115,8 +115,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); @@ -125,7 +125,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; @@ -141,7 +141,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; @@ -157,8 +157,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; @@ -166,7 +166,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; @@ -176,13 +176,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; @@ -197,8 +197,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; @@ -230,7 +230,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; @@ -259,7 +259,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; @@ -278,13 +278,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; @@ -309,7 +309,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; @@ -318,7 +318,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; @@ -357,7 +357,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; @@ -574,7 +574,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; @@ -619,7 +619,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: @@ -627,7 +627,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, @@ -655,7 +655,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 @@ -675,7 +675,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 */ @@ -786,7 +786,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: @@ -794,7 +794,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, @@ -821,7 +821,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, @@ -836,7 +836,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 */ @@ -945,10 +945,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. */ @@ -1213,7 +1213,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; @@ -1237,7 +1237,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; @@ -1281,7 +1281,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; @@ -1370,13 +1370,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, @@ -1390,7 +1390,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, @@ -1404,11 +1404,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, @@ -1567,7 +1567,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; @@ -1580,7 +1580,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; @@ -1596,7 +1596,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; @@ -1615,7 +1615,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); @@ -1632,7 +1632,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); @@ -1649,7 +1649,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; @@ -1673,7 +1673,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; @@ -1712,7 +1712,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; @@ -1780,7 +1780,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; @@ -1813,7 +1813,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; @@ -1855,15 +1855,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; @@ -2031,7 +2033,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; @@ -2044,7 +2046,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. @@ -2441,7 +2443,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) { @@ -2481,7 +2483,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; @@ -2569,7 +2571,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); @@ -2588,7 +2590,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); @@ -2673,7 +2675,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; @@ -2717,11 +2719,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"); @@ -2991,7 +2993,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 1bb0afc213099..81563c3dfce79 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 cf37ed9ab6c4d..03539d86cdf0f 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 Tue Apr 25 14:09: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: 13223385 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 CF703C77B61 for ; Tue, 25 Apr 2023 14:11:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B11366B008C; Tue, 25 Apr 2023 10:11:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A99616B0092; Tue, 25 Apr 2023 10:11:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 89E636B0093; Tue, 25 Apr 2023 10:11:16 -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 757A86B008C for ; Tue, 25 Apr 2023 10:11:16 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 36CD8160213 for ; Tue, 25 Apr 2023 14:11:16 +0000 (UTC) X-FDA: 80720100552.09.4F03456 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf01.hostedemail.com (Postfix) with ESMTP id C7EDC4002F for ; Tue, 25 Apr 2023 14:11:12 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=AoyDx8ru; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=HMds6F+P; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf01.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; 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=1682431873; 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=SjQ+Ak+LVQQqfW83hoX5RLJcaeyMVrqOz8zEeR0GSQQ=; b=b3iATN2b6XzPPQaVKIUx+sJQeGnShVfTxQeL+aiLMMwyzIIhNEd+BW7TJ9ABWm3mG5kM8F 4MsBRBZuDmL0iCQiEPutC2HkWW9sjUpjFQQhgcVx9rQXncyMFP50MmDKGf/aj5k3TJF51I 4dLtfE5bQk66kgbs/9OcGQ6Kk9AgDn0= ARC-Authentication-Results: i=2; imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=AoyDx8ru; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=HMds6F+P; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf01.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431873; a=rsa-sha256; cv=pass; b=Gxah4f74lSA7N6GxMZLixrpsjAqFTM5bjrotFnrUskbIZDrkKv8ruwhXnCN/SzV3sbu0WN 0eNuoAFYNUff5VzKSfnjso/Ytk2hncGoMLhk6aCFltj8qPORZluVqW0lBGAlnenSrW92PG uyg5mMDGL290sBGabKZkhQj8MqFEV4g= 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 33PDinSF017700; Tue, 25 Apr 2023 14:11:11 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=SjQ+Ak+LVQQqfW83hoX5RLJcaeyMVrqOz8zEeR0GSQQ=; b=AoyDx8ruHtcrBCl1SO6Y+t4PgA7OOtpw0qGrBNrSWidwR9Nj7AC2c63UN8LWAHh1SKyB mFoO/ZjTHV8c/21mqQBPPuH8Gy71Vs3MtJLKYn1qrwMtGrx4kVzpuFFSPkAzC9e/doCl XX1K5Kw0yGARD3S/idAWsVObRW+7ec1qJcMLbqU8+rpJ4KXr6bU8qLWn3oC9Z3tqu428 u/gGmanqZvwdN0KbQQlBzL42FhwJvPSTd/ugnzDlfR/0NnDn8ApT1EZA4pgrENv9b44Q bjW4RIiSQSs/z8F2vXK7i7nQXSICag4tvE+ZEY5+6n5NX7/V9BEfKVCmULSaJsYS/8M1 ig== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q47fandv4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:10 +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 33PD1ftv007351; Tue, 25 Apr 2023 14:11:10 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2105.outbound.protection.outlook.com [104.47.58.105]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616ge1p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N7R+ro0G2UpapPaqembNViyryMV8YFP+oxJWhZo0PrDD0/GtYnhdLSjYxnTPVS7qf7GDWVDeopCyuVrxtQsadKtBAyV022dobogsK9P86Qz3xGDcX2YIF3bqqPic/5U+T3pNphXDeuoW8+KVAAwvVfDRSa3u5AtNrnsRozCOEgyFIlL0l5MSF4Ny2km5jAHgTPoVEFBCDFEFszmKWpgIfO4Htcj600/RCxQS+oSP8w+5maBlljmdDL+EpFtwfIrz/nXEO44R1XfJcMqRWO1T+p/Kv5Awm7i6zQ9VI/UWAueagf3TptYAnOWHl7g7DF5xcJhJEOEShtpY/qthBNTyFg== 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=SjQ+Ak+LVQQqfW83hoX5RLJcaeyMVrqOz8zEeR0GSQQ=; b=TXvphHfaEwGWhFwGI5JUwVPfm0SPYCzleaqloae209mIIg6m54O1BN6GYu/eJQU4soryO/DaFdofKa1ffOkaL97QlARwyGTkjFlmdOHRcefRALwTosSR7tA0kt/O4Gga/UTvFvKmMFY6QvxF0E7OYQKEJulr+g8UXoMqElQZhlwTnUIQzIuH4AyFq/l4DPtu7DjfJRRjJgpq5sO29durZUrAcX5nb8TLLh3siH5EsG8Ij2Vb53VQtomRuITEIPV4a+5qtZ58iyDKErYR+YVSfFnjbS53W7IeIxA1FTzPHDw2+JFjBct7eONLVLWkxtbJ5++wGRiC+9sJsiRte0kHmA== 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=SjQ+Ak+LVQQqfW83hoX5RLJcaeyMVrqOz8zEeR0GSQQ=; b=HMds6F+PKN1PyAzUeHMPzwBxzJX+CqzZMoDTX/M0epMWol/b3QPFXX6iaRgLHP6H32ZniBv/K8UTW0ENvtUvuoRdmDmiAXo2H2CRz5gvP7XXCBmK6nT7INWFj+M9dU7b03/s9dUd1yYFLSlL6RpLgGPQsbMlD3I+iyGzh1UFLvg= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CO6PR10MB5572.namprd10.prod.outlook.com (2603:10b6:303:147::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:11:07 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:11:06 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 20/34] maple_tree: Remove unnecessary check from mas_destroy() Date: Tue, 25 Apr 2023 10:09:41 -0400 Message-Id: <20230425140955.3834476-21-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0095.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:ff::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_|CO6PR10MB5572:EE_ X-MS-Office365-Filtering-Correlation-Id: de23e635-4957-4187-5511-08db4596e97a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dVaWCPAh/MG/KhTJZmqL8Y0gSZqcrSGBqKn1AWca4RxzpJ+RzB0fmNe8m4qHJ+GBibRBbvYW+0iowXMa+xutcDQtT9d/SY7f3BHv4vFEgstza9VG7UyNJqts5ZaQUFOGAJW1h17mjfHze+P0begRgIGqW+3FKiVOydxlMocCjDDYz7+tHCxxMuHNV+o22JB7dm9H9GB7WzXALCNlvXRf5s3dVpjy1Gqvn9Y7kP3z5fSwr3kfEdzHDWrk4MwGsLima40CIvp4o8BZv2zUng78NiqdPB/xOTHbaf6tns0tr6AjR7HU5qROJn1e4e7dTHgIn+hFl6RyfA2LlA2Kz0kbPDrIcfGXzz6RW8AZ0xJ25SLRcWtF1pUDIaPhd5k1zv30lM7Bl1+Va1ZZfU6tJXuPRIAZzrGuR1+nW1ixdyQ1x7F+Z0zvfRqK/bPWHIf5bwsF8RL/c3PJ8ie6yXXUrm0AOOiDmbLBVODjl+d0KeEcYSEe0sq0j7n6HlnsYyVDzp87BjfDISgm9nNjbFv5G3ZS00BjUrQzjYlzQ+1AAw8GpN4wMv6YhQR0nhEFDLVjKc5s X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(346002)(39860400002)(136003)(396003)(451199021)(478600001)(86362001)(36756003)(107886003)(186003)(6486002)(26005)(1076003)(6512007)(6506007)(4326008)(6916009)(66556008)(316002)(6666004)(66476007)(66946007)(83380400001)(2906002)(4744005)(38100700002)(8676002)(41300700001)(5660300002)(8936002)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: h7/0YI1QAHtoy91oaZIFXmdrSy5U3vdsOSgulVDCQaifD1CnJfwlIkm24WxS/kEwBZh+fY9N4I3BTPabtsfsB6BriHQ/IPO7rcvDNzh+rX1GixxrO0h7EIfiwwlLHxMpvssxhQxifvyNcuQWooEQ8WfIodUQNT914MYp2bztZDgl0/PeheamG7QTF3AiXBC0tmYYA+g0jvzIZLfXRZOuOlBjZKpbhAM+cf/rW48tXg/fUyp9HlA863lKnMgls7bZCqeC/TeNO7I3wUNaLmk5XZ+2Dr3MWCTuWOhyDWs2SIV5e4+HmSI4+mgyFECoRRFCRuWulIZLjLUghmVJvZqMevsxfvg4Bq032tn/fsbTww/anUOEYszdsX213lvktqD4KuRlIq5bl4yvzBPzCEuUZlJHUXywkhWdfHmVchl66Ge/fKR9wIk9jsjrRHnUad1Nx7ZOzBNB9v37alPsrqr0fcFx6XAjXbP0jhGscpRM9XnIKOfxOrGWe10C3fD9zBofExrAgXLMlZLW1IjEmeYy459TUsfvFTf9OWse+4na+GKsaZLgdlX9t+H1yY+lN2tp95fRYnF60xPin1alOoylj96GfF0/82m27SgLbVmuGtw0Ff0j0cGzM5Tcm1LdinQbOM+ypbUfrgDXNe7dRdzbS8YpjTtgIyaUvOrk7ALGYhi9HcAuVOoDYz9M7voYfF/n7bG6wv0yn/PEtSP8Y0z04pdR7TGy/N2pYGM31Biw1oc9kdZR3NS0YO3tmFD1vnfZnRrgWpfAKwOi9cd5dtpd/t/urS+QSBY7Nh1hZajmJ95K04MJ8SgLNffe+KO6kE4JuFrCnaIHO49uXIDqTE3FsJOP96QZy5kf/0KSN8hQfHf95eiv7uDLOP0YYzd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ErUE+CD12zIKb8ekcuIbtmVwfkI6WBvYY8FvuHuZRljzm7V7ygTkuMThyau18WB76nAUEZBNQQNQcATEXZ7b9I0COGVa1/uA4Fnq6O27uVmBn/8J1KAHIbqsQq3pl2N9yQVaeB1i5SQk/cSE6yctVqO9vrjLuRGotgGdikZKA20lEnRl6VviRuajME6Q6F3cDwBgkwy8T5aCUDke+e0cPU4Qv4UCgCjboVrpFz8/mIj+/7GbDcwIz654TFkvulLGP6kLzqGhmmzU4pDeGrpvaUFaK6FlTtkl7tsUuRXhv2wwHDSJlxPn2ovMF3yAVgi/bBSb0XCHGO2UzL3uP7djgCQRG0GmJvVQY9sqfiRJTSO8PA0hzAevAIETN7jtj//6KVKYezKpHzqnS6t/iHHIrBYXd1aG4qyXa0mLMEAPld1BnEA5wZ9iRU1IdOEL++J3qfamemFEQlHk/xceKhAgRKwJ/X7EH9Qa61gMjnpnPiNOSMlK98TDaSFAAqJssFK/okwtdwJUY+Dpe4gvdh1y9ghFuY/UIkgbtfZ3wVwfHK6BdpENfmcnvOVJ7UsHqdjatXNTjgwOJol6yU0qN30SVfim+cAIhMAXib2xAFfo3++iZh2Nngu3p5eLMkefJbjFmoQf5p89w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: de23e635-4957-4187-5511-08db4596e97a X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:11:06.8755 (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: aPVhHYnH1CdJsnePG6dqMG4SMDezdR5FedTzpffSmhL64LN72cPeiKDG2pXl2XYMN42LYUQE6bAZ0qNmb4dwtQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5572 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-ORIG-GUID: -bXm8Rt6vYSv20pKsqoExK9Grz8M8Ktx X-Proofpoint-GUID: -bXm8Rt6vYSv20pKsqoExK9Grz8M8Ktx X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: C7EDC4002F X-Rspam-User: X-Stat-Signature: ygbmhpk4u518j18hz9x15meg3i4whmba X-HE-Tag: 1682431872-931114 X-HE-Meta: U2FsdGVkX19UsG70EUtuQBpex6XNBh0PDzdUnUwFz9DKD8BobbLSvEJstyml6HZTEKSd2stX6pafZzvGHKaGKZZByMn4m9wkt3I2v8geSDKzgULHHL08EchzjmwYaOvdGy8M5pdhyyw/EY1h8edSlIjA4OmJeWlXjmJuNiglb5BbP7vbu1/4MXuDCRmnsYyZefMJ14qiKYD6prvqqni/lPZW5IKlKbeL0crgrBARI2f08YrVUcrc/Reu0oA+qNRrzxUVRJcDE4+CJicD7J6u3zrf8b9whROpiUfkJjGx8vHRrGJZ6XvMtvVTJuMZisR6MeeRwUjtNu4b4dCqXFiDrW5WrMHUusjaGByFTg23djIuf1U/mhoZwUBU5pzXsC9UERUbDHNIru+RStkdJlRQaR+SMEJLws6Kk3msmmzMIluQHjgCYSIDC3QIxFIgRe+nFqD4tM9uAFrrK5+s8KsCEThOh8ko+xTZrzUOIRcbU7fk510DHhlYdowUEXr1ekZnXCQjH/ZN2TwOEkx51abt3/Ln//IPDXruSHGbBEVTsqKCBcGFZTSPpV4k7HtMFh7nJOGEkG0xSuTnbXAUX38yWRAefisvhjHT/EIZTzWgqKsFU8Dv6S+Nnbqe9mx9VR0r9rzmqQYZ7OJDbk7Kijz8gIGtpuwAWPtrI6vitcS2o8IlCfZk2XoDtcJA4mJJPQsC3PQTE5YrfgwJ+x1ay9LZiz7zDC/orZsjEe2Hon/8/0hatn9OQEqXYiVcs4AsOndGghwd79K3fBTFJ4Nu8jSLjOX5HNa+Kw+swyfesO/lON6PyjiqBw3hjHiCUf1bTn/PzNNFBVGuWf6D0h37jzDebpY+6o8VDY+C9fSMJVKlhbT20C1LMcVV6e7lXSMkIMJD5yUQXoTEtcbcrnPR6/GiTsD+VTmUEwLLp0nLBrPMkgrypPX09pKhTVIzzjIUkYCMzmKaNC5nfnX4omkU2W5 s24dQ/EG yixnuS7iKgfH+cvKF3BCbOKKkAv5dU5IuInAq94E8O8Dk/McP+SL4snl9oqLaBKfXzKQZJYvjoue1a0gbukAWhg8ki8MyqgkFetTl2FsUCFQ/FKaHBNXsd79RkO1D+ROpm+xkw1MsgcoWzVK5fbDm+5++yYTcX0nGF+0zPA8SL/+0ahffFqtCiWOoKh1OxnG9D/73eKeybDwtWBoFIivHUVHVvmdpAycYhFxBCW34iRgeCgTYmX/j7X79Ge7z98xuOjGUVlrAu8tznWSjwxXP6BU6vG23t3eoOuw2ZhjzxhNJM+voQxZLQWoolATi3vXV2bJFu3OotwYnULPIzkhTFyS6pXqNBhiDZenfWu0+x+ThIsmUxLdbHBBC+h6vKhU275+sb38hH2dGLL6jNb579qHPhqeccl4otpOadZXKR5eDuVA= 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 89e30462f8b62..35c6e12ca9482 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5817,9 +5817,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 Tue Apr 25 14:09:42 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: 13223386 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 80D96C6FD18 for ; Tue, 25 Apr 2023 14:11:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D0AFB6B0092; Tue, 25 Apr 2023 10:11:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CBA806B0093; Tue, 25 Apr 2023 10:11:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A983F6B0095; Tue, 25 Apr 2023 10:11:17 -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 9778C6B0092 for ; Tue, 25 Apr 2023 10:11:17 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 715F71A014A for ; Tue, 25 Apr 2023 14:11:17 +0000 (UTC) X-FDA: 80720100594.20.E864ED5 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf04.hostedemail.com (Postfix) with ESMTP id 2D33B4001C for ; Tue, 25 Apr 2023 14:11:13 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="cMq/7R30"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=OMCljb0G; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf04.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=1682431874; 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=zk1NC2fG6tYl5ET+sXVIUCMom8YlQoKAotPxuETP2bE=; b=2P0V+1J/wf0rTk5uQZmdEVUu2MxCzqLb36xA0I0IQXx1IA+VZP4LxBSXF9B+FM65pyv9ss xkiAAGaVBakX3bTi+dRkt3M92NtTemWPecrEeO12MD//gkPKtRWPSr/qW0kVaQmr1Rd7rq 9c7i/k8FKK3hEvy4CIRdMJ1KJaxo3lc= ARC-Authentication-Results: i=2; imf04.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="cMq/7R30"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=OMCljb0G; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf04.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=1682431874; a=rsa-sha256; cv=pass; b=vh5fVggGwzVJiM1D8EopW6W4Ej/FQVD2Ujmd31h2d5J+oDRuUCY/CeLExInD6WzmrGFxIZ JwUzoFo0u8V720e/F3exSv3zlS0NKlLCdsqLG0YMmxI2gf8PLRLSnb1NGdBswF8cuaJTMN 4kabB/G1qJtx/PYrBZbeLBz6Pnz0YCs= 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 33PDi1SW008675; Tue, 25 Apr 2023 14:11: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=zk1NC2fG6tYl5ET+sXVIUCMom8YlQoKAotPxuETP2bE=; b=cMq/7R30hNd7CxCX+HQut/Evm2eJoDydFZYxRBMsz7EHue2Qw9VJHrDs7Stjpl1vk69O pYN4Wnl9dUHjql19zzlJd7OeBdnWh2Dit8USV1JOtM6vgfOS+oI1xafFffNob/yq/yJ/ ggBEB3RrgD57dDJZHNM5Ti5jYxhmikGD7u0eT3Hg8iJtUeWrU0WxYuDEhPhltg6r7VGi 31B+Pl77QWU5pWH2/laIJPLKhgVYWJ11W7yOtKjWBbT+T9rV3aJ+sTXzOVvmeLbX0ETR iw+6H9Rkf8uxew4SwnS7h/t4JTvJi+Hk0Mhm3EVt3C9c465/bc3YPKu8emMOHoAhD1pG JA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q460d5e6s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:13 +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 33PDXeUe032632; Tue, 25 Apr 2023 14:11:12 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2104.outbound.protection.outlook.com [104.47.58.104]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616qtmu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N+yfTqRRhYxW86E0jI0E1srfJBPTYoz2vIR4X8LDmJW7ResI1jQaFbcjidbInjxmZkpxgcNuzUhjhAI1zNzgeh7IzhcUkR5j7tt6Zughf9FAOfc3M4YEkksDWUCtNEQw4fEJAWdxb9F6oMUvYOBMk4E1XRNaFfhdaNAWiMhHL6r7zlK2pz5Ibiur0xoAbcsLeN3QgLiTLWTwQ9sHboNfkmOL1dFgjFLK929bdrYFIpFeU62tUc8BzOWTHrc4K1VuhqjLMNxYRkS9L/FgVQJC2xCxG+/mW+N9QTuGkGuYNcOZSr+cFfIOiD1Y2q0Cw1cAbOWvWkIwDFQhMvWYV5xRSQ== 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=zk1NC2fG6tYl5ET+sXVIUCMom8YlQoKAotPxuETP2bE=; b=JpuZ6+i8sIca4M7iDUhyI4W7Y5lmkvAyynQ+49WqNX2ea4rgm0by8xzmo3GXnlIpdx3zqvKCXtZRbXYqBkNtZ3AoVl499YmHPRg7TxEmXDQ14pAwnK0o+sR9r+dRS09ruYSjpbRhCYhiaAhR2S29O8m023SJd90oe2mS1t6SqlvRzkCPp2RYW1RBObzEg5kobcBjHvHxUwSfFI4oc/6+tbydoUxUN1XoSEEX08LAKM2CvWoyhtJjTddl4U5vFB0RI/WXsTezTetXLfevPIk+y2UtUrsSAuT2tOpOVXxHodQ5rT3SOlAbMbeylHWSm86S11Ig4plVnjiiISx0uC9syQ== 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=zk1NC2fG6tYl5ET+sXVIUCMom8YlQoKAotPxuETP2bE=; b=OMCljb0GTlhdG3KLfeIU/WcViSxYopQab9UaQH8K86PG1gVHebRdprxjeKtIt8zQmCGRbCyfjBYkYJZwi0pbUXC/WL2dREf2I2eMyRGIs1wFyS+PyBvnOZRlKbGCkI4CYxC6FNFTstllUTPWWqZfPj3A4EieWaG0SSQqZAFqmg0= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CO6PR10MB5572.namprd10.prod.outlook.com (2603:10b6:303:147::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:11:10 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:11:10 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 21/34] maple_tree: mas_start() reset depth on dead node Date: Tue, 25 Apr 2023 10:09:42 -0400 Message-Id: <20230425140955.3834476-22-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0011.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:86::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_|CO6PR10MB5572:EE_ X-MS-Office365-Filtering-Correlation-Id: 7e9b0886-0df9-416d-70da-08db4596eb65 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8Lg989TkU5CPsptCc/e7c78db+ozSMAioF6pXWKSFA793/AR+pBK6ZVEcD9Zb3RE10YsnpORhcoLwVh0eeu3v0wtdjLyaF7pO0MW/TDIG1v+e2p8nY7AOiCdYcNzHiJXh6NlD7xp4nqYzYwybJkFVAH3TK7vipfc3LKWUif/3GWglpbDeWwzGY3RD5A50NupaPyTilJjuNU5woXR71OzeixOIciGF3wr34Z3FoR539M2FnsBvz53z2I4iuG/a9EW9LLk/MS/qSqKOjb9Td21OdCd8HYB/OgbA/BwxDJdEIoV1M9u4/dL4/KOO8CEZHzUUu6K8IrtbKlFFAey25E6UUb+j/s2/AhFc7Bh9QugghHXPFYmDibx9RdzhBQb9pElhx/46Ue+Zh4gKeW9zVYY2YPiITUtq+ag/+VtHpxRO29KT8l2Bo8lQH5CPVEiYbWOKWLRtv0IUX4+6RWzUUnD7wrV3FhqZqszciELKjoQFc20zUUSnsSYY+zZhoc7GytkEd+HC5j5y0TvfyDtrcrCmkUOkCoHo2m/hzmkBvxj0i10v6P9a6zJxyu69zXPONJI X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(346002)(39860400002)(136003)(396003)(451199021)(478600001)(86362001)(36756003)(107886003)(186003)(6486002)(26005)(1076003)(6512007)(6506007)(4326008)(6916009)(66556008)(316002)(6666004)(66476007)(66946007)(83380400001)(2906002)(4744005)(38100700002)(8676002)(41300700001)(5660300002)(8936002)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qxeKpFQEgsK8q++75o0XRPi3QzeX6iubDanujPc2reUJgwdrtoRHJLW8Hk8mlrugWRM61zIQneXLa8hwBw2VQEoiIh5bKmWHQTt81WsRtOZHi40OwR7GpPpwHRkpJ+i0AO05pZq9sIbPmBaXcNTWu5TrTFj14AcNDX6sthWU6tjFv8PzBGWUW5Ckb3sVrEvual9iOknz37oPW3fxdqG7mlyUrABQoRYSrrU54JoQA2DBiaRP2SAxTDaTblj7L0YyGuZl8MmNXiUxNI8yZXhphDT9hrSA7W/5f2X4FqXcYWBZo+m3K5u5NljHeTVviOXArDR/RbeKLioThb5ZTwaGnH/iiegwqYACqmhwjbsDQB/kQct+ZKPy3qhaeRqwrNf/jctOCYTPmxL4y6LKdPonWEO3fOAx9UnKByvb8x4q889v7qGHkb+LiNkIr1rf+n7tzHk3lc21NjV2npaNER30VShQNrg/4KmQnZWIiXscc7WJMTmD21sZ+oqHwlGI9RlIjSVwePjC5oz/NRG0qg9L2Uj6l/Ilv2SNHLHLhHNJ0r7K97vjxsNPM9C2tQzeVDOs+x5RRT4CuFmYAsyVcCfqDNj0636r2ghPDAKA7yEt8CMx/v0pB31WnrmJAxQqoag5SvIHoMRrar067kx+T9comhD8lE9Kfgtb0PwHhiWluuWBU/OpWErfMCA7DrCpxQy3+pV1K040vx6UT0ZdWbg36HFIkr7u3TbArmABkt6sM+ZGSiMcMxEsAhd8nMJTzHxHDOvZGjZnBPybYH1hpoP+XSZnseVxy/TQ6obF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I5uIJq7oNtUYzq1n4Rhm2KUnsPQxkjDTGTlVbxs+qPULRxIbE27Gz7JVrgm1jw/LA2qaR+HbcgNGutXZw7+8rBMTTvn3q0IvZrTkXqdcTTbZrin7cH4zhOqIHds4/L8XoEmuejgG3Ec6Jf+TAaI0MAGj9nUZ+sG33gOR/tA8NfOayT1W3vFPUWTzlZexjYYNUiTdqAJhZ6lApNGv1UK7tuxf4oEzClNQPWU483GcNBuT0TdKbZEEe+gmeFIwDrVsR8zomKg5HOoBETjbECUFjY1tDg+3MCOxfPL6TXB5zhQvNyfal4glMbijRxAkuNukAPcqohRKILdGehtF4WeQH/PRFp1ZRY/I0q8/NZZASgb9UvpJe6ozO5IYnMv1ktdYow7wyU6j6NCCEhdHsfH0YcT+cQG28f+FbkVgvJhImAJjfbQyaaS1QJX1JSHN2JZXDwHUKHt3gMoguWVhxHhNm6Rc920G9TkX8hp7IzIK1YHtoeuJRG+ptHVql941tzUV0TAF3/KG9w89tAMxLJQIAlkLySEzYsIa4Gt13XyrmP8L+9np+5uBcZsDA0iOLQ3sm30P5VO8ZbzrIEG/nwhrx4LNxBoum67sJkAp1zwgArvgHrBh67DjOAkLxnZAkl681L2t/KVYDqzlFURUfoP7EoHrQ69Ij+JimkbzRfEWuUxX7ZTxbM8m5cpP/w2Ap4UzncuC0loFTrZ4vGBgh5ZweRRZZyKY+DytJ/6w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e9b0886-0df9-416d-70da-08db4596eb65 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:11:10.0794 (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: mVi6jQ2lXihf0a/DwSfRRQC4vTRP+bb3GJoheCI2pJ/Z7fNkDfxpA4x0rWFsGkgEZmSpQ4ItyHgYf/5dRAfrPg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5572 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: CQ_JprCwYgSqd0-Xfigb6jQnQawjOYco X-Proofpoint-ORIG-GUID: CQ_JprCwYgSqd0-Xfigb6jQnQawjOYco X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 2D33B4001C X-Stat-Signature: o3jhpr9fwpoqe6ogsz3n9ojnyb35e4cx X-HE-Tag: 1682431873-265219 X-HE-Meta: U2FsdGVkX19fiCzOxCoCXTiDMkNgs0go7UZxwsU7y5FstesNDr7i/C5jezCkT3ZCbspqIXugpCMjeVGnm9jZNVXR74nJ7K99JMq/xiRKGpCQLXaxfodMOwrDNgWyOJe9mli0d511K2qi3mRdZkP/JbZgm352ZIff8MQDbWzBo95aMr5vPZyYHReHErbqH7WTVRasp113u201KPBi/sRr2H2hrpeFKWPIyVOSHmL5qTsNj5Lo0PVWUeQrcvx4L8i+ELLCfZlOxxiMuYYVjUjeGAyN3kN7vXX3WrlHnY0AQ4k3q6YmVhUfbYydDYPPC0wf5QwX8v/mVX9V+IGblz2jXFco9mf8ftdFh1bYceNTwD5i3kxN/We8mxuIpgHz2TCvcsdEZzyQCPbXVqFExsFocE1UZL2fK46gxhTdlOWBhjQYxgu6ALdNvB/ZJUXrxxW/hjtvvi1xBXzSEE6GGOfSOcukQBLFtKIe/JY6J4xwxwixLSp/srqG/haLcZeqUPTZyXo8947FKQvloG9G6+h9SBJ/5oKabrkXlOj78rP9pQY/HjfIQZ7csHTwtdxMlLLpSmtnVcI+3d97yIqgdj1dg5V+idkTYFgYHav0iVt2tGcO9ZBAMWdsSN4XWFoWSjJvZ/v8U3Wyv4OY6ZKzTzPgI1+s/jqqf51MQDZyDtp5cqWVKdxduRGs9F8/tC+08ER5XcgyrB6R703J9wel4lps7FWSoH9ieQE8QmzXjgX64l+helBUns2H565iO+LQlwld61U7cELcWjSgW0H0clV4Y7/v6cpr2/H9T3ZNltW1/HSy3ca0XGjFBxpoMH/0FHRoBbxcj+MprPu3VX0ouehDFMaFggiG/aRSjzTtNt4BwjoO3XDVJiq9lWjaUVkQpDxaVlewer1iiL7BiJgd7A6jNjZvaMDMri9V2ZZkz3rkTWh7Row/0c/6PArmLuWX2LQ8Uda2WXFhDJ9hnzB4gsA Bjh8eGC/ Dbih1WuMO4ldu5onUqeOpnkJDQUMJxhfFlrI1DAbttcMcOowMPKrq4+CSDhLUqNArhnCpYxHEBRug72aMCheZvfC5+vaxwfZYuMKpaYzzuapTtxrsSAz1mJXZUDnM0JI+/5AlLBVallX15ZJHq2rtPkZHfLRuSFjYB1XPZACcS7P/CJ6HH9W+iCkQ3e0ZGBqQXCYYXEn8KxolfI1YlNX4g2MyMB8yb8yC4jTazoRsqE9jf621dCnfp4XKgAzkaXJw602CCfvL1MHKdHmVLsu5jPN8iqGX9pQlIz54lbB4KjUmQe779jXDonoQp2JtcLfltWOkvQ6rYyKI866fdmGenXSE44X42l8iTkAb/S+GVtHRc/NPXpNA1PBjFXYtL6rwUdW2xHgfuN59WbSaZcwzeQMcE5bEEol+mffJFWz3jAWXYQA= 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 35c6e12ca9482..1542274dc2b7f 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1397,9 +1397,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 Tue Apr 25 14:09: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: 13223387 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 13BD6C6FD18 for ; Tue, 25 Apr 2023 14:11:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 51CD16B0093; Tue, 25 Apr 2023 10:11:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 47CBA6B0095; Tue, 25 Apr 2023 10:11:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 25B4B6B0096; Tue, 25 Apr 2023 10:11:21 -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 1597F6B0093 for ; Tue, 25 Apr 2023 10:11:21 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id CBB5C1C6609 for ; Tue, 25 Apr 2023 14:11:20 +0000 (UTC) X-FDA: 80720100720.30.743ED43 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf27.hostedemail.com (Postfix) with ESMTP id 5691B4002A for ; Tue, 25 Apr 2023 14:11:17 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=jiVMh+JO; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=itWB01lF; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1682431877; 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=a7fPAWEOduXYw/G/3/MYPCdJRMwWOwltmUWi9khAMRY=; b=pmH6rrICqji5V3X/htmfMjZ4IWWzAYiNv0Kxc9qgUJoTd9INpxjJ8hCPcu4EKInG01x9ZG EiFITv0XInEIoG2qcfeWDsWJbVRg9viED8vBHpd0IPytRYNkVJkv1onnTsm4EOny6DIbpC tdNzvdXaiyExgS4RWaLXj3HMce9JBzQ= ARC-Authentication-Results: i=2; imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=jiVMh+JO; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=itWB01lF; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431877; a=rsa-sha256; cv=pass; b=UWBrhaAtt1rBA5r1L+LrKwU8tf1n2vh3Si8SZ1xqKQiNmOSIT1x3VeT4SpjqgvP0NLl3F1 MM2GvbHgThg00aVb01NuCok68xN2vCJTMv0CxY7bsiOTyHCnaix6YJl/1rX745CwhTjcyb /VCtrbEIvaXfummLipNQmgdjj9LHSyM= 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 33PDic35005263; Tue, 25 Apr 2023 14:11: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-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=a7fPAWEOduXYw/G/3/MYPCdJRMwWOwltmUWi9khAMRY=; b=jiVMh+JOS98b9e1hjX665z3BTuuupH3/SAC6IsZ2/SFXg4qatGhbVzYYokJwbKMvn+8w iHp88U7I+mWVkPjPkEnleXmOUEzFwNdVaprWyfvw2nzt8k+wSJ3xr+eQgTzz2YebiAgx XQBk5ZIGNW5j3tyxhd3EqXbOKxQSwFvzShnhWlMn3eAXZKhhPMUN3wAi5TpMO+pn1BXx altKjklC/nm/XBSJs7arAFjkg23bw9M2wzxyUC/dY1QFk5T4UI60JkaOUiyvmaHd6cp3 wYjUcl1aR4TH+AZLroNg8w1Pb4pxNt6d8ucvEq6iNCvmI8JjALd3FekHHQ5NTu4r+luJ eg== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q46gbng9c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:16 +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 33PDo5Zr025221; Tue, 25 Apr 2023 14:11:14 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 3q461crcpa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f9cayGSwC5rx6BGOUach/bIZRejNbWmD1R1aNfK8vtIyXSaBuYQCGyuBCra+enCvx9sDOle4hvY65mUofRa5Ejzq1K+CohNKFwPUDC3xAXTW9p3+IdQavixtbfToPuluMcthA1/PWSuLhSWudtHTSlW9yxsvnhSMITji74c/i88r2WuXacNFjtUGtmiAwzv4uHdQjHLUbKyvojGV/h8v8GHpo/IqeOxM7AmEqs5W/L5Rvk8gU6y0IZ++yijIQjqOl0ufuVtexXTcrYWHM4nA+Nt3V5gnuHGIuE0TiHCvq3dRX0d2Mp+nh+QsSDrPHnu6qAG+aYnjkMCABNHThRnpiA== 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=a7fPAWEOduXYw/G/3/MYPCdJRMwWOwltmUWi9khAMRY=; b=IBxR93cpwr+sIfROqb7OfVCEgL4dhgZW+XBZM+l6o8yFMkAEuDIF1v6vYfnAm9eSv+UF1ZpNUt07ke8NUwTs1vD6GFHj3BAuHYzika2kO6Dws0Doq2LQ74VuG2vkdbjyx8VH1wFZ2JLo539Zd6o2UT7yT/x0omcXfElVhRukWvq9bBgwtfdU6skJh69IZ0KFXuAb2LCSWQDH5b38O6vUPcjKkXCpAQyB5lSUQI5OtPi8maKuUlOjxPKibvMK0zjyxHYQIpSlWKQMPWV9pFsqRnpFmIhIvM8O81LLNI86qj9ZoJFtncQwit4KXNF89HWmeit4N4FYXIJl8e2yb+wTXw== 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=a7fPAWEOduXYw/G/3/MYPCdJRMwWOwltmUWi9khAMRY=; b=itWB01lFw1awA4HXqZZQ+abmL9supCCVUkB6dFp6q6qXnvpsFldv6uC+9SOebkqpuLRMcvavARmM/uxxbDcpiUE4aoVfB/gdPH3CyYoMMMqxCj/73DnnwylbY89T/x63lFM0wbWyS9JTU+4xCCeSVf5q4vaWD7rBssj7cLWDe6s= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CO6PR10MB5572.namprd10.prod.outlook.com (2603:10b6:303:147::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:11:12 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:11:12 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 22/34] mm/mmap: Change do_vmi_align_munmap() for maple tree iterator changes Date: Tue, 25 Apr 2023 10:09:43 -0400 Message-Id: <20230425140955.3834476-23-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0029.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:86::35) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|CO6PR10MB5572:EE_ X-MS-Office365-Filtering-Correlation-Id: 1fb3e998-a05b-4a26-b99c-08db4596ecfa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WS/KgJGFa4g9iZTMqP4Jpyzt6sIZOreNfrnwGsoO/qHwd8tF9SCy6h7d4Arh24wgkuWiuB4kHiKe4+MfDyCYqwUZK0cAqFhHSn3UOh6U6ogGRY3Rupqm7xTRM3EIRzeQO4IXb8y/ZHV2yaOnhChhT6a+ucIaQUn4TnDw++fr9I0jEPpaCl2Tv5rQANMJmnlxyi1TZqVwPnG69fonNJ55NocVxJ8cquB5bn0iOfDs8zN9XaI4H/tHgS7OqBDkPe8l4JbZEUeQZOoFCWTVJ3W6V0MsHO1MYv2gcwhsx0WmGfKsHdttjLvsfG0ogQum5BIZzaOK0A4IyU5LoaLvru721OeivJ6zoTbmeBeQzJ56lwakKYrGsrk08GrGoeV4yhbxwvvwTp/f59vPlM70MdLCX3hG0yNVWunt702elT6xXBAshI/zM+FoDCgn4vEQbvA6hLG+j5H47X3fdK2dA9H526rEF2opX0fEaj+daFw9WVwOEgPJEY3jR486SUs9EXkhxptckZNKJpdAsVCfKFJGXbwERpWhl8bn0l7wDE51jFNGV5sSfWha/d5RyaZ6Bv/3 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(346002)(39860400002)(136003)(396003)(451199021)(478600001)(86362001)(36756003)(107886003)(186003)(6486002)(26005)(1076003)(6512007)(6506007)(4326008)(6916009)(66556008)(316002)(6666004)(66476007)(66946007)(83380400001)(2906002)(4744005)(38100700002)(8676002)(41300700001)(5660300002)(8936002)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4C3SLf9ad9Xq3Bq2R5PS0e+ln4hx7TObIVVktpClJmrlrcyhrAkfYDexvmDfVtMvl7GLJOjU5WcMdui06CXR4mR2/SCPPXQsvfEFM9HqOpArqHYiTLkkuorbng0djiCQK7QbD5jyrEUs5ApEjSjz8CqUMQah/LtuX4Z/n1xJyhECktEbrBlsRwwc8ahYbGfXQ/zfggairBGgHeiQR6pF+l0zkMKpBVtejC8R/RJuHvW3NbFerR7PHm5A7DiQ7dT3/Np4HkVPb2jjmR3OloePW0kOUmD96rk9Zq8lFpNs5/Ol4KwFludoNy009YuYJsstJPDgOjil+GIc84uiVPR7C9295kgy9afPmJeDUqzB7uNo7tftzP7iVEobrAocxSarpGrQXLN267FPxj3L2/D4MAPXZQfnuhxRzXY5K2bttwtpIFPK83QPn8l1gx/aWx0OZ5uQMEOemXxzVHr/ZOLDn6w0BuhyD9FzHJ/++ae9KXtlXrO/7yc4TPqfAwg3puDYepGT7o03UkcrUOy/263Nc4ycDn6vQ6mGREBTu4B6b9NojDml7QfTbRs6g7D87eIAY2r1doN5xQeodLAnss083QfJYn2N9JH/HcRujLbALkASOJ0Zn95SmJ9aHS8ENmWAEG2iBE1HrWeVwVQIsxWHWVvwqW0ryl/vS0jNUB++Pm8xgprdQz270NyYtliCLX2nyXMGm8dkQVbHakdHNKK95Eqy5qKiO0Fta6Hd81+CUvqCKZF2F3S6D0TyIDdEr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UOcTI3SmtaqIXMCbxJHEfDPv8V8DOoUVeBgGJUvEttWfXjgo9+z9ASMJs8fVMUQGB8/53WPbjgwz3+jFWcp7W9JLJcEFUKkn3gPywSqFzFife1eFs/qt4U/U8kv0HUEphi97G9w7rfei0XXq7vXXS3BEAklFZF43ESMva4+oZiGK/MnJQIYqUznNVB/Dqb0mzQWLVYhydVa+bZdUKw2tBwhbID2Zw6V+qPkK8ByM1IJhKZH0jki5Mj1PDyOzSxK51sAehL/BqCBYsU8XzBOkaHia2vwh9/lzD2xIzskAlAt7Ww/6wM3ePav+oCWIOymAu65dD/m/0yO5+kp5Ol5jK1IvhCgf6Ja8fj6YydWro/BRCu3YqGYoCMRVGF1nq8DR3MbrPy7KVX8QFl7vJr0f5iiKIEmpUFTCNqPCiSsWV8hJtpHP6azNEm4CZoF+GX1Pg3KWWuzYRh2YnZUW/eWUaZFIhlPXNXZOevByP9GaVTpkZiN7dEcwxfo7zYAOeFndtL2zZ6OZCDW4uwAUPycxE4H8hcytjgvPTttrLZwMEwaAkW8xQdj0xz/dNXr/KQ+XLbzk6S6UfgRssfTBARTLwgdZ1mRG/aE6CxiPwwU0NWVQwDo31O8gvuDolHpyExJfbyctuqwTccsm5cFJPjHQ8qz6S3+HJTxPu9/+yx2IB0xt85pXVlh/qzeLZoSeFhfZ25h3qheOQC5aJRjhpfeE3iCx132djwLy5Jz6SGpLm7q1oRsvCAp+S0uU5ZSrntBgajnJw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1fb3e998-a05b-4a26-b99c-08db4596ecfa X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:11:12.7224 (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: DhGuCQPMDQzc7TKMVLxR+n23Go2gXGHbD0ytXjDV3XE1+irZ2xCienZ/49WMd+qHM/zTtr9Bvog9EXxBVEHE3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5572 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: V3j-aEsCKsoSNYX7ECsgYiDCn3kIT5Xk X-Proofpoint-ORIG-GUID: V3j-aEsCKsoSNYX7ECsgYiDCn3kIT5Xk X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 5691B4002A X-Rspam-User: X-Stat-Signature: 8i1ema6scmkzftocyohdotdk7uox3gms X-HE-Tag: 1682431877-748149 X-HE-Meta: U2FsdGVkX1/uEFy0lOzX5A7Bwh23Q6QF1DDO0fgvJYQs0oxhIUIHHmNIVU6W+VhuPl99u3GF85aCdjrv19cNiCdSuT7LPqaYOhjYcqCOW+8MLY2v3wjalwc5+SstwxaWLH0/5AeS6a21EFDLEPRevO2Hr3uKTWr394ggvQan1ANUoZnwTMe/AKZ0XzmtBuUBE9tEhlkGmZfV710JudG07gVCRlB69gTomSyRUWJFwgDorDpxXAg6mVlcNk0hdRx62BbduzyNLVQKIQUz0UwFz52J7OjH66ioE33C0pZeZckGnvdiSSYsG48fZI56WjWd7OVsMsOYZ6txtcVe30vLd89Afn7P1o6j9Nb7wX1Pqsi0g59K/tOdmyg81EpX2z4tsYIr/ay+jaJv+FNBOsNicwlEUM2x12n/IQO8Cp2ObmVk9c9qaEKYw/RKhLxoMtBesBVeTKYxmYMD7cOV91CgreTdTOE3qnj/eqkeT1u0sCK8YVvVc5Tx76kxYunSA6ps57jfN0jGB8KbUiiGLkyWaOgyZ8llERRzhZZlbhuygUyDLX41R3Dq6TC66jd04l5Qhpz92A2aafMikcmxAGY7sGICOfAeY9MnIp0NyS6eL044TecA1GV1TDcnAhYSEHvqIxuXi6A5P6lyKcO7APcuGGY4+rgFrhQYQu14hi8TpImPkELLHledHZ3O01gmKmiCnZZ0jNIn/AniP75CDLA3uQAYaNnsKYgtuguIFIM/+k4NQkJT/nnqeSYoRhksLQk3fI1FQKxdAFGnfkwWlKvftOjpSTHs1r20c+PZdXZi2o5DJhxcfcxGGICaw58cGrtMPKTV7or5+XYElx+347LLWyoVFD174KLCfXZs3XJ4T+mbgONdgLowu/uk8Ea6lUBsGNFx5xUocWEjhYgs6wAsdmq93Nsa/7nefNqOKGDSRNIJnJuHvKcjG8mTxIkKse5ZnWC642gd4fDj3FfmD5E whR8Sq91 w/JJVjB0oGwW020bRfXky/cUTJ24wle2XLtp7Tn3/eu0GWVIGDDFXVi3PbfCyXsMKFbP5j+ESNX90dmrQQHr7wsMm5sAE4XJPAo26crnDS11D5wH3AK9ag0OawBewlw+EIC3DQnh2xBgitZAwPR5zTDb4p7aDZNH4H9QfIlWvfPLJnv9eW/UAetcrVofOcNji/50i4YSCHBmXYMEd8CXwLNUKSoMt9/R53Sz+RAjPAnIVEbf9CZ4rFk7n/QI1WWOoJ/JqtDYzewtycfolNPKdn0Jmkk3Y9u3Vwc3DZTgVYmVAZzG2Ve7261cDsMgOaXT2icdY5OJQzicC4Ys/36Tw7bAAby+XAzkuXBr/gDEVIh9qpfi0P8HIIDg6+/sZHzoTGlfZHV/kxRBS69SPrljDmygInsIv//47OUwRz2ic7QyJNow= 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/mmap.c b/mm/mmap.c index d34a41791ddb2..c0140a556870a 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2391,7 +2391,11 @@ 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); + else + next = vma_next(vmi); + if (unlikely(uf)) { /* * If userfaultfd_unmap_prep returns an error the vmas From patchwork Tue Apr 25 14:09: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: 13223388 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 6FD20C77B73 for ; Tue, 25 Apr 2023 14:11:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C2726B0095; Tue, 25 Apr 2023 10:11:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 149B16B0096; Tue, 25 Apr 2023 10:11:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB6D76B0098; Tue, 25 Apr 2023 10:11:23 -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 D7F7E6B0095 for ; Tue, 25 Apr 2023 10:11:23 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id B6D53C01F4 for ; Tue, 25 Apr 2023 14:11:23 +0000 (UTC) X-FDA: 80720100846.10.68072E3 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf09.hostedemail.com (Postfix) with ESMTP id 4607B140018 for ; Tue, 25 Apr 2023 14:11:20 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=l+rxpYL7; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=DgBdnZPT; spf=pass (imf09.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=1682431880; a=rsa-sha256; cv=pass; b=Pn/scoc6o2/B2b1ofuUZV2rNBq2nAxeLRriDkI9b7F5+31hR44IM15OeK2UoH9p//0tihD IkFc0f9FT6knhVdsNL4c0aNTBdDlVvw625DWOVc5YBvmd/SsH199SA2shNdhC6SO8jk3v6 w5q2peDqbBEodGdFCJhvzJ6kBk+alXY= ARC-Authentication-Results: i=2; imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=l+rxpYL7; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=DgBdnZPT; spf=pass (imf09.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=1682431880; 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=7WvxfxD+srrNnZyxfWsPROhv0EgqoD/8Wp1bZvKRdD4=; b=po3LqNfvdeBOLFSnS1+dGXrGqp5WVWZGdKPHZa/A/NU5BGfRG9pr/QD+EgMF9Hin8LGLzN BL9vOkdWWrG/95+vBdYshXQVHRBNy00IxVlOIZh/Syq2B+rRdXe3j9h1amZunbZuwYsDqd GyPhRfov/NTOuPgDijLlTVJS/S86fDk= 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 33PDiT6A022532; Tue, 25 Apr 2023 14:11: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=7WvxfxD+srrNnZyxfWsPROhv0EgqoD/8Wp1bZvKRdD4=; b=l+rxpYL7HMLuyr0Hvt6LeDsIk8lbvqMFReGtog22sUbrOHiHoZgAJXScT/N2zIg2lg6t I/XuI0rQIetuFwUz42dPgG/BqAr0t/tdOj2GArNdyEWJAIKp96ZcPFXXfNJrtsZbF8SE ggeMu9H5OS6346MFyssfdPRQyYh+OYJxNAbPbtIhYiF85Jqk5wDtmdHvbodrjbLKNZPw HdOYKtR2JyWpWHJRh7fMIs5VucEiI/fYsqzjBM0rnBeaFp2g0pLK9S/EkgsSVBlEBC9x lsvoymoEq9esUdFyv6VYd6be7cA0wNOiWReKuuFGmcpl7KBYORv67erVyrqo8RH50CZ6 DA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q484undsx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:18 +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 33PDZh63008655; Tue, 25 Apr 2023 14:11:18 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2103.outbound.protection.outlook.com [104.47.58.103]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616qpax-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l2NvE8t2CCjaACt4VSE6n9YAReX+NJHNO7b5yw3yaiBfILy5M4Ccosw6d2eKNz0pxSv9feFDHHkKiq6VEY4RTWqHfcBNmakgyUNKJDx1A7EsVMRQ3cfdSD9jd3sfObi7Z7O1T4dkeTTPX8WMUTL8MJipmCV7D7cqYXvmxCIr9kLHlrf/hg9hhIyQOW+WD+9rCgHSX+WNK4A40LZoTkAFKno96Fvy/SW9lsKPF8pCJR2DdXTWIzmoYSMkq/3HHvlwgXLjxK/Lz7RnDGdY59hLwvd43J89jPgUyS4ZXU4Xovvi5t/1WdixkH2poBf9bEqRm1EihlN6S6OhXW6NMdlq4Q== 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=7WvxfxD+srrNnZyxfWsPROhv0EgqoD/8Wp1bZvKRdD4=; b=HseEM0TcQ51mAuB3VNMQN/54jACEUrd2fBeZbOMK6XfferC7O4a9eCgbzGJyGPv6YeH2i9hdfHcAy2kt8xsHkZigGgJe9kYdy/jJkmUxovV6q5KrWsTMponIvdkifhOLq0RYN8ZZ4v1EwABwFX01XkTF8h89Iyqbjjb104yUP976OnArcrlXPwWDHD3TvgIhykfXPxjTqLmJ7chd0NZuGLBVHW94H1cJblpcEaMhcfi0Sql0If2Sj8VfHtx5eWAj+nXNla9gvzLqYKLAkWBJJjo2aRA5dRP/Zq+cjtUclOZ7Qj0YH0c9fu8VjxtavlcGMw//RTwcM+3YPH7R6MT+Rg== 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=7WvxfxD+srrNnZyxfWsPROhv0EgqoD/8Wp1bZvKRdD4=; b=DgBdnZPTwL8MRIZD4EEErmFBfVebQhKbj8zYAKJGxXDgOpqlyh6B7xO13QUpkC90n1Hr4d7R0GkBaO5DYOOk+xUaKuz0L06b+r5US5DgwFeTPcYv48VVxBj9IYMkWAIltAfIhpZTViPUG1MUhPCsWdjibuUqnJSxfQrRuTrsVN8= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CO6PR10MB5572.namprd10.prod.outlook.com (2603:10b6:303:147::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:11:15 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:11:15 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 23/34] maple_tree: Try harder to keep active node after mas_next() Date: Tue, 25 Apr 2023 10:09:44 -0400 Message-Id: <20230425140955.3834476-24-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT1PR01CA0109.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:2c::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_|CO6PR10MB5572:EE_ X-MS-Office365-Filtering-Correlation-Id: 8a882c61-b27e-4436-b284-08db4596eea0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xF8Z9iy02Vl9yNJa6yOlquWLM4U/5xW2dCoYXKSYUx5Z3nEJoGZRz6NyqxxoPMYO3kzKMF66iMetewRzQmvCVCiaTP4xzXglKlOnBDPmSTcJCngdcF4rbpXKr+8UDJxmIXl5lW7bNBUshhhB/2Lfcmnl8gNiRhhdP6VAsXwh2yA3/AqD7AjOo0+nkANPdIrIeG1cBeaMTmzDLE7y30kDVaOyaz5mLOY9o2c85LvEPbcAsLrRml6ABTjqMPG7GWdL0JoOH5kL+AryWSZrAHy0mY3ecw3KIozjPGq0sYCNEO9m1j7MVWoBwionmsWMXX9fKBwGGty3AeG2pJXWTrlYek1IHeRD9dGyZWGlpqxKu9EFgv29qlBO/iWuWWa3GcBZr9LiNGucb8u+dJyxdik+2wHWg4BHm36AWXDMnpKkeDuReKeETY35sNAU2bzcyBAdkgJBg/9zO2I2KTtBcOpKIT9Vt2i8Kfc/tcfrmN/HzJZeW0BtVr3wMx4n3Xnw+n0CPEc+vSjXEciZII7g39She1/FwNpxcgdUpxDZc8f3l+Pw/qoJ5YUohBOiwJEIpjXFToYKE8ZHZ8aNlI2j5S1rzAP4sZxemzo9HF5x8nAK+I/TVcU0xgdAQ5y9Eb13/LfGgXaqNSJ6eVzW1rJY8WMCJg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(346002)(39860400002)(136003)(396003)(451199021)(478600001)(86362001)(36756003)(107886003)(186003)(6486002)(26005)(1076003)(6512007)(6506007)(4326008)(6916009)(66556008)(316002)(6666004)(66476007)(66946007)(83380400001)(2906002)(38100700002)(8676002)(41300700001)(5660300002)(8936002)(2616005)(34023003)(148693002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +uol0bo3KdgfB81IXg4cQZVhRzdgiD5MYRh9mEC2f8/6DqlAhMDj8iqujxScRn2aEdABt2r+G3Df6WupObVo/cz0TdCRYNb4h1y9q/Dmhgq/g62dBdmes931OZgkoUDHjg5tP8zNcmbAnXJTv5d/CFfA++yh0TBMy48dkmBZfrvA1GyCgRj7NM7hT2DPl2akgE63FpiSon8YoUA+sZ0JtCUQln0QnYkp5WDuhiUgaPb/CCySVDoNsYmNROGtVQ9vo+8gkVefNKfJzLXWOa7oPM0XbOfo06rVrPlGNQ4TjPbhx9M7wit+WCkaL123bCrMVezkxxRPAGy/pXV6vQwUXsvptKRSyh8ahSvUESul+wj0rEdGJSesodCh4F7NUsddu2ySepQueS1l3xNIF6FOEQE/3Zvbt0U4Neda/dOoXRV5mRbV+jCDp521H74g7eLf51IAOdqqjTcBWDMA2jXVXOweI34mimtwcOL6ymLs2v6YysWkEvEVZkudOcuH6GemFiuIVvPD4A5Xxw1OkNwZyZFDWh71DuZtvqId2TRzRaVcko1CD6XBcxnIpClfpVcZzTd8WRNz/1J9Hf9E737layQ55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Hop-MessageData-0: 5sxA7SnaFF32wa3SNfcKuB8ByOlk26QlO0MfOUViqy/cs1g4wQh2F5TeUUUPRBpTUGSk7MyMmEaVloO28AcscPEdP2HLF/06LZtMkz7QYo37jNH1Rz60l1xrKukEGZjSrutT+k5uQg7Utb+pPEuMOSIF6dKI83pCKf7prQfzYpwMdlsRcWjsghUim6+yj8KOW8yipNJ9HtLWg2Z9xOtCTb4Mb9+XIprqkureWs69/rgyKVzpT8jxxIoqoE2f7C4xnpkGPphq5cR76AwCFGZ9yACXP/S0VBoP5WIPZAoxVYeaqrF0HCEzUUiysfdh64iz99BSwkimgQ5ch6eACP6inNmx35CYnIT5O5/jJAn8WwcBXITxGv34r8sAy5RlDmOkpbhrtAU+NEB8IvMLN+V+dDiMntOD+AMmZrv85RJqdPZ0SJm8TIHb/ds42AnQXjzelaIgmIGlw7hwnz/wClj1O2zzHQi0zE7Al8UKUOB6GagfsjZW54+b7viq0E8ISbVvDznUsWkFQRQhCLUEPwYzTlz0sdZXAmIyiXmqentbjLEvTRBM3YT5Y4HrrtwEzkIongh3CTAGytesd1cE0Qsgcs91yDiDQRO1vbrnlLlT3wfFXiULcqpCoTE+JTOpljCgfH8LuSmUKjGP1gXeSraqsCQM9OQVx0pxG5dxx8nV9zZRXxPpDLsI5ErbclRuNwMeReobeplkv8x1seNFnV1vJ5jNWwahltgJ0Dv3UK/4t+pwiN3+YvYw971dG9wPFWveZVHfGvPv4QEgd1RGkd1mApVQ1t1PgavdpEVlDS70gBW5AwgMOoIAjCC2cMCgjkhKN5s45ABZMiJ6rG56G7QXL3b4yIAblwqnl5QBtYiNCSak5u/btNlgavlU8UY++a+0XixqVSe5H5Dtmm8uBybo6A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a882c61-b27e-4436-b284-08db4596eea0 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:11:15.5023 (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: KqzbQnfANxGGj1kQjhxrZXk6utvhMKvMQ0SvQVC5iJbboT3Ju3Od8IXgSIdWlYo5kGzkOjqgefRU/h2WKbP5bQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5572 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 malwarescore=0 mlxscore=0 adultscore=0 suspectscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: bynY_zJYe4DUneV7ZV7-6mUfRe_XRueG X-Proofpoint-ORIG-GUID: bynY_zJYe4DUneV7ZV7-6mUfRe_XRueG X-Rspam-User: X-Rspamd-Queue-Id: 4607B140018 X-Rspamd-Server: rspam01 X-Stat-Signature: c7ey5ffwpsysoxuo3xphoh81ujeiiuj8 X-HE-Tag: 1682431880-282917 X-HE-Meta: U2FsdGVkX1/ld65b4c98u7F8ih/eQJDqwWRhbx45SJLkjCgZq14m2pnupeYIIQGGJ3hD1tyP4Qliwu30n94a+p068t7K53NF4CYw/OJfkCVeRXtjmtREQ2G97dj4YMSw7GcEuGKbmpslEvspvRuy8P3Skf6XHchyJrI2u7GJxjOr0s1gHKGfw2zJX+sEl63iJ0JAE+vt0Y6ECgVjn2IHjdhCgjjJXC8Ynn6jj4nxVHNGwSVkQrfFcdPzvSZFGTxjxmuH0lAoZgupkYylJU8lKjwl9hcKMN9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5ccGomMXOiVxeQFkP2aBElVf4gObRtkqcMiQDMorvebYmUo38Tbpxd1g2vM= 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 1542274dc2b7f..ef7a6ceca864c 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4727,33 +4727,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; } @@ -4782,21 +4774,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++; @@ -4815,12 +4801,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; @@ -4830,9 +4814,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; } @@ -5920,6 +5901,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; @@ -5927,16 +5910,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); } @@ -6060,17 +6043,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 */ @@ -6082,13 +6073,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); @@ -6519,7 +6524,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 Tue Apr 25 14:09:45 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: 13223389 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 6E93AC6FD18 for ; Tue, 25 Apr 2023 14:11:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 346FB6B0098; Tue, 25 Apr 2023 10:11:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2F7356B0099; Tue, 25 Apr 2023 10:11:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0FC146B009A; Tue, 25 Apr 2023 10:11:26 -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 EAAD86B0098 for ; Tue, 25 Apr 2023 10:11:25 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id BF884801FF for ; Tue, 25 Apr 2023 14:11:25 +0000 (UTC) X-FDA: 80720100930.10.DF8C0C0 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf28.hostedemail.com (Postfix) with ESMTP id 5C981C0009 for ; Tue, 25 Apr 2023 14:11:22 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=b1qW3Vzi; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=u9HsLFcq; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf28.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=1682431882; 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=LjlCxI1yd9tgEAjJz6ebTiSqyap04NE9PQWsvKoR4z0=; b=ATdepwiHfa5TkSFq5rKrX5LvhSJ7KwUiT0SZg0vWQnQiX/3iaX9qhmi0pFhSOlgz2RnPW1 8G6SqcuVXEjaq5tMgf5EsPnLU5x28sh91R3Tq5clC8scQdvPTpyuBYOeIauaezq392UAU4 jmyfD/gRuWhjQ6lawZh7isKmAhRblFE= ARC-Authentication-Results: i=2; imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=b1qW3Vzi; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=u9HsLFcq; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf28.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=1682431882; a=rsa-sha256; cv=pass; b=4/rXj4ueFFBxggEWRpBenOb64EiqNsAG2GurxSWhVtvYkJIiVDCPWZdl+myXF2O1E0pivs vACNAWGRX3Us245qt2/tITnOdVGcbcwbu2nmKilWPY020Qa4GGgAc581k2r2/BcEwFt9gq jShkQlZmqk4MaKhl9haWq80sdFcpdLY= 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 33PDioRg017723; Tue, 25 Apr 2023 14:11: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=LjlCxI1yd9tgEAjJz6ebTiSqyap04NE9PQWsvKoR4z0=; b=b1qW3VziproRVSYtuLkJPD9lPOc2VtYOpFFLTrwdJCcrah1V3MA9cV0bHGnzVJh/gNpj X4u1R0gl9Mr8C5/DI+y6W88Y7B+cnkrtfHawuiRs7GfdJcGQZl70Ki5BnJJbNaoX2SDD ZRfZ//4OhFNmIVAC3rbPwhi7X6/pFmu87benFPbLzHxEhtTrZOqmbftUPb0aVyYrOwX0 YigdmiKw2rEU24QMbKuNFjg1hFjao3lImWbZW6e26yEyNXHAlDcgAXDFfXF+8rXP1BXZ iu3wUpZKUAVzFoDXrVIhzCv0LuonjWiYUFR2BzNMtvRm64Yc1G2ZjSsOr9CDBYFV8pFh xQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q47fandvm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:21 +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 33PDBwKs006648; Tue, 25 Apr 2023 14:11:19 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2106.outbound.protection.outlook.com [104.47.58.106]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616gsa3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bCmKuo7GeWUyGUKVfdzejin/Mn7qdXxMgUm9/gW3Qysj3QkKbz81aY/K6iwHROqi3+97idEdvNI1gGBY0+sxhIRdAZbz241rZU8x/wtIwU/3T3WnfYbKasVjOAXx+lDdJuWJyuq/6n9cWXGIwTGVISUZ8kbRohCHTR8iutgU6yTdEBfCzChBXlJXrqxsmeY7LQQsASyLdWDtmpKzl6MQJ/ePaWaTBQYQAQpEI6H3YBAv0OTvxzg0iVY2iuZEDB6XcCuQn5Q8HPsN2xQUa2LvNc75ASxG2ldOM+nKrLa7Wt6jT8MTf9dfVgIW8X4tNkW2X8xZXOC7Qi/md1+J6YWnLQ== 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=LjlCxI1yd9tgEAjJz6ebTiSqyap04NE9PQWsvKoR4z0=; b=bB81MCQHPrvijuXk5I5efJXday7zaD1ze1jmZiIw57FjjVL2v2gHZN1XVTnkxJjQzsp/FoyHOTTDqyuIufrwl3BwmwxREodsqZ3jN1+Iij3AqFtOcuRD7dZU0FR4hdVoL/WYbLYNwMG7Jpi/WhR17czupt7pjQ71gYUzR08QOIwJAQeX1l8rhgJAAFpBlpK7p+Pxip8S3EUbPFRwZu7Yo/JIHnhWrG65rS2+p1F8mwQn16KLkti/q3wTSrj2MHAyY9koC/teve74tFEUu4NRZfgS4ivCWAC5vrThSuBAR5cTmOL9sqmzUfHjjXhvwVtbFCNsP8hdzuE75l9qUpOiFw== 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=LjlCxI1yd9tgEAjJz6ebTiSqyap04NE9PQWsvKoR4z0=; b=u9HsLFcq1q1FYTdEYanDrwSbjWlqc1HcwvfNazJ5NJzB4mhYJ1UDYFId6cTxTCrKDuWvFy6d8lX2U1Ed1kdO9RylCusnsA1e+UusoIRLUBIi7Pn1OXrlr1a3m7ntFqQuHCGNJ7o03mG3jROBsze1htAnMLDzWvNrr4bS6k2oDzk= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CO6PR10MB5572.namprd10.prod.outlook.com (2603:10b6:303:147::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:11:17 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:11:17 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 24/34] maple_tree: Try harder to keep active node with mas_prev() Date: Tue, 25 Apr 2023 10:09:45 -0400 Message-Id: <20230425140955.3834476-25-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0213.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:ad::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_|CO6PR10MB5572:EE_ X-MS-Office365-Filtering-Correlation-Id: 82f8dd6e-ad7b-40dc-c5e3-08db4596efdd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Jlu6NBvkI917q7OAKglGkRB/IOpeI7HNj9I/F2rwYgyRLdFG/XQDpKANMNrSIIpdjUvoEI2wVL+qKPy4P7SSP6Add4pMsIHKaKbkLlFa2Z8fcZCMxtafg5rKKynMv1/0OsceUYQXEFdaSo35xZMmfxbZQfbdzpXTgTGYTXheqhEWv+/bjjxio+MiWgww/GAmaajgPRgvTUoRxyixYcevlZCKO25u7EP98jfYK3xD23mFZgo2IcDNOY8WEQbEkYFsFTSHTds3XziaR6GfqpIrTt1tqglAxVGn2urkwA8HUX8fDEmXT5uaO+hRGTZbwYbrLkvo8Kydn2jw3f7uzIPANymJ1R1lF/7IgVYap1zN45xw9rAKCTSa9P62FJp0Cs+ZlYNRg80h2zYf95K1iVZS5fT4UaJa4kTAxt2IlKrVrD+t5kuKy1pK3wuWJyDBRTHGUWjrBbOedjZqPQ3DI8EKsu3DWK7YHoTy/T9HPN8WpGg2jKa/ap8BD+wmRyzcgmmIOCrClHov3swU6/IhMS7Dg3Z6Vmz06/9V889nyb8vob5v4gxJNxo1GtZllqy490bm3wkFiitIhFanZuznj09kYSMFfDjg8m9gQ1QAk8U7JcNGXLaaQB7YgEjMo5Q+g1B0Y7lKIQDSnHAAc18GMKF1cg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(346002)(39860400002)(136003)(396003)(451199021)(478600001)(86362001)(36756003)(107886003)(186003)(6486002)(26005)(1076003)(6512007)(6506007)(4326008)(6916009)(66556008)(316002)(6666004)(66476007)(66946007)(83380400001)(2906002)(38100700002)(8676002)(41300700001)(5660300002)(8936002)(2616005)(34023003)(148693002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4kDY+B1M1yhelL/UXyb/5xBKfmDRw5Pn0dw5bQKWAoUHS4RHK1R1JYAPMzC1brxnoUxZM9eXfNXBPPn7rYVmPrj7qVrt65GXtMYIJdWteR+kvqkMfbZDYa7h6kFtbIOVBiulWs1WP16AtzCvuCSEgBct739mCr5RvIpMVcnn4NyO0Kn0tVxQCtZ6ALeFHJGdtRsWR9SlHgYP3muf/QLTBK9OXCBIoxdSxlBZix9CPLw1W3RBCbgXLoVukyOd1glS7bbFTRDk4qlcWfdOTihYj5wEw8WjnCO3uhb/9XkXkhZzysBf0MswO/uqtOyrPpuvMDgbxTwuPd/+U/CF2HLCJC9D+hnu9ElctGMX7nGnEldVsKJglawrya9RfQImK3RssDLRtZojVTdzrcgeycAbPXNaT2oy7/Xo8l0HtDhIn3EtdzZk0p7cx2wKUFuCkONYpN6ssj+NmdQ0Q8szjoF60xRK5Dl0nqR3Wv2BNaDGkn1OlSiibwFJzc5pS+nOjMlRJiRcmUe5YNIulNk5z9/a2ei+gDxNCoZub/aZpAFRErBb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Spam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: OtH3qyJNK5w6N/V9pbzP3H9Wr8DaiadfVB+bJEz+IpgGlkNTh0qVgULXt+ORS2nOXE7c2rqeAJSuGjPhv5wHzM1JpR70UPttk843i4+3RGfJvBEiFGmCbOd8v3dgYNvhdBMDCuQrrauEuHhN1w9xQRZrF9WWzqjcy2B6Agk7HWuUxrs7LB5wE0UhRv8vfpyEpMZzHHAMC46XLk9IVg47ifbCaIJwFOX02AtMedxG/djXHIVRk+Tede21MxRdTSGouiHV8PRTlAI/5DtAdkandMKJ5dVjEZZf5u69+M+c5KrcdKD0ymjc8sWjKWuGIHFlvX+mlVuru9m9cTvZ42jNFjXErdxGlkRELcIG/b0yuvUDfZhDOqW1Wv+XeLmywLMun08CnmtZA6oK7KWen/Ty86qPjTt3BjErVAHtHxmpbe+z051SLMnPpj+bvZHaXleqTiGgOBqR0elp41G8mRQG2/JH784Uf5I1KT1Bd0xVMHAxhJea1kyyMRry+BLnOM1SIbHlCaPbkfJhFFmzLPHkcTqbcZ1A1qIJYK30lrYqelplnIBALozRE6jxwOYrv82bKEwUhj9dGMyiCEdsIU10k+pI+rb71+jR/JNNj6tOkgqS0Ii/Eqd4N9H4aXHbwLLWhZl6wbRA8tBAIY8NfHYr4PACV/VJgsV4olhUGCF9SaaAfrbaJSEzOyJ/oz1ZG7mR5SpuZ41/rcLA1C/IfFq0Rr+SEZJBQrqmUbAKUqoCWFz7z3NMDNtsN2z1g3528yY52F8XBw4edyccqFXmD3YLk7W+w/pmhDAk03KsDdgC9eIxSasfGOo+Db+NGsM0c2XE/YpQ73Flj2hhN822kcs7BMkYMy5Y+ARa5lncrSYydcoWK9gnGdmUv1L58XX2DdTtd5RCuNiAHxSx9yxuDMfW/g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82f8dd6e-ad7b-40dc-c5e3-08db4596efdd X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:11:17.5993 (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: U6gb4qHGiIDF8j+QwmNBBQSS2x74LLYvJbJA9WafTILvyxSueuhlWAW9h+uO2dwVvOiyvMB3RWzRrnex9p2MLg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5572 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-ORIG-GUID: SgGJfYOnvijv_m_87PRucyzLAeumF0po X-Proofpoint-GUID: SgGJfYOnvijv_m_87PRucyzLAeumF0po X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 5C981C0009 X-Rspam-User: X-Stat-Signature: wskn1hhpdxa7re3ys9hozh3uc9hrtz4i X-HE-Tag: 1682431882-327753 X-HE-Meta: U2FsdGVkX18NMcmk8KJShC3P2CEqSOwsocJSTZiRkSTk6mELXAzCWmM6ilcEpSmoLQpzzOwbCZmMlcR3o9SHqa/p13gTZkfyQ2jXIYRZdgPiTJMrd4CTQmrgfvhCBqypBlL0O/R7h8EYdqlRPnBUzrFhfCtCT39sAz2dbaZk2xauKPZPFMqlsRlVN0ws29SQocgrM5tKu0sCn1fJpkdwx7xUWohJALKYQFOx/HX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CC8QWZQwftUa+na2qGwR8I+Wo+vxaXRyqijfWZaXrCyhs0pilfGpUUn6xcaY5n6ZpIdHulAYvI/10SJ8+P0Y342vDzkXP8zwv/WPpl7SotHHLkGj4k= 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 ef7a6ceca864c..20f0a10dc5608 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4828,7 +4828,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; @@ -4842,29 +4842,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); @@ -4873,32 +4886,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; @@ -4907,9 +4921,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; } @@ -5958,15 +5971,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; @@ -5974,19 +5980,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); @@ -6112,8 +6129,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; } @@ -6133,14 +6158,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 Tue Apr 25 14:09:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13223390 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 331C5C6FD18 for ; Tue, 25 Apr 2023 14:11:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EB9326B009A; Tue, 25 Apr 2023 10:11:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E42646B009B; Tue, 25 Apr 2023 10:11:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C46216B009C; Tue, 25 Apr 2023 10:11:28 -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 B3C9E6B009A for ; Tue, 25 Apr 2023 10:11:28 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 8FFB5C022B for ; Tue, 25 Apr 2023 14:11:28 +0000 (UTC) X-FDA: 80720101056.24.BB95B31 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf18.hostedemail.com (Postfix) with ESMTP id 039721C0021 for ; Tue, 25 Apr 2023 14:11:24 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=SupMEHNW; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FxllB0eU; spf=pass (imf18.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; 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=1682431885; 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=7H2wIy/la9zGER0MZ6oUbF5r5hWOi2yPIm1zTd6UTEg=; b=IxSmIE86L3WQvcDZmBCfU3zrJ1Qn32Gkk1eSWKakKDLPe0E2+OP40PrEqkqP8jJze9alHv XlupHVhemc8AkPCa8R84u0jlX0Yl53FxnQo77yeygpPPgDGWheEndrp2ojGsSFfnSpH3ll IdEpwrJmZZwURWnYy8mF4jzVEnHEZnM= ARC-Authentication-Results: i=2; imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=SupMEHNW; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FxllB0eU; spf=pass (imf18.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431885; a=rsa-sha256; cv=pass; b=RMBmFHxnvtltemvUDwJ72L01Dj3r+W/LVDsQLmPqhoJ1bjy2V2RS84yS6K/j13hktqC9l9 lDCk3k93H1n4xGcUiklWxxzO2MP6KJdZZviY2UpHmi48z2ftPk6ixQEC1VRZK2VELtPxkU ukdYHG90noMwcCEO366j68kWRh4vl+I= 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 33PDibUd006082; Tue, 25 Apr 2023 14:11:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=7H2wIy/la9zGER0MZ6oUbF5r5hWOi2yPIm1zTd6UTEg=; b=SupMEHNWvFC2qxRmU1f3/cXRbBlk8w373wL6wH1C1r7VRB/QswI7JEnl4ME8aIuS+WiI 6s6KIbyhvzCemImzWHQUX5/PyhGnXuOE727+0yiHUXzlFTw6Crmv98AgzlDAPdbqLHj0 WgSmxkLFU3zLoYl0fcrifyDA2sL6gQU8FmCAj7axJQ6t4GyiphjlmITSY+CmfwENTnEz sAOsniINAi4l5J/mdHwGazzm0U7HQYQyvEC4mnZAauvu8+xOzFNnjiXl4HtMR/8Eufyi BLSWhY3grQNRJmFWLFPihtYkg986Yf1rWIwyfKyTUWr+k4/B8cmPYl/CFTwu6eZUAOmS FQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q4661wgns-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:23 +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 33PDuJe4006705; Tue, 25 Apr 2023 14:11:22 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2102.outbound.protection.outlook.com [104.47.58.102]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616gscs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NaH4avUehhEodfV55WfSHcuAGfU71+malbQxHsgzpEDcoDR1da+Nb2Rl3VtwGDl8LqH/RVQiCzDJNm5v3IHRVY0MjuOx/WUHGI9XpXFsG9Vc6oC1YK31HL3uYNEjl9gSGu5kJZl3mORRmVIHy9n5ka2qe1tFNpa/Ec7CkImJSGajCYCcItJgTI9oQqZD3p67Lztv18KBKFgVh6jxoh3pBCWlupgu/DlaQytK6wS2jINJlaY8bMGfdpTmt5NiPJUptuFoOclN/pPyW1gReobZ8qGQlBs/gAKueJLKPTnJqwXxtGsu2q29bbXNgvFtO6wD3uQX0zfdhRPEUarYQxnyWA== 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=7H2wIy/la9zGER0MZ6oUbF5r5hWOi2yPIm1zTd6UTEg=; b=WTQZVXLTdIFmmUHiYwts4yYx3zPTWNnuKKDNsxDh7Y0dJPnZUGl3yOBD1B+FgEkCkxdhqLQqNc9MwlA9piKAb/LiJofbld7D+Ys1Gc6labLjVPH2wJ0H0f43PqlvE5M8YltBETDaZ6N6m7olDLqIGvba6rm2ggIRkHaPFfM6iI56ceRQfoXRQZPRa/5X5D8rz6sE3F2VSWAkv/UfwMIYCJy2WTw2ionWugGT7D2y/UMw0/6Xgq7pwEtORGjlijckt/vO6LDn5sM4U+XDOr5J/RHNX5ODafqxYqPCsG7oTwtKzNPqKWnGJ50eQoXWcYQAfL+C0hRKGHp9AbFrutSRxA== 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=7H2wIy/la9zGER0MZ6oUbF5r5hWOi2yPIm1zTd6UTEg=; b=FxllB0eU6lfWhxvE964CegWS+dFY9VIB4fWMpTEHgmxsVboRix5abF6k6UvIqvtT5KqFY7eu3u33ZUB92nUGhoPaI9hpKpJ3tX6MQwrcX+3dV76SUpfGN1v05h//FIcKbP+BkeRb6Q83zJ/jW+16Ze3Ka2LgRxHHHQ+LSkZogGY= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CO6PR10MB5572.namprd10.prod.outlook.com (2603:10b6:303:147::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:11:20 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:11:19 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 25/34] maple_tree: Clear up index and last setting in single entry tree Date: Tue, 25 Apr 2023 10:09:46 -0400 Message-Id: <20230425140955.3834476-26-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0021.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d1::27) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|CO6PR10MB5572:EE_ X-MS-Office365-Filtering-Correlation-Id: 573cf4be-fba5-46f6-6067-08db4596f143 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gIo3vjtUgup4kgpTOaZNKlShb/0MFhY8sbk7+jOt3WRJRMIQ+wtU7Ocr8hpXqX5WQ1IUqY8iiIdVmPTPUFRcExVAXH5gKj1as7jBGoFHqTdCmIjpVYw2oiAKvrXRON+Foyo6bFD19yhQ3x6KndlfImnvo0rEAhTQ7F2TD4DRUlPlwgjFfU2GYrDYBZPYb28VwIFcWTYx8X3xXjSaKTgE4ZVLMjPeN8qQ/kZJv59CmJBpoiEDhQqnITEOZbq8M9bvWWS7hpy7CIpXOcE/CqBM8TdrwOoF+kRuz9FxToUA9FLo1zSIajc7NYHyBcGtrujtvmZ2+PopRnilrrq28yAfE+RBMnP6fnLno72OQHeXZZ1REb2CBALw/BnxDaauVwrE0mjtKMnZ+xwp3gVD8FOrcbjpWPy4T4xAH/7MwR0D+q+smn/WcLcaOxcIZMFEB5PSa+tPrwEEhrdo0/IvtTujPPTVfEiiJ2dYqc2CRELrvnwgF2xlq5Uibc+FhxzWCy+y82+evrwAKlgwW8+Hsnqhk9Ovx+I7dMWODEnlzdslz1FZrGIYGInuMpvCy8NAMx7Z X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(346002)(39860400002)(136003)(396003)(451199021)(478600001)(86362001)(36756003)(107886003)(186003)(6486002)(26005)(1076003)(6512007)(6506007)(4326008)(6916009)(66556008)(316002)(6666004)(66476007)(66946007)(83380400001)(2906002)(38100700002)(8676002)(41300700001)(5660300002)(8936002)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zq2g3TaS4CTH8JTC0UiT/vd26CAuOBcIqMiTrXxzenZzzS2cNhOdGpQ7SfS46KcwJuf5K0gkQgNr64kqzxG8vviosE1QkNQTJXeuAi5PKxhcNDWWytKJ4cFbP5o5YjPTmZdYIayRh5CuazHXrBBLRQs7yPRQcOqPuvFsnMlmwR4hRyYzBz4WJRxt7+kmyLB3rWbsEXE3eIq+EV/+KwSPtNUvIR2s0xdQgaO1Py0xo49PZHWpzaspcU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+BkpTuPNXsaYcZue/p6F7UNw0JzlyqEBx4FVoUrmxwPBTT/y/vndU5b/CGoSfZ4Tsu6P6Lbj/2iJ0BlD8b8RNn/lftu41+NrffAnYky+BenZyoJBn+lUzKRp3hHxrwThS7YifX4VS2UhrKg7/X2MJy6OX/7ibW8E2ytBMZj7S/TWMKot2dGHlom64Gt+DnUwWTDc80Rd3C2s3Bjx8Ow/7DMX3g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 573cf4be-fba5-46f6-6067-08db4596f143 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:11:19.8877 (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: Iww0KbDh7aacA4pNn7CjE8th/hRsJEPrqNk2kh7hjsvn4EL94+NXB7I3VQLTilzdAQkMh1Y9Aqa5YyuC3QwH/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5572 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-ORIG-GUID: aSL3LELxtz-Ywa_nI11Tg0jxIXMZdS6m X-Proofpoint-GUID: aSL3LELxtz-Ywa_nI11Tg0jxIXMZdS6m X-Stat-Signature: 4ctu1p16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XlrfWiuaI2MTtRVE IRARwhkB NMhaQH+iFyB//x7G0G1+xGB4Tdt0zETFe7hlQ4x6TYtjZA1IHUTuVQRazvyedvGxAAZXVjArOh8Ixf78IzvcCA7/xAfRrcIv+AOSqEDMnu4Ko8cgfnuhvZpGLbFQMtnOvM95oGiYEsOEP+L3DMhHfwwoes3hDyTro5GCW3gBOR04N93ah90EgN17m7IANatTGI4+bw3jgLbVer+xVSbbLSp9gQhs7UPACENJp+ARb+p6eUR1dAaAJSDf1DkNExRRfDZQnTd0O9rAWq5iuHET5SNVBYgwZuiYGIaVC0IzCtAfcaRzIGis2xb5x4PtjIXVnerlqzL9PUkXHhU0C/irt+Xnm9TkAmNgonli+wZeK/qz9DvfI2jep2tMLz1DezyGhcOhOk4A5gG8Hv9BzoW5e8BJflT3rTD70nFU03qv/6AMkTIA= 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. 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 20f0a10dc5608..31cbfd7b44728 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5099,24 +5099,25 @@ void *mas_walk(struct ma_state *mas) { void *entry; + if (mas_is_none(mas) || mas_is_paused(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 mas_root(mas); } - 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 Tue Apr 25 14:09:47 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: 13223391 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 7AC61C6FD18 for ; Tue, 25 Apr 2023 14:11:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9FDFA6B009C; Tue, 25 Apr 2023 10:11:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9ADDD6B009D; Tue, 25 Apr 2023 10:11:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 78B0B6B009E; Tue, 25 Apr 2023 10:11:32 -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 66D226B009C for ; Tue, 25 Apr 2023 10:11:32 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 068A9140238 for ; Tue, 25 Apr 2023 14:11:32 +0000 (UTC) X-FDA: 80720101224.01.A6FEF57 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf01.hostedemail.com (Postfix) with ESMTP id 6E8374002E for ; Tue, 25 Apr 2023 14:11:28 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=J4fELOQG; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=HXXOVfOP; spf=pass (imf01.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=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=1682431888; 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=pEckK2cnioWLc0ybURTU2AWzV3oTPeI2nzG2oZt4+uw=; b=p3rsqSoDV1YNlZUj1LRR61PPFflF/CqMOc9yxhdlZKtXTNqY0OeNW8k7YKTOyMd2cTlwyS kp2wnyOY9CmFoBM2S1WV6EpdYdfkC/7CWSjUrScjsISTb9x+nSgwoek2qqRi2VM1k1AX/C i5etR8ypPCllm57pkGytK7eUmIBDGnI= ARC-Authentication-Results: i=2; imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=J4fELOQG; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=HXXOVfOP; spf=pass (imf01.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431888; a=rsa-sha256; cv=pass; b=LgnZeW5sDxGZ8BBDGX8bRpXxEQ0Nac65cjuhdvwxkdB6w3XH0XAOyFANKCfZwL1f7ZHsfl dty99+Bz3UC4RQMaVx2a6lN3IU97YWJCA4PMnl6pyqo7k9DOyMCwQa4ImqqM4VIbQPeqG5 x1Utgq6O0M7vUAgclCc4cJwaK+rrCyw= 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 33PDioRh017723; Tue, 25 Apr 2023 14:11:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=corp-2023-03-30; bh=pEckK2cnioWLc0ybURTU2AWzV3oTPeI2nzG2oZt4+uw=; b=J4fELOQGc9VtoeDXJcMhx35GxDORwWDOQbRz2ws39wwH5/77rte9hJqbMhPjJdfCsm2p UJoNWAf4ARxL3MUzoYdfRgNs1UcXPHn+4mO2aFX5J7ND5qe2MLJJ9KrPbMSzEVidy/OI bmlPy5iD+CNer0kyOju0Dmd/jn9WwKofbox7jRpNLWBJ3Yd2JNpJOZQTLqPiwXKDvFUE SPgFX+/HL/p5pe0boliow/GCwZGOQwqEfoNDZI8n8rqT1Gc9MGcTqBPeydo2zpIardxF brtiwMWebm4jiuUXoBtTjwkQvyf1LSkl5dwM5l5bAP8i37yU9qCNGQcYBhi3coXanAQQ gQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q47fandvv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:26 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 33PDAP9V006669; Tue, 25 Apr 2023 14:11:25 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2106.outbound.protection.outlook.com [104.47.58.106]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616gsg6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nUpiPZL/5lFiBXprTpAYtJJVUpBS7XTbTnEzBENrItNEICVFW+jqZO2sA0h4icB9Q51vZN1aRpXbICTJmHhAtqHriJiBS9ZfDkdliXTbkDPqL/ke6SdPq3t68ld2gZkVZtFrRW8MDS/njpIBK0Hu92OjBgjMN241clFl3XEQMl2ufjzKcepTCza2F45K120AaonKKeGmw38Q7oh5qLMUiVOOBkZ8F0n3bmbSs3/h/AVp24gV+AEX2KeUMYJc1q+4ZMjd9/ay9lZTKd+VM+8Zv8FVbLczmF/+fAGJJmnNzNzA4M9ap4HBgUY+oiHNTJ9iSYCt+qGBf0pZjLsdqLOsog== 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=pEckK2cnioWLc0ybURTU2AWzV3oTPeI2nzG2oZt4+uw=; b=hT8WI6PhFqv8M4YSsuPj/Pu2sec3srXefSnf08bFm5bLRcH2edBUEdDlBOuHEyMC8Zhy1Nr+J2RMNfIGBK1BiFsjlclJWeWbr3XEFeYHwIgX/+8ovTSt5/UnceFezrELwe7pd4EhMaC1QhfmID0nctf7ltA8txZydDrCneXfyiiQLKzW46OmmqZDlJsDeRXqXbQK67OtA1HlfnJIFa+O8Na7h3JZPVJFvf1eONG5HVh63ChG8PutRd1DPZIvZvV9dlF2wV7YopBKk6bDidUtQMCfLTL69bI2Tdw6Go03joJIKnhAKjJlwSMaDyNVaZq44DOM+rcanKm+LZkxyoLvJQ== 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=pEckK2cnioWLc0ybURTU2AWzV3oTPeI2nzG2oZt4+uw=; b=HXXOVfOPM04Yg5kDayLUSZ/7neX7zy1cTnUbKdEcr7WF1j21qz3Jte8DybjiIcsXB5TXF+KI14CovCnDphk8t7E4UPbOTHnqXBSGLu51PdUTVgGTmhiTa061ExaN9+bf+dfvRoQLgvsNjRAwlvJjNs3WWy7lOi/jRfDGL1PW7QY= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CO6PR10MB5572.namprd10.prod.outlook.com (2603:10b6:303:147::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:11:23 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:11:22 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 26/34] maple_tree: Update testing code for mas_{next,prev,walk} Date: Tue, 25 Apr 2023 10:09:47 -0400 Message-Id: <20230425140955.3834476-27-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0005.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d1::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_|CO6PR10MB5572:EE_ X-MS-Office365-Filtering-Correlation-Id: 26436b6d-d75f-42d9-ce0b-08db4596f2fe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6I/om5ZpEVoGBEfjeeptiNy9d3W0F4cGImXsEBG8HcVBn8j7AYK9ROdY02xGT7+CJirJnTErRyYCP/J+uCy6CxvChpBw2hukeYMqW4QbAitCNfrBPqNTQXnd8nHjrENRWOcsasbvKN+yw1GbnOKcBd+gDIzlfVZaB9DaJRoMpyDMMmacdX2bowXEq3Xc+SEMOKkmh71HY2WV7uNooVjFruJw/9kU+3f2WO8aOwo7JhLl4YCWdqQeGn7pUaq5F2mrTyGI0UJKrYMwoLztY0YM7qkrUwcxbrajYvXq+2jHgkClqIGotZ0FtKyzrDqd3XMM4pfJp5/FgvbDUjewFgJM7sF/yYSuZtMsMRfzS3kKsdngyHUSxqjCP98x5BXq+KwJm1glqRHI4q9gSY4Cx5yriH6A1i2vbu+p71hmW3K5RbJSEG2dMZ59J/ShlXQLhov0HS+53Xr2gXNnXKzbxiYXaagk10bJdZtFDXRqd8gDrC3t6G4FvPEnmo5meyDCrxM2witBba+Pe+P+DcZGkd3I20mbHDkXZ2aOsL8ETYHOfFGq9Zc6cI02T2yASTm35+IH X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:tl;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(346002)(39860400002)(136003)(396003)(451199021)(478600001)(86362001)(36756003)(107886003)(186003)(6486002)(26005)(1076003)(6512007)(6506007)(4326008)(6916009)(66556008)(316002)(6666004)(66476007)(66946007)(83380400001)(2906002)(30864003)(38100700002)(15650500001)(8676002)(41300700001)(5660300002)(8936002)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?MmmiG011nnCZS/ir/C8m49HOwyR9?= =?utf-8?q?vAVCDLWKJID+1u1SbkuaM/QAgVH9scUw2SBYxfORa0+cNPxlmRRFBhu5+szJncmbO?= =?utf-8?q?QoJKkvCiQyxEibawlmLN9ADaLJ7lhhsWbsAJkXxTK95Rn3Klg8vb0Eqw5mvfHSBRQ?= =?utf-8?q?wvTRFbvOb6hdaU72m3RPaTVogq3IpTiP5g1OyKaPAT8ajAkvb45KxD4D4m+dhWoco?= =?utf-8?q?wkAgi1q1C7m5KvST4B9LG2xrQyg6wLDdldpPeRzR6wN9OV2OWJ9mVFGBbXiyydLps?= =?utf-8?q?WbQoKuvMW+TH6/d2UNFg6I99PiwjkvQm78uN8MWFrE+Q/aiR0sq827FsC7ny4NflZ?= =?utf-8?q?CbHqVZgNPHJbs4cF0lLN8DsZExVis67FhTtTzE2WYH7xG+UllQQ8nihqbt9ThHYMc?= =?utf-8?q?zigC3HarvsLsgw+r/GCQLMLddHn4StcBtIYBP3DumM6RaZyEv7dx7Ws+dPihiVU1v?= =?utf-8?q?jvNtsJ6dM13bq04c6kimds08ku/3cngtkgDZhNqU9k9T9wHkJnczCDe5SqKtSL87W?= =?utf-8?q?K3OMqWAAPf2w6XsypnBdIYDqRX2Z/Pr0G4TW5pFNq7mTacBCMaLkJKb2ca5piaBfx?= =?utf-8?q?OeTjLOtOHysFlr6z/mpxNeCZ5zeCxfQ5cee7bdVOJfZuw0xWLaqOoBCplLCvPGrWa?= =?utf-8?q?432tAkOTZm08KnpSGnfylWSF2Lkshsf6b4UpQDFgOEuQa0fbq5V4wBvViI6Z6G5/I?= =?utf-8?q?1iq3dWZ/oviWrGhM2Ud7m/4z+QPMIGzyN7fmxZFo1ZHdnvurHYqJO81zztSjJVoZe?= =?utf-8?q?eCgWpdz+d8YDJlgw4vlI54FQ+7gr275F69QD1yoLMq9WBaSikueVJfxEB3Ws09cPJ?= =?utf-8?q?hxl1ru3h9P/NagQ74j8whyJ0WZIGmYcPgP5BlGMrF3NdRWvP7j/mwqfYkGXb4xVHS?= =?utf-8?q?fCxdU2sZhYOLy6VRGlWxl4boSQSE8RYIR+EwxrZo692yzDx12JxH8resZU1kdipfU?= =?utf-8?q?GmBEslJOIxTI3B9eQo5c0+Ln/5wg4L/mFRw7pHE5okgshUx8yUnLzhIlNeFd0plTh?= =?utf-8?q?1VZeDKiEp+44APpAiV/OqpPoor13uVaLD9wao6MknhF7fC8zQicF2uXFMl2FANxee?= =?utf-8?q?5Xi+cSSLKqbQ3/Krj/17poRXK3X3sQkD53sGqdQNSji7LKtxElipKIF8lO2hhAk3o?= =?utf-8?q?m3hfyqj/pkcolYbRG3Vow7uqBAj0TQbEwJu5E4dxBoMMqZiqAx6LpzkuSIOgHYzCy?= =?utf-8?q?3WB0F1qUz/5mGSZ/Ue66UcA6zY4HLl47Cy/qtNqq/e1iWoIgt/jRpNQ7f15mondvQ?= =?utf-8?q?jj87R4RzrIQotE0sumc1B0Y0pqfsHaZDA39AW+pRe/VoU3OE85Zr2naW5Qe37Y3ZG?= =?utf-8?q?AVK62dPemC9ZTeeQjlqZqIrszruHcJCricu/QPsn9kj/lnFzlgt7y2513eDG098um?= =?utf-8?q?P6WOPbrxoEzRA0QqHc0jiJ9j9ehNJyZA/B34e84nAvi92PS8UGpRjKDf0JVQjapXB?= =?utf-8?q?jQM9ArKD3sSlGoSgO9sQrxulk5ykbT3pX6vDUbxN1YVsMZc4Hv/tbp/T6gTSwHHpO?= =?utf-8?q?AqRei6jDx4f0QHGM11GaL0PZpKQDq+VzFQ=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: qsn2kYBTmS9STICrlbzyTNGVQ+KMgSgtGFR0RVqlvQ5s4PjQ2xEoXXC+iZJ2ACA/zPntKk8BYTEsxYQv3oWE5ZWKv4vMKHeLcn7qNpR8fA3TaBY4cent1sZErhEQzsghdmlQ2B2dM3V6dBI2TWzsSj6e8x8iMB6u3BZHAS0CaADkZJb15EV3p/dl4GN2P9lZtPa5PDG1JISh/TpfI2kqqbg3690wPqVm2KQXSOqVyMgQXs/YhvD24pgkOgCelyzOlwYMOX1KAtcuFDzw//8eSbBG3Sp43z7ns83X3xkui6aajMJuQPeiPF4+6rzjkHua0zvlswl3LiepNTj2VPgieXaTwJo0KoL3KKSIHdSFK3F3FEdBw2dlglb+m5suJwmlLkrgdwo54xOhyekQKC1yX4hSZMYs8GRexXPPNaYIMmvztNKoJ+1TAyxX0dHFKEE5xVFO69djiJH1hPflmSVv5uHUSLGEPQSo2PBGsFJUY4GuUchimeARKPMae1qVWTGY8eOJyN1O+KX/HBsZ7KIy3CdRdswcqds5nM5JYCCKuJwi7pVQtku3wchWjFJcfOGkJGnKNwhK4tMNVrti8+EZmC3N/Ass9LMdY8E/H3qFVqYEkVIfKAqWlgptcg01N7TGS8n9SO/5IysOSVVxyUSGxiivd4f61UcLFDqt00CLco1n7NZut0gGd2Ej49hmAnUzhoMQd9rw9ogqzqxD7+tkoXMdlhSROfWOQV6hFaqAqxoR0f2FyH6UPDRucFwepdR5Y3jSkH3Qgzu12f4I/qNQcuwxeoDIknmxsIXXGW8l0rACI0csWkyxPRob3IpXwfXnQLuoE2FRthuLVZtvl/jf4AjxqHJFUiXhc7CuExNuXfhKS5N4Eu3QxwrmqruMUHlDng1J+Fsyhgm1tAjXu4zD/A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26436b6d-d75f-42d9-ce0b-08db4596f2fe X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:11:22.8047 (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: k1SmbuTyXAi12TPjmswMsV2COJ+hN8pi44qEk6n25Si/HWsNLxptGhLltxqlin8fh+109qI7f4yb+a3yXZDw/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5572 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-ORIG-GUID: m25avwC20cHss527Nwg9wvf_uSeHenWu X-Proofpoint-GUID: m25avwC20cHss527Nwg9wvf_uSeHenWu X-Rspamd-Queue-Id: 6E8374002E X-Stat-Signature: i5b5tk1zu4x98m4ust5sqxnxtb969g7g X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1682431888-623811 X-HE-Meta: U2FsdGVkX19btqagH7utz5tx8Zy8caKwlKCu/9YZzhpCVgYrb921Q+hgE7RwmG1FYxLRWIZ0EvQulFZ5fADHF/vyShxbBaUE1xGgdI6sRHBuJD0MhV7vafagm4qsF5V5aKosfytfo4yPbY6SQxPvBu6snwSHbCtVIkln31/AHuVoSsUCkPrSdXu83ZxDMv4z4vVvKXvvnXd8hDJi/k1/VuB1L33+nQ1gAOxuQc/VMnvQ7wQBXbRlQok7Qg2JMTHZMV8z+r5/FvrOV3QcZbnpHULvfIKc+NTZc6iB9M0bHvKmcx+7xzxMniWp84uW5D/ulZHwnTzv+HIJ649W7DyfCKn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KZ2C1eBVtHGER4hN8NUQ== 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: 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 | 641 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 635 insertions(+), 6 deletions(-) diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index ae08d34d1d3c4..345eef526d8b0 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -1290,6 +1290,7 @@ static noinline void __init check_root_expand(struct maple_tree *mt) mas_lock(&mas); mas_set(&mas, 3); ptr = mas_walk(&mas); + MAS_BUG_ON(&mas, mas.index != 0); MT_BUG_ON(mt, ptr != NULL); MT_BUG_ON(mt, mas.index != 0); MT_BUG_ON(mt, mas.last != ULONG_MAX); @@ -1300,7 +1301,7 @@ static noinline void __init check_root_expand(struct maple_tree *mt) mas_set(&mas, 0); ptr = mas_walk(&mas); - MT_BUG_ON(mt, ptr != NULL); + MAS_BUG_ON(&mas, ptr != NULL); mas_set(&mas, 1); ptr = mas_walk(&mas); @@ -1359,7 +1360,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)); + MAS_BUG_ON(&mas, (mas.index != ULONG_MAX) && (mas.last != ULONG_MAX)); mas_set(&mas, 1); ptr = mas_prev(&mas, 0); @@ -1768,12 +1769,12 @@ 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++; } /* Make sure the next find returns the one after 765, 766-769 */ val = mas_find(&mas, ULONG_MAX); + MAS_BUG_ON(&mas, val != xa_mk_value(76)); MT_BUG_ON(mt, val != xa_mk_value(76)); mas_unlock(&mas); mas_destroy(&mas); @@ -1979,7 +1980,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); @@ -2003,7 +2004,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; @@ -2015,7 +2017,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); @@ -2718,6 +2720,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 of 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); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.node != MAS_NONE); + + /* prev: Start -> root */ + mas_set(&mas, 10); + entry = mas_prev(&mas, 0); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0); + MAS_BUG_ON(&mas, mas.last != 0); + MAS_BUG_ON(&mas, mas.node != MAS_ROOT); + + /* prev: pause -> root */ + mas_set(&mas, 10); + mas_pause(&mas); + entry = mas_prev(&mas, 0); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0); + MAS_BUG_ON(&mas, mas.last != 0); + MAS_BUG_ON(&mas, mas.node != MAS_ROOT); + + /* next: start -> none */ + mas_set(&mas, 0); + entry = mas_next(&mas, ULONG_MAX); + MAS_BUG_ON(&mas, mas.index != 1); + MAS_BUG_ON(&mas, mas.last != ULONG_MAX); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.node != MAS_NONE); + + /* next: start -> none */ + mas_set(&mas, 10); + entry = mas_next(&mas, ULONG_MAX); + MAS_BUG_ON(&mas, mas.index != 1); + MAS_BUG_ON(&mas, mas.last != ULONG_MAX); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.node != MAS_NONE); + + /* find: start -> root */ + mas_set(&mas, 0); + entry = mas_find(&mas, ULONG_MAX); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0); + MAS_BUG_ON(&mas, mas.last != 0); + MAS_BUG_ON(&mas, mas.node != MAS_ROOT); + + /* find: root -> none */ + entry = mas_find(&mas, ULONG_MAX); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 1); + MAS_BUG_ON(&mas, mas.last != ULONG_MAX); + MAS_BUG_ON(&mas, mas.node != MAS_NONE); + + /* find: none -> none */ + entry = mas_find(&mas, ULONG_MAX); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 1); + MAS_BUG_ON(&mas, mas.last != ULONG_MAX); + MAS_BUG_ON(&mas, mas.node != MAS_NONE); + + /* find: start -> none */ + mas_set(&mas, 10); + entry = mas_find(&mas, ULONG_MAX); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 1); + MAS_BUG_ON(&mas, mas.last != ULONG_MAX); + MAS_BUG_ON(&mas, mas.node != MAS_NONE); + + /* find_rev: none -> root */ + entry = mas_find_rev(&mas, 0); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0); + MAS_BUG_ON(&mas, mas.last != 0); + MAS_BUG_ON(&mas, mas.node != MAS_ROOT); + + /* find_rev: start -> root */ + mas_set(&mas, 0); + entry = mas_find_rev(&mas, 0); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0); + MAS_BUG_ON(&mas, mas.last != 0); + MAS_BUG_ON(&mas, mas.node != MAS_ROOT); + + /* find_rev: root -> none */ + entry = mas_find_rev(&mas, 0); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 0); + MAS_BUG_ON(&mas, mas.last != 0); + MAS_BUG_ON(&mas, mas.node != MAS_NONE); + + /* find_rev: none -> none */ + entry = mas_find_rev(&mas, 0); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 0); + MAS_BUG_ON(&mas, mas.last != 0); + MAS_BUG_ON(&mas, mas.node != MAS_NONE); + + /* find_rev: start -> root */ + mas_set(&mas, 10); + entry = mas_find_rev(&mas, 0); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0); + MAS_BUG_ON(&mas, mas.last != 0); + MAS_BUG_ON(&mas, mas.node != MAS_ROOT); + + /* walk: start -> none */ + mas_set(&mas, 10); + entry = mas_walk(&mas); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 1); + MAS_BUG_ON(&mas, mas.last != ULONG_MAX); + MAS_BUG_ON(&mas, mas.node != MAS_NONE); + + /* walk: pause -> none*/ + mas_set(&mas, 10); + mas_pause(&mas); + entry = mas_walk(&mas); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 1); + MAS_BUG_ON(&mas, mas.last != ULONG_MAX); + MAS_BUG_ON(&mas, mas.node != MAS_NONE); + + /* walk: none -> none */ + mas.index = mas.last = 10; + entry = mas_walk(&mas); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 1); + MAS_BUG_ON(&mas, mas.last != ULONG_MAX); + MAS_BUG_ON(&mas, mas.node != MAS_NONE); + + /* walk: none -> none */ + entry = mas_walk(&mas); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 1); + MAS_BUG_ON(&mas, mas.last != ULONG_MAX); + MAS_BUG_ON(&mas, mas.node != MAS_NONE); + + /* walk: start -> root */ + mas_set(&mas, 0); + entry = mas_walk(&mas); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0); + MAS_BUG_ON(&mas, mas.last != 0); + MAS_BUG_ON(&mas, mas.node != MAS_ROOT); + + /* walk: pause -> root */ + mas_set(&mas, 0); + mas_pause(&mas); + entry = mas_walk(&mas); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0); + MAS_BUG_ON(&mas, mas.last != 0); + MAS_BUG_ON(&mas, mas.node != MAS_ROOT); + + /* walk: none -> root */ + mas.node = MAS_NONE; + entry = mas_walk(&mas); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0); + MAS_BUG_ON(&mas, mas.last != 0); + MAS_BUG_ON(&mas, mas.node != MAS_ROOT); + + /* walk: root -> root */ + entry = mas_walk(&mas); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0); + MAS_BUG_ON(&mas, mas.last != 0); + MAS_BUG_ON(&mas, mas.node != MAS_ROOT); + + /* walk: root -> none */ + mas_set(&mas, 10); + entry = mas_walk(&mas); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 1); + MAS_BUG_ON(&mas, mas.last != ULONG_MAX); + MAS_BUG_ON(&mas, mas.node != MAS_NONE); + + /* walk: none -> root */ + mas.index = mas.last = 0; + entry = mas_walk(&mas); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0); + MAS_BUG_ON(&mas, mas.last != 0); + MAS_BUG_ON(&mas, 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); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0x1000); + MAS_BUG_ON(&mas, mas.last != 0x1500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* next: pause ->active */ + mas_set(&mas, 0); + mas_pause(&mas); + entry = mas_next(&mas, ULONG_MAX); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0x1000); + MAS_BUG_ON(&mas, mas.last != 0x1500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* next: none ->active */ + mas.index = mas.last = 0; + mas.offset = 0; + mas.node = MAS_NONE; + entry = mas_next(&mas, ULONG_MAX); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0x1000); + MAS_BUG_ON(&mas, mas.last != 0x1500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* next:active ->active */ + entry = mas_next(&mas, ULONG_MAX); + MAS_BUG_ON(&mas, entry != ptr2); + MAS_BUG_ON(&mas, mas.index != 0x2000); + MAS_BUG_ON(&mas, mas.last != 0x2500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* next:active -> active out of range*/ + entry = mas_next(&mas, 0x2999); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 0x2501); + MAS_BUG_ON(&mas, mas.last != 0x2fff); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* Continue after out of range*/ + entry = mas_next(&mas, ULONG_MAX); + MAS_BUG_ON(&mas, entry != ptr3); + MAS_BUG_ON(&mas, mas.index != 0x3000); + MAS_BUG_ON(&mas, mas.last != 0x3500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* next:active -> active out of range*/ + entry = mas_next(&mas, ULONG_MAX); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 0x3501); + MAS_BUG_ON(&mas, mas.last != ULONG_MAX); + MAS_BUG_ON(&mas, !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); + MAS_BUG_ON(&mas, entry != ptr2); + MAS_BUG_ON(&mas, mas.index != 0x2000); + MAS_BUG_ON(&mas, mas.last != 0x2500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* prev:active ->active */ + entry = mas_prev(&mas, 0); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0x1000); + MAS_BUG_ON(&mas, mas.last != 0x1500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* prev:active -> active out of range*/ + entry = mas_prev(&mas, 0); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 0); + MAS_BUG_ON(&mas, mas.last != 0x0FFF); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* prev: pause ->active */ + mas_set(&mas, 0x3600); + entry = mas_prev(&mas, 0); + MAS_BUG_ON(&mas, entry != ptr3); + mas_pause(&mas); + entry = mas_prev(&mas, 0); + MAS_BUG_ON(&mas, entry != ptr2); + MAS_BUG_ON(&mas, mas.index != 0x2000); + MAS_BUG_ON(&mas, mas.last != 0x2500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* prev:active -> active out of range*/ + entry = mas_prev(&mas, 0x1600); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 0x1501); + MAS_BUG_ON(&mas, mas.last != 0x1FFF); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* prev: active ->active, continue*/ + entry = mas_prev(&mas, 0); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0x1000); + MAS_BUG_ON(&mas, mas.last != 0x1500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* find: start ->active */ + mas_set(&mas, 0); + entry = mas_find(&mas, ULONG_MAX); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0x1000); + MAS_BUG_ON(&mas, mas.last != 0x1500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* find: pause ->active */ + mas_set(&mas, 0); + mas_pause(&mas); + entry = mas_find(&mas, ULONG_MAX); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0x1000); + MAS_BUG_ON(&mas, mas.last != 0x1500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* find: start ->active on value */; + mas_set(&mas, 1200); + entry = mas_find(&mas, ULONG_MAX); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0x1000); + MAS_BUG_ON(&mas, mas.last != 0x1500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* find:active ->active */ + entry = mas_find(&mas, ULONG_MAX); + MAS_BUG_ON(&mas, entry != ptr2); + MAS_BUG_ON(&mas, mas.index != 0x2000); + MAS_BUG_ON(&mas, mas.last != 0x2500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + + /* find:active -> active (NULL)*/ + entry = mas_find(&mas, 0x2700); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 0x2501); + MAS_BUG_ON(&mas, mas.last != 0x2FFF); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* find: none ->active */ + entry = mas_find(&mas, 0x5000); + MAS_BUG_ON(&mas, entry != ptr3); + MAS_BUG_ON(&mas, mas.index != 0x3000); + MAS_BUG_ON(&mas, mas.last != 0x3500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* find:active -> active (NULL) end*/ + entry = mas_find(&mas, ULONG_MAX); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 0x3501); + MAS_BUG_ON(&mas, mas.last != ULONG_MAX); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* find_rev: active (END) ->active */ + entry = mas_find_rev(&mas, 0); + MAS_BUG_ON(&mas, entry != ptr3); + MAS_BUG_ON(&mas, mas.index != 0x3000); + MAS_BUG_ON(&mas, mas.last != 0x3500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* find_rev:active ->active */ + entry = mas_find_rev(&mas, 0); + MAS_BUG_ON(&mas, entry != ptr2); + MAS_BUG_ON(&mas, mas.index != 0x2000); + MAS_BUG_ON(&mas, mas.last != 0x2500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* find_rev: pause ->active */ + mas_pause(&mas); + entry = mas_find_rev(&mas, 0); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0x1000); + MAS_BUG_ON(&mas, mas.last != 0x1500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* find_rev:active -> active */ + entry = mas_find_rev(&mas, 0); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 0); + MAS_BUG_ON(&mas, mas.last != 0x0FFF); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* find_rev: start ->active */ + mas_set(&mas, 0x1200); + entry = mas_find_rev(&mas, 0); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0x1000); + MAS_BUG_ON(&mas, mas.last != 0x1500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* mas_walk start ->active */ + mas_set(&mas, 0x1200); + entry = mas_walk(&mas); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0x1000); + MAS_BUG_ON(&mas, mas.last != 0x1500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* mas_walk start ->active */ + mas_set(&mas, 0x1600); + entry = mas_walk(&mas); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 0x1501); + MAS_BUG_ON(&mas, mas.last != 0x1fff); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* mas_walk pause ->active */ + mas_set(&mas, 0x1200); + mas_pause(&mas); + entry = mas_walk(&mas); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0x1000); + MAS_BUG_ON(&mas, mas.last != 0x1500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* mas_walk pause -> active */ + mas_set(&mas, 0x1600); + mas_pause(&mas); + entry = mas_walk(&mas); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 0x1501); + MAS_BUG_ON(&mas, mas.last != 0x1fff); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* mas_walk none -> active */ + mas_set(&mas, 0x1200); + mas.node = MAS_NONE; + entry = mas_walk(&mas); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0x1000); + MAS_BUG_ON(&mas, mas.last != 0x1500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* mas_walk none -> active */ + mas_set(&mas, 0x1600); + mas.node = MAS_NONE; + entry = mas_walk(&mas); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 0x1501); + MAS_BUG_ON(&mas, mas.last != 0x1fff); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* mas_walk active -> active */ + mas.index = 0x1200; + mas.last = 0x1200; + mas.offset = 0; + entry = mas_walk(&mas); + MAS_BUG_ON(&mas, entry != ptr); + MAS_BUG_ON(&mas, mas.index != 0x1000); + MAS_BUG_ON(&mas, mas.last != 0x1500); + MAS_BUG_ON(&mas, !mas_active(mas)); + + /* mas_walk active -> active */ + mas.index = 0x1600; + mas.last = 0x1600; + entry = mas_walk(&mas); + MAS_BUG_ON(&mas, entry != NULL); + MAS_BUG_ON(&mas, mas.index != 0x1501); + MAS_BUG_ON(&mas, mas.last != 0x1fff); + MAS_BUG_ON(&mas, !mas_active(mas)); + + mas_unlock(&mas); +} + static DEFINE_MTREE(tree); static int __init maple_tree_seed(void) { @@ -2979,6 +3604,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 Tue Apr 25 14:09:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13223439 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 0D7BEC6FD18 for ; Tue, 25 Apr 2023 15:38:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4602C6B0075; Tue, 25 Apr 2023 11:38:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 40FB86B0078; Tue, 25 Apr 2023 11:38:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 289406B007B; Tue, 25 Apr 2023 11:38:07 -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 153FF6B0075 for ; Tue, 25 Apr 2023 11:38:07 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id DA2768021A for ; Tue, 25 Apr 2023 15:38:06 +0000 (UTC) X-FDA: 80720319372.08.C0195A8 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf24.hostedemail.com (Postfix) with ESMTP id 8EF24180010 for ; Tue, 25 Apr 2023 15:38:03 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="HO/t7gIM"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FqnIJ1Le; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf24.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; 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=1682437083; 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=mwgxS4v/JFSCwGiJrJKZtRQ4wYxr/0cEbmcARTsSEO0=; b=POnIu8u0TtK61mUf80QrLsTmTQiQZUglwiTY+sHz7IPo9tepNsuT0cJie4D/7IKV/j8F3r MyWcv5VmKtTk51+HcIeFtVktxxhSUAYqoHV2yybaWLJ3PWFJbK0pNJc6ueKZ+0UsNkB0kG 3riBe1BRqVTpQrug6mBXsqIaWB+mOyg= ARC-Authentication-Results: i=2; imf24.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="HO/t7gIM"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FqnIJ1Le; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf24.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682437083; a=rsa-sha256; cv=pass; b=JGCWHrWllOTAc5MfeexB95Nvcloi32pNgmC8tJ7yVsi6Laf3XrVJzs3KTUg92U2hMLYOLd oKBNgI9sARThrdFmWAgzGuFhmH1LTPRfRp11DhyW3U/S6eZSgkvN9YV8zIbrAK0p6zWymI ibstiFRFDZCRrACmsD7glQvQmSomAGY= 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 33PDhp48001833; Tue, 25 Apr 2023 14:11: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=mwgxS4v/JFSCwGiJrJKZtRQ4wYxr/0cEbmcARTsSEO0=; b=HO/t7gIMzf0YzSG+ozsRk2nfhw3Lwz62xpZ2JA+wHP17FPAQE+agjwlnf7BeLhmqrgfc PgJPqRnxuXyk5bTSF56N2B8Xz1/VHEnbRjhs37yU3dnTWU1bPLuXX9iSEZkkATgKBsZ1 rmdf/pz8loZh9iY8WG1bnPNZcxDAspvMV6LNrzfFV7HUQsEv+ItfqxEQdD/+mFKAnwBT AE33bIkZ5zvKcehx6HgTa2wezgMluWjz6ML0w7+OUq8+kG7rLjGU+1QZc+8RMlUtFzke NJPKVWmLdzbUOTzHZrZoluHxofDENpwZxI+GeMy2RgA0Ce5MD7cx8oHJfgygMD1+QLIh Rw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q47mcwfeq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:28 +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 33PDt2Y1008641; Tue, 25 Apr 2023 14:11:27 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2109.outbound.protection.outlook.com [104.47.58.109]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616qpmu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kOptfW7TqT9Q4zrXfd7n9NUEdxgsMiZls3y+ed73EaaPmv2PB2Bc/6QqBfZB8GxJ2CityXesp8cNFiesoZsFXI21b1Pna+WxAKgOP8E0VMUxwWNrW+agdkCC/QWfwLyBqLbuSXRtsbAE9FNV49kjDTRLNupLI3Hp+en1mPX0f/ZxXKwAyMqp9FTUDn5wo0iNuEAoKehBeEHSG1SSQDTKfU0a2khH5LwENVN4GJhEIx3CncNYpzksCS1kL8Hx76AknWoZ/kuTS/oDZISvoaziBaxs3RifZNMr0YlhXZlnnp4vUr7uScnnBe2EFS1MDSZoMU1mT1evudQ/ufjdGaEjug== 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=mwgxS4v/JFSCwGiJrJKZtRQ4wYxr/0cEbmcARTsSEO0=; b=mZpxxoYuYRDCrag36OtrZ0yZfzOElmebwhjRImhjQ2i4OdDs4Pp4SV8WqDRAr4onrfdVSsImZFyFPzPJJnQsstsCcocwixfBSLn171S/dAkyBj5RQeXNmGhHRNNXlbDY7Fz2S2HR8uhGbNiChsRtos0Gg7Cw/olpeNc6If6y2vouMHe5EE+1l7xYhLA5jZohvsz4dgeYxFJX0ReTVBZ9MCiOM2BDjIlzZ1Lu3wGQKXy67kLr91mGON+beBJCfjsGxgGJuhxvZnGti2xz0A3Pt/pwTsiwrIcAMIHO+in2EP73F6HAx6ERn78QpuoIxIcaUJ3zfconuyCyd7IxudFCRQ== 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=mwgxS4v/JFSCwGiJrJKZtRQ4wYxr/0cEbmcARTsSEO0=; b=FqnIJ1LewCDYvSvVa+3K613WBDkiYP94Y0gufhVBq02DMbJT0awxkrllf2qnml3He+/c0XOEGDyWHqrQmZ9j6tFCnH+21+9xG6VGx9fCekWbfZqoe/g9iyfP2iUVfPfr9v2FOxU3fNthiFWduU4DHulG4Oa8zxTCYJLxxkjAWj4= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CO6PR10MB5572.namprd10.prod.outlook.com (2603:10b6:303:147::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:11:25 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:11:25 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 27/34] maple_tree: Introduce mas_next_slot() interface Date: Tue, 25 Apr 2023 10:09:48 -0400 Message-Id: <20230425140955.3834476-28-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0192.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:110::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_|CO6PR10MB5572:EE_ X-MS-Office365-Filtering-Correlation-Id: 80cf6e67-e905-46a8-1aba-08db4596f456 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: enmu3md3v2fiEIRsk+qdbGSsKc8zYdrnjbo0+vNCruFrdgOdRK7QgJ7flEt2gM4SJo9cQr63IfCwHWxdHgwvTBMAOqltZ38Z9BsenlYMxMGfykm01YzE3nw8B3Qlgsd4GeoqWpVIruFejaPU6v1JS61z7KdYojj8+gRq9bokWfFldOSvkHAPJtcyg6oOpFnDEWgN6/8tq7uvfMHCMOxWhMsIPc4+EFXX1TVDTyxYbliYS90ITPdabqDZz+FiQ8wPy4iQyOb9aQ6H2iSJ24m4BtvafuwNFh6aZmrRGq4kOKzfebCjCGSsDezTywrnXgyQwp3W+NXEAvKrhVxWaUv7YzNIOkmGVaoGX38/f/xIkScJvIyZg1xd8MvcoYmaic2yQnxfB9JWzuxtkBsKOR2xIjbS8h6xT2cVZwrqppIdgNeJgF7syBIPGsPRuhAHYhNCdH9bpbOv2m5gXa9TkmbGZHZATJ3BWmmWNy7Ya5TDR/LokuW9Ezs6Dp7gU8MLDj76C1le3rIBvMbR51cdG5r4yXbdGaWd95AHbjnf/mUW2yMX/jNBD4AO1mmZkYDsyzyV X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(346002)(39860400002)(136003)(396003)(451199021)(478600001)(86362001)(36756003)(107886003)(186003)(6486002)(26005)(1076003)(6512007)(6506007)(4326008)(6916009)(66556008)(316002)(6666004)(66476007)(66946007)(83380400001)(2906002)(38100700002)(8676002)(41300700001)(5660300002)(8936002)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: l8nUKj8cnxc7XfYs/+TFxzE2eaZyVxMpzwf0oFiGHCuRoCOCoQxdZEq1kGWYqLIGnOMN8nhqFE5c7TnIJOdEjE4S97yQveV13mLmt+YFgnTbSl9EOO16JKO16wRKtnxAIntdacUFncRIRxvgAJmX1r6uC3gCzHy8b0ftr18z/6Rshuq8qp2g3SgFP9qPJWJhJYNaq0ct4IfMLGoYxNhZzQMNUYRKHm1pnlRRY6HxAcrEYMOP1OPasellDBiXB6tOYNavxXWPrWJXSkU0988bI/nhme+dCz87nZb2g52rR1VdYcOiiG5eyV9WaWiFiS3SOU7IHuHwD5SDHaZMgcJ7YIWZiONAzRAt5kHNOR/SDFz6LKE0oivBJ/NZs4qWGEnIuUgRaizOnvIYc5BhQRgdfzbnvgkQINp5A9BisyecjHwIYJtd6wnKXZ9RGF/egqLDoIH7g3jP/aZnjt37eHsxF4uKF3+8/oUwR85Y9V4GbzFkitdmXjvIUczd5bfvFO+IxoVhKx2SfYATtsD55xZbBXn2gTcER1w/TELkGHP+w8FwZxECX5QY2sySRwiVmo4jDQrmHzXG2HzmXWfOyRqMju9BrwW3ICFyxm9EvQjjITNb5C1MHLYuGTxKbOw8JiGfHKE+LwY3OJQgbNa19fuF6W3DyVlxPXKPo55hUP1OcS1DT9LkudmYxKl9PCM7oTMdpCrxLFHV1S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/O8n3gS9zQGqdr2h7vmG3B/4n1jO+IW7Ik3xxNySsBoHLGaZ9Y4P6FjvzM4D6n/PxvEznKNP6MBNvk8u7dK0szhCiNS4tuQzbsW89B/lHmbhiSMy+SpAllJU5A12P7DKQfQMIGVgrEi+plFj//bdB7qW4Y2ENh3O9CnWRTTEuqnTL5vZNyLImCr4t/OWmYSMC48iCa8oLYUjrnWxHmZrZlEQ1y47s9ZMLWUCq6SDeudDpebXlamXv3WBUWhRH2yObxfsDrWnHeLVRmTvCJh1KRZoA+lJ7usLxJ8poqw1EBiJWp3FXrwjWKkLJkw9eloNMxLB3sSmQckj+FdbMRMi6/un+bYUcH0bIKzi6wHZDuTWNJnDycLQVmtOf43QRv9rsOBsUQvBDnHR+e7gasxySTQDBTgYsxV27kUwc0rq6D1YYHvyJdL9CZ3+Zo36Hs8mMwdQGnDt8JqDyhzQFgOQjA0plD0kEN0rdmIjUgylhlJ1feaMTtZOUDHWyX3gR6Hd0UBAPUdcTeM4xscIY+CkxfUxqAfFgB2R9ZJKCKY/UjBjqOBxO2cdpScp+PIOXULrtGGvT5oPRcOoxRzKCmT454cstt9hMWm7Kzh4g/VCfIpe2BQuBvDXeFClGAY0YXVSL5WEvPWg6rZVTdgDRqAibZ4fXpRrRmYF/93ITy4XABnS6YsqaquG6UYZNdRvod2h5GM8civBnjYcnwLy3Mtjidw54BDHeM1v9Bvk0HczIHcD17GU2zDMySKKPcfE9Z/cSDc/5dIklVYcMYNrPaEOG0yaQpqsR5BbbLscSHMe+bfcB86g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80cf6e67-e905-46a8-1aba-08db4596f456 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:11:25.0993 (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: kpFWD+cwwl6NmAG9A9+jaO6yC9utag5yYXiHGIihob53SbljDNxf5i4VtdqIIvVAQsRSiF0QyO1GFCqAfQvKew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5572 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 malwarescore=0 mlxscore=0 adultscore=0 suspectscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: t8F04wz0Ftsm1O74C-L1CQ6UaNqG7mCN X-Proofpoint-ORIG-GUID: t8F04wz0Ftsm1O74C-L1CQ6UaNqG7mCN X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: ismpz4gizxngyja1hzhnhw63estoc9ir X-Rspamd-Queue-Id: 8EF24180010 X-HE-Tag: 1682437083-30265 X-HE-Meta: U2FsdGVkX1++yysSNRCNzq9c1cZavQeFnJyCg/QbmXheEorcLCHrHzQwfSsct/Pa7J/vYrmrMt9g76hWjIRcyNfeYLhsyEwJYr+qvQgRVQnj8JXSbIcpqbE0DMgDauVBPlwZAeq0RNDPs//jTw/2aKCH8EMhbi33nlOSeSnyaNWckOh2LbEn86Wi6kylZC7NnNyEdCbN4MIqvOsGqqII973ZuOWdYoP8tWVnMUUkyqa/2gqTvgmA6YM3ey2kLF9B/8Ppe/PP4Q+TicQcuC1X4m2eSbnFXaY8LEvu3LD5eSMTcLpGb/+5Qea9VHuL383UMAmJ7ErIPnThP7FwfvD82Gco8rHOQlY41L092bc6ZaEU/wijC8SuDn8ao6zk6TLor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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. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 178 +++++++++++++++++++---------------------------- 1 file changed, 71 insertions(+), 107 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 31cbfd7b44728..fe6c9da6f2bd5 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4619,15 +4619,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; + if (min > max) + goto no_entry; + 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; @@ -4645,13 +4646,12 @@ static inline int mas_next_node(struct ma_state *mas, struct maple_node *node, slots = ma_slots(node, mt); pivot = mas_safe_pivot(mas, pivots, ++offset, mt); while (unlikely(level > 1)) { - /* Descend, if necessary */ + level--; enode = mas_slot(mas, slots, offset); if (unlikely(ma_dead_node(node))) return 1; mas->node = enode; - level--; node = mas_mn(mas); mt = mte_node_type(mas->node); slots = ma_slots(node, mt); @@ -4680,85 +4680,84 @@ 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 * - * 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) +void *mas_next_slot(struct ma_state *mas, unsigned long max) { - 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; + data_end = ma_data_end(node, type, pivots, mas->max); + pivot = mas_logical_pivot(mas, pivots, mas->offset, type); + if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) + goto retry; - if (mas->offset > count) + if (pivot >= max) return NULL; - while (mas->offset < count) { - pivot = pivots[mas->offset]; - entry = mas_slot(mas, slots, mas->offset); - if (ma_dead_node(node)) - return NULL; - - mas->last = pivot; - if (entry) - return entry; - - if (pivot >= max) - return NULL; + if (likely(data_end > mas->offset)) { + mas->offset++; + mas->index = mas->last + 1; + } else { + if (mas_next_node(mas, node, max)) { + mas_rewalk(mas, save_point); + goto retry; + } - if (pivot >= mas->max) + 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); } - pivot = mas_logical_pivot(mas, pivots, mas->offset, type); + slots = ma_slots(node, type); + mas->last = mas_logical_pivot(mas, pivots, mas->offset, type); entry = mas_slot(mas, slots, mas->offset); - if (ma_dead_node(node)) - return NULL; + if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) + goto retry; - mas->last = pivot; 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; -} - /* * mas_next_entry() - Internal function to get the next entry. * @mas: The maple state @@ -4774,47 +4773,18 @@ 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; + entry = mas_next_slot_limit(mas, limit); + if (entry) + return entry; -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); - } + if (mas_is_none(mas)) + return NULL; - return NULL; + return mas_next_slot_limit(mas, limit); } /* @@ -4845,10 +4815,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]) @@ -4861,10 +4829,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]; @@ -4881,10 +4847,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; From patchwork Tue Apr 25 14:09:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13223398 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 CE5AFC77B61 for ; Tue, 25 Apr 2023 14:12:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B0E576B00A7; Tue, 25 Apr 2023 10:11:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ABEB66B00A8; Tue, 25 Apr 2023 10:11:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8EADB6B00A9; Tue, 25 Apr 2023 10:11:50 -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 78C886B00A7 for ; Tue, 25 Apr 2023 10:11:50 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 3F3D51A011B for ; Tue, 25 Apr 2023 14:11:50 +0000 (UTC) X-FDA: 80720101980.07.6D2F39A Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf18.hostedemail.com (Postfix) with ESMTP id 95EAB1C0017 for ; Tue, 25 Apr 2023 14:11:46 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=FSSkfT69; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="eZJLvWM/"; 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; 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=1682431906; 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=k0fVwaKie4oTeZToT+Ho+LImSroGb0R9XHF478dE6eI=; b=LSBLHlAhpHuljc7MqVFZzNGRK49zIIXF5AQ7LW0ktPbvCknaiEbwQCMGl64xxCmp927Qhi yl6/HdttTnL3Zd1y58EYt0VnZjrIASjT/bEesdNFVu9HhQMvuHL27bBiKicv3qFpLqN8RE LUJ5Df78waWqXbLraDO/sEKMSbYEvNA= ARC-Authentication-Results: i=2; imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=FSSkfT69; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="eZJLvWM/"; 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; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431906; a=rsa-sha256; cv=pass; b=0G2nZAw/U9njuCLs6n0msSBmvLqEcoM+8jxOKZUiqtHkN39MW2xOgWErjJahWJxjghTZ6q favZyMKT7swgfcuAzAspRIcjT4Yx5lenNTNwwHHRoEEiDGJB0SUaSyWzx6G9Oso/nZJa8f iOHlJCX9Nzjktu8o1PBySLD9ddNH9Zo= 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 33PDi8r3024340; Tue, 25 Apr 2023 14:11:30 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=k0fVwaKie4oTeZToT+Ho+LImSroGb0R9XHF478dE6eI=; b=FSSkfT69UmkFY3kLoipbXjkOQtz9Ct8BuXm2X0D3cD2bftZjj5l8AEpKid34WsYhEAPB NQ2/m0yZD1bHY7yvnc8EWLqB15+5FnJ28orHWup7MRuSaSDxATBhdE2HT4cIldxd5fo/ OrfzsnLZSPX1c1pNdQwbuEp+yVklvI0jqwBbSxwftRlyc1Ya9L5L5PzY+eQhqHxpjXH5 gxET5JeyAULdGoIkfvj0ieLatnExUumrjzjMMD3H5UliCm2rnDekQ1BLjphHUO4O64Lg PvexKUU5fez+Sm/4kGUGiJd0RpAEdfQNN015ECo571sNFFPYnGwswMMja/+EeP/8MK1W 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 3q46c45fxm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:30 +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 33PDRVTv008651; Tue, 25 Apr 2023 14:11:29 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2103.outbound.protection.outlook.com [104.47.58.103]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616qpq1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PzLMoy+hYIZr7JsgZ95rQwvl++cQZit/1h9NTA8BK9zr8q6Br5fr65ebxQnSgEQg78INhiS49uqwTsX8u/TdYSuxsT6hbnR18Kxed1bVEiAbkyaUnxwPRRO2jsKstt35l3NcDSKKG4DMbnVg9qvvvQEamRj1w1+qkm22bhK2O1L38AGtJKQ7yr5Cf223NE5RjBzk7IeMv2uUSX2lbp7Xl4le0m39nO42rIUFJvNEzN3F4bzSf3ZTtHAkunL5zxwAXoxkkFTlsws7GgazvFRG2peVVLFLumQPw671Iq5fKbKwVZkzjCRLg/8C9VRveT/0RFaqDrY/vwzyxIZaYtj6gg== 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=k0fVwaKie4oTeZToT+Ho+LImSroGb0R9XHF478dE6eI=; b=SPdoXrAUmMUlohSAgnrpbmN1jE0v+fqcR1lm5gTEsQwVrX8s5fZ5rPWuunACCdzY3P98ICOo6sZwC48cDd+htgpAFLrmziY0KDerQW5LA/5ctNnZI6HzYiUztOpVCdxA1kfxWe48UQQ8ptXqXZ5LZg3BYGILRGErWw90PzD1MRushOAaqR427It5ApQxxh6QRTKsbuc2dYj0uPD4FfIsUy6FgKFNBA5jEa/dnt6xU5l6f7k3yPCQjbt0qeNGfoc4WmfLyfA9BU9B5tj8/bGYMTPtwzPhlzDvptyFAYCZseKSk4Xyd9HaJXlxigOY/cOIKOII9A2tYXX5ejLxLLZwCg== 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=k0fVwaKie4oTeZToT+Ho+LImSroGb0R9XHF478dE6eI=; b=eZJLvWM/EmvmTSvjGkQir7m4nAzxOVAw8JwstP6s3Gw8oXNsWxrHXKAMnAszNxCG1kJmyOwZ4hdO31WfKmYJl97V2rSTqlSUeoGxUKnzjvFD5ORu2YGGjfn/Iv5XzR+qypFYuykZglIpoi5FK4Wz23y03Xi0IfdPnJP/07mkMKE= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CO6PR10MB5572.namprd10.prod.outlook.com (2603:10b6:303:147::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:11:27 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:11:27 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" , Peng Zhang Subject: [PATCH 28/34] maple_tree: Revise limit checks in mas_empty_area{_rev}() Date: Tue, 25 Apr 2023 10:09:49 -0400 Message-Id: <20230425140955.3834476-29-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0139.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d5::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_|CO6PR10MB5572:EE_ X-MS-Office365-Filtering-Correlation-Id: b43eeb0d-62b0-4217-3e7d-08db4596f5c5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nEIdFEDEwss2+1IjqFJzbHJQUM1w+mMz8mH6v0sUr1AalTV8MvcqncIQhYnwqnIxfgnQ8uI6E1mnO6+T2UpBM/OqkNBSd8XcaYQNm3xLEUztVz6436U9I92XEdW4jmw24oJniwS+TkNf6AVvyJtRTqxVpx8wLcyXehQVihVgOlTuxiWrB88GNLhKOBIYZqMwLWsyKy6taVTex5N5mlQcpTWEPag1kYdxrajFG6B2WrVw5vLsYtNz1fJCvzHegPbSM3EAKaYxx8OjEUUWYrl46JtR6lnfk0ZBfxLENhXye4ZUtpmQ4ZLoq6W5BICT1ac9D3ohjvvuj6tYvuE2jpJcc81kCOqUr6Q6qho10VI9C/yl6P/zAQ+ksBscos0RNpgZVHJk+PxqBU7FVWPhsbv3WhPKSIGW3RmQAbhpQP+NhrWCg0gZEx0bkVI9xYieTEUqP/LXo1FLsXPX++t2LVaCxT4wzEvBUFKb547MndJ2CFAfLHGQWh0Zng1y0QjoTwzVyG2IABVRsHRKTCN6JRSO7Hd4GArbCko4+jQDm9X5tYU9V5ZFxfoYBaQ1mXoHIONl X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(346002)(39860400002)(136003)(396003)(451199021)(478600001)(54906003)(86362001)(36756003)(186003)(6486002)(26005)(1076003)(6512007)(6506007)(4326008)(6916009)(66556008)(316002)(6666004)(66476007)(66946007)(83380400001)(2906002)(38100700002)(8676002)(41300700001)(5660300002)(8936002)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kYoRzLumolKC51FHmeyiwKkwbMNKQSB6yUYY1Jeweok+GHC+A9h0zRu/O0IB6yTp+bJNlLwMcCEVbCq9jvedmhqBbp0YwZjVW9A6crPr1I2SyurE/hAog21SrFwGJOHvBu0KMBxgK18L3t/S5CZwOU3M1cbpcY5/LQFL76Ahfbl2Q3/L/W6AZJAEpt/aKOanUflCKvq60nUM2TxSLOzyNqujxZR1RSgMFXv8UE859MxNiYVE8KvcQclVnhKZnR7Z61aJQlkz0YE7yagHHnrgII+OOpvL8bXLkh8x+fvetxvli7ChHQegiAAkLaTRLfabw3uGZLv3Gye3tKC13EoBvT2IjH8p7DmFhoZxnrIaKruRfbgYoxkq9U27cqyfcDwCqOnAWb/+Hb/lZWCC9Lcsg4wBgH8yMmvs7EmXns3hD1iHqd14fkuFnddQbEFylkrcyZFLil1KBbeQYPPGqZJlpD4XQA8ZL6Yo58zZyc4embZz6LWFvXg2NmOV/O9hAjwxTaLnE4O2ooz3Em2lrVuc+CXj6Sex+OOIagYRrw/+gkFEzDVupA8RalTJ4pyLqSz2YI0+ahGZ6vc0ktOrCo6g9HutIKGs0ZCLNUBw/CJIhLJM0Zk7kGts1+HsKlXoW+q9hVsJK3XuDMF9RrUUEkbaMOCbmW4u9zAjuorqjhr0Tim7jHtbj9sICd30RRtBshmhAjMVtIlCjg7mkNhZqD7cw4VmgIc/bNt70jjWkJ5mRK4C1V4w/+cBmPwNBpAbnjjw66vQeM60KvXouBEiI08jnTSXWJTy0K0tArL5UhSR8BVU+aqss8dCCdKwiaiAPsuiwNyMDKi53hYJETKkxHU6+9CEtSXTO4zQEYQTU684MkwlzmG5JyQWxmU538C+v7J+3bcjUF1x0DuAwmlCXlMEjExT2Zp2xvpq1HKVH51VY+VREmmf8zgcJcWOINVvNXHH23lmXffdS8EVr87URcKWv2PTurh9TRAv8/8FHsBAgmG3DGHKTGWNliOKtaZb7t69c7tOSudtfGB65kzKHHSBIoNOlfgzldUUS0U93ZteVdxq5oI5epyZ4Iv9HYQc5TfqUhuCnhrginFv8fJG3752qgf3goQgp0CgjMAiEf/SxI70jYlKNzBq9oMIBEiGgDhntIQWgWc3rzsNkw1MIhdOngcIDpcHE9XbGQlnX3ZaqPQw1WDTfYXE169q4hPkb31v4+3zdtsnKr17pBMQAwfo28poGWYY15Z7am+EfMvRD2uO2/gw/0aEHBYPVgMaw6TTFtwS7s5fhgR7adu+hopRcNc/qWwQXiAtrfpXLlhgL6wB5Cdmkp1G35gznnzxf758+j98WzGgotsKptHIeJcmrmyF9/ry6UVn1vVBcSrYmfbWD40DsCyjrPt26K3MhbX2kROFal+E0JNOtsz3TbQa2O5FAGXj4sS/SIFeuQgqXLh9i76HP3c0gcfbtQPXDaNb60xBv3AVGclO1Nc24HKPcNCOd+bLLtEuZhKvx+cCfr0Vf89K0MjzJ4Zb/Fg9z32hLkyRgrxAV4FON7Gf4/jBAO1yc4MsZXgx+dHZFb119UI4+PDznaLtVCiH6MyY37AmK2ONowGDEY5RtrFX6e6jVw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 6N6d2R+FGZS+Ded0nvSdXEoS8W23cju8DayuWrM/dpG1gKm0oPi2cz5A+Kti8HNc6wn8fKal8lG8tw4IX211U2zdD+TSfY2uvV1jItPjjqelWE6iuVMkwn/OlA5c0fNK2WktiXMa15hUnaN2OLX1pPdgpRWLB7+ab69bTtA9ZMMUQTQpMT3mxLy0SL2Q4wriiCK0gghZXhGTTcQqcbtcFd2vQSBswBfMPgJqbR+U6LlRBQLDQXiaRcHtz4uDjHIo+aJw6VpT4/caFx1VIS9cmw/Q2Jb7S1V+XhcEaIoun899Amv/iIRPN5DldFDd1r7FFuwYmzeBXQCicFYCmz0KcUF4oYw+nnKtsBnrLMzGDkTo8YyX8jVZY3OlF3YBp6rRW1dcwHy65azzEaq4rChZPah845/gbLGj8flH2N8+XAo1Qi/RT3WtBwodYtH3cywv0s2zS0WmjWAJMqlHubBRA0AqPWqDCHCrAfmXCxetXQUsmoL4h4NL5gHKWFA3gMwYvgw8itf3rB+4GoAc4REnezxa2+D0f4jYnnhfcaVZOJOCcSP5Ft5M7ggJR9o4lfOl2tOqtL3XAIs8zDC3P5yzfYIHtm7NrubZqGH7jtSAqFAjw7zUS2YQSmwdi8ATNhjMjUDmIeShp+No21wiLi2q/trrrde4tvfsVv+umIQc2mTNOlcLqNN7cyRCj8dan2fTBd8x4obftfdWDMEDPC5BhrUMyld1SwQx5rv8KVYDOmaDXKyXWwGDR1qz49K0f1K2uXUCFUORn8MSaaGx2NK9z4HWCGXDb7olSIVbB/XaneEZdozUxqzqabCpJZTLu9JzMfukOB9a4yHJB1eQfkIrqAQJkRZMcx6Cv5dp4JwayGe7BDfPgTuL6s1p8Z6IkPMG3sqKdR71MRLnJ5ccX8l9D3UjRF7nKPYY5BwzKTkDrR6w8tzOCIQ1lJPk/kkXxiQ/ X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b43eeb0d-62b0-4217-3e7d-08db4596f5c5 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:11:27.4855 (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: USK32S/vwbS5JgYh123LPFQnhNFJp06dCVmgqY2cURbe39Jb3iM8xxQyUqg+0nDogjJln7k4xbS5WqiqX7FV3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5572 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 malwarescore=0 mlxscore=0 adultscore=0 suspectscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: 28P6BtvjL_-cDmSEjHX2Nd7mihE-pkLp X-Proofpoint-ORIG-GUID: 28P6BtvjL_-cDmSEjHX2Nd7mihE-pkLp X-Rspamd-Queue-Id: 95EAB1C0017 X-Stat-Signature: 3t4druyto791mmz5df4r31oz5u6ukqn6 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1682431906-390940 X-HE-Meta: U2FsdGVkX18Kb3EaxpXvf5kR6CapSk/JkOWg/5qCCFdV42SUW41GjJHyEwZN/u9QdpeOpy0RMJw/zA0KKr5P2x9qaeQY7st5p415p4cEchdWG3Ifxs3zdMLutH39xBxAkwKK6vMBTrBIxwMOJtRe4zQag7957yuNpQYC3n2TvawwGufZ8c4VKEVFvG3QXCeurI051k60sM9zmwzkBnPf4WtM96nzRUkIR7JgoyFWuOHTBgsZ+HD8Ru4EgLXX/McD97BT1+caU87RBR+Ykg1eauInyAHlihb2v6ehL4EFaM8mxn8g/RZWBGbQzmVZPCnaWj3hWxu7Q6JjGjyiM4ZgmK2vPigSV1e2lIDXO6DKyqOUMu9FCXXkb3FtKvSUwmQlspg5cblgPIhhJddi8jKaeIDwMA+z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mzrbDVVfF/p4= 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 Reviewed-by: Peng Zhang --- lib/maple_tree.c | 20 +++++++++++++------- lib/test_maple_tree.c | 27 ++++++++++++++++++++------- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index fe6c9da6f2bd5..7370d7c12fe3b 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5248,7 +5248,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)) @@ -5303,7 +5306,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)) { @@ -5339,7 +5345,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; @@ -6375,7 +6381,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; @@ -6395,7 +6401,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; @@ -6411,14 +6417,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 345eef526d8b0..7b2d19ad5934d 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -105,7 +105,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) @@ -683,7 +683,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. */ @@ -695,14 +695,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, @@ -714,6 +714,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); @@ -762,9 +768,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 @@ -883,6 +889,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 Tue Apr 25 14:09:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13223393 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 F1E81C6FD18 for ; Tue, 25 Apr 2023 14:11:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C479C6B009E; Tue, 25 Apr 2023 10:11:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BF9796B009F; Tue, 25 Apr 2023 10:11:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8A10D6B00A1; Tue, 25 Apr 2023 10:11:39 -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 776A06B009F for ; Tue, 25 Apr 2023 10:11:39 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 4D79280245 for ; Tue, 25 Apr 2023 14:11:39 +0000 (UTC) X-FDA: 80720101518.13.4098070 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf02.hostedemail.com (Postfix) with ESMTP id A3B9080025 for ; Tue, 25 Apr 2023 14:11:35 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=Jzx4n5jW; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=CCvuEumt; 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=1682431895; 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=YYamRYSZTRjLgiYuJg4HLsvFp/mKjad4sqbTTV4Eyi0=; b=W2oyiOsOiNwsbNyv4NrvcTp910bXSU+v56rC3QjGm6BEKK6HrKSZxvRH15THhFKlrv/PaD eWXfRzTX7iz2LzCkLkr7CxB/ao7bHcRhm8/yjqQxitFJl6x/22+MfxF6PPJ3ZLQOin9/n6 cJJeTZhVuO4xv9kEBqnQEbpiot2Go2o= ARC-Authentication-Results: i=2; imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=Jzx4n5jW; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=CCvuEumt; 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-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431895; a=rsa-sha256; cv=pass; b=iPgHB0iNpytHbZl9Xxo+1QbCaEbxrAGo5Bx3NEnBJMQkhw6eYNum07ce2J9w9ZZbAMibnA bQMuw6Pbg9i7F+D4UEcMiJ8+IVJ78j6mfxPT8cmGFMqadDnTLYV8YQhp1km9+G2SmigT6T Mswrf0CJgCK5YCYlBrhYm4iqZktwj/w= 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 33PDiZFW006058; Tue, 25 Apr 2023 14:11:34 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=YYamRYSZTRjLgiYuJg4HLsvFp/mKjad4sqbTTV4Eyi0=; b=Jzx4n5jWalKA/Ufad1PtwvrojZOi6SIcpevWbIKkx/7r3nkpWT2IdbmGdm0cmxtejDLQ q82UPAdMLl+1Y0YkouIfyzwYAHgaP8l0o4HPNOQO0L0PU8Kx6jPj3DIaroZAz7I/YTuz x/HVDtWsT32pvWwmKtskzpe/aWS2I8O8aIyYb51N+ViBzyNy5kJ4D0FtyxQ1FCGnQdMq g7AIv7E1mpTI7vS+dCyiEpmtlLjxqlXhCF0nBT3ZK58DeUizYbPd+zyfcTzpDdGjiyRW UUVLOCxODGVrOYrTkYi2KGYrdmcSUrlmc56ffT0TJj4RoXlk5j7IzMyUoDvi/0n+PeRT aA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q4661wgpb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:33 +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 33PDi2Rb006664; Tue, 25 Apr 2023 14:11:31 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2172.outbound.protection.outlook.com [104.47.59.172]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616gsqw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b/uVqmpqu+N3N1SwQXpLYyhO2my9RwNRQSSILBpveKhQ/V5HRRIS3t9AGuqfVfHwepandMMNlF5aa4d4b/9xeNfG3tpeU+CqHmjS8xaAVYehHb/WiCSFU5T6FMoW4PF+gcyzE1w6qrbCILt4OmLxlWov0yHpMvoJC7iW/w062fL0ym34WeQrcXSzaFdg0P3Rn2Ti0AtacJIRpWLNE8pe7PtL+bPE45sjEH9X1uhzexfn+HqjGesjZHmUQ1zZa96/W+Pmm2tHmRwlI59vCfranKAmaPNeaQY4NhKR1HHS9R7TguobzEeojYeInNFxcQ4cGxq1g6lney8/93+1llkYmw== 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=YYamRYSZTRjLgiYuJg4HLsvFp/mKjad4sqbTTV4Eyi0=; b=LSzDsZSDLD/YwFlcEObfgC9x9taZmuam5koClu5OHDIMrV5IXhXrrzFdnGgfIWz5uOP2RHC8ac/3j+uR6awVNYCu0DCD0tde12HvLl2s554LVwzbVp2TlG5Iwrl6vS21GENuYhfJJWZM5BDpnemT7Q8uCTr9lDARppEZ2Wgc25HWC51ObrXpq0hOlw5fYLv/uI/ZNWtiTivUdGBb6MdA26aqFzPpwMRa96IB4RaEL2pHXA/xdZ0DlZXX8f+12dkGJ1rwa2YtSd3N94zQlmwnM82ZwNXip6c+rFnxivJjwnHoid2yp7e0FWCxhIijwpzTN8XzEN+1togYWTxkgz33zg== 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=YYamRYSZTRjLgiYuJg4HLsvFp/mKjad4sqbTTV4Eyi0=; b=CCvuEumtzf69RmqC9XP663hzK4chfe7TfRCHa4ZDRW1UhQLyr26ikdN2Dtoi1GJWvkRavJo3+GFb7GtYwS/zMoJn/yU7ZVf09LRrkHGtQ9OHRyGyBrH1QQo7W5hNyAl7fRNAnqe6Q2WeNFFuiV6dM7ifqWup08xIMKlhxAeGTm4= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DS0PR10MB7125.namprd10.prod.outlook.com (2603:10b6:8:f0::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.20; Tue, 25 Apr 2023 14:11:29 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:11:29 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 29/34] maple_tree: Introduce mas_prev_slot() interface Date: Tue, 25 Apr 2023 10:09:50 -0400 Message-Id: <20230425140955.3834476-30-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT2PR01CA0024.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:38::29) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DS0PR10MB7125:EE_ X-MS-Office365-Filtering-Correlation-Id: e73a2624-c676-4d7c-1466-08db4596f726 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5VpW36Zhzpec40RNopzK+43JtdMUir+8uOBT1HKteQcN+lkXcaTAe1Jr+fIZ2OkPmMB0ox8gk9+60o8Kco2dM9l8ZzuqDvlA/HtBLoc2MihSRw3lyGlg/I0DwYqL5Q6bEkBh3V6cjzJh8mVgt59VSHiNhFdy4ZQPaZ9biAUeVjpDfF+XVztQetUPjOxbxfAI+YlCWv+0lhxCz73768jODpIlhEKqG0LlQ/FLQiqImqOsM4A64fuyZ3IGf0r/JNRVInRkRgG0GqYA3bhm2RSAbktQGfWJw44gsTlJCeNK9vWoPFLtUEu05ejDzxzVSsDdCsPfUfZi/Jukc+pjKIa5Q2KgUoS2R9Zr6KZK901mETHCaNSkLC1DeLL9jndYM24efl4n83Bhvw6kEAraDR2lV2spngOc2lYpSndlTEzMtsrM2MzfMLkL7PZzx7Q+tpLmOqWmuBfBV+uBkspd1833KOBA8iMbqW75r7Lwt0CDccXiuzggDY5/U5H87GFCBQ+VSW2wLD0RiSpnb33ptT5qpbVCTQWF9izy/eII4u1zYO+1IkUGQT0Um1mLx+gIWLXw 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)(376002)(396003)(39860400002)(346002)(451199021)(316002)(6916009)(4326008)(38100700002)(41300700001)(5660300002)(8936002)(8676002)(36756003)(86362001)(2906002)(66476007)(66556008)(6486002)(6666004)(6512007)(6506007)(1076003)(26005)(107886003)(478600001)(2616005)(83380400001)(186003)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: z3Zv4eni6aaNqCt09KnOaqZSM9BCdlVd+Ex8GbyKyzCpYp+GaBORrjwGHei2hTHi94/xnuDUF/vCt4Bab+/bqRcTuSmdPrg66WPEs1lYZNq0/2irAqOZw2xMsCksUVyq3kAbkQT5aCfeKr0eCfdL9xeGFfCZNhjoZFFtg6yug+OoYbYOBvz/zDe/RtS3Lq1naXu2l+IPGH6nnr/BJw/Wz70mxgoG0OGHurvzRPUXlOs+ydOn72E2WYTWHcGuMvn8cGL1LzvjQ/6EzY2WCEx2ufkbk9zhbUz2kq+zGHX0Ch/pXv89bvOq0YDrzAgmvdvGkxlMdfoj65RMW175GjjBUum7NPdy7W4XLTXLQMbE91SfMciZQ6tDw63f9fakWAyS8Y+2dBS+QiHNRkPGh8396wt6Ri3WP23UYxlT59ydf9wWsJzOHjaKjANpzRzKotqXzLkYqR5X7enRbTUCZONiQnQkHCslUPphM98XXc6MnvvG/GA6alsB/Okg+OATfvStOU57SRvKXfaOx1eP6J8Ix4AsNNDB2IK+9MwRg+k8zDlU7LyMv44m9SvqxNZSbI2acYhU09MiiFVhQfGIpoxxn33FmaAEpiYd1a9LZ5nR9ylqqzasKyp9Fe3vr5WF80Bs6IGtWV/nah7QBAK4jMBDCIR2qnL7zJ6kQ6Pnv1RAklnFzUeNuzpylJ9mX4oMe254iBxhmamvmJffrGA7uPo18pE3IBJnN8JJGTpNVP+qhF9AhAIQOxNpBy+5cD/FFD20jZiSPYYSOruHA7bvXaKn4Vxh/9JClSjaw6vxgqgURl8RpOrnxKy1zisE0s5psmay8ySRJFz1UDuVkrh6jaqTbDmE8QX+Nhm/kr9Ed37blOdYAYnh8wxfj9TFrAQS46n0dyWEUJIEb3AxjaOXIgxau03ryBJLpefUf4sO/pIkvnBCg6KBSrDf0lU1I2i8z7CI8ZM9G6641nWyUczP8tEejxNF0ZFplOf/CB8ZCCe6WLoZFzSmmmy48mjSzvswT4dWS+QODoOUX9n13/n+dO/UalKtUr0JoAyQFRmLLsggKUnXlrldJoW8p2zPFFsgBr9jyLCb3bAbKmqjH1IQdLFxd72040ZmwBHYICrPBWCy9FeSFl3awBG8f0KL5Au/cQe5FZT9XZoeLkU7VkZfT4byYI1OIarbipZHSka9ylq78g+pLyVxsQuICeByuljOuxCBsizb5XwLmgqDSyP9evVrzjI67iJEsuLdzfOGnGEF9ef562eaIUBb2TjSNu+gBFU/+9dDEQZZfJdiPdE0Ssiwxmq/YYYafmDw3HHRGuQKFOKneCoZtxFgxAT0VxARcn0HkbQQB3u1uf1BZmArLGcml07rCR185tX723yhZvPD/3Itce9kbcaOzeKMAOYAbYl52lcYRalAcWaQFzX3A83XayNap9jeD2vlGGgJVCOEGRqGa0uWffJ8f8r5I1o8707CNogtcdXagIi5W//ZiGb2DenAEizNBHF0/rFSkvEj2946Xg9649LzNZysGT/4inmK2g46ZbMtVls9Zk91jHijZnYF92sHgicBQjXgJlDX6WzRaGzWEtz+roUsEuu2d9YvPF+qTWobtSpik8XyloZKhg== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: efq4GwUnMOZtQ65lLeFEvexjjYGffu3eXDYWzgK4w52OzUC6+1V3N9N1KNKdjuErhDJwWSHtCpxnllOvSJkiq7BODMET2MRn2thwoFOR5Yrkz2oNbAhn/gvknDfIUdW8fmuOgTu3YpNAqLhdUqaCEWACth3BDjhJDtvqgILGhRfAkZJGmM8I0dQignzgN7o8tfRET0AtHcDFrTkydRuwDGIEi74atKnlTI/1dNl4ZUAiQTsrbvGpKFCzn5IQILq9F1COnxkaz/qBDU21t0LhTIg21gTiYqi02q1ZRnz7MHkw9tbh90mSv9pz9SZ6nZ4Hrxgp+bz4PvDnM2FgChW25lPboXIplIrUWpQlHJIQ3ZnYV8A+klteELR53glup2M3fzSmmAGwbsMqSJHvUAdOI192C7SWrjwhI3M+1QE1Ov/HzT4D6gx59zB6N0VM9sehAVB2sQDmLc+y8sROkbp4AeveoWufDjIWvL9rfU5MQsBe/q185mIn+gx/ab67EaWdwK1wjDKyloUJbxxXEce0pYGMYNb8xrK5hat0t3rBsnbzdvnQKeT7uuZ7uZ8UoWVj9YxjLVCmz6ow+sL9kNEyDnY5f18+5nLFPIegmGNfrXEGyxs5tQKBsyBKkbV0LxtxhAXIhtZLitoo+Kxdle/hAZe6YClQy3xsNHJMPwBCHYm0B/HZkjOumXY6Sl6uby2NNo81dlALzmJFIEAgisYvEja1sKNtk+iyuPfy3wwTua4GXM3EIYgzr1dU32BHldrhxtCtjx/4xV0bPnIKLUYFLKqqtYgsQDsoQ8bqyzF5i4jtsCJihnZYyvysh04iaqvmUQBFGfTazCUVsrSvtSqMmK7cMyV3oEAM6v+oVGdMNPyGV4h6QPPtv/Frevkv/JgH/Ao5nKsL0bIIsUCoqgVieA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e73a2624-c676-4d7c-1466-08db4596f726 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:11:29.8122 (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: u9FE2lq3YdVjZEus60R1urlrAHpoPvJdwDuFCKlIoBwKxCbMKQ8uXCwFTy1aOuKSAjkq7lQTpf7Fzr2WuYDJRg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7125 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-ORIG-GUID: yyV82fHQyKw0x2EgS-D7iU5jS3UIpNKH X-Proofpoint-GUID: yyV82fHQyKw0x2EgS-D7iU5jS3UIpNKH X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: A3B9080025 X-Stat-Signature: is33kb68ibrx6icizihfefqtzkhfkmq8 X-HE-Tag: 1682431895-274483 X-HE-Meta: U2FsdGVkX19vYWqeI9+sIh0b5J4qsItaqmTnedJRRmh4PQfDsNhCVKRRs3Lqnoho0bS4g4PMytHIFSjShBN0uYNkFl9VfVry/hKVa/44Lb/Ffd+oSMuiaplzrFUs6kL6oEJj7vdr4bKLImAdtdRkwr7Y8J5md2aXJ3CjepSGtHpSm0hZVT3NUAWq9yQPSFrtFaCvlTKukaaqNd5qUfljw3kkQp6hNEt/ilRH/tCHzLapUCP54w2Caxb88Tqfy3mr5W/2KNng1hCGBr5ke4YJk3jd38u9GmH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H6vdko1Yq7Lvju/LfF/RempnF/TPm0OM8+63Y= 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 | 217 ++++++++++++++++++++--------------------------- 1 file changed, 90 insertions(+), 127 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 7370d7c12fe3b..297d936321347 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4498,6 +4498,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. @@ -4515,13 +4534,15 @@ static inline int mas_prev_node(struct ma_state *mas, unsigned long min) 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); + 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; @@ -4530,11 +4551,11 @@ 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))) @@ -4543,12 +4564,10 @@ static inline int mas_prev_node(struct ma_state *mas, unsigned long min) 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); @@ -4569,9 +4588,6 @@ static inline int mas_prev_node(struct ma_state *mas, unsigned long min) if (offset < mt_pivots[mt]) mas->max = pivots[offset]; - - if (mas->max < min) - goto no_entry; } mas->node = mas_slot(mas, slots, offset); @@ -4584,10 +4600,6 @@ static inline int mas_prev_node(struct ma_state *mas, unsigned long min) 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; @@ -4596,6 +4608,62 @@ 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 + */ +void *mas_prev_slot(struct ma_state *mas, unsigned long min) +{ + 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); + 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; + } 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 = mas_safe_min(mas, pivots, mas->offset); + slots = ma_slots(node, type); + entry = mas_slot(mas, slots, mas->offset); + if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) + goto retry; + + return entry; +} + /* * mas_next_node() - Get the next node at the same level in the tree. * @mas: The maple state @@ -4680,25 +4748,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 * @@ -4777,117 +4826,31 @@ static inline void *mas_next_entry(struct ma_state *mas, unsigned long limit) if (mas->last >= limit) return NULL; - entry = mas_next_slot_limit(mas, limit); + entry = mas_next_slot(mas, limit); if (entry) return entry; if (mas_is_none(mas)) return NULL; - return mas_next_slot_limit(mas, limit); -} - -/* - * 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; + return mas_next_slot(mas, limit); } 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; - } + entry = mas_prev_slot(mas, min); + if (entry) + return entry; - mas->offset++; - } + if (mas_is_none(mas)) + return NULL; - mas->node = prev_enode; - mas->offset = prev_offset; - return NULL; + return mas_prev_slot(mas, min); } /* From patchwork Tue Apr 25 14:09:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13223392 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 F3D44C77B73 for ; Tue, 25 Apr 2023 14:11:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 82BDA6B009D; Tue, 25 Apr 2023 10:11:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 76DB36B009E; Tue, 25 Apr 2023 10:11:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5B6786B009F; Tue, 25 Apr 2023 10:11:39 -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 4B5F46B009D for ; Tue, 25 Apr 2023 10:11:39 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1862D40193 for ; Tue, 25 Apr 2023 14:11:39 +0000 (UTC) X-FDA: 80720101518.19.E2EAED7 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf20.hostedemail.com (Postfix) with ESMTP id AA0AC1C001C for ; Tue, 25 Apr 2023 14:11:35 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=IidXUwE8; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=KwWH1GQM; spf=pass (imf20.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=1682431895; a=rsa-sha256; cv=pass; b=eakW5k22+dnmhAA7VWvpHrONYLv6kze55o8umU74JaTDg9+DDSkHH7oBDMTmZOgbBlN7zJ UzmqCySEIz0lOLBIansprTjH0IyJcs/cw71bjwmK6J/5wcqng3kxqlF2rkm6Fx0ohk0ebi dgsugSDVjSqP348IX8chykIw0pbZZkc= ARC-Authentication-Results: i=2; imf20.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=IidXUwE8; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=KwWH1GQM; spf=pass (imf20.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=1682431895; 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=bmSYkPqvnaVhYx4pD2rduyU9aD84b3mzvnm2w3DPPtE=; b=WZvKp8wtuEPO7s8+iq8iSAfVZOr7nBZSsrV+Ge6p67pU8USoeOkCWe5DH+bAvHyftzhA3t wrpJd1Xd3ittGeOJ2qalkyin2VztBwI02jANzmo/WkQeXZ+XBw3bQK2pd5OeEbQnSUEDVH JjtVKA/x2zevLJ5BlUmEvJrdRCYARS0= 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 33PDi2a1008719; Tue, 25 Apr 2023 14:11:34 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=bmSYkPqvnaVhYx4pD2rduyU9aD84b3mzvnm2w3DPPtE=; b=IidXUwE8YmdGl0fdrg5c/7jbYeFQtCa4+263h6INtHFTYbml8+Am1KIzppoVIF4Y9asO dVkKCcP5wsxuKSkVqIQjwLipFIcvJyIFdU4xhD6DN0QxLc29j6FwXuYIbx6bTmybUlDv jUBa7DGintogkl/0HCqDy1pKLMb4ErSh7CPtMvsQqL7HdEvQtoOq8Z0WlsqK2IoW64ne 16PI3yVEqPEnssqxdpST06DRk5M7gXO7oh0zgZ8de3C8kV97zCSkMNxsWGnsAjho72zj KiZ200zeMdcDANhUd/ev6bCjlf9PkGelSjJptOxikGvAPGggws1U56ZpZs5Zk5SPYgOf Gg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q460d5e7p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:34 +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 33PDbqwV013387; Tue, 25 Apr 2023 14:11:34 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3q46168f3e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YSzV0xIbdRXR42kRAGNfHaBXU4pO6WTRNrr6KMpL1dRHrOAE+A7UzxNdi5M1yMWc47OsXMDugPFrziKBLmPba4DD9McrucikAFi9vFUqTPAIPLnF6RW7RNR3Xm3rhbZ/ItEh5G7mhhgUu2u3BI4JG00GcW+ZQ5aWamjdbHIfbrZuueLzT0GIfPkykSYd5BThT6AAftpTJJNbaKoicbrtmJK3FNyVAmYdWiwsYDz16AFDgxSCBp3svcxv90pY0tvnitwNEiDmvtlL2zAfrYNIOfWA+D76HqEhKbYIkFqSwy68g/PMlddMzfDA5FdlVenJ6lL2xjaLoJ5hIUz4UomHlQ== 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=bmSYkPqvnaVhYx4pD2rduyU9aD84b3mzvnm2w3DPPtE=; b=DKnRhQnY2VA7sH7ZKLVsl6E/c9GwS9UC2gdoDQZa7kkfUtfPtn7qS3GnT8TqLdYz9JSjN8L34dQzP2XuAmOz6J40vcPutlLG7gaNJBc55OquNVT9chH3eWruOEjYwWFQE5ZzsPVLr8S0DhLqFgwzQgBxwjAcjAnE0nslOtT6Zny/RVEyrdM7LNHr3Jw7mecjUy1q28wEKEHwK03IsXl2TtHU6jH6pZEtKurgCcFynwS7dGVnxqUftQ/d070r59RqVqqqHxcqpm0JasiyHY+1ElKlUQyCesHPNHfQ/z9DfjxX33G9LEJTHx3tZraWoxynobLl9uW2mbODAtWlb++YfA== 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=bmSYkPqvnaVhYx4pD2rduyU9aD84b3mzvnm2w3DPPtE=; b=KwWH1GQMrniSUDcG1pj14AhiUAgo9AetL+SCjcbEHfgeSMNugXslA7+sgxhzER+iUHQrHCWTyPQo2wmF1LhRrJoHb6jRqVOZ370s4IuuEhdkxh9xXYIS9EVyeXmueOQOiddlFScE5jTUZ5ULm1ap7k4w9TZtVrrX5rV6T/uZyuE= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DS0PR10MB7125.namprd10.prod.outlook.com (2603:10b6:8:f0::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.20; Tue, 25 Apr 2023 14:11:32 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:11:32 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 30/34] maple_tree: Fix comments for mas_next_entry() and mas_prev_entry() Date: Tue, 25 Apr 2023 10:09:51 -0400 Message-Id: <20230425140955.3834476-31-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0043.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:82::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_|DS0PR10MB7125:EE_ X-MS-Office365-Filtering-Correlation-Id: 1b55d470-1da3-4151-aefa-08db4596f88b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UJ3yflsN0hQtib0jUvAetPlwu+JA81Gb2pDJYnJGB1r//TwDgNe+ca3aVpU/TDuQueRzGKdMjojZ+MBWJCdGDxJIrQn0Fh/orEhBH9WSWhDlH/LbYrZTYzBPQTm0Aav1yC7HHJKf/la6W6K39pWeiQDyw+e8f+IYH4KtuxmXKIGVJYoqoRHoRFXSJqZeKS9LnW0CiZd+/amHuN4QIoe1X/tineXGeJ0RmefMtJLJXR9zLCwFLiMDjikhqWObQ3+CEfyMbfokNLDFLqdTIsEm8S9KfXypIzV+No/1rk68YjdAm97EFdtZ6eqdhl0c/wesSKZHoUAmZuAyK7/EAzc+dVzgx4S7V4LcGsg9L6ygk5HaMNyYUlJoFzZ0Z7ictDDbJqEhHNprkYgGKPp/BCRXDtcqJqbEJ1o4nR7BtIOzGYJQR2bpZYFC48Cvui7REGR60MGyK0eMm6mT+L3cXHvizCdcBdZI8fQ7iYkI1HSOdYepWsVdUEuFE2xeT6xXJfdxvHEAEv1cHGSI0eYw97mEout52dSrlM2IOTWSE++4azHygdijn2sSRc18WEFvG1oF 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)(376002)(396003)(39860400002)(346002)(451199021)(316002)(6916009)(4326008)(38100700002)(41300700001)(5660300002)(8936002)(8676002)(36756003)(86362001)(2906002)(66476007)(66556008)(6486002)(6666004)(6512007)(6506007)(1076003)(26005)(107886003)(478600001)(2616005)(83380400001)(186003)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WJAcrmVj+y/ZynBoY+MvWbs67h4PhCQDyfzhP8nfeOLoBU14QfnQgIiqNKQ2MvZlwKAw62BCMoVjg7DIYzKvyyfbox0rgU7TbdFMJtHxGh8mG0i1x/4v1EOb6QJms766XJL4fZ7ma7iiJ3Vqp20mnXHL3yyGW2IXUN51+XEc42oMcHa4hLr+/3/ftqM4POGbyhlPLzbhvun7LERJtOK2OEOliOrUoVa35T2VuMPsyudaqBbYPh3Eg7RcMP39h58MVuzwBZOYc0ybx6MUQSzZJdPt/CaEu6M80P1eGm+EktsCA8AS61dcVlTPX/QE36GpTykyVwxpE67mZ6BcqfWILxjidFXYMp+sBl+GQKyZPvY1d2ZArVL9vA7WFwy8TghRPjlxPYdj3UF7JYfq/WWX/jVUi8A+HOXVOxRLgvc7S8r+Y6460BtHrq4JZPcJOq67A7UvRMhkRcYwVmEZLRDbBltaBynmbhfTYYSfxjQbssYUqDjRyHaiFLAR0TReBd1dzXCjafv0W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490H97Vag== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 3Hn4KpGMNiuGzwP8j1I1iDPUZFc0KkMNMYjG6V2SdyKbai6IMlUgsrq0XI7wfQGwp9UySNnV+MIUdgdPBBkLboeiRaupWy8zpHCkOmk4QVv11uCBaic6+MA7ysyCCqAUeDDBKrD7nQxoKQazx4v018sRoR7nVhr2hFUP9xHG6/fNZzghfh5PRjiJwNIAm0y7fI7/iodDe4Rd0x+tZKy19UAkBlE+eSvPaZODfcJo1iX/dt+p9IhC2ZtNVqwCdUBch1vnSqRMj4RiAScaZFqFwDn9ThSfTrSsCM8ZqU+RG574jZruAdIR5H3u14Q/yLRLkOW826a2oozqpocjUmK5DN8d99hjf/CUMj+g/qLzI2peBx14j1pykVIif9QZ3zwgNaWgZPxl79FhOEsA3DZ2LU2BfYJtU769e8UXG1zJgwaYMyCk5RHjQtZ3+egxb4fqRHkLFQbPsNVL0vzeLXLyTjtVh8lq0DY+jEEJztM3gWE2dA+qRIE0bKPEDLvaxIv35kxsQGiPUXqsWv7xh/Y6uANuaTw2p7VFDR2Vx05FuJu6P7mP1F4+eV5DXZZyZ1mqaRDzF6/eXMWIM8TMS0B/FYJRnGu86AqMejZYFADLqSZoX4V2HuVnjXmveeXCMCZtsTthH4eVgAEupPVJmuX2FmS3oHXLY2gFvFdDrInNfHZRR7eJKBeh1Zc9M0FgK1yBSB0H7FQnNegy2DI8eWnF84WRFF7R0564E5jWM+iJbSK9ya6921vZbJiNPXiFF7auUg6ihh+jclhMbGKq8mv90m3i0zk0YfMdfuJP9H75LC/VuPGXIAxprVeSoX4aV1XWDXzXSLZ4UtRgmTAP8XgScrHAikVz/iBOjgpSmLS8y2aHp60qBTicj+Pv0ptQs09AOdoNU6ICEY+fzG1XnCNHbQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b55d470-1da3-4151-aefa-08db4596f88b X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:11:32.1053 (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: CnjflXOc4C25tq6tjN/BFIoSN/0fRO+c70HN69fwSUZfsBOfwan6oD04QQ2BW8qasw0hZqlnbjE+Sm19D2VNCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7125 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 phishscore=0 adultscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: Q82MKt_jneol0Q4HlIiFu8b2jdiDyytc X-Proofpoint-ORIG-GUID: Q82MKt_jneol0Q4HlIiFu8b2jdiDyytc X-Rspam-User: X-Rspamd-Queue-Id: AA0AC1C001C X-Rspamd-Server: rspam01 X-Stat-Signature: 3jurt3ofnbzcokhq1z1k5qgt7ddrk9d8 X-HE-Tag: 1682431895-372638 X-HE-Meta: U2FsdGVkX1/az7VMSNag2oP3393XfRfbbmBbDGu+LEXo9R51vrWQ4QPJUJSBBvhMxVTwe1h1uaxXeTOBfAHLNb3kU1vs+Tt0dnwU86ToWOWrs51s73oAKZBubC9+tHo9GJ8jbO+56N9rWAS2ab6ZBz2EGLzH1FVJx2qaG1GmvfEQlbGAoerHebklDOzQTYu6T1QwoFOUxjS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n6oPdclqY9k2A6rVryDvm4Bu1/uMHZPIwlMcaJfse3RyzSYfOVr3NDrRqI/vED4U6YcuScq4NNVT3nR+5ZpbNQDe5sP/r5Md3mzsYoig1dkp8p2WkvE59UfLH9QSs0JGn4A= 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: Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 297d936321347..377b57bbe6b9b 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4814,7 +4814,7 @@ void *mas_next_slot(struct ma_state *mas, unsigned long max) * * Set the @mas->node to the next entry and the range_start to * the beginning value for the entry. Does not check beyond @limit. - * Sets @mas->index and @mas->last to the limit if it is hit. + * Sets @mas->index and @mas->last to the limit if it is within the limit. * Restarts on dead nodes. * * Return: the next entry or %NULL. @@ -4836,21 +4836,33 @@ static inline void *mas_next_entry(struct ma_state *mas, unsigned long limit) return mas_next_slot(mas, limit); } -static inline void *mas_prev_entry(struct ma_state *mas, unsigned long min) +/* + * mas_prev_entry() - Internal function to get the previous entry. + * @mas: The maple state + * @limit: The minimum range start. + * + * Set the @mas->node to the previous entry and the range_start to + * the beginning value for the entry. Does not check beyond @limit. + * Sets @mas->index and @mas->last to the limit if it is within the limit. + * Restarts on dead nodes. + * + * Return: the next entry or %NULL. + */ +static inline void *mas_prev_entry(struct ma_state *mas, unsigned long limit) { void *entry; - if (mas->index < min) + if (mas->index < limit) return NULL; - entry = mas_prev_slot(mas, min); + entry = mas_prev_slot(mas, limit); if (entry) return entry; if (mas_is_none(mas)) return NULL; - return mas_prev_slot(mas, min); + return mas_prev_slot(mas, limit); } /* From patchwork Tue Apr 25 14:09:52 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: 13223394 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 02570C6FD18 for ; Tue, 25 Apr 2023 14:11:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 36D756B00A0; Tue, 25 Apr 2023 10:11:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 31CBA6B00A1; Tue, 25 Apr 2023 10:11:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1494A6B00A2; Tue, 25 Apr 2023 10:11:43 -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 EEDAB6B00A0 for ; Tue, 25 Apr 2023 10:11:42 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 85E1B1A0211 for ; Tue, 25 Apr 2023 14:11:42 +0000 (UTC) X-FDA: 80720101644.03.0676DC2 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf23.hostedemail.com (Postfix) with ESMTP id 15986140003 for ; Tue, 25 Apr 2023 14:11:38 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=LR9i+Aor; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="wfqeQ/5d"; 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=1682431899; 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=Cwe2E6An3ilIZZ99/IBBEa89cMtvEgGITgAPgWQCdgw=; b=oi59p2fDRjJz11uRXSze/nsiYfsdAINCR69TXG5CDdobigameAq6/gTy2WoJswnZtIjQBx 0S7Wz8alKKsLowmq8IE3fIqbEKU9q7yqzGCc4M1/1tMNldA0itu2BdfYtH6zIZzgwvRwGE IGMjWMTuJFB79Ie4IFD9I403RXFMt6M= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431899; a=rsa-sha256; cv=pass; b=o9JTHsSU4jv/+SeCXsvmd2jIS8jljYRgjfW8sBbt0/+qMJ08AMUgw4yhopjg6y7eCx/y9s 48lvjbexXXBOBnJETQx/vQJaxq9kLsS03WHOdKU6kT4G01X988Wm49VbcrKxAZb5THpdj7 5ur074TBOcNYYVqkMx9t90OjGnMge7w= ARC-Authentication-Results: i=2; imf23.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=LR9i+Aor; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="wfqeQ/5d"; 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 33PDiZb5006059; Tue, 25 Apr 2023 14:11:38 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=Cwe2E6An3ilIZZ99/IBBEa89cMtvEgGITgAPgWQCdgw=; b=LR9i+Aorzu4QSjLjC3Rdjg7fTF1M4tD2gMlWCPtULkgjDJcYf7OjVXUHT5eIytUkSzO5 tVnYI5hA0wzV1cGQFeF3HfSe8BjWcWZZU5ZUte0JivfMhJT7s3AL/YnioPWIbP7Zv2gK j0RNbjdPeQYvIOhnL5HT93GSScc1fbGN/AE4ETYijQdXBA+s6yaqwuTFXZ+7fb+l403h UTCU+LUjsXLWU3SqGNXrV00GCjr+08zeFYsusfM4TTK7Rx9IIgaavQoMCAHpEjdvtc6V CB4xXLOt+jjUOvQl+LVvNEKE26TWgNHJtQFBMTXqBZHRQc1f+JXTWXzKb2/MPPLABGv9 kQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q4661wgpg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:37 +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 33PDalUR025010; Tue, 25 Apr 2023 14:11:36 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3q461crdd0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=glsvj7ZzWMCF865BrFcYWMDvxlsL1tHMUJ8lr0GK/XKrypvuhUT3aSEpXNqQRUaVeXZF+AwpnFHFbURSNzMkD7h1yYZ6sTDj/chkpCRy3cRr2B6WbuqLiUqbrrkCZWJvt6admIbgluv2s18K2c3qeGokCdNCtsaF0w+CDNA4D1MoyKRtujh0Th0i2JmHAGYl5NCFUXvqJlrJlq2KZ4SZQ9SU/Ytx3xUNfryNo3uQe1Y66VO8aMqammNAiS4qCel3L0ixDXnaKVpHogYmFNJ7W7f5KQVBc1ykTsBeQT31YVqShR/1nL2VA+sQWy7nwaC4QM9ge94Rq6YQ/UtLBXbJxw== 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=Cwe2E6An3ilIZZ99/IBBEa89cMtvEgGITgAPgWQCdgw=; b=FaUwWMhyhDO6liEAri1wt60hitmffEd8tENgVWh7fp6FfSrBUrnIz9AAVB+K4TJ0Dfrrf2Hg4ya1DDlqJAnqD/pyswvSn7a56mAG64U3YZZqgJ0GUvVB6LaVtZbb21rqH/KGqKhjlfpTlE54D4Ps8qjKGq927+NUH+tvi3DvmNbdILAxWi+YL6fHSQAO9tUW2+AxTPOUqfprRJ0giLnIVp0lVzHOl15006oqF8g0RpKfCl4dFkvC0wLhfQ0FVqawphvvXEQxVD/oxxWUrgK+8fidBG9Qjdty6ArHuZfX8ysmqW5YyUjIY1HXLkVgV74L9u9bTpGgAbdtaHDS5G5piQ== 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=Cwe2E6An3ilIZZ99/IBBEa89cMtvEgGITgAPgWQCdgw=; b=wfqeQ/5dibdZtJ0b44JHqdVV4A76dgyZ0WlRJ7H6Kl4Sypz25wzLc6ZDm11QPGgwM8j36HHN7E7MCOPT3Ijjzee2Zue0ELoLQEeLiZvggpuezKA7YsxpX1wjQ687YmGzkJ4HMrGC+K6S/veX6IGxExoD9ZmC/Zy6H250pJFk5Lc= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DS0PR10MB7125.namprd10.prod.outlook.com (2603:10b6:8:f0::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.20; Tue, 25 Apr 2023 14:11:34 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:11:34 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 31/34] maple_tree: Add mas_next_range() and mas_find_range() interfaces Date: Tue, 25 Apr 2023 10:09:52 -0400 Message-Id: <20230425140955.3834476-32-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0058.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:82::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_|DS0PR10MB7125:EE_ X-MS-Office365-Filtering-Correlation-Id: b6afc938-be71-4b15-d6b4-08db4596f9bc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GtuSP45pr6UEZg5Hgw84rM5Kd7NFy+KoljiH5uzJy0ENqKifh81214k6K/XZi7q4snfBSDdJ2i0RUft448fa3vERyfiX6hnAD6f+ECMZY+FMIPv+MFXxUovfpdypcIxDZVV44izWFR2PL17RrQAr4UpOsQvyCQ+mkf1ujNoAHXnuy7hjGddisE3ocKjqeUM3Sxr7y6ABsn7yk+OK1hDmAnDHGGnkFQ46VXZxuMclyWPs7DUQWzjIg+8YG9IcY/cg6JuzZLLZXs9qJb3EZje2pRFYOxm36VkvhXLrxwD7a7M/KGC83v79WNF6bja8mGA+upXcosW1fUQsP1b7nDZIlFVMxeGpk0q7Hw3uFrTynLeoEB0gd0YkDfN2iHXO1Aq6IGLJwJwlqSFGDg6v+PzTF6c09SVpF3GfRqI01US4tgKUQIffpFnkIEmEqZMaf0Xj3osxcw9guHbl+kI6ZiUmDwmRHNQVidUIRsqeeEoYRz04guLWjRaq6ABIlZ0FK70givyx0XrJpC08D+5OtXUTzR4K+KU63qbWZAMKoQkkNvtQ3pLVEcbuFmq1N7OqULZd 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)(376002)(396003)(39860400002)(346002)(451199021)(316002)(6916009)(4326008)(38100700002)(41300700001)(5660300002)(8936002)(8676002)(36756003)(86362001)(2906002)(66476007)(66556008)(6486002)(6666004)(6512007)(6506007)(1076003)(26005)(107886003)(478600001)(2616005)(83380400001)(186003)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HG1JfSQDdLYL7wPgzuhLWVHWqQysaBAC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EfX5DNf6ChuHE771UKRbeBkhvsow7f7j6+B0eVikOoxm7iAMB8fEZW6cQEOhxmJSByeoquXaXAW7l0OPtNYjbkAhcPNTM2D/tnf/eUPiBMqXDZgljnxit+AT4rRarzETC54XpzGuoykMK2H0Kv/NnQoS20gjyHt/N0V5v+ENHmTzRcjp5gLLNhegZviAh3nrTaaQbS0geH852sjURMiU2i90KQQNdeVPDnXfsjSsf4xk4lsR50VgWH++YWOHKqgTRgUiu0irRmp8tpUxru+ohsnNHMWq3UlEckOd9BEf4C0Vi1bhboEjE266naRhUN9l/rwY6lmhHDxtakww7+q89525LCpSUrWG7CjYQToQWlHRPvvavi5iVYQ2h9owWA+dpcuS723F1g3lFRf/uTwb1mUFPl6kcCiGNg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6afc938-be71-4b15-d6b4-08db4596f9bc X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:11:34.1551 (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: Ndwc0dttlEvf0UkjAZ5Tx+uvDQLv/JWkyauggXCeeBgP1p1UB8ugJj6+4RHKMlbbKQDd95xopbYTPnm2EfMIZg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7125 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-ORIG-GUID: EIKEmd8HKhYWBO8pQTV797H4zd_xmm_t X-Proofpoint-GUID: EIKEmd8HKhYWBO8pQTV797H4zd_xmm_t X-Rspam-User: X-Rspamd-Queue-Id: 15986140003 X-Rspamd-Server: rspam09 X-Stat-Signature: j9asjtnwcpn1dztw3ywsjopkd168a9pj X-HE-Tag: 1682431898-521956 X-HE-Meta: U2FsdGVkX19zKrnZZ56YKU3TdZcGobMlhiIXqGUEUphd8CGSzOeP6gF661mmqLmeVMmKTw3uveAz6waSveN6PUKTgjALL+wgjBi4ytLXCfynf23/DWvN9TGrnW71hMwGFm4nJ6ffcc7hjm4lTb3xUvxjahAZeJwtNKMqcmYcum9KxybjEitj63f/qsiQy2FF4Z5oA+1Z8GOYeHGq6ViLCJFZjRtc30nRN3YYpyh5g4uOh0uMCA4PiKh8fuyzlQ7NXdZAEpvk1DZAhIqRrIASl4Z5ZTSHF5S4Ps9Pj/jW/i2IX/tVZDoyDXA6gPSPNxf1x+Vl/QFo9WHDwGsRaz9VN0ufxfHUlYnDupip73Uv/nQBtcxK73/RMyRWI+zpPUg0acjARxDkP6M/78NRPmgb0KxhcZCOlhngPb3H6qprkmBcVWDNX6D2LJOn4yPfM6FwJsBcE7Ajbni/kMdyIvXrOu+DhLu4Q6XkVsXusN9nSysD3a2LM9o8rmJfO8uYBkOGyZrSYseV9EJjfaGeWHGfTfwJUY4TLAhx3Hhq2RhdyJfCtp9F1vQCZQDpntQnjsQV53naUhQZQlEBTLFRXqk0zndZ4a5zcON4pu0BOHR0x4OY04KBbCSOnc/foeN6tXhHIdf+PHvohSmYa+WMAmNx83L0tNZGvVrket/LOSUsFWXFri3+RfC+7TfcO7UI/jmpCPnGe9BAsR7FvogCu4Qdh97LwzPKeRssCVAMgLj0Y5s3f59F1VxsT9PsOL8yqJCuWQWzWxE7J+85aA4SzBLhA97O/YA49OENjmeAYLamir33Uu1st8M/Z4FO6wsEviHkLL7zJHaeTLkTs3y+w5UTac9GgqHwShE7d7KYyDYdNQKq+Xu4QtM95MH1c/JM5/eJQvx3Kj8goEnusVrwf7QLytiPDS8QRz265hLE5p70UuYH0ILndigfEA7ek2mr/3NY/5fBFUAg444E7xB/r3V TVefYq1A +j/HCrjjnc5RGMWuWN12Y7ww2+lKj9BfX3uAoiv0nDefCTlCyxzLGS/ekhaZZUKclslG6ovzqA3l7MLJ9bD2egmx8cFg3ed4fvNdjdakDu1N9Eb2/DxtfBrJmGp/qqYHqS5Em7uzgbUs9SB4T3f4dgt6Zuh8jJV+CD6WFcc3VQs+dljqUJAPwYrLMAqnPXghmJRNqo0La3EDG76akWMgF7V5Zmjo7TWm+9nv272MI0sO2s91g30Phntq/I54HIhKVeNCwMQoitSKCtAhYPgXoNrKKLpj9TQHSsKc3ygBNQVp+AQw4Pjjd/R+BudBxPmV3E2H27x1iEKfOQxpkCH+HE2n3QeelPrT1kR5yMIvWQvC0Pa1iWH601GW49cTtkdrYobP2IvRaCHs6yso7ztkjsVwQTyBgYj6no+ySZtlanckmuRM= 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 | 14 ++++ lib/maple_tree.c | 148 +++++++++++++++++++++++++++---------- 2 files changed, 125 insertions(+), 37 deletions(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index ed92abf4c1fb5..1fe19a9097462 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -467,6 +467,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,6 +529,19 @@ static inline void mas_reset(struct ma_state *mas) #define mas_for_each(__mas, __entry, __max) \ while (((__entry) = mas_find((__mas), (__max))) != NULL) +/** + * mas_contiguous() - Iterate over a contiguous range of the maple tree. + * @__mas: Maple Tree operation state (maple_state) + * @__entry: Entry retrieved from the tree + * @__max: maximum index to retrieve from the tree + * + * When returned, mas->index and mas->last will hold the entire range of the + * entry. The loop will terminate on the first NULL encountered. + * + * Note: may return the zero entry. + */ +#define mas_contiguous(__mas, __entry, __max) \ + while (((__entry) = mas_find_range((__mas), (__max))) != NULL) /** * mas_set_range() - Set up Maple Tree operation state for a different index. diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 377b57bbe6b9b..137638cd95fc2 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5847,18 +5847,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); @@ -5871,19 +5861,63 @@ void *mas_next(struct ma_state *mas, unsigned long max) if (mas_is_ptr(mas)) { if (was_none && mas->index == 0) { mas->index = mas->last = 0; - return mas_root(mas); + *entry = mas_root(mas); + return true; } mas->index = 1; mas->last = ULONG_MAX; mas->node = MAS_NONE; - return NULL; + 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_entry */ return mas_next_entry(mas, max); } 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); +} +EXPORT_SYMBOL_GPL(mas_next_range); + /** * mt_next() - get the next value in the maple tree * @mt: The maple tree @@ -5993,22 +6027,18 @@ 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: The maple state - * @max: The maximum value to check. + * mas_find_setup() - Internal function to set up mas_find*(). * - * 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. + * 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; @@ -6016,7 +6046,7 @@ void *mas_find(struct ma_state *mas, unsigned long max) if (unlikely(mas_is_paused(mas))) { if (unlikely(mas->last >= max)) - return NULL; + return true; mas->node = MAS_START; mas->index = ++mas->last; @@ -6028,14 +6058,12 @@ void *mas_find(struct ma_state *mas, unsigned long max) 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; } @@ -6043,23 +6071,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_entry */ - return mas_next_entry(mas, max); + 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_entry */ + return mas_next_entry(mas, max); } 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_entry */ + return mas_next_slot(mas, 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 From patchwork Tue Apr 25 14:09:53 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: 13223395 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 21759C6FD18 for ; Tue, 25 Apr 2023 14:12:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EB8FF6B00A1; Tue, 25 Apr 2023 10:11:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E40F86B00A2; Tue, 25 Apr 2023 10:11:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C6BE66B00A3; Tue, 25 Apr 2023 10:11:44 -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 B3F0A6B00A1 for ; Tue, 25 Apr 2023 10:11:44 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 910101C6448 for ; Tue, 25 Apr 2023 14:11:44 +0000 (UTC) X-FDA: 80720101728.01.E92EE50 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf04.hostedemail.com (Postfix) with ESMTP id 1F7B540022 for ; Tue, 25 Apr 2023 14:11:40 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=0WuAjC6N; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FdWzxGke; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf04.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=1682431901; 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=iKKn9jpp9wDQXc/pAc6us+ZOVLDwMdFNQWGi7o0zXuQ=; b=SL3U4CqqBNa6NchTliwW6BBzRYYRtA/ZnYKyKHmN2QP4kI9Pvs5JspRxe6nqSAxuPZ057X ESM9OPV87Rd2EFfOFn+j2T7w80hu1eyoz95y/KL4JxpgNbG6lej7gSjWNwkJWkE/2JhaGs I6dgFueaR+nyfvDDbde/nTNrpTh/6q0= ARC-Authentication-Results: i=2; imf04.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=0WuAjC6N; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FdWzxGke; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf04.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=1682431901; a=rsa-sha256; cv=pass; b=1gnPEaRGULoV07zjpNoJ+XVwKaTMJWLAILJrZtXyki6UQiv+MGt/0sVj47EMGoCRus6wgd eJRsRYoyk9Spd2YxP0EH7YKO5PN2+sdeYUBchXarUAQUH8odFKkVNxbg8tstIyXVjkPVGt 8aYgWNWseBg8/chql5bMdCl7k37ekHk= 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 33PDhpDJ001851; Tue, 25 Apr 2023 14:11: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=iKKn9jpp9wDQXc/pAc6us+ZOVLDwMdFNQWGi7o0zXuQ=; b=0WuAjC6NcX/tDiIOb06wWRpnbSAXWDFgfW52of2VYCKiDXqX8pL7nP4/v0qMDEn/Cpck kosVzk9gK11Rwk/sQZzN8gKXrzOQmISPVNHrgSZcJEpo+PH6gAdSHnswvEdgUt2XxTf9 4TsHuCvUpQlUGy+17AythpQkdePcjT1LMBCokcVcwPc/eAJXgKMY/XZr4ZE+mIucXhxQ DaOR/yOs2K2/g/h2nc+13xPJFuhydSlQp255GMzvz2rWvA9a7BUz9sXgAbqZsrgoXHrq MsUu+nSNdpjBFDoXjRVw2JJi49Bwq7BqPFji/1HXj276h9SyW8uZCam9QBvYOymJ3rec 5A== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q47mcwffa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11: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 33PD909b007380; Tue, 25 Apr 2023 14:11:38 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616gf25-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lCdEeb/T+7Xpx/LeQ3xXosidA2QHQW3IybPeIRX/A96SQUq4E/ZijyDkVD2xhFz5r+ToCfzWio2DasB+ygzAmpktMJtGSuIXSNR/wHSTIYVtxUzTG9ItxV5zg6AJc9W8FQ/dIxCS4XPPsFc1u6wllJtce6IYR8C2dpk7OR4cM/JVGxoUeV2xNk0PL8FjAwf1+r/P7S1ZIWXvtRbGLHBEvU8QGdAzLMRKtWMX/PaGyEprGivjrfAV9j/Xes0i0Pt8U9uHaET/fsvgjFPq0Z6m0cW4wOYO1VN00XdO1j+CfyCuiHCxkUYW8JfRD4C6NqVAR2NMXMpHfN7ROe3dtRgqGQ== 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=iKKn9jpp9wDQXc/pAc6us+ZOVLDwMdFNQWGi7o0zXuQ=; b=TDDVU0vkb0uGzymsjHIa/Rzq1shxjIOSyJjFvh2VcqgDLsrX1zTAHr235CqtpKymADMVPpc7QNVYl1anvqKSvUTxHnS8vja/o6OegivdrK2JwmqZP3gjVsOairlbp3UL1cryLzLTxVb5E/G66tF1sRjJp5avysB58sUSvVQ7Rs3G5OKeuNCP6PsxKwz0FgLyPDsIH4PSYO8ZU8JDaz6b1hfhN5eWLWgAm8NNOgFU3uaVzEu6ycFBMVMVBMLC5sKqKhpJjpiOoa2CHmhHezbwfZ9KDLgzlS2aoQvpPl2/tUUF23cnFbnQ3a+NTM7xf1tiN86n2p/W2JWwl3M/eQI4hQ== 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=iKKn9jpp9wDQXc/pAc6us+ZOVLDwMdFNQWGi7o0zXuQ=; b=FdWzxGkeBEAIrWdzAOBn64ux3aqpoMpP+sHVvuv7C51xPveNMPTrXdDSZT8jkZHf22ER3JZBSDL8UO9OHXQK83Ls/bqyySVH/psRotoqPfmxzAazTrZKdbf06j2cCOfq6h15puT66y7kpSxy3g8GsgOixFoPdVZi7+P3/vFdKb8= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DS0PR10MB7125.namprd10.prod.outlook.com (2603:10b6:8:f0::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.20; Tue, 25 Apr 2023 14:11:36 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:11:36 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 32/34] maple_tree: Add mas_prev_range() and mas_find_range_rev interface Date: Tue, 25 Apr 2023 10:09:53 -0400 Message-Id: <20230425140955.3834476-33-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0371.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:fd::20) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DS0PR10MB7125:EE_ X-MS-Office365-Filtering-Correlation-Id: 9b816514-4344-431e-5eb8-08db4596fb0f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LmZsL8axCvXwODMKH928AQr8MujmXuBMH8CBVffkW2se6Zuls2e0MY9DaS06YRu4KmaqCF2fyTVw5MmNa0U5HSAa30ymwY7ZZNx++RFn9OzSUZ+ii+bUgC7+i7MZQl9hF52SCirbzcMZsRqH3Q4d3e9NxB9LIy1/pp6KqGhQFlT5472QHxSLBe96MV1w6MH871w/9YZp2m7Ijyuwydk34Me6hiFiy4c5pPP79NTs1yuwPj1AMvfWG9V+UDNeP2jsjxGL2PKd1gviDpQwT9R67U/eKTidHkW0brVL8d9Aot98mb+4QpLDexBXIHdNfjoem4r8kjyMwt+xdK3FF/u+94oWWcM4X55eDLJIg3VhwEY8ZtvYLMpD0tO5Hl59dyqXcGePlVuydEIS8EhQxFXFCozNOn2na9F8GXsD/6ONNL6DVprs5o7Cbntko40t4T8pVq4Q5qBfoDZB53LXf39IHlfEwg9rFE+uJik14GNVzg4z0dobs7bkp6ChIVTyXYA2xX6by41Bb6A7QugjGqGDL/MJyC98OP8KvclB9o/i7RgLrD98JFsB4Eg4b3clbpDZ 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)(376002)(396003)(39860400002)(346002)(451199021)(316002)(6916009)(4326008)(38100700002)(41300700001)(5660300002)(8936002)(8676002)(36756003)(86362001)(2906002)(66476007)(66556008)(6486002)(6666004)(6512007)(6506007)(1076003)(26005)(107886003)(478600001)(2616005)(83380400001)(186003)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5PvYoXL9yWwIvFLR1yxE0Ym96pWkjpFJLsG6C2P0VfJ8G3J8o1CktgiWqzUofr0q5XZ44u0XNolVle23RTYXW2LkaOojL9OOvtPbWQxPpWADDxZgqhHG1v/BV3hbsZzdToDveyUydjD0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kzGQUO6MI6QJTSQ89WP9IQ7Sm5xeDdh6r8+JnRXt/25LItXaylWbuRSeXtGbY0+GeURQeOrrOsDl4bjKxUMMpj/6HPaY3tK+8Ms2P0BhEMvrTTqmb43hq6n9ohFWQ0318xMvBrO2mOx+RaxkZkark23bgbqn1EbcPSrv1B+QV7rSynTKzEYu4E9M6FDHBgECVbf3VCXItnvMeXL31EmPr7Y1gyc+erO22tvTHZqDWpNIxaDt6quGXI6cJbhNtLPuHMkHdRijj4hTzm8K0QuuJwHjz2aFR8GkWaJLiQgii6MH140ew== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b816514-4344-431e-5eb8-08db4596fb0f X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:11:36.3634 (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: I7uqp+UdEH9ZvTY1PI6KqRNiPRYrSan5DN6iDEcAMCqTElZ9iFLtbFzpXC8IAZZQ9mnkDltOqp79pC+CHbXfJQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7125 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: Y7SibdWNp3_ZxG2DRWxichY3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jasXkXLI7cDLx0bnrxsGezQi8caNTP2nMv+S4xExE7qJn70tcBSgMeGzGwmQfATsahAQRXrKJaaoj41SBQqw kfEylLTg 5AtHHv/2r1L2LhAiQPupdXa4S+a3Of/bUvhD51Lmvj1C7tQdxzGvr+EFGl7a5t94lVodTJ7qfCMkKrDzrZPA2bgZvyKXadkX55I1fyCZpHcHsHU3Yl6qy9W8iqf3sQGQp9bxhdipxxl5lcWCIAIwDamRALSaVJcv+YNXiQXgKAbM8qSmdYO2r6EOsqgr8GbfBPjCXvMLliXSHCXTwNycG4HA7ZFmzeGNxfOPaSQo9SlQKJuVHmHzZ0Eqv/VPuQWAYiI80DSFW9nTdS/By7l6PWl2FLbelgjVX6Az2LTphz2WeHS4ROwAKlDdQ0AIo7AoPTT2wctThbQxaH/cZRm3m2rlYIRhOB575iutRwzwo1AXZ/GxAZZdPHGe+wAfAepUnwN/BG4I38wctGOTdPKSKx22wv5g3ioyjKgyO+VPtUqlIoo0= 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. Signed-off-by: Liam R. Howlett --- include/linux/maple_tree.h | 1 + lib/maple_tree.c | 163 ++++++++++++++++++++++++++++--------- 2 files changed, 124 insertions(+), 40 deletions(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index 1fe19a9097462..bddced4ec7f2c 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -466,6 +466,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 137638cd95fc2..04b73499baffa 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4852,7 +4852,7 @@ static inline void *mas_prev_entry(struct ma_state *mas, unsigned long limit) { void *entry; - if (mas->index < limit) + if (mas->index <= limit) return NULL; entry = mas_prev_slot(mas, limit); @@ -5938,18 +5938,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; @@ -5967,7 +5957,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)) { @@ -5975,18 +5966,65 @@ 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_entry(mas, min); + + 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_entry(mas, min); } 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); +} +EXPORT_SYMBOL_GPL(mas_prev_slot); + + /** * mt_prev() - get the previous value in the maple tree * @mt: The maple tree @@ -6134,21 +6172,17 @@ 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: The maple state - * @min: The minimum value to check. + * mas_find_rev_setup() - Internal function to set up mas_find_*_rev() * - * 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. + * 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; @@ -6160,7 +6194,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; @@ -6168,14 +6202,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))) { @@ -6189,22 +6221,73 @@ 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_entry */ - return mas_prev_entry(mas, min); + 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_entry */ + return mas_prev_entry(mas, min); + } 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); +} +EXPORT_SYMBOL_GPL(mas_find_range_rev); + /** * mas_erase() - Find the range in which index resides and erase the entire * range. From patchwork Tue Apr 25 14:09:54 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: 13223396 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 4087EC77B73 for ; Tue, 25 Apr 2023 14:12:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C6F786B00A4; Tue, 25 Apr 2023 10:11:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BD30A6B00A5; Tue, 25 Apr 2023 10:11:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9FBF06B00A6; Tue, 25 Apr 2023 10:11:47 -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 8B3BC6B00A4 for ; Tue, 25 Apr 2023 10:11:47 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 582BBC0220 for ; Tue, 25 Apr 2023 14:11:47 +0000 (UTC) X-FDA: 80720101854.19.78F17B7 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf24.hostedemail.com (Postfix) with ESMTP id 5736E18000A for ; Tue, 25 Apr 2023 14:11:43 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=ghpWIYvt; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=UanMrA4X; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf24.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=1682431903; 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=3DfKy7f3QGztZoG4jh+vukpmsr5aWh+KzrUG3uqoicQ=; b=1Y4NdL04cTsXS30/hy5mEKiv/2Rs6Uor7AHdEcKLRhmLL0MjvKWMycQmIEsCFlRQXunD2U OcbfgQefhU6UxEYsofnGmLTCFXkMqY4XApD+VJ1OWLYJToZch6cHsRBiOr43jTDqAQa/mp Au/V+aYVa7UZdB6vA2WYzQYvD3YRbJo= ARC-Authentication-Results: i=2; imf24.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=ghpWIYvt; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=UanMrA4X; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf24.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=1682431903; a=rsa-sha256; cv=pass; b=MpPgXiYsdsPxLufHKMmbPWNWQQoFjZFRHCBjmOAlovDvC+TJHn9NSusgkh7fpIFroyhtPd IhinLK5n5rrls2la9EwfZBfa0r3jld6rbGVp+bL9x4F9RRa74YujqueaOi+2U1d+7M/9wk m9cBFBrrvyMgrz7+bRorMG5DYseMUJo= 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 33PDiZQG006067; Tue, 25 Apr 2023 14:11: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=3DfKy7f3QGztZoG4jh+vukpmsr5aWh+KzrUG3uqoicQ=; b=ghpWIYvtEN1eKmgENBEwrDiNTS4Igk9J9Q7APWdfkby69/zBrxXIMUXU4OJUMwEA6ohm dbbx8zHJokmrXWvmwDT4VwHRVm1UcrFp04YW8UIINuuOzArQJo/3PfKLpxjgeC6cOspO yowXIeZtsviWB5VdW/c0H+ZY5ypVVgThwxYUIKn1OnmESHUcchkm0CHsghmk1jOm4Lv9 3b5M73ScVuXQduBDgi5TUr6QDcMnSSjIvZvA3TkoPUldrMnf+pyvMmQLR9Fdaa0vHAya RQFRIH/haekxp022k+FVAIQIsydO9BETFC69SwLbs4WYwm/YPI7yhRqiI72bfz1LLq0C bg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q4661wgpp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:41 +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 33PDUxeB006663; Tue, 25 Apr 2023 14:11:40 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616gt1p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AGY/Re3s7o3YcaU/vGnHRXfLr9sQagVcyYKR+ShQTnOgxIJo81vLVYl/4jGhhMRhrq4Tt3cx+07A5TR9lV0T5PxYh2po+jn2Nyqm8yfkMD4dIfetM+6VJG9fSS41rQnCQd9a5kVc2qEYUCW71TsdHkXpH62KQ1H4UUgjSobpwBd3K3uGC3U5uW4tNMW2IR0HlJVy7QpXbeR7vTJlcRo6SWi8tWCx00CQN+doNSGEcL2i14RwABfrfdjOXh2vAaVQPaYIg21IE6PPJAqSTFd4lpoj2XZgipwzWmSMAqK2XLzrpKyC85OBT7NdhLqUWwVGJBXAhllG8PscoynN7gBmiA== 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=3DfKy7f3QGztZoG4jh+vukpmsr5aWh+KzrUG3uqoicQ=; b=NuH97YwM4HsSa4hDwfkElOgAwVK/qeFvfTacTH0D2CjxpXxZVVaEKrlIgyV7Uga1TNB+TcvsqYi4ZzmictfMSZgjg1d5rkhcJu6DYLJhrIgrXdISbBdDOng1cK89StpUXCEW6R379CoYp8KNBz9gfuSIprYnNdIiAw3V+VT7agcU/MKenDHXoDtYeCqYTiEgHYi4FsaEHJIXjbOIFQDE6LvS//yjw8n834cmYHF28JbrOU/RSovzgcOfmwBldMQs/nyFkejM/OQ/wkF52bmxzTNu1mH5p9lHzRd1MFLnrqjNgsFLCLQFqSfGaTs/DpV8VP095c7ukqCmnzuB90A94g== 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=3DfKy7f3QGztZoG4jh+vukpmsr5aWh+KzrUG3uqoicQ=; b=UanMrA4XNOaMbOmIq80eO03g1MW6VWxYszPNCKdr/yK8r+1A04hYYawUBjWnEe+wxQ6Ef/OpbUMl7+qOX2QoFbTfFqy7tly5uaT6SmQWVcB94N6PV+lsPruQtqfL1w9wXit6kJOEf/HESrd6nGhnpF2q9bTnle3aF1Icbuh+Avs= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DS0PR10MB7125.namprd10.prod.outlook.com (2603:10b6:8:f0::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.20; Tue, 25 Apr 2023 14:11:38 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:11:38 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 33/34] maple_tree: Add testing for mas_{prev,next}_range() Date: Tue, 25 Apr 2023 10:09:54 -0400 Message-Id: <20230425140955.3834476-34-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0135.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d5::16) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DS0PR10MB7125:EE_ X-MS-Office365-Filtering-Correlation-Id: 09903fc9-71b8-4d4b-0dc2-08db4596fc69 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VXMupEzGnDy4wHfjrQGrm9jFrzMBY0xvOeCdgOLFJSM6jeGfosxbsOOjy/GokW/2BmXZDCqsQXI17qvvfXVXU886X4oJu7kqhKW2tMMwPFxymXc7VbhjftUyA6KAhGd4ldttS04ncok8OjQDbqJ3iA3+5FVzKukr8/vNCSybcmFvYRK5dbu9dQ+JaR5sSe2IFwPRVXn53YWl2YdXDc4M1mT2S66YcaP/1EyTfSe+VZl5cLmEa8Vg4P6EK1lcfLfl5FV6gvFpcX0STrYdj5s76ukvhnTW6z2WxbwkIEtUoRgEyE8sMRNgSWmBTlPb/K7fbKf2juDkz71Leny9rA8ie3qJyrNQKuMH8cCdzS3SH+vGmYGM5KJrcJBGnA8MJmmxHFnLJ0hY49rv9RInEGWeyVA+ngAHVWxsop1G8XXNgd2G6VKAD9Bj4yUeMfauJ+RU13pxjJMv9PG5T/Q8gJHl4WBHHEej0kJpTrOLmnioMcy7C87avmhhiMt4Zqa13pkV3d6epKltq9kQGtLNTmCAA9SUOeopIKtyOihXnpZBegrsHvvI28yzU6gkru8JD+zY 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)(376002)(396003)(39860400002)(346002)(451199021)(316002)(6916009)(4326008)(38100700002)(41300700001)(5660300002)(8936002)(8676002)(36756003)(86362001)(2906002)(66476007)(66556008)(6486002)(6666004)(6512007)(6506007)(1076003)(26005)(107886003)(478600001)(2616005)(83380400001)(186003)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ucV+D3VuzXfS/Ud6oIAmmmyq9j/blPPvzKjE0XSRXGH9YuIV4uCTSgVZMCUGzUWMk7ICwCZcl+hZpg/TTvVrerqY4SwMaaYIh62DGj2ueyOeY/Ow0Ef3J+MlO/fgrLJ7/Gj+J8otDiwZ/B76x6uzMUWRigoKzV2fjWDE0jQFfWvkjPrRCQe5hFinXgtd16QL5DZ6nOG/ppdDlpO461rOCmltotAuI3ZZam50k3YvZ+CVfVFQlYXHknCWaCUOYChIBlj0bQVxRj3FzBmIamuHOi9w9BhR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FKcAEv/U1q0lNr7K8+nKQxtWQcx2cq3OeYGWxz9JQnrrkbWm1/k55tpoYODStLQTEfUWf4tobbqeNWIjzHPEoJRjhtwMp06r56IA5RJLBxn/jRfTbpjjcq2wQ3BhNPtMiM2enO4ZSnVYqKjf1XjT9TRWAzLFvc4hyle7S86dvWRbcXjvYQm4xpFS746Q== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 09903fc9-71b8-4d4b-0dc2-08db4596fc69 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:11:38.6045 (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: GblnROLj/y93IeG59GyQCJeIFJv/Yg/6Z2Llsnxjp2Zcu7a37ZeyPubBcO7WMzZ6Jk6yIOQD/7yiucnVMNAErw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7125 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-ORIG-GUID: _JD2u7UsrKi3xpWhhpuNHo8WsrdfRgI_ X-Proofpoint-GUID: _JD2u7UsrKi3xpWhhpuNHo8WsrdfRgI_ X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 5736E18000A X-Rspam-User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YtEFXQ7AoZXVVzFJKU74B8IzwYoHcTEFLW9GjlxQ5wuseeiGJDKfWBgUaDrYIX9hGlgzzKpqWQa4dOmCM0alr+sMIaAP7iE9rBLYzpAkOXNhYqHRHOOaaxB0znLappEu5TH9ALCI/c0DpxDcFZzvag4KFB8CTpNdn8hltiM2P1VdxwMJdoLPB+DXtN3gFvAuNh4lVQPP0AKTyFLrTqy//pb6egwKPvCGTnZqBsV63Bh87R49OoB1aRP/VdiVFtOtxkfr8gUhTx3w/WetoDHVGdtTIWhWTyj5laWUmf55ZXeQ8kk9KfBHwKwzvPawoP8MeJ6IjKHG6xu28lUOdtSkwo+AZi+98iZpFjeN7wLzUUDPO9KF2ObIgoB8gIFOGq7RT2PSFP3GQ2PgPtaTpeYpQi1BrH2GRxYk= 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 the testing for the new functions to iterate per range. Signed-off-by: Liam R. Howlett --- lib/test_maple_tree.c | 148 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index 7b2d19ad5934d..adbf59542951b 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -3356,6 +3356,150 @@ static noinline void __init check_state_handling(struct maple_tree *mt) mas_unlock(&mas); } +static noinline void __init check_slot_iterators(struct maple_tree *mt) +{ + MA_STATE(mas, mt, 0, 0); + unsigned long i, index = 40; + unsigned char offset = 0; + void *test; + + mt_set_non_kernel(99999); + + mas_lock(&mas); + for (i = 0; i <= index; i++) { + unsigned long end = 5; + if (i > 20 && i < 35) + end = 9; + mas_set_range(&mas, i*10, i*10 + end); + mas_store_gfp(&mas, xa_mk_value(i), GFP_KERNEL); + } + + i = 21; + mas_set(&mas, i*10); + MAS_BUG_ON(&mas, mas_walk(&mas) != xa_mk_value(i)); + MAS_BUG_ON(&mas, mas_prev_range(&mas, 0) != NULL); + MAS_BUG_ON(&mas, mas.index != 206); + MAS_BUG_ON(&mas, mas.last != 209); + + i--; + MAS_BUG_ON(&mas, mas_prev_range(&mas, 0) != xa_mk_value(i)); + MAS_BUG_ON(&mas, mas.index != 200); + MAS_BUG_ON(&mas, mas.last != 205); + + i = 25; + mas_set(&mas, i*10); + MAS_BUG_ON(&mas, mas_walk(&mas) != xa_mk_value(i)); + MAS_BUG_ON(&mas, mas.offset != 0); + + /* Previous range is in another node */ + i--; + MAS_BUG_ON(&mas, mas_prev_range(&mas, 0) != xa_mk_value(i)); + MAS_BUG_ON(&mas, mas.index != 240); + MAS_BUG_ON(&mas, mas.last != 249); + + /* Shift back with mas_next */ + i++; + MAS_BUG_ON(&mas, mas_next_range(&mas, ULONG_MAX) != xa_mk_value(i)); + MAS_BUG_ON(&mas, mas.index != 250); + MAS_BUG_ON(&mas, mas.last != 259); + + i = 33; + mas_set(&mas, i*10); + MAS_BUG_ON(&mas, mas_walk(&mas) != xa_mk_value(i)); + MAS_BUG_ON(&mas, mas.index != 330); + MAS_BUG_ON(&mas, mas.last != 339); + + /* Next range is in another node */ + i++; + MAS_BUG_ON(&mas, mas_next_range(&mas, ULONG_MAX) != xa_mk_value(i)); + MAS_BUG_ON(&mas, mas.offset != 0); + MAS_BUG_ON(&mas, mas.index != 340); + MAS_BUG_ON(&mas, mas.last != 349); + + /* Next out of range */ + i++; + MAS_BUG_ON(&mas, mas_next_range(&mas, i*10 - 1) != NULL); + /* maple state does not move */ + MAS_BUG_ON(&mas, mas.offset != 0); + MAS_BUG_ON(&mas, mas.index != 340); + MAS_BUG_ON(&mas, mas.last != 349); + + /* Prev out of range */ + i--; + MAS_BUG_ON(&mas, mas_prev_range(&mas, i*10 + 1) != NULL); + /* maple state does not move */ + MAS_BUG_ON(&mas, mas.offset != 0); + MAS_BUG_ON(&mas, mas.index != 340); + MAS_BUG_ON(&mas, mas.last != 349); + + mas_set(&mas, 210); + for (i = 210; i<= 350; i += 10) { + void *entry = mas_find_range(&mas, ULONG_MAX); + + MAS_BUG_ON(&mas, entry != xa_mk_value(i/10)); + } + + mas_set(&mas, 0); + mas_contiguous(&mas, test, ULONG_MAX) { + MAS_BUG_ON(&mas, test != xa_mk_value(0)); + MAS_BUG_ON(&mas, mas.index != 0); + MAS_BUG_ON(&mas, mas.last != 5); + } + MAS_BUG_ON(&mas, test != NULL); + MAS_BUG_ON(&mas, mas.index != 6); + MAS_BUG_ON(&mas, mas.last != 9); + + mas_set(&mas, 6); + mas_contiguous(&mas, test, ULONG_MAX) { + MAS_BUG_ON(&mas, test != xa_mk_value(1)); + MAS_BUG_ON(&mas, mas.index != 10); + MAS_BUG_ON(&mas, mas.last != 15); + } + MAS_BUG_ON(&mas, test != NULL); + MAS_BUG_ON(&mas, mas.index != 16); + MAS_BUG_ON(&mas, mas.last != 19); + + i = 210; + mas_set(&mas, i); + mas_contiguous(&mas, test, 340) { + MAS_BUG_ON(&mas, test != xa_mk_value(i/10)); + MAS_BUG_ON(&mas, mas.index != i); + MAS_BUG_ON(&mas, mas.last != i+9); + i+=10; + offset = mas.offset; + } + /* Hit the limit, iterator is at the limit. */ + MAS_BUG_ON(&mas, offset != mas.offset); + MAS_BUG_ON(&mas, test != NULL); + MAS_BUG_ON(&mas, mas.index != 340); + MAS_BUG_ON(&mas, mas.last != 349); + test = mas_find_range(&mas, ULONG_MAX); + MAS_BUG_ON(&mas, test != xa_mk_value(35)); + MAS_BUG_ON(&mas, mas.index != 350); + MAS_BUG_ON(&mas, mas.last != 355); + + + test = mas_find_range_rev(&mas, 0); + MAS_BUG_ON(&mas, test != xa_mk_value(34)); + MAS_BUG_ON(&mas, mas.index != 340); + MAS_BUG_ON(&mas, mas.last != 349); + mas_set(&mas, 345); + test = mas_find_range_rev(&mas, 0); + MAS_BUG_ON(&mas, test != xa_mk_value(34)); + MAS_BUG_ON(&mas, mas.index != 340); + MAS_BUG_ON(&mas, mas.last != 349); + + offset = mas.offset; + test = mas_find_range_rev(&mas, 340); + MAS_BUG_ON(&mas, offset != mas.offset); + MAS_BUG_ON(&mas, test != NULL); + MAS_BUG_ON(&mas, mas.index != 340); + MAS_BUG_ON(&mas, mas.last != 349); + + mas_unlock(&mas); + mt_set_non_kernel(0); +} + static DEFINE_MTREE(tree); static int __init maple_tree_seed(void) { @@ -3621,6 +3765,10 @@ static int __init maple_tree_seed(void) check_state_handling(&tree); mtree_destroy(&tree); + mt_init_flags(&tree, MT_FLAGS_ALLOC_RANGE); + check_slot_iterators(&tree); + mtree_destroy(&tree); + #if defined(BENCH) skip: #endif From patchwork Tue Apr 25 14:09:55 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: 13223397 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 7F56BC77B61 for ; Tue, 25 Apr 2023 14:12:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 011D46B00A6; Tue, 25 Apr 2023 10:11:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F040D6B00A7; Tue, 25 Apr 2023 10:11:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D325C6B00A8; Tue, 25 Apr 2023 10:11:49 -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 C00FB6B00A6 for ; Tue, 25 Apr 2023 10:11:49 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 7C31212023D for ; Tue, 25 Apr 2023 14:11:49 +0000 (UTC) X-FDA: 80720101938.17.2550504 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf13.hostedemail.com (Postfix) with ESMTP id 35FFA20023 for ; Tue, 25 Apr 2023 14:11:45 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=r+Wxk7lQ; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=paszQA8S; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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; 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=1682431906; 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=lSws5H0p2AZUKlOXUrhiWvpa5Tl3YjQZDc5LQJ31yD0=; b=IvUrf/zaPSQUu4gNT2RdPM0kco8N/hZT6ZpwqcslzN1327nemB+dHF7GGWHkuTaID4rHR0 /ahUbYvmDcttnXxuh9zxQwAP0/nGyzPVwSkKx2/ckmy8fkBOtrcDTJf0tHXFPWtBMcofWN y3dV3k8CC5hK0+hBV3LfJGZn4RA5P1s= ARC-Authentication-Results: i=2; imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=r+Wxk7lQ; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=paszQA8S; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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; dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431906; a=rsa-sha256; cv=pass; b=5CLtAZ6hmBlGbvnTK0VEfxZ2zeOsOYOo7czcaG7QxZrQGovnfDxezzr4VYC6ZNs8QhTu0s M5L2xxx6fiSdEVuLLsvTr8IZZCevZbSwVtJ9NlvYHyNbDO93pQ/isEG2hnxd6QZLNUdMxj c6dluAkjSbSR5piNaWPO38SyrrsHG6M= 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 33PDi8r9024340; Tue, 25 Apr 2023 14:11: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=lSws5H0p2AZUKlOXUrhiWvpa5Tl3YjQZDc5LQJ31yD0=; b=r+Wxk7lQ8mwaGsBaq6aPKOVsENveRG37/EF82nesqvTo8E4/CvOl7HaomJUI8Wu8LeYl Vc6AyYZUR+PbsXPw8k6nINz1fQTKqCezF2BOadnKDJCUeZFrNugEk5H4KP6JH73eXWim sGHVv8N3WWLMpT/vwq+F4Z+Olu+PpobmLi+C3m1afirEgPtOgE6r8fB1Kys/Vj6L1fn7 +V8GEFHmrbuNRNRMwdseDAnj9QUWuGQhd07IMZLepYPt9kZMcVmnao/XuMbjTjVhYDLJ fCqfYbRGYZN1OwtkYQDuzxAORMCuGl6dEx8sVcoUP9IMreKE8JFo5yHs0a6Ijm2Xf3T4 0A== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q46c45fy8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:44 +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 33PCgvYc008521; Tue, 25 Apr 2023 14:11:44 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2172.outbound.protection.outlook.com [104.47.57.172]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616qq7c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nE6mJEd/dWoCLUZJdkdyUcVRwRKWadeR61W7g/NnnCt3TV1Mu3pPMbQ5mZyFuwBEjGjZlA3nn6yhZ8STLn7EVigVodmECxcqZGbDkxKfLYXrOQ8q3TUUMyvMjyuB0Vu2OQppk5P20nlhRkoifaY5M2i3arG3b3nQ5sb1LmIo+C7Z4BFb273Y1KLS1GOrI3KlBGcJQZ66fiHnVSptlW8kw8KKEfKa7I9srQewHZon3yfCCUskEzdv4CW86MgkPfc4qmeZFItIuawdk194mSi01y5hPWJw6v3KttDKWhjZXnPB+DQ5vlUbzVg0dlfblt5C3j6zaq137cKiKLB6h2M9ow== 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=lSws5H0p2AZUKlOXUrhiWvpa5Tl3YjQZDc5LQJ31yD0=; b=SZ3SrxuVnPX75vMpQsHyTfeaez02kKuAO3ulMS8NVM9nmuGJ7uMSqQPnYVDiMxR/1VK+oQJZtVIVV1DHmPyyYJ9RQtFCXQ3kZqv9edu8WH6IM6iNIMFJEahhMsE5ekHljLoHfNWiyMdJod3qyAoxZ9IF4WBpEYeI6rLOpoNPBGG4Y+Eyyqo8riTVqRFhJoYeAGO/w3httv0mIFxVXJ2P1QqE9U6gFMBRDKm0pBUoOXfEBRKF2Y3juee8MCJlVUjnl31Ff+4EDy34xjaKIZ2tJbJptIS42iid/oq5H7oTEuOSS8FTlrKIc0jbeKZ5rgnj12v14Y5CYJ0JBnlSzZi0nw== 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=lSws5H0p2AZUKlOXUrhiWvpa5Tl3YjQZDc5LQJ31yD0=; b=paszQA8SBL+/3L/fJsRNixl38Hw0jheviZvlO7lM+NsfiWadSA7RZdlLZe0UUQta0k5NAznoRnvxyWR5Ca4Z3Sg8IEZjqztkso0hpjHf+BsdCd1lyhxIeIU/81D1hw2+kjtD8lCzssScBUD98mO1JAJ14AjHrBS9SKKJNnQj410= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DS0PR10MB7125.namprd10.prod.outlook.com (2603:10b6:8:f0::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.20; Tue, 25 Apr 2023 14:11:41 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:11:41 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 34/34] mm: Add vma_iter_{next,prev}_range() to vma iterator Date: Tue, 25 Apr 2023 10:09:55 -0400 Message-Id: <20230425140955.3834476-35-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT1P288CA0003.CANP288.PROD.OUTLOOK.COM (2603:10b6:b01::16) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DS0PR10MB7125:EE_ X-MS-Office365-Filtering-Correlation-Id: df72d563-e618-4988-173f-08db4596fe41 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jowgrgvykKtpQpwBw+Wwle0gK5E1Dm3n81jcpVaeqxYEZTmR1PiIXipgNlZHdwMFtGQgNSem29rDpSjEE4g3vhGXJdckpXdfuTTHAWKLhtgD8aMMfQIzyyFmC5KkppC7cPqTA4ceus1EdEkKWqn6+JPfh3SmWsjlMKxfVND+wShe0CEgzKVkLjR24whwG2LsIj7aS6piJSjRzprJJnpIJ8SHf9vcXEjXVQKOt5z61qCcLi9dGUROIOdsHsrvzAlONCGvdC8vA8epUQcArxozyx0ErT+raZKgSLvML/VdybiTIDG1GtVscosjRsGASxfAlBWm+bmcgpWhCJ564nxCu31e7mQ7u5n6Y9o4ez07DptUx5sYxll5Lp6BcSaf4Cvw5JHaDK0ftAA8FZsSXSk+wLuZJh536etaFGwN/TuC3cKBfj2viTL6BD/PvYuX6rDxHU0N6rbYe2/6vehB8AorvRoIIAAZiddwcuHol0c1jUvrwnPQdqqmslNcz+uy/UpShsfVpyjajouGKilQAp9ONiKL5Sq0uw/J91K+xWEyXJP+M8Xtu2RP8d6Vku+KffeK 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)(376002)(396003)(39860400002)(346002)(451199021)(316002)(6916009)(4326008)(38100700002)(41300700001)(5660300002)(8936002)(8676002)(36756003)(86362001)(2906002)(4744005)(66476007)(66556008)(6486002)(6666004)(6512007)(6506007)(1076003)(26005)(107886003)(478600001)(2616005)(186003)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ybGlKIst+zhEPMJkzW4jwkML7RO7eN6M3gaHU4LyOqloWYFKuUs9Jmo4VogRmI7LlYfsfUi6Frtz6BoRjAPOiem45OALG5FDvAqh2/5Fmj2NclHmNME7zYIqMxuOxR3vYtgH8zefVPbxbm//WsBpwfivsxaH2t06357e09opM4hQCMByYDZ9BufBJPfG6IpFc9FeAbZbvgsGwZe5F4LpekJrzbHOTeRyspkMkYAkmDFVXPFOj0pZx4P5bCwZ2FT0+Pt/3Q3TB9P3QbCNVzsJG70mRBGaIf+Bcp4uxey06w+ahRits3IeP23Y1EriYWC+JNak+wM5x2CUx6Y/yMLnbq+uq80Tb5jTIMry2CWFa6YDXjmVsqJS8uppFZCueCbcGlWim4mFcFY917lipCOmepL9bkL+Xaqd/G10kiBmH3bHV+4ChyZlQsT9MVv4p4z2gb5Ol/CBrrIqxgKvuuqE/m0qg1zjSBIgDxF+31thAOvsLaey2/kpmAtBuMn9IR1xa9WcFep3bew8IC/R6+eqcDRqxAofeLfZNl0weVjdaBA4yz2L4ytTI54Oa8GUxDCVd4sat90DVRkMZwpLq3Cx/GayNELD8yIXQPASVmgf/5VaahAvY/QgvlsRFKjYE/ky6ONfoy0TpSqY3mYnwo2Uqvd/hntcS1KwIsitkLzA9y0OsrZg3SbkHSLcwnaWFGVF4GIXin5GhxHmwnn6fOYh0Yx0mo/s+HVGF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HgzgblmwmTVCPeRwuzGISVCpUN/YL+G9nVDrh2b9SAQMsJL9xdW6dDoPMxKFG79w9t0vRvq2Q9TcAocOt2vOhKYhfnfEwUbWDYX3t0OtO4BQ75CbVTmBgHog4UHScSFKXw6jdUi8sLOAkt28GrNkuwEvhKWVlOtvG7G55ucZn4Otb+N2Krnzu+rT2svqkyOA4ALZApfIHCGpiPvP+nyLhrjFXSijOYOoRxTr4P5NwvAe5qsHgDQEtNn8cJE6wZpn2DEkxGlbK8frU6FBTmYYHTTdsT9CDImbfIrDz+/RRM5vPnhSc44aJTfShH/EdpPAzVC4EYLMJ2DCrrflbQOWWw+X8VePzP9ZEv0NyWh9gkCqIJRfOOrjEXRHctWAWrh1xIpNQssQyQ1my3Srr8CKEuq/qU5X37+KXbW3WKgW4V1OwkVlNNXH4k2gE+f0avRzpIdoMpUr7E/cIton8ERuMWqPFwWbu2HLFO5CW88FtbfLcKK7YltVMhuRNrfYNUE0VO+q1Vr3YP4o7aZF6MKWpHAljzMFIB0qNaB3+KU974lkFu/qVjCHZNRLELQ11svE7zR5L/F8AjoPFKb5GLMGe5halIqG6jHpwQZqmG2LJnMTsdoJ1RdLSso5mLbx7zb3l0zHYs/UfVrCoTf5X4K9ESAr0CcwwgO/GKay9WReuPi1iSD54/D/ak4Yc1U5w1jd0XIkktfy2VrMmkGrdt0YlSooLU8fkTtytmDZGMlKH5OFRhuo7Cxz/L33bAKb5CLQJ6rT5M23YNagKLkeu730ca4nOZHvpONrJ1RxuB7gAVjVXHyQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: df72d563-e618-4988-173f-08db4596fe41 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:11:41.7032 (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: 7bHkMxJD8QYkNCMJ7A+Fs2/o1eYY1joBhpJ90FSfT1aaYMiUoi/wKbECo/8xJA/1M+dvmHrXdTMwzlPqRwXt6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7125 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 malwarescore=0 mlxscore=0 adultscore=0 suspectscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: Cc7Rt3lLs1G2Scz0CJcJO43D1KpoIz1x X-Proofpoint-ORIG-GUID: Cc7Rt3lLs1G2Scz0CJcJO43D1KpoIz1x X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 35FFA20023 X-Rspam-User: X-Stat-Signature: g9acr1z7s8mgzo9ogjadcu86jzxnza9j X-HE-Tag: 1682431905-285093 X-HE-Meta: U2FsdGVkX187R/Bz2+hJu1HLuTwz+p0TGPRuGr1u/nXkIY85KIQoyyWkcDGLp0wsoAZGlx9KdgkpuiZ90+N/6HNHqvhchjc0+WUf4aGHzMLwE5eFzwTPsL0jyYkC0X/H9eR7M84pprik8tt32Ie6BhHyol4p/2EHkGUV8L+KUPWXsqjpeIBvTdB23QllmeFtC8jkQQ046WfMkTK0B2Lofctt/2vHAz+BIDmemtP8uJzlQtak3ztEHWXKgIPioSRuifiOfg/pExhstDJ13qpBDHOxmwkIORf01aWK1Q/dzDnNFMYLwiJXnxKF63D3U7LzkDP7tCuRgPtWNNP6Z0jHRb6FdXsRcD/5Hzc5jRvJt6Rjc0iSqox5ahthONXF8fMRRE2WoqcJ3UigoZetQRVWVG+3atUPIh0/zYu8j2o/R5JH0GnbZ5OMqbmOHSWDBvXzYjks/5axqnvKetoYcNYQtojixoyyUVciadrCQWHlFBzvTvPOZJqeLgvcG4658PHt5yhy0TfCuepiKzIBUDbqpYS7CuyQCkKZNsuSUvH7RgdKIYNac+a8R/1kOBbhiO/xWseBvQn57TnbmVP5g3CN62GuWOJHbfwMmTAXtGxSZUz28sMgp0zDYKEHMoZAq3eW8EEX5ejUOSk497KKD0f/YlSOAUvv6h58A8IMDpXxHUjkBkfscWB1L/HesbAwwV6mdHCl6S6tWLzbiJoe0PhKSiomMp5SEHMs6B+kixgIQh1yZaTbrbtWHWpc871kZHe71I5IYqYbn75WOQxxRP/470fA8AZyS5GWqLx0ybddHdkIMA38nuAVVH+pRHW1rV32PCHITFznY5itvjKPwFbEMMPUJ7PGEW3rBIEcsbRIUVsZP/6ZcLLInCyf51XXT5u+rrS0a88mN0lG4SWJge2vWI2AHgH1oYCcbJ9m5J3iWpneXC1B/lVHQKXyH5gD2RFzWY3YOue30Tz9TzdgiYQ GGy1mqUG iQSq0ys+Llfp6LufE6fwD4eKvGmvS1tuMbpULfQa60ADWSQC/hKjduprGL8OV4tppos9ke95HuNEnso+NwmVHSZ+z6c8cqB3qERo0iyEQfbPZj4TMFhoNdYywe/MMC4ZU7puICpJdZjbnXRhC5R29oC9QSGPZA/K15XlY8dXs733Q+YEE0uiIy3V+PdrAZL++ePWnCbz3ipflcOEwndKu771YcWIU576h8qpbpn9hz5sbo38tl6L0VcAn00E3FiKd3UMSGvhNlJfvm0QFdzYlV+oMCEk9mzfIkA0crOnPo/H3jRk4DH/f2z0g6yhcMiBWFv2JM1CiLF1bDWQcyIngrSnmb/gYMJ6SwPE1CdAwFMORFe/VzyGCyOCzxVpaO9ueCxUyy9J2rtOI5wN18a+sjJFQk2WXJ5nCdsxK2uPScGj04F4= 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: 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 37554b08bb28f..2cb6e84ed6113 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -877,11 +877,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;