From patchwork Tue Jun 4 17:41:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13685730 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 E701BC25B78 for ; Tue, 4 Jun 2024 17:42:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6A3F16B009F; Tue, 4 Jun 2024 13:42:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 652D06B00A0; Tue, 4 Jun 2024 13:42:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3E0A06B00A1; Tue, 4 Jun 2024 13:42:24 -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 173296B009F for ; Tue, 4 Jun 2024 13:42:24 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id BECEC1C13F5 for ; Tue, 4 Jun 2024 17:42:23 +0000 (UTC) X-FDA: 82193925366.20.2CA7001 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf27.hostedemail.com (Postfix) with ESMTP id 5C94740021 for ; Tue, 4 Jun 2024 17:42:20 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=S6Tp4q9A; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=fxqSD0HJ; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf27.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=quarantine) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717522940; 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=RMx6uAATy7QTVcRAH9zV6tiagLCEAV9FtRSVTr0+QWc=; b=AtCsTGLyp7LL53bDI155fuPLPT8xMqDPfv98ktj1r3mB2zql6nO0AKJL7e7mNbwj0qX4cb FHrzeTfkE9ePvTUrbWr6PVD2YFzo6BXVXlOUVIviBY3CGkXrUSyA+uRP9qglw4hHM1Ucsg aXO2MNEJbxFM1KGAwUbB35RJKfVMcf0= ARC-Authentication-Results: i=2; imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=S6Tp4q9A; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=fxqSD0HJ; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf27.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=quarantine) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717522940; a=rsa-sha256; cv=pass; b=n8zS5gvWKvuUgC6wsQuwJc+xBZM/PTzw/RbtDDCnmNkhAqucYuGmXPFKE4DXPFpPCd5uBG vmOwPhUqtKxYrhzWseCT4xE5SU9j6KZn7mPUhEQK+eDEyB7FMszKZfDz/b1V9sTuFamlSI UIBP2ZTMkMsatPIkmldmuZKL/eWhyGg= 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 454BnNwA028131; Tue, 4 Jun 2024 17:42:09 GMT DKIM-Signature: =?utf-8?q?v=3D1=3B_a=3Drsa-sha256=3B_c=3Drelaxed/relaxed=3B_?= =?utf-8?q?d=3Doracle=2Ecom=3B_h=3Dcc=3Acontent-transfer-encoding=3Acontent-?= =?utf-8?q?type=3Adate=3Afrom=3Ain-reply-to=3Amessage-id=3Amime-version=3Are?= =?utf-8?q?ferences=3Asubject=3Ato=3B_s=3Dcorp-2023-11-20=3B_bh=3DRMx6uAATy7?= =?utf-8?q?QTVcRAH9zV6tiagLCEAV9FtRSVTr0+QWc=3D=3B_b=3DS6Tp4q9ARLvKipWqH5fth?= =?utf-8?q?gPfGLhfKkOAKqmqDll6lMle6A2SKwNXztHOAouJwEmNYNcj_dtFVO4FCq8s3h/1gD?= =?utf-8?q?kcmKFwS5sOwie9Gmca+kK0z0YYLx46TCR5cFkezSfjXf/S/yzMi_tME30V57An+Lt?= =?utf-8?q?CWun6miwan720YRCab96A/5rjJzJ8ch0x41JJxgB3M3fm88Q9D2e7xC_oES+6jE2Q?= =?utf-8?q?bbpHxQbU3ZLwGpBVmfWoH/NBWu8It6AcDZgVuL6MTsGI+gQYqYbSFyiTLUO_7qilI?= =?utf-8?q?xsMVV6Dx0O+7jXHIl9lPyXmZs252EniAqtstUSlmwO7/8UtcS9YB0qF7rrAebnp_R?= =?utf-8?q?w=3D=3D_?= Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfv58dj9g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:09 +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 454HNoQj025242; Tue, 4 Jun 2024 17:42:08 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrt8xx21-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l3WycuekYfUB04VJuoVa1sQQ5HLXtOrpkvEj3cSdBilmnRy/sB0AtHXTIQWwKNtc/Vj6XbuAR1lVH1rI4nRXYCRhvUNmvQ+o1QYlPVKW2gI7aUFcPlXnxOBxBbb8Pj8x2sE/l2bn7w3mLla77xSlC0Yai1TlCxqRr3WquXjS4Xhky7HNTFAsfVAluBMVWDlMRF34lfsC8/y1MhGvwQxR20W4TRyewZsRmp13wL3IUSkzYcXrTqVH5yvy4HJ1atkBo+6XtvEFGSzduGkZc+qWAvsWdwHDWtsr1GyhWSYdWLgbPO5Y2N1ZVm6YuAIutzkGnC+K6lop1vPj9TXSOMgGGg== 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=RMx6uAATy7QTVcRAH9zV6tiagLCEAV9FtRSVTr0+QWc=; b=Vi5NxHzXt3sycoGzRBXd0OEf6Ymnn0fuhXWXGJ/+JDA8yd/kT6OsSVLZUgCdmtu/Q1l7MfqIFe+UwVJMyspYJY3GuKOb8sa9HTzFt2LaA5Oooqt9PEIwU3QRZCMLHxf9dSp6EYTX881Y8R4TYJysnO1/q2YYerijx6j9sGp7SO4+h06aI47mtTUPU2WO0bZk7CWWABAlMi57Tmi3OC/KA9s1/C9tUV7mIOGsjlPIDTP7GQkMmJ8Ox4uvK9RJo19tTsfBc99eOSZxArrjv/pmJGtVjBOKsXi+hGvsFQxelkgZH7n2bhiyJ8+F9aUg2hiihsZ3VhWf7tgCReYU0ikKjw== 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=RMx6uAATy7QTVcRAH9zV6tiagLCEAV9FtRSVTr0+QWc=; b=fxqSD0HJzvaQmYkGEEXUhaD1oGOypL4gaCytaWuyFN1oelsBVKjZe7bzxqDUAj+gIXpi/Qe++GTmM+ShmDvLI1RqSWbJ0EU+osogZGcGC8WJR5+gapcHCsezCvT0BZgj06vDb22UgQN/8lCOiJNsQjv2E6oWTHY7Ty7jANJPKwA= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SA1PR10MB7593.namprd10.prod.outlook.com (2603:10b6:806:385::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Tue, 4 Jun 2024 17:42:06 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7633.021; Tue, 4 Jun 2024 17:42:05 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, zhangpeng.00@bytedance.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 06/18] maple_tree: remove mas_destroy() from mas_nomem() Date: Tue, 4 Jun 2024 10:41:33 -0700 Message-ID: <20240604174145.563900-7-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604174145.563900-1-sidhartha.kumar@oracle.com> References: <20240604174145.563900-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ2PR07CA0011.namprd07.prod.outlook.com (2603:10b6:a03:505::20) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SA1PR10MB7593:EE_ X-MS-Office365-Filtering-Correlation-Id: 96b9b646-c952-4df8-9144-08dc84bda64c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|376005|1800799015; X-Microsoft-Antispam-Message-Info: YiHAjmRAmUkkNvHpu9QAWBTt4mkzhEuyccGYqtEEye0lkvtJSYApXZ1OMR9JIqHMEdjAFgXDFmCn6V3GiitNrbWoCJvpz1h6kOiFH6aSQ4ZCo7cOCDCYeYVL3qJEzlNNNKz9fHJ4LXyax9bHEBVVHmq0gm+54SJJu48vEECz153YZSiFqY+WCc1B5sO/j+AvkYf7leHOHPdmYBq4nRgLGXgU6Rpx0YN6Jpe9xMxkPvxu+xnd5GAyMrk4NPKW9sd590CAefz9awesUv6qM4egUFe55SsmOkir8mZ5op9Kom6IfuPsBuusM4GXcnszaluDXU10gzb9QZdzyifGCBnykpsig7lqPNbck7eLQgvbS0NrD+goj7Hel7XKbnEvz31GKmD9myDY6auwSNF+nSHFMTpHMSXEmr2sjCgQlXDzRavYTRPbqc4IKBlKIHpw5DWvZFhPbUM5+C4lAddjzANcdpzv4bEvPcRpxXckJd3XlavmU6FG9VvCnXO9cCv3Uy2KvHaOpHSMTs4C9yN26+BT4SyVWCGIEwA+GI11rpJ5SCcmD/M1ZJPvgEB3l5AZ0AKc9+RLnhAoljFXwVP44/4s2ieSyPsfqxGbmtRo/GAL1T/k6vG9GLT/hM5G+jhmeCP7d4LMIPU6DLDyqzZ2ei1xPSA0ldCVJH+kCida86GVyOriYVoE2IiCSKYq2NCjl/OGiA5EMG8NgDVlFdnH+70Zh1nWgmKx18asT0N156DoqPmCKetylTCba4GtLEgmqmTco35FTL9Kdxyxh406VKh0I49wkCfm/r9GpiLu0oKDLvgSkUTEinYAMcGfORdKhvateZbOLWgaxAc0MRtcUMYWpXDhqrgFyDNmOiXkSyQZma13dRFh0IDGlJMKhObZMNOUDfFJuQ4mBu83gGuE5Opr+CsfxPRYsz5bQw5nPp/hh9y/nJ224XmrSBreGVOwVayZJQZGl3j3Djvvx0KrKrFkbGGiScMN4mLndQPbv/VL1pq5GSWq7/EZBsEbWYOhX/3wlFkfz6pU9oBk2YO9SCcaXl/OYvulQJCPm5hDPRUjAzsetU5go79TCd+xOH5XqpZLL39WMN6RunHsENou4SThypCi9cG38SgkdVtW4+o/aYyC0kKUf9iJeh9LN/hvHuDgqF5FBn/efR5XpgzNoN9iDqO7u0ugC+Zgc0tERlMd4vimJklu/v71EqyEout6Vdd9AL9oq3tq0Me8DQhVlSmYjBP+JcssJliHZbYlFjNZtZRVcYRQq0723mMp5RvLoggLvjtXU/W6V4T4CxDpglsp6Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Nd1wa1ulr+wrHbN9dgFwv5mYonHWbPzWO9b8Jsw4UEdNR8jmJ6s1TRzX99o0jtQCQu3Uzm4grPg3bDESCr7NflIXAZwrLidQzE8TWZnwm6WIJ4Ts6hh2Q1FZtOTX8OcP60U1aMv8AYgjcINOR4MVUP00LICbGPDOvO+cK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YVQjwNNUuVFVfrKaYr+E6lEfpd+SCEuzHQ6lkimLjeey1fqEBvI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 96b9b646-c952-4df8-9144-08dc84bda64c X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:42:05.5732 (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: I/H7kmfCRvKTO8j+9dQwQYTsyE5/O4jKxJjkg1Iq7l8LcLSOyzIy4qcU9GJ4zFjLrrzAxDYEp3emaX7OQWGcrL7VFNEnxVAgnbzn47kk68c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB7593 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 spamscore=0 adultscore=0 suspectscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406040142 X-Proofpoint-ORIG-GUID: ZqddAFvbfuPVpoEFuezy6a7vt05sgPvX X-Proofpoint-GUID: ZqddAFvbfuPVpoEFuezy6a7vt05sgPvX X-Stat-Signature: c4ixt65tstjf4isoddkw9ipheopquhuu X-Rspamd-Queue-Id: 5C94740021 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1717522940-304123 X-HE-Meta: U2FsdGVkX19QQT5QVggzuy23NslK35Yb14c9ZPowu9/sIyxCb+bTs7Rgbly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jj0nDFbJE+yjGIzT5WHu30/fGW5AxvtTnmavxB5a8g292VY0mVKws/dJExcGoCuHm0SyoGfWEeabjTbIZPzyCfwEzC5+D5C9/Uoj5hhBc/mAdADKF5Gagb+PIk/l/bn5H7KtvBIHpZ9Gx2huWANOdMa6JDF3aavmXVKsQKPYFZfCpEVQx/uiAMf2RaWcnECdSBPNaoIRQsuHR5ARl35NAcrCwqsY6aAVCZtFUbTy5Ro+8ZPclWGQgcxgS2qbUfrkkk1Wj29eZeuXGBxQZpYTxtYGSl388ui3yxU7ky+J0fcLAVXjvlycaNZxSnWxJJoL6Cw== 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: Separate call to mas_destroy() from mas_nomem() so we can check for no memory errors without destroying the current maple state in mas_store_gfp(). We then add calls to mas_destroy() to callers of mas_nomem(). Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 39 ++++++++++++++++++++------------ tools/testing/radix-tree/maple.c | 11 +++++---- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 3780d4bb0415..f1496817e52a 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4526,6 +4526,7 @@ int mas_alloc_cyclic(struct ma_state *mas, unsigned long *startp, if (*next == 0) mas->tree->ma_flags |= MT_FLAGS_ALLOC_WRAPPED; + mas_destroy(mas); return ret; } EXPORT_SYMBOL(mas_alloc_cyclic); @@ -5606,18 +5607,22 @@ EXPORT_SYMBOL_GPL(mas_store); int mas_store_gfp(struct ma_state *mas, void *entry, gfp_t gfp) { MA_WR_STATE(wr_mas, mas, entry); + int ret; - mas_wr_store_setup(&wr_mas); - trace_ma_write(__func__, mas, 0, entry); retry: - mas_wr_store_entry(&wr_mas); + mas_wr_preallocate(&wr_mas, entry, gfp); + WARN_ON_ONCE(mas->store_type == wr_invalid); + if (unlikely(mas_nomem(mas, gfp))) goto retry; + if (mas_is_err(mas)) + goto out; - if (unlikely(mas_is_err(mas))) - return xa_err(mas->node); - - return 0; + mas_wr_store_entry(&wr_mas); +out: + ret = xa_err(mas->node); + mas_destroy(mas); + return ret; } EXPORT_SYMBOL_GPL(mas_store_gfp); @@ -6365,6 +6370,7 @@ void *mas_erase(struct ma_state *mas) if (mas_nomem(mas, GFP_KERNEL)) goto write_retry; + mas_destroy(mas); return entry; } EXPORT_SYMBOL_GPL(mas_erase); @@ -6379,10 +6385,8 @@ EXPORT_SYMBOL_GPL(mas_erase); bool mas_nomem(struct ma_state *mas, gfp_t gfp) __must_hold(mas->tree->ma_lock) { - if (likely(mas->node != MA_ERROR(-ENOMEM))) { - mas_destroy(mas); + if (likely(mas->node != MA_ERROR(-ENOMEM))) return false; - } if (gfpflags_allow_blocking(gfp) && !mt_external_lock(mas->tree)) { mtree_unlock(mas->tree); @@ -6460,6 +6464,7 @@ int mtree_store_range(struct maple_tree *mt, unsigned long index, { MA_STATE(mas, mt, index, last); MA_WR_STATE(wr_mas, &mas, entry); + int ret = 0; trace_ma_write(__func__, &mas, 0, entry); if (WARN_ON_ONCE(xa_is_advanced(entry))) @@ -6475,10 +6480,12 @@ int mtree_store_range(struct maple_tree *mt, unsigned long index, goto retry; mtree_unlock(mt); + if (mas_is_err(&mas)) - return xa_err(mas.node); + ret = xa_err(mas.node); - return 0; + mas_destroy(&mas); + return ret; } EXPORT_SYMBOL(mtree_store_range); @@ -6514,6 +6521,7 @@ int mtree_insert_range(struct maple_tree *mt, unsigned long first, unsigned long last, void *entry, gfp_t gfp) { MA_STATE(ms, mt, first, last); + int ret = 0; if (WARN_ON_ONCE(xa_is_advanced(entry))) return -EINVAL; @@ -6529,9 +6537,10 @@ int mtree_insert_range(struct maple_tree *mt, unsigned long first, mtree_unlock(mt); if (mas_is_err(&ms)) - return xa_err(ms.node); + ret = xa_err(ms.node); - return 0; + mas_destroy(&ms); + return ret; } EXPORT_SYMBOL(mtree_insert_range); @@ -6586,6 +6595,7 @@ int mtree_alloc_range(struct maple_tree *mt, unsigned long *startp, unlock: mtree_unlock(mt); + mas_destroy(&mas); return ret; } EXPORT_SYMBOL(mtree_alloc_range); @@ -6667,6 +6677,7 @@ int mtree_alloc_rrange(struct maple_tree *mt, unsigned long *startp, unlock: mtree_unlock(mt); + mas_destroy(&mas); return ret; } EXPORT_SYMBOL(mtree_alloc_rrange); diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index c57979de1576..c834e91e6810 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -119,7 +119,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) MT_BUG_ON(mt, mas.alloc->slot[0] == NULL); mas_push_node(&mas, mn); mas_reset(&mas); - mas_nomem(&mas, GFP_KERNEL); /* free */ + mas_destroy(&mas); mtree_unlock(mt); @@ -143,7 +143,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) mn->parent = ma_parent_ptr(mn); ma_free_rcu(mn); mas.status = ma_start; - mas_nomem(&mas, GFP_KERNEL); + mas_destroy(&mas); /* Allocate 3 nodes, will fail. */ mas_node_count(&mas, 3); /* Drop the lock and allocate 3 nodes. */ @@ -160,7 +160,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) MT_BUG_ON(mt, mas_allocated(&mas) != 3); /* Free. */ mas_reset(&mas); - mas_nomem(&mas, GFP_KERNEL); + mas_destroy(&mas); /* Set allocation request to 1. */ mas_set_alloc_req(&mas, 1); @@ -275,7 +275,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) MT_BUG_ON(mt, mas_allocated(&mas) != i - j - 1); } mas_reset(&mas); - MT_BUG_ON(mt, mas_nomem(&mas, GFP_KERNEL)); + mas_destroy(&mas); } @@ -298,7 +298,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) } MT_BUG_ON(mt, mas_allocated(&mas) != total); mas_reset(&mas); - mas_nomem(&mas, GFP_KERNEL); /* Free. */ + mas_destroy(&mas); /* Free. */ MT_BUG_ON(mt, mas_allocated(&mas) != 0); for (i = 1; i < 128; i++) { @@ -35846,6 +35846,7 @@ static noinline void __init check_nomem(struct maple_tree *mt) mas_store(&ms, &ms); /* insert 1 -> &ms */ mas_nomem(&ms, GFP_KERNEL); /* Node allocated in here. */ mtree_unlock(mt); + mas_destroy(&ms); mtree_destroy(mt); }