From patchwork Wed Nov 1 17:16:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13442925 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50524C4332F for ; Wed, 1 Nov 2023 17:16:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E0C65900007; Wed, 1 Nov 2023 13:16:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D6DE1900006; Wed, 1 Nov 2023 13:16:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B4C89900007; Wed, 1 Nov 2023 13:16:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id A4593900006 for ; Wed, 1 Nov 2023 13:16:51 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7319E140330 for ; Wed, 1 Nov 2023 17:16:51 +0000 (UTC) X-FDA: 81410040222.23.F2526E7 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf02.hostedemail.com (Postfix) with ESMTP id D851180009 for ; Wed, 1 Nov 2023 17:16:46 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=NwSo2f6A; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tWgUJ8US; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf02.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698859007; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ktpTDecE9FlsB63AOPLwZ5bzAUL9RNQcS2o96pSyoYQ=; b=kSaHrUkzvdwv87YPLSIxM32UlWqFDxDY53B9PQFtXo1cz2l4XzMiC1/4LOC0eg5VjQg9Dn Gta3+C6CLTeBkf0l0PMQKzJvxhi9IOhkC+RU3vIlsPy8FSNEvMub4P31zxFQSuPWaLaXn2 5RDhFdR8Xf3ri8V4QdDQtB9unM25JeY= ARC-Authentication-Results: i=2; imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=NwSo2f6A; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tWgUJ8US; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf02.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1698859007; a=rsa-sha256; cv=pass; b=p3W4c0AIdFpxQnLZVe4P9/W6zrDZDV7Fyi8rUTlMn7+qMdc2cZcNTj1vbLg3w9BvuNsYaN WsAEogKiT2EBKQFaoHKrCXLH6eo6JZLHDISxL+NpiJAQqsmEzVjYpADtF+WDIOrR7pHipv ksGXw2hP8Vhl0JyGleI3vc00BMZGD5I= Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A1GYiEF004982; Wed, 1 Nov 2023 17:16:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=ktpTDecE9FlsB63AOPLwZ5bzAUL9RNQcS2o96pSyoYQ=; b=NwSo2f6AxF6YGSIDMM7DRZfh+nE3ekwdBrK878F6QrJNtS6Z7MfAA1LTl9KuEgGpVa5F aPmnkuFJHYbPZaf4K0u6AwlkbWQtCIOx7qgkPYwrHTSVFHos0133lR2rCXapcS2DW0B3 d2qj42i47mNQoY+ZD4V+IcMTOSmp/ifvT/K3nGL5zcqKwVthX/KXkJS/9nQIHV6OOVw2 DX/dCF/+dAuV03IjuMCYQJ+ZwtbBtBctEcDV7s2MRpfUhfb7c8CkhGmkf+7PlUILbujV Y6J0ie8wB86i1D73usf1irPsgB1bMp6YRrFsvtPANo74uix6lSV/DbVe6TjdYvve+SK/ AQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u0tuufuec-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:45 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3A1Fkqbi020283; Wed, 1 Nov 2023 17:16:44 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2040.outbound.protection.outlook.com [104.47.74.40]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3u0rr7d2he-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Nov 2023 17:16:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aTSmxZ1wezIDuQMC4YJOmia8ibsmjoVhf1flU/C4WKEYnGn6M2NJhYr9sb3XzgbsSJ0UarKjT36xpE4AT6FI93ktgYjXFA7O1NQqKVafwq5/oZlNydR31LKKFeRycl0U5cx6HCPUDAYHZ2vermAEKfFVWREeoOIwWHdV2YRCAc/EqnqbPaDdSZfy/M6RLbxFnpPvchdAb4mlKCw+nMptUvtwK+db0603+vbwQljls9Jul2BzPdCZ/TXoPuUIoaR6AiLe3c/MVkWbCWcfOOINCPVJblJ2QvRSnLqazTvRvtU4jP6/aYWciTy6oGeYrHZSmwf8TZqdG6VAysC4BUCL5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ktpTDecE9FlsB63AOPLwZ5bzAUL9RNQcS2o96pSyoYQ=; b=cbS4bvU/CvQfpM41uH0d/mrWf/KCVxDsGyMIvpklDj5UXlAs7le7txJxY8Smme0alt+gPwhuWqRURceDjKAwfuWxdCHG+s403+QFZer/6FJCw3KWhhkriZBUMgijjQNjSg673rUet8TFZXI4AOgmMGRXXGeBWxizSzSUu6yVY9lLkntzWdX2qW8FluHbCIeUo8DQevyekKox/F5jeyJ1l67rrHzURrbzxP5KeXq3epg+S7eX+lgDpD2sGNx7VBCxSg6hLVDQG1QK4ABe8YIaR/Rcy3zTAhnutUfr7IToDLFY4x3Z3a/gRfNs0AXXk0GLGn7tZkWxnFH26mXW5V4ozw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ktpTDecE9FlsB63AOPLwZ5bzAUL9RNQcS2o96pSyoYQ=; b=tWgUJ8USGKikxg5C0v4OjzwGdraTwbD0WRBSKoydV5IILcwfzDnZuJwdgfAY3G7LafHPAJaRkXc/qb76CzF5hVB/MRu9NqVcF7HqkC4NTfkHKIR/Q7IfOQGvBpTqgpsVkru8nf6tOK/wpWBGTAnUhv3+kLGAPAvGeut4wfmpT6s= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SA1PR10MB7684.namprd10.prod.outlook.com (2603:10b6:806:38e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.31; Wed, 1 Nov 2023 17:16:42 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8979:3e3f:c3e0:8dfa%4]) with mapi id 15.20.6907.025; Wed, 1 Nov 2023 17:16:41 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Liam R. Howlett" Subject: [PATCH 03/12] maple_tree: Move debug check to __mas_set_range() Date: Wed, 1 Nov 2023 13:16:20 -0400 Message-Id: <20231101171629.3612299-4-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231101171629.3612299-1-Liam.Howlett@oracle.com> References: <20231101171629.3612299-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: BN8PR03CA0026.namprd03.prod.outlook.com (2603:10b6:408:94::39) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|SA1PR10MB7684:EE_ X-MS-Office365-Filtering-Correlation-Id: b4cc36ce-a02b-474d-14f1-08dbdafe5102 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FXEZamgLMUhvIjV8YO5Qf/U4Kq4f78SXE/gmA767sdPskoyOyRmGWrgsDyCdPw75YAh+EO2yA6tUiUc9HM3BRxzzfuyXK5RHk0kliXgq8B2hwd6/P69R5MdlDzdU3MnaITlg2yfFYb/P+z0ioLG+LiGcZAqq/riIa3BOJosT4R7S46defUNKVsFsvpzPIrvg1e0FrIvqrj5GI6F8AWRx3NaeEGKU0QCS5oJ7mc48Abm/dgNIj3kxmZos5c9sez1amaUQIIERdcLzE4c09aRjiCDY1nObFUiY9Dowisfet5bCV5Z1svUDCu/CjNP+cbWlaRV1ken0gT7Jw/YBhHTsTsmkW81D1qxKuH+L1tUdpoJrSOorSm7qs+e2DMO9wDud2LW+y3e0DFmlIfwUgrNfEQ53SJsk+2OTeJPlRfHnPEkwSNQ2oGQVKZCxhLa7F4mXO27vlPzOWP1DBYVox2PL0AtiyZxEM8kI5PtU66UMYTHIUoGlm/W5hO0aeW05g6eaZ1Uz5UdY6PT8puwIXMbVSQzQ2lMhXWVsOWciX58JjO3HZgJ25ZVtW788AN3Tq623 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(136003)(376002)(366004)(396003)(39860400002)(230922051799003)(186009)(451199024)(1800799009)(64100799003)(6486002)(8936002)(2906002)(4326008)(30864003)(41300700001)(8676002)(5660300002)(6666004)(6506007)(66476007)(107886003)(83380400001)(1076003)(2616005)(36756003)(26005)(6512007)(38100700002)(316002)(86362001)(478600001)(66556008)(6916009)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-M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ajyxc3daSgR/+CmwcUHHD3kNyOeImm/eYolSorcdNT5TScMmo3df8dciSl0jPVeiQ9nliw7F7zu1zFdOgy6zs9i6d92Qo25hXHNP/oIMzISthFiu/mHrsoLQYqaiQNUzorbZbuSycx6/lhWCe4uRXbDVSUH+VSIe7aEUaoDwPO5b+NHk5W6fJ1k/4IbWsJmVh+Q87O8j9ICcJ5qSzpCYCvQWQJWfsjWfi6JZlh+GEv+NI3mJvLLE/VBMifkR0wRfntRMmERRYJA8biHTrZ5+sd+ZHiJq7qtuky/3F/Si8y05WqqP39tLPbC9RfXzyOOiVPAr/hY9f+IzPnsnyO4bdWvJI5zZ6xmc8RKSqqDnEqaAhMMoi6/QcOKT8I9ptOPt1+KxhxvoqHZkCT/oPEcQ3Zwiskw3jbYRRMquP9yvvf0gWy08CgC124BsV6v7i2CjhRsqaGm6HOc43AIoGgSfSaQR3Q== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b4cc36ce-a02b-474d-14f1-08dbdafe5102 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2023 17:16:41.9615 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CiHvr5U6cHN3f3Iu+13P5lDFA2v+EDTpqCwWXQfAyydPxFzmEyuZlp8sDd+/Ut5WZsvJAuehzYIUHwhddL8Gwg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB7684 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-01_15,2023-11-01_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 mlxscore=0 spamscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311010134 X-Proofpoint-GUID: 0pb6tihkiWLkoY-370fgnTK9Do1fCDoh X-Proofpoint-ORIG-GUID: 0pb6tihkiWLkoY-370fgnTK9Do1fCDoh X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: D851180009 X-Stat-Signature: z4xfumyggxaukho6gxend3irbibmc9db X-Rspam-User: X-HE-Tag: 1698859006-444869 X-HE-Meta: U2FsdGVkX1+RJc5TY8fY3QHMTnWRyUpnlJHJSzA8fm2EoR7D3NUApQZsRXJZBQXvcQxX7KH0k26rihOEdx79feFe4xLVoWomJ5XOynEUtMGJla6wwk9JB4GDZM8Bbm4EwHFb9g0V5X1GsKpPUTo4zzHuNgz/mt3zNuSKQwZiJemXN9ZrPngyIUfSTB3NIkD1ThcabOM8JW5zqvPhtCDrxuW8JZfwsYlAKNfXpcB42NkOxfzb43iIBa14MeOMEHujppkbvauDETJ8137JW3kC/JIO1/xfGjJUSY7/gUIsJD/NFXyE9rZMstiqwVWh/+dyfDgXHbuIiH8lEa4aGW1tFWDmXrB37qHp2uFSraVDeuweFTratP6aUwASazeL2AFjFadnJulpGW3LukTwpT8xEton3BoI16vGJK7EtDRGQikz00Mj1G2aAEgC9/P8hOT5SLSn1zDu2A9cWJmt8ZlnPyG56fBp6JRY2bjrnOtkw/VbuxYwAH7Xw/Z3QF83wHpwkgkfLMwgjGyHEb6JfaygFEjHO98Tapxx5QB+QfpOaZTh56uMmpS4dcQj87mg7uQAc358gtM2siwNxfFgUDzXSb1AErVENL4bk6/F1/nMGrR8tC03tuajHE1/oKYKR7cWdEdacIGX7HdlBEUSXtr31+djLIzmVNY9yfYEZUurrM4Fi8kk4qa/e9p3cyzj1eTgU+wHqZuhE+0PLPB7OxOVD3EfQ9Vo2ruRK0jB9nfyp7owGcO59fJIEyHCFjdkIDIgtz5yPyXVsMezxg51EZeGJfC3YCU2ruhB2THthc+1sHZQP94kdi4+I25eHqqtK0HT+Fv3kVg5Tv6VR9T34bI2VOQIpY6bI1XcmY2S05w1n2ctjyqecVkQo261fl0BKC5lmZ6WDZ5L6YFVDtJZwMsGdM41YKrZHTQ2mXy3ToYKAQtc+susJ3AvauHWL4fE38KOpdoiTkEwGOZxELyOSa1 UewZ9Soz IeH37kAmFCn1Kx0y3aWRMUwm4NaBenqcGgyGfI7DXkV9Deur+c3wYRm/E3ygiiNL2KvtamnBJJHpGzohjJubSOE9X/YFrzODabrsxVYgfUdFF4Zf1mJW1dvir+e1faH184d2Xfxoh/L5GoBzk2AKwkZydscKGj7MaPlrUaQhb1vCOi3tXvC/ktnbBHbvYDYbrZjpq7M7EI5fctxcVvFOy6mjR2MQgNULDA9XImPoWwtsOTX2Ez2GhXrwJ/RHUXObUHJupmjmCMHp58XAXpU/qxBmtjjI3qImLEI+i0dJhSZuKupeHM642AdjH7NnMrXkoyhvnmwviwT/2Zx2h+oMdEJ5DKsWF6quVcjAGXY8+oWEkFPMtFzdLs9RAjxsbiq4fvrn4kFFtD8Ej7b0ZvawXsDqU10wIDtSjgdUAmtI2VLZyLtg1xjN1GxRlsfR/qbHCZhqe6dbR0c5ghQU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: __mas_set_range() was created to shortcut resetting the maple state and a debug check was added to the caller (the vma iterator) to ensure the internal maple state remains safe to use. Move the debug check from the vma iterator into the maple tree itself so other users do not incorrectly use the advanced maple state modification. Fallout from this change include a large amount of debug setup needed to be moved to earlier in the header, and the maple_tree.h radix-tree test code needed to move the inclusion of the header to after the atomic define. None of those changes have functional changes. Signed-off-by: Liam R. Howlett --- include/linux/maple_tree.h | 255 ++++++++++---------- mm/internal.h | 2 - tools/testing/radix-tree/linux/maple_tree.h | 2 +- 3 files changed, 130 insertions(+), 129 deletions(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index d01e850b570f..82a6bf5fa969 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -550,6 +550,131 @@ static inline void mas_reset(struct ma_state *mas) */ #define mas_for_each(__mas, __entry, __max) \ while (((__entry) = mas_find((__mas), (__max))) != NULL) + +#ifdef CONFIG_DEBUG_MAPLE_TREE +enum mt_dump_format { + mt_dump_dec, + mt_dump_hex, +}; + +extern atomic_t maple_tree_tests_run; +extern atomic_t maple_tree_tests_passed; + +void mt_dump(const struct maple_tree *mt, enum mt_dump_format format); +void mas_dump(const struct ma_state *mas); +void mas_wr_dump(const struct ma_wr_state *wr_mas); +void mt_validate(struct maple_tree *mt); +void mt_cache_shrink(void); +#define MT_BUG_ON(__tree, __x) do { \ + atomic_inc(&maple_tree_tests_run); \ + if (__x) { \ + pr_info("BUG at %s:%d (%u)\n", \ + __func__, __LINE__, __x); \ + mt_dump(__tree, mt_dump_hex); \ + pr_info("Pass: %u Run:%u\n", \ + atomic_read(&maple_tree_tests_passed), \ + atomic_read(&maple_tree_tests_run)); \ + dump_stack(); \ + } else { \ + atomic_inc(&maple_tree_tests_passed); \ + } \ +} while (0) + +#define MAS_BUG_ON(__mas, __x) do { \ + atomic_inc(&maple_tree_tests_run); \ + if (__x) { \ + pr_info("BUG at %s:%d (%u)\n", \ + __func__, __LINE__, __x); \ + mas_dump(__mas); \ + mt_dump((__mas)->tree, mt_dump_hex); \ + pr_info("Pass: %u Run:%u\n", \ + atomic_read(&maple_tree_tests_passed), \ + atomic_read(&maple_tree_tests_run)); \ + dump_stack(); \ + } else { \ + atomic_inc(&maple_tree_tests_passed); \ + } \ +} while (0) + +#define MAS_WR_BUG_ON(__wrmas, __x) do { \ + atomic_inc(&maple_tree_tests_run); \ + if (__x) { \ + pr_info("BUG at %s:%d (%u)\n", \ + __func__, __LINE__, __x); \ + mas_wr_dump(__wrmas); \ + mas_dump((__wrmas)->mas); \ + mt_dump((__wrmas)->mas->tree, mt_dump_hex); \ + pr_info("Pass: %u Run:%u\n", \ + atomic_read(&maple_tree_tests_passed), \ + atomic_read(&maple_tree_tests_run)); \ + dump_stack(); \ + } else { \ + atomic_inc(&maple_tree_tests_passed); \ + } \ +} while (0) + +#define MT_WARN_ON(__tree, __x) ({ \ + int ret = !!(__x); \ + atomic_inc(&maple_tree_tests_run); \ + if (ret) { \ + pr_info("WARN at %s:%d (%u)\n", \ + __func__, __LINE__, __x); \ + mt_dump(__tree, mt_dump_hex); \ + pr_info("Pass: %u Run:%u\n", \ + atomic_read(&maple_tree_tests_passed), \ + atomic_read(&maple_tree_tests_run)); \ + dump_stack(); \ + } else { \ + atomic_inc(&maple_tree_tests_passed); \ + } \ + unlikely(ret); \ +}) + +#define MAS_WARN_ON(__mas, __x) ({ \ + int ret = !!(__x); \ + atomic_inc(&maple_tree_tests_run); \ + if (ret) { \ + pr_info("WARN at %s:%d (%u)\n", \ + __func__, __LINE__, __x); \ + mas_dump(__mas); \ + mt_dump((__mas)->tree, mt_dump_hex); \ + pr_info("Pass: %u Run:%u\n", \ + atomic_read(&maple_tree_tests_passed), \ + atomic_read(&maple_tree_tests_run)); \ + dump_stack(); \ + } else { \ + atomic_inc(&maple_tree_tests_passed); \ + } \ + unlikely(ret); \ +}) + +#define MAS_WR_WARN_ON(__wrmas, __x) ({ \ + int ret = !!(__x); \ + atomic_inc(&maple_tree_tests_run); \ + if (ret) { \ + pr_info("WARN at %s:%d (%u)\n", \ + __func__, __LINE__, __x); \ + mas_wr_dump(__wrmas); \ + mas_dump((__wrmas)->mas); \ + mt_dump((__wrmas)->mas->tree, mt_dump_hex); \ + pr_info("Pass: %u Run:%u\n", \ + atomic_read(&maple_tree_tests_passed), \ + atomic_read(&maple_tree_tests_run)); \ + dump_stack(); \ + } else { \ + atomic_inc(&maple_tree_tests_passed); \ + } \ + unlikely(ret); \ +}) +#else +#define MT_BUG_ON(__tree, __x) BUG_ON(__x) +#define MAS_BUG_ON(__mas, __x) BUG_ON(__x) +#define MAS_WR_BUG_ON(__mas, __x) BUG_ON(__x) +#define MT_WARN_ON(__tree, __x) WARN_ON(__x) +#define MAS_WARN_ON(__mas, __x) WARN_ON(__x) +#define MAS_WR_WARN_ON(__mas, __x) WARN_ON(__x) +#endif /* CONFIG_DEBUG_MAPLE_TREE */ + /** * __mas_set_range() - Set up Maple Tree operation state to a sub-range of the * current location. @@ -563,6 +688,9 @@ static inline void mas_reset(struct ma_state *mas) static inline void __mas_set_range(struct ma_state *mas, unsigned long start, unsigned long last) { + /* Ensure the range starts within the current slot */ + MAS_WARN_ON(mas, mas_is_active(mas) && + (mas->index > start || mas->last < start)); mas->index = start; mas->last = last; } @@ -580,8 +708,8 @@ static inline void __mas_set_range(struct ma_state *mas, unsigned long start, static inline void mas_set_range(struct ma_state *mas, unsigned long start, unsigned long last) { - __mas_set_range(mas, start, last); mas->node = MAS_START; + __mas_set_range(mas, start, last); } /** @@ -706,129 +834,4 @@ void *mt_next(struct maple_tree *mt, unsigned long index, unsigned long max); for (__entry = mt_find(__tree, &(__index), __max); \ __entry; __entry = mt_find_after(__tree, &(__index), __max)) - -#ifdef CONFIG_DEBUG_MAPLE_TREE -enum mt_dump_format { - mt_dump_dec, - mt_dump_hex, -}; - -extern atomic_t maple_tree_tests_run; -extern atomic_t maple_tree_tests_passed; - -void mt_dump(const struct maple_tree *mt, enum mt_dump_format format); -void mas_dump(const struct ma_state *mas); -void mas_wr_dump(const struct ma_wr_state *wr_mas); -void mt_validate(struct maple_tree *mt); -void mt_cache_shrink(void); -#define MT_BUG_ON(__tree, __x) do { \ - atomic_inc(&maple_tree_tests_run); \ - if (__x) { \ - pr_info("BUG at %s:%d (%u)\n", \ - __func__, __LINE__, __x); \ - mt_dump(__tree, mt_dump_hex); \ - pr_info("Pass: %u Run:%u\n", \ - atomic_read(&maple_tree_tests_passed), \ - atomic_read(&maple_tree_tests_run)); \ - dump_stack(); \ - } else { \ - atomic_inc(&maple_tree_tests_passed); \ - } \ -} while (0) - -#define MAS_BUG_ON(__mas, __x) do { \ - atomic_inc(&maple_tree_tests_run); \ - if (__x) { \ - pr_info("BUG at %s:%d (%u)\n", \ - __func__, __LINE__, __x); \ - mas_dump(__mas); \ - mt_dump((__mas)->tree, mt_dump_hex); \ - pr_info("Pass: %u Run:%u\n", \ - atomic_read(&maple_tree_tests_passed), \ - atomic_read(&maple_tree_tests_run)); \ - dump_stack(); \ - } else { \ - atomic_inc(&maple_tree_tests_passed); \ - } \ -} while (0) - -#define MAS_WR_BUG_ON(__wrmas, __x) do { \ - atomic_inc(&maple_tree_tests_run); \ - if (__x) { \ - pr_info("BUG at %s:%d (%u)\n", \ - __func__, __LINE__, __x); \ - mas_wr_dump(__wrmas); \ - mas_dump((__wrmas)->mas); \ - mt_dump((__wrmas)->mas->tree, mt_dump_hex); \ - pr_info("Pass: %u Run:%u\n", \ - atomic_read(&maple_tree_tests_passed), \ - atomic_read(&maple_tree_tests_run)); \ - dump_stack(); \ - } else { \ - atomic_inc(&maple_tree_tests_passed); \ - } \ -} while (0) - -#define MT_WARN_ON(__tree, __x) ({ \ - int ret = !!(__x); \ - atomic_inc(&maple_tree_tests_run); \ - if (ret) { \ - pr_info("WARN at %s:%d (%u)\n", \ - __func__, __LINE__, __x); \ - mt_dump(__tree, mt_dump_hex); \ - pr_info("Pass: %u Run:%u\n", \ - atomic_read(&maple_tree_tests_passed), \ - atomic_read(&maple_tree_tests_run)); \ - dump_stack(); \ - } else { \ - atomic_inc(&maple_tree_tests_passed); \ - } \ - unlikely(ret); \ -}) - -#define MAS_WARN_ON(__mas, __x) ({ \ - int ret = !!(__x); \ - atomic_inc(&maple_tree_tests_run); \ - if (ret) { \ - pr_info("WARN at %s:%d (%u)\n", \ - __func__, __LINE__, __x); \ - mas_dump(__mas); \ - mt_dump((__mas)->tree, mt_dump_hex); \ - pr_info("Pass: %u Run:%u\n", \ - atomic_read(&maple_tree_tests_passed), \ - atomic_read(&maple_tree_tests_run)); \ - dump_stack(); \ - } else { \ - atomic_inc(&maple_tree_tests_passed); \ - } \ - unlikely(ret); \ -}) - -#define MAS_WR_WARN_ON(__wrmas, __x) ({ \ - int ret = !!(__x); \ - atomic_inc(&maple_tree_tests_run); \ - if (ret) { \ - pr_info("WARN at %s:%d (%u)\n", \ - __func__, __LINE__, __x); \ - mas_wr_dump(__wrmas); \ - mas_dump((__wrmas)->mas); \ - mt_dump((__wrmas)->mas->tree, mt_dump_hex); \ - pr_info("Pass: %u Run:%u\n", \ - atomic_read(&maple_tree_tests_passed), \ - atomic_read(&maple_tree_tests_run)); \ - dump_stack(); \ - } else { \ - atomic_inc(&maple_tree_tests_passed); \ - } \ - unlikely(ret); \ -}) -#else -#define MT_BUG_ON(__tree, __x) BUG_ON(__x) -#define MAS_BUG_ON(__mas, __x) BUG_ON(__x) -#define MAS_WR_BUG_ON(__mas, __x) BUG_ON(__x) -#define MT_WARN_ON(__tree, __x) WARN_ON(__x) -#define MAS_WARN_ON(__mas, __x) WARN_ON(__x) -#define MAS_WR_WARN_ON(__mas, __x) WARN_ON(__x) -#endif /* CONFIG_DEBUG_MAPLE_TREE */ - #endif /*_LINUX_MAPLE_TREE_H */ diff --git a/mm/internal.h b/mm/internal.h index 30cf724ddbce..812ba03224f8 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1063,8 +1063,6 @@ static inline bool vma_soft_dirty_enabled(struct vm_area_struct *vma) static inline void vma_iter_config(struct vma_iterator *vmi, unsigned long index, unsigned long last) { - MAS_BUG_ON(&vmi->mas, vmi->mas.node != MAS_START && - (vmi->mas.index > index || vmi->mas.last < index)); __mas_set_range(&vmi->mas, index, last - 1); } diff --git a/tools/testing/radix-tree/linux/maple_tree.h b/tools/testing/radix-tree/linux/maple_tree.h index 7d8d1f445b89..06c89bdcc515 100644 --- a/tools/testing/radix-tree/linux/maple_tree.h +++ b/tools/testing/radix-tree/linux/maple_tree.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0+ */ #define atomic_t int32_t -#include "../../../../include/linux/maple_tree.h" #define atomic_inc(x) uatomic_inc(x) #define atomic_read(x) uatomic_read(x) #define atomic_set(x, y) do {} while (0) #define U8_MAX UCHAR_MAX +#include "../../../../include/linux/maple_tree.h"