From patchwork Mon Dec 16 19:01:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13910219 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 465BDE77180 for ; Mon, 16 Dec 2024 19:01:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B367A6B009F; Mon, 16 Dec 2024 14:01:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A705D6B00A7; Mon, 16 Dec 2024 14:01:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 876D06B00AA; Mon, 16 Dec 2024 14:01:44 -0500 (EST) 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 5C0796B009F for ; Mon, 16 Dec 2024 14:01:44 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 0E43DA08A7 for ; Mon, 16 Dec 2024 19:01:44 +0000 (UTC) X-FDA: 82901740740.11.E68C10B Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf14.hostedemail.com (Postfix) with ESMTP id DDD6E100018 for ; Mon, 16 Dec 2024 19:01:07 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=KJ6BcCFK; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=TWaqy2xg; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf14.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=reject) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734375681; 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=Ia/NP1kGJgCvcglMLxHajq/c3d/8nTeQNYTL0rvJcug=; b=UzXmkn8YvxseSL8iYoPhd6Wx52rmxnfqaJ95xe7TYtrMrmwix7JtZYNBgjG6wPUuaHWzJu 5/LRJjzJP1ivFvbjdzDh4w8cwqxHdIJvxMy1Kx+QhYSLhPgO8c0js8HvnLp/UqHAMBfh82 /aVVLf+SOLyQx69PKy+TnHdRBpvjjVM= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1734375681; a=rsa-sha256; cv=pass; b=1wmsVegD2o5m7/frf57W20MIAyM+QwKIs9KkottYO011OuFSD/OT8ABeiOUwl2iJ+rJvPm qAC4BeAEzk0nXkl0u6sFnYxcPJQFpTsAcYRiMVZ7TzRcFLVdEFpdI1/fRDUNITUZZPiMAK /wNBlGR+ONai8ZA9xtA/vjUqrarMXYI= ARC-Authentication-Results: i=2; imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=KJ6BcCFK; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=TWaqy2xg; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf14.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=reject) header.from=oracle.com Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BGItuTf006696; Mon, 16 Dec 2024 19:01:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=Ia/NP1kGJgCvcglMLxHajq/c3d/8nTeQNYTL0rvJcug=; b= KJ6BcCFKFssowP0kfAEqeqaMsCM8lNVVXi5oVOh1pyZwIWzIlNyWMfUWciHaYoTC f87uuBZuj5SToDlU0T2LLs0kuiUDwW02+0kPkU5M8KaJZJllaAwu4xd396vMA2UI o+IZHWah2Kzw9VSp444Y8ZOYpqTmbdNaowWJqnEz9KOZf/gjFOvVyAGJkRrHjwL7 +kyD4RoSm2scWYwnpj6TWBWuZHQNvlVC5yBnxyPEi9FK7WMfnYJ3EauCOD3CVGvK nwf79piei3nDhPH5oH0RghJKqjRqnpwxe9SKgevn8ITtpoOsuImdzeL2NzzUC7y1 vUJ8K69PZLjXeWnILAu+7Q== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h1w9c21y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Dec 2024 19:01:34 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BGIsqFh035295; Mon, 16 Dec 2024 19:01:30 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2049.outbound.protection.outlook.com [104.47.57.49]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0f7fd57-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Dec 2024 19:01:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WNj2yzErUzfIiC9FoUdz7yT9n20M70FuKLWHfr8hbDYZUdXAbFgr14skizrsK814dlShB8N+ezPCtaUaO+OGjogMAvMf8Pyu5QYSbZ0lJmEiIb7noA1o8nPG1v4DP4UfAERTKkHtmWBBzLIUH6Or/Q8eN3yYQlzMLu+v9L+P0ZuwMbmhdeLvgHiXyUTIOf0NeWWkBFbQIxFf4HyvfFM1yZ8CitLHPRB0kUaJcEpW46018btnUhBYmEY2uYmMiOUUazVKsJ+10s/OCMYNMWkc0nDx56MjAEIr7BqQ+5jXaS020sJH8i3Kg97Ir8cWPLcL2piUIIHGjsw1VPTVHjE1Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Ia/NP1kGJgCvcglMLxHajq/c3d/8nTeQNYTL0rvJcug=; b=fA7LXNlhKeaHfHUq+0aLHZK+BEZoGcVb3LiTrYSyH6S1QrwZLFY2cXCX5H5GQJeGMMqGRYFQoETSUqmYlhr9Oy96ztgploMV8YHRC8wz5sY4Tak8K2fBkMxWJj4HwqAltXJ4c4+adEth/dxIG1/kfJeIwvMfqsGuJ43qGxVZjUhpuerMZV/8G1TUKMms2OaiU5QKs3KgbXD1TYjRdMijLHx93e+dLYq5Lh/VqXDM4Pt1AzJzZkuh4pbqsufKsehaxTsG7iOFTUfyygw6UXlLSTVZtA7SmVvITM6HXqG9KUJnU+29JsZU1PjpWbjeyNcGNLFkYujxPL/WHXXBuOvSMw== 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=Ia/NP1kGJgCvcglMLxHajq/c3d/8nTeQNYTL0rvJcug=; b=TWaqy2xgjkg5UZeAX727zqY+1PFTyZ8P3ZVfoMcWofBWCu3Af0dsAW/gwGiwZNEf6fEQx0HcICLU/c+c8IFY4rG0JItAgyu5PhoiweCmGeGNUmHgzDsmTF4tGQbFKNnyPAbZ9XuLBA8P4IxuP8ikbJ2LC4BcPX8n1sBMt94sme8= Received: from PH0PR10MB5777.namprd10.prod.outlook.com (2603:10b6:510:128::16) by IA0PR10MB7602.namprd10.prod.outlook.com (2603:10b6:208:488::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Mon, 16 Dec 2024 19:01:28 +0000 Received: from PH0PR10MB5777.namprd10.prod.outlook.com ([fe80::75a8:21cc:f343:f68c]) by PH0PR10MB5777.namprd10.prod.outlook.com ([fe80::75a8:21cc:f343:f68c%6]) with mapi id 15.20.8251.015; Mon, 16 Dec 2024 19:01:28 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yang Erkun , chuck.lever@oracle.com, brauner@kernel.org, "Liam R. Howlett" Subject: [PATCH 1/2] maple_tree: Fix mas_alloc_cyclic() second search Date: Mon, 16 Dec 2024 14:01:12 -0500 Message-ID: <20241216190113.1226145-2-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241216190113.1226145-1-Liam.Howlett@oracle.com> References: <20241216190113.1226145-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0408.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:108::13) To PH0PR10MB5777.namprd10.prod.outlook.com (2603:10b6:510:128::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5777:EE_|IA0PR10MB7602:EE_ X-MS-Office365-Filtering-Correlation-Id: 62739901-6c0c-436e-1784-08dd1e040bc5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: Mb1H/UzpAXCQeKxSgbm3GY7Kqq7BINlf/kl1AaQK10uW8uLjX0gLFdjvolv2kggvqRJFfyCc1fa2epkPfraNdD9/Vx4FO4Kpi8bqwzhnnGZom3ZBAEJxYbK+lGNH5LB4CHxplFSbvZjiKHy7RRKMbDWMHfK041z1ydcWRHeQjUIIedqG2hQGXck/QBBj+V5UMgPgMbtIVUSI6UuazLuGYb8mpNZSmVffq7yFSwdd9I360kjgmTQpOmNtCJvsor5t80DnUag9335sub4FNqbwITsX1Y9j+RQk56Uf2BoxblsM77rkd2xLbOzgJH468ZCzE63pN1UYXUz/VQHiigFHdyhUFdoc69KNpoyEyZk3g8SI1+oCAENQXJhg0OJ1UHYky4DUkdvA+JXsFYxjPLwpvKlUjkOqN3NJ/XaGHLtNyuugtLoDOLUGT6jqVLVrVCuyW2Xe/vZGDUy/tpldfAZ9mJiVuW9vF3ev5weaoLLJTw7HD5kJg3JzaSQ+AoRD2ItoFdAN41tjv2A6uTM8f7slE3KKpkIkS3s2FvoVH8Q9DTBkSjvhTZfPUPC2xwnyn7/GdGvSR0y34MkY0dl9jk+2ZJSw85KqYeJZDre88EPBE9jFQCbOG4YEkHPXtooFGt4WZPGJumOAR0bAY6x4EZ4KJG3nBvnd6RtPzW0dWOVBKzBmKysp8EsukA48doy868+Szr4/cQyuNvo/18QkFYlONfz/AKDDjqqCpRmyEZ9OhcPnM1zxLYF3/5x2Jvt8RKxnIdW5N3gDt0AW9HS3e9aQ/9WH/GNq4bgliFzQ5pRELI2I6mJTQfDbKJWTpxYLBLmXjX6679aau2T4Lw+km9pa5dhuBUFqb/y18RwYj6AfYFNHRFJmcv1i8ZPFlN3U4At4eFb23r1ojAd0emZ7ntDQyG1vFPXeoZIP+/siVu42/OF5Aw2wj7yIpqpR8Q1GLggwppfUWC1MgileSyznWITdutAJ7P2SBYPYiiFZtJZhFvpieD0M5zeo1I5u/NKgajDFYNKTsuMAvt+xJmuJFYk4GcWoYyr88u1lygHVNZ2EPWJiCYMe2mVtnwBsg3BVzTezOvys3lHrn70XI7q1YbbF745ZhXo5W/2RFd0u6pcLGwLajn9LW3w3mjpiqJKK8j5mn4VZGmvd9fbTb1l61atRIGJDbWMqxx5nuste5lnJiICLTlzbUgsFIZUsS0E41inyGA3fk/PSLTkXAfPlXtjtf0awAOXxxdUW/FsA8eTiCWe12sKt1K3028ltKSQUyL6TOpvS5W+DQopikpuHquMWv8fDvSUgufYHLTK9CLbIiuzJlkQG4Vuab4xG5aaBy7fv3XpsE8PHsJyoQwgedqFxuLyP0PX0oqfEUiaFMCao2Ox+DNKZT+/iNHc4gZFqotWO X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5777.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YfYV1v1eGUmsGF8KAOVr4+dE/zRjQANVl0ytX7tfh1U8RB9+6j+56n6MzJOVTNMYb4mY8moyTUnvHc/2VkIjfgHXibverPxKlWvEOKHIpnOrOQDSW6vBYkQYK7DqNFxD/SbdDg0sry9CdNCK1lK1+M51hogTb69ls8J6k5A6hDDeaJFuBMRYvIhu41WJeP/bRQkplaYVlNKiRxn2nRelZoQjYQTRZq35CDcxMDvAZ8PbavrdNZVuuv68klgtM+mmEc4o33uAGNpOYxGxqiNUPoXgb86uv61DLnb+LzSmKQUpSzcGwr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nnXMdjKSdDjXvFuCRZkzKoh5sGUu2Ou5cRD2loa8zaIvODqBrrrHVwLn9WzI8qqjyZiVZYh6tosVCxi0GmMAPbdMvbgTe8hy29SprrmhxbuSCcfH5nNyx+xIOG8RNcER8pfd8bpJm55vEH9HTXAdZ3K/P4OKN9pzTDeSkoxlxomJwiP/f23Ztv4qVsiGQPROX1puNbp/0vzhjpac+BI1N X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: i88+3TNshXyT8R/rj1QRJI6urwgdmHWVQ7QYDZ/mVyX++29s/BiRupi4cS9BHC608dK3daMTjTNkEswUZgwp6y1vURgZ+ZD88TPBRO4oCnRJAQBV/HI2q4aqxcCetrdNzVhNAksEv2hQe3V5RUxQy05fAiyTxLZXFaYHI7gdQZ4y9Eyv0qTzucGeFuX6fFoxO/fNdQrer6hQ6cGt2HgMw4elfkfEetApdhYUUkG8WlM+rDStB1iuvXv5/Gfc5Uufj96ATn6/KOXGSPvOwZ8A/3C0sSLyVXmJhPf649wSB3nn4vFWSQ+O3MLD/NLLBFdp5PeZxqnbeMit4JLx4aIduUyI/wMydAOEB6ms1TDj7mnPSIDhgCWLXbzu2XgSjfXoFPsEemempLE4hLgrL4Rpp7Rx+8LccYqW2+2neChXkknYl1Rb8TsXeyqz3hmd5dW/EdEU2aoItgGqx1++BVRM5+UcjlX+jKvMVqM5gLIf57C4pdtdjIv/Q5bNsRI1D2DeZzF3YX1cSVpudH8Vrs7VhkynKqQyuxziqyZ7UzvyjrxPvgG3xetlPgWU0VtASMOnPZsio+qQuT5RM3cTIv4mCrDO6e7Xd7zd3o50/ABceXM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 62739901-6c0c-436e-1784-08dd1e040bc5 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5777.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2024 19:01:28.4172 (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: MZRZGfn9JtF9fDKjeE1HQi6mV/BSqHIN1H6TuHLmK8b1lu3MDCWmDoTw+TDM54ny7N0w+clP8Up1lFfxrRY76w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7602 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-16_08,2024-12-16_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 spamscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412160158 X-Proofpoint-GUID: n7_Yjfg_Vc-6_fqrKSAnGkMLyNe280YA X-Proofpoint-ORIG-GUID: n7_Yjfg_Vc-6_fqrKSAnGkMLyNe280YA X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: DDD6E100018 X-Stat-Signature: 536r16pu4b3hi3q8tfnm5purgipz4yu7 X-Rspam-User: X-HE-Tag: 1734375667-891239 X-HE-Meta: U2FsdGVkX18Rf7T5/WNWGcIrOVZqhvTxWKqCxUgDj8PazFVUxJaJnT7VAk+eRAiYRRaj4TtDcgWgrvIywBBuA5e6NvP0Tgn5HGbRWkOS+qgPy1UZmmvxsv3WID9Bhu+FVGsD8dL2NJlazW/HDQvFDluh+OIU9K1Wz9rXypcX+EjgFDRDoZaPKXc543Uz0CcXarlNHpvlCT0ICeYCeNZR4pKp3CwgvI5hP27oyjjamB4+bw5/HrnduRE1ipdFJta32X6KMy8cgBsdT95DLfD1uTyjs3BxqnafT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OsugXLRvQaJJlJ9CeUrs7e1jzKlp99caOBGjtN6ZQpdoM63P5NdD1PtNvGoMHIjnBPh1EiOsEVe2hUAIJNBlhxePAA9tiTJjiXyceLdFq8psoJu35R1Lflx/e2dTjcrSgaF+njjLBJlm7WpP95CMYjs+TX3bcNXQfHzhyzRVjLPzhGVCZrx1sEI77k9dxmHbqBq/3JwfxMkBja1PdWkXD7NyoPBvaqji6yeijXwsvjK2qyEGyInYlQtfuBfvI+3N3wUGLr5VTeicXm4XuUv4xNSUS8C3RVwlzsEqyI5f7yngl 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: From: "Liam R. Howlett" The first search may leave the maple state in an error state. Reset the maple state before the second search so that the search has a chance of executing correctly after an exhausted first search. Link: https://lore.kernel.org/all/20241216060600.287B4C4CED0@smtp.kernel.org/ Fixes: 9b6713cc7522 ("maple_tree: Add mtree_alloc_cyclic()") Cc: Yang Erkun Cc: chuck.lever@oracle.com Cc: brauner@kernel.org Signed-off-by: Liam R. Howlett Reviewed-by: Yang Erkun --- lib/maple_tree.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 940d30653407b..f7153ade1be5f 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4335,7 +4335,6 @@ int mas_alloc_cyclic(struct ma_state *mas, unsigned long *startp, { unsigned long min = range_lo; int ret = 0; - struct ma_state m = *mas; range_lo = max(min, *next); ret = mas_empty_area(mas, range_lo, range_hi, 1); @@ -4344,7 +4343,7 @@ int mas_alloc_cyclic(struct ma_state *mas, unsigned long *startp, ret = 1; } if (ret < 0 && range_lo > min) { - *mas = m; + mas_reset(mas); ret = mas_empty_area(mas, min, range_hi, 1); if (ret == 0) ret = 1; From patchwork Mon Dec 16 19:01:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13910220 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 92FC0E7717F for ; Mon, 16 Dec 2024 19:01:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 238BA6B00AA; Mon, 16 Dec 2024 14:01:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1BF236B00AF; Mon, 16 Dec 2024 14:01:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EDF256B00B1; Mon, 16 Dec 2024 14:01:48 -0500 (EST) 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 C8E266B00AA for ; Mon, 16 Dec 2024 14:01:48 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 800C9A075A for ; Mon, 16 Dec 2024 19:01:48 +0000 (UTC) X-FDA: 82901740110.08.461AF35 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf22.hostedemail.com (Postfix) with ESMTP id 24A82C0003 for ; Mon, 16 Dec 2024 19:01:13 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=YSj7CASi; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=vS5csxOx; spf=pass (imf22.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734375682; 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=xuctSjfhPXjd0DVljUFQ32ExsSe+bdxch5aI0NlBsWo=; b=uMQdmAWAlzUnvvyKRNXBvd3BEVk0ZOekqhKpbXv/Q2jWy6jKDSbyeoAyS5jv4mUPK0BieO Cs7b0do4xJKRKEzmyFzGDpt2+e6BiNofhhu7jCrh2sTFUw2x1Fo/vV3rd66/1gco14ylEI YO/AEAlRHSWMS2HoLpjHOW7NhaVM2NM= ARC-Authentication-Results: i=2; imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=YSj7CASi; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=vS5csxOx; spf=pass (imf22.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1734375682; a=rsa-sha256; cv=pass; b=qHyNKLHrW9KX0WR1Wh2kyPM5FxrG3lyJTJePdNHHhhIamfqdcwQ8VgmJAIyES6a+acqLOn 3WSlrYZyECkHITOSJYJsDa2yhOK4E8rsbATerEBhjqa0thhZYnvRatUvAhccPrRnYpc5Fm 1q6hJGnW5xCggBiw9tfKvltqYhnUF5Q= Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BGItpm9011703; Mon, 16 Dec 2024 19:01:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=xuctSjfhPXjd0DVljUFQ32ExsSe+bdxch5aI0NlBsWo=; b= YSj7CASiDw7hNXqLt9c/twkG/fW0CIM6ivuTi4s0xYjXciADLr22ktfzo6i9dBzn 6CCpgPnFs/k9m9TGwohJsYAbFto1UDT9qucoeZ1AlojkowLKgeVwWc5v4G5sozoY SWBi8c+OpmjlJPzAuypKTJptiT+BGfZZweGOWq/P6VkTVTHiJbjen0jsx0Hhrk7J +dtCfNTy7ibC52z5sW3aDwAuX3Xx3/6zzehqgHpXNMCQGUtaXg4jfmoIbj/lrARR habrrttLabS7/e3gCU98QJkO3HKcBEdW8wN9bErA2PpjymAGRlAzbGJ4M0a4wRgd qD2E1NljHJygCJuJWet2RQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h22cm2p3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Dec 2024 19:01:33 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BGHROee035805; Mon, 16 Dec 2024 19:01:33 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2174.outbound.protection.outlook.com [104.47.57.174]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0f7fd8u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Dec 2024 19:01:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mtvZbblkDkQpOeToSuuCyeDfzz1M43AiPRtCqoeFM4SXoV6x7hYgtAy81150FSM+AWYU+Wh5REhM7AAlk7O02XmcXdlV+IZk3D4ZDbf3HVVE25AiJlFT5295hTuWYXj9Wp4rlmMYd4NJ5fXcm/+R2DYLNylsPatJ58CT3BKtcfiwz+Rqpqx8x6DuTRXLmarvV6cCPUWc0PuajTA4Fuj8GtQySlgtUUdpqiugEBqprty5IVPuTnLoVCrDp7CT85gpi05+YHuYWxxJYntFvng7E31JEPnUxSgRRO48PPE5IjcHO7Gn2b1GSTO+NDCX82h4GDwy8PEnwbt83r3ncajQbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=xuctSjfhPXjd0DVljUFQ32ExsSe+bdxch5aI0NlBsWo=; b=yEZ3gDql46wJMexW2/TFuDOAx32CGYJxveJLSH/W6VJrG7xLXCjN236RKUDEt3oN05K79QfYS/zRmcfgvl6m1Pwzs0MmySqLHwbDYNxH72yKtWt9rmY7w+Ix6uO24Cyqx7kllJB9BoCNZnDXbMfzVYnsi2uAPaS6scef7HQXvvfFN3LRaUgCqBSa66RZCCSoR5lMzAJzfLxqbX1YQnDf5t7Dkjvw7ndmhbdKbvbpoyYG0Wm/DgP2LMSIwsM3u0vAWQgNwOjn/BqwbbCez7V30wR+46btoGRi52GLl/oM3QfMNAZ001IPxrSvEh9KWZdbnb6N76D44BPBXjd6LflvwA== 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=xuctSjfhPXjd0DVljUFQ32ExsSe+bdxch5aI0NlBsWo=; b=vS5csxOxsov1KfRj5j2dqPxLEW7zwRvsEdgKdtrUnZy00u8PlgicrTgcV6aAEKPQbbfTPCpGOMZuALA9SQa774etZY4hi/3BO4D0KmtFUZKE1i5OMHMqj9Xiq0tZIDlwXfkPnicSSWHxH07ytNfOuUYuIfuN+j7O63R8x72QHXQ= Received: from PH0PR10MB5777.namprd10.prod.outlook.com (2603:10b6:510:128::16) by MN6PR10MB7441.namprd10.prod.outlook.com (2603:10b6:208:474::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Mon, 16 Dec 2024 19:01:30 +0000 Received: from PH0PR10MB5777.namprd10.prod.outlook.com ([fe80::75a8:21cc:f343:f68c]) by PH0PR10MB5777.namprd10.prod.outlook.com ([fe80::75a8:21cc:f343:f68c%6]) with mapi id 15.20.8251.015; Mon, 16 Dec 2024 19:01:30 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yang Erkun , chuck.lever@oracle.com, brauner@kernel.org, "Liam R. Howlett" Subject: [PATCH 2/2] test_maple_tree: Test exhausted upper limit of mtree_alloc_cyclic() Date: Mon, 16 Dec 2024 14:01:13 -0500 Message-ID: <20241216190113.1226145-3-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241216190113.1226145-1-Liam.Howlett@oracle.com> References: <20241216190113.1226145-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0388.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:108::29) To PH0PR10MB5777.namprd10.prod.outlook.com (2603:10b6:510:128::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5777:EE_|MN6PR10MB7441:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ac6efdf-7783-4966-8d89-08dd1e040d38 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: FwOvubTsVpMkSIK5N5So89HhDpaK8NoVhGf51rfb/ZD9A6KGDnaFtH8Jm15E2AKamP9ojUGt3luJDV1zI/rwpGc2A/pyn1EbmDkywR+kd6S3rHrDJ7sGgw9f77Q2tqlVRuk2uv5ewBPcEZs4LXBFF1upPr1Co+A5mNVvzJth68VBHs6fLmVSzmF/gcJ87ex+j5lSqgcbzDqugp0+VB4W0iCQB7uAjfrLpJW8JUeHSq6MNFFUioBOrKgMpzw4Z1wki19Aczmf5szsfuIL/4IrKrU6a3wZtltYOMfYYaL+UDLWyh1OlZ+RhvjPa+0fF4ZrT8DOZM2iotR7IC3Z1/YDl94iYfzanTZWQeAYaEQlqlJ1Teqop0OmGgS02pljtIiPAHU5BQX373wxUO3j0JX1MC6v3q2stDQWb4k6s+TuFl9XPm7Zr/MNj6E29nYiCwfhnsbm0XnlGY5eaLE/s6ofDSSPJQLZFSQU9pS2R3LYxUYnD3tYl0zRYIFjdaBCLw+jPbQdVpl8c+IAazbAkc1Xx/KtmRtM42CW4dhFqMlKZMBzu0BFLCvY0q7qTlwWiy59TZ++6c2fgjpTzr2qRb3RBbHFdRDPRU+yaUSyUTdUOXxVcH0u1++pux+TEKsRtTgYQpRCOF0ptkEx5ml7Iyox9V5JAx7Ah9NDlc4FD62HFQ3VxNOH3sAlHXzD5K9OI/+9e2iJWOnW+8CA739jL55Pz3ReCLi8KfwRD73ECdfUeLQUB616EGujW0IJsoKa24vm/TCF3XWg/NDaVwXvEPoA+ZV4QOFsbx3j6FQrwP6GiO4s3bzaBcf3JvbhFreXGcN8xV6+1STotHGsktTlDv3LitJI3iGfmnxwc0qaPcQtMo1rDkN8iY5AhZNBgU8Ippl3h5P463/Lkvdoo6dqQulHUkg7vHH+0GfCnPAeP7pCKI+0FDmVOmg1DtlaFL/nGOeZFuA3rzZToxkGUY0YissaFpyzscljMiMxMzmcMEb3XXCf2LkVB95fR0SPrdKx9fXlLVlxi8XhzJv4ZRCn+oFdGZTYhXiHwU3OWZ4Qnc/IWP6uUV/fiA7pbTI/MdX170vT7pNLfwZbXRF9GRQxGheTsfTUI2E6gFif1ELerjF4yyAMLC1T8UVK2ZRHKQY2tzW40dWicS0phJYe2dC2QJ1QfSspMVPIrPxEOPOhsq2jkK9mW23LKgJkMABr778BEaHBvYON3gdPVYCayVAurqxf2x6e4ZQMPBVW1rYL0mzewoOoQ00uXJxtGHlOZbG94v0HPhpjW95lTf6YmlMsMSPqoHI6OORFXNZcQl3smSpZjpnHdl0tyVoA4QLV9EjP0St4/T0M0wICFnLbN7Atc88pDOrA8zh0eDU2qK2mCiD43QUX6ABz71QbUXgwsCBjc8nJ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5777.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1PEXxgchEBkZ2f0GbKHd7y73ZWdfVoxQxRRtGyR3ZFAFIRMjzFMMywur5eRuzKVfmRBLGtUdq9+ExoBBVNePRmtPlbSXu403yQdJTBD/HmKNjKchyOiRuSSL8YJL7OKzRAbBIj+Pke0M8HqkW9Fo4uLznNS9MQdZ9gSRWz0Rbn5GJWTBJ4EH1jJHgKUZLevVl9kB29i+QUY/bXb/xp8cDIBaDSDubs9ShOC5mc587mHiG1a7e6z30vmz4Bv3Ji8KJe65hSMnPb+c7VUsHOewm7F5Q/4b3Q/jpp+ggVbr/8B2V3PGNcNzmPG6LSO5hRrM6HuMug7NIPAS1x3VTN+9ixIDdzGpj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ynCse4gZGy/DfMwGW8eDoxHuYiy0nYuh3lG7rPFmoWxKjTbBB4md4r7wofo7DglDHjgLV+VwTU2TRQZ5hNxxIiZTvJSW5cE+woa6p2AV+9xjxHUVfLUVbpe59dX8uCbU6PvvOe8rYys7f1At7E3rc45rK7sdQz6BISa X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ZlGiKn04+0ry7ujA7C4KC0XZ6yI3o9o+D+vXvt+39LOqdPsIA4mkcnf4UwNg0bVS0OyUanPhsPEjmrR3Vd9Nag/620gsCriEAtl0foOoyYf9Lv8EV6SXCFgsNxuIlIIKobc3RRx5opPLSRDz0IXq8rGZLxhplOzwraPzM/3rIqn8gX3u9g4S5H4CBYfaOC8bTnq5pc4E+7BBpmAhTNsEsCSeJXDZ5GOjLug9Y32jjM+T2uFIx1p3Uf9i03dU/QiVTkCvx2ySFiQIITjl/1H46SBZX1qo1P3EwzCESHscdFz9rk/K563oMgGQH6KH0m/cTlGlrH1xTgQfJ7iGL+uZPMXVBeE75MErkAIDCTedjxYzsyy3/4wnQIbrvok+BMbQpvsLEhJDnGMulqqe94sugSr7HNW3jzil3lTyfG4rAid/XZ/lswt4NRNeK8ICjiWcyWFjT8ULqeXVy5/2h+3cYGZhjnAGbcdvy1AMQT+i91L2NdhVgdc6heKCsxjPofNKolYqh+Kh90DMNAdw2C30LaP9Y7NyLUZJJh5JjKxTSImqdCU6gCrplNdzGUzjXIwLJ2Xad6Pj/O5ba3TMR9+g0uZ9g82ZVxFE3Q9iMnBz8sU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ac6efdf-7783-4966-8d89-08dd1e040d38 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5777.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2024 19:01:30.7999 (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: hiUgnAxHBbYBQmDuiGxBG5EUxFyNJjG753wGDCQQ9jgdytGVdB71n+TJoxxBCguAG/ffz4nbySKjqQ04Dq3FBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR10MB7441 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-16_08,2024-12-16_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 spamscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412160158 X-Proofpoint-GUID: p7euNwSz0Q86VJB_gEJWJPy8S4ZJcWwU X-Proofpoint-ORIG-GUID: p7euNwSz0Q86VJB_gEJWJPy8S4ZJcWwU X-Rspamd-Queue-Id: 24A82C0003 X-Rspamd-Server: rspam12 X-Stat-Signature: fyp8y6irh6nio7mjxixd15g937tt1qbu X-Rspam-User: X-HE-Tag: 1734375673-696608 X-HE-Meta: U2FsdGVkX18ZDlCLMQWtGWhfZgjEGDymzq2koiJZKf3LEbWFX5ezPZ8Dnlf+fD4S8bTeztZ9UDbNQBFop6/6Xidp1D9OOaFKQUe35JEyYYFyWmoPfnPND4LgPcxjilWW/3fSXqOy5hB0RMU1nUz0n7NkKdq8v5hzYv2cs04UIL32hAMijv9XSNT13rJjE8MklfOlg79RzGr2WZbSQ8g99JDlqxEpUL0dllQB9u5VTI/6jcvSzGP27WcMI55A0bwKWsIf7hGhPDddiQvaRyEM6RVNtvc0NQ8nuQHivDT+BiLGqvw2819zb77g8esQToh2+GkNBDneRAYNhF6alxf4DIpubb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REuALlxoW+yC6EMsXOxooi2XO5lthfUQM2BnXp4vlEn4GQ8nNnKi637G55DmTdUAZXekIf2qUVMOurep5x1JAqmFa9Rj4sCAr82pQVDeUZLtM6Y9l9wG+l3m6JcM4mJnadJdkugBy7X9UDgqlqZL2d0VKBxBkP5PL7hZtn0rAizBWbM0dJlLfkMdIOclamE1ju6i50odRJVB6vRvRGDtQytvWiq80YUHDYQ6qw8cj 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: From: "Liam R. Howlett" When the upper bound of the search is exhausted, the maple state may be returned in an error state of -EBUSY. This means maple state needs to be reset before the second search in mas_alloc_cylic() to ensure the search happens. This test ensures the issue is not recreated. Cc: Yang Erkun Cc: chuck.lever@oracle.com Cc: brauner@kernel.org Signed-off-by: Liam R. Howlett Reviewed-by: Yang Erkun --- lib/test_maple_tree.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index 72bda304b5952..13e2a10d7554d 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -3738,6 +3738,34 @@ static noinline void __init alloc_cyclic_testing(struct maple_tree *mt) } mtree_destroy(mt); + + /* + * Issue with reverse search was discovered + * https://lore.kernel.org/all/20241216060600.287B4C4CED0@smtp.kernel.org/ + * Exhausting the allocation area and forcing the search to wrap needs a + * mas_reset() in mas_alloc_cyclic(). + */ + next = 0; + mt_init_flags(mt, MT_FLAGS_ALLOC_RANGE); + for (int i = 0; i < 1023; i++) { + mtree_alloc_cyclic(mt, &location, mt, 2, 1024, &next, GFP_KERNEL); + MT_BUG_ON(mt, i != location - 2); + MT_BUG_ON(mt, i != next - 3); + MT_BUG_ON(mt, mtree_load(mt, location) != mt); + } + mtree_erase(mt, 123); + MT_BUG_ON(mt, mtree_load(mt, 123) != NULL); + mtree_alloc_cyclic(mt, &location, mt, 2, 1024, &next, GFP_KERNEL); + MT_BUG_ON(mt, 123 != location); + MT_BUG_ON(mt, 124 != next); + MT_BUG_ON(mt, mtree_load(mt, location) != mt); + mtree_erase(mt, 100); + mtree_alloc_cyclic(mt, &location, mt, 2, 1024, &next, GFP_KERNEL); + MT_BUG_ON(mt, 100 != location); + MT_BUG_ON(mt, 101 != next); + MT_BUG_ON(mt, mtree_load(mt, location) != mt); + mtree_destroy(mt); + /* Overflow test */ next = ULONG_MAX - 1; ret = mtree_alloc_cyclic(mt, &location, mt, 2, ULONG_MAX, &next, GFP_KERNEL);