From patchwork Tue Dec 12 19:52:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13489830 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 B34B7C4332F for ; Tue, 12 Dec 2023 19:53:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 40CF76B035E; Tue, 12 Dec 2023 14:53:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 36E4A6B035F; Tue, 12 Dec 2023 14:53:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 19AC16B0360; Tue, 12 Dec 2023 14:53:22 -0500 (EST) 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 041376B035E for ; Tue, 12 Dec 2023 14:53:22 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id C10E7120615 for ; Tue, 12 Dec 2023 19:53:21 +0000 (UTC) X-FDA: 81559215402.17.A1AC04D Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf29.hostedemail.com (Postfix) with ESMTP id 7B198120017 for ; Tue, 12 Dec 2023 19:53:18 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=RPQoT1ys; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Lk6UpqXx; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf29.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1702410798; 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: references:dkim-signature; bh=s9ZHq4yOVd2m969bRXUZGiWNOPfyPIQzd+QL1aKkjGw=; b=ffbYCSLBVXyibcY/tj7v1HDSqYlFaiU09pq+iUNv0OwZWgOR/iVP8a+xSacOuqSSP0FV5k YiqAw4HZ7kPBq0lUzUcpna6CVGipBgIQ9PF8abd98EFOKFDgF+zrAn9fYLJKEa+feWrxYC AcexC7KHk/G3Gy5F/CWVFS5yyq5ac3Q= ARC-Authentication-Results: i=2; imf29.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=RPQoT1ys; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Lk6UpqXx; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf29.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1702410798; a=rsa-sha256; cv=pass; b=V3kwKw2yigAqoWZITbGhXM638YLXeXVPtE4w2LKkvBUt/tQSCQW5ndq22Gxl34ZP/B91Uc 1oxJEwAtldfzw5Lb8i1ZpBefwekQlL0WjKbA1/gBAJV9HWZif4vVzIKtKAIzLniLfRwH1Z nV4YGE9DyRGHh32g1g5H+LCiVKzeI58= 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 3BCDiwok021412; Tue, 12 Dec 2023 19:53:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=s9ZHq4yOVd2m969bRXUZGiWNOPfyPIQzd+QL1aKkjGw=; b=RPQoT1ysIf3WELAOKMKTM3DuW05GBiz6FzzLqYWSVeU7coj06IKhtWIfWJ3DsCCwlstH z+amcbXHv4fJtG/fzrC4+ww71VgWX72D1Ys7X0YX1GTCjKz/cbCkoIuTIVBlwMuu2z85 4z7AFAJ8MqKbcOkA/FWB3sUUEsV2mE/OomXf6j3m7FDgtbL8irJA5aPg5dl7hmI184YT mMjXEojdyMhYiTy8I/poqnt0BkK7bAd+krZo3z71k+AS+A+6dejU6enphhSrftZhJDzi XjpjcqefuJFrWkGs/EeUYfjCjL5hmtuDNf3gnz9TSPqB6YJdzUuKO3ZDXm9V/3uYkgv0 hg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3uvfuu6hqg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Dec 2023 19:53:02 +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 3BCIKkwG003177; Tue, 12 Dec 2023 19:53:01 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3uvep74je3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Dec 2023 19:53:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LWsqIN+rUwt6Etp1MXFDLZDvC2VjjePnH7Mt5Oju6Efq7ZKMJOlvwmYfke51grF/Qbw19QM3kJBAsSlXe9hB32MPnHFWTFZrdraIt3IaTokPmhyRBbr9+GDDKETDgZr7//ZcPYLjaJlOYD4kpbn8HFTm0QNiC7nZB4CP11NPM0WIA40Kil7uSAGIPRn745ItzoUnDwrGS3bBgIGMnkSEyhFzdZdZqA3h3fGdGiEFauvOiDAcj+0IBcfd+0L9QcPYCS1TM8JnUIXFnZnOHvxo3/y7hSFizw0QSMpICaumS0LjS/8J+YVssjWh3GXBeZrm9AQ40dJ+jHm+TjlUvALi/A== 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=s9ZHq4yOVd2m969bRXUZGiWNOPfyPIQzd+QL1aKkjGw=; b=D/5UPFTjgDcUAY2MSElz+rWleECYrk6G/8uBut1PDvKGKqr8DhGLSGbx/n4KSk5wVOgdSrmEKZWvs/EHS70ibvLLguo4VIRS4pal2b09TEwHtISaa0RIbIJQE43dM8MRTDvG1nOjck9qJR2d424fefgesxQ8QFIQj6GeADTxUguVruDoCg2EiiTLQ99DAyj2c56ZOx/nlroem7vR6H4N6omis47jBv4NVDUz0Q820iOgrZ7fywecDR5cc3gVxSXU5uZi6vOuBTSit6HXcEkHHyLUggIcOyCEgcpl5ySVgU2Cr4KpopmqniLKgKyDQYw0W2v4+Gxda8oddzUUtdS9yw== 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=s9ZHq4yOVd2m969bRXUZGiWNOPfyPIQzd+QL1aKkjGw=; b=Lk6UpqXxNCsIYIAiiYnWWX19P5Ad5cFiZS1dfpQAt/XL+awpUM+Q2Dtj4MXTm7YTzAK7+GKkUeGHfAwKMaR5tZEkqXPEmRhFIJ/YChNhuWNoCYWdddapxA13IVTjoOS6XtaXujnMYGKA9UbnM786pscF2qMQS+EtaJocWg4BKaI= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SN4PR10MB5573.namprd10.prod.outlook.com (2603:10b6:806:204::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.33; Tue, 12 Dec 2023 19:52:59 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::7361:23aa:7669:bcce]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::7361:23aa:7669:bcce%7]) with mapi id 15.20.7068.033; Tue, 12 Dec 2023 19:52:59 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org Cc: akpm@linux-foundation.org, willy@infradead.org, liam.howlett@oracle.com, zhangpeng.00@bytedance.com, Sidhartha Kumar , stable@vger.kernel.org Subject: [PATCH 6.6.y] maple_tree: do not preallocate nodes for slot stores Date: Tue, 12 Dec 2023 11:52:55 -0800 Message-ID: <20231212195255.219624-1-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.42.0 X-ClientProxiedBy: BY5PR17CA0039.namprd17.prod.outlook.com (2603:10b6:a03:167::16) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SN4PR10MB5573:EE_ X-MS-Office365-Filtering-Correlation-Id: eda2e2d2-d153-4c37-548d-08dbfb4bf12b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4dNzgR9+NsNwHSOwRJYo8pbN0AZQUGkDaQdkG97sj670/MDo2Dxtj2fFeF/qzMb9cbrd5pN+A8apqQMIkIGYkAfvHcpm1mxX4FjOGsW0bMyJKwFaesH7AXKMuejIca9M4aHqGgm76JjEhmnP7VT1izRVJ3utdl/VpyoPcERzKbXngWXMN14ovcgE2zwES/VdE6PCTaqm5jzuvXRANfPlfoG6axyzztabDTCJRFW5RJkLLGQUKCqK2IllmCMoI5OgWmrLrgSA4tN9OLCgd8rOAP8xp2glRLHZzIYOY/mVzkM7RjXRzwFbbhlSOs3NLx9ufEBkJYAGXy0dz7dgy4AczYZ4lo5m0HGNHYRPlGGLnOX4hDH6QUnOu1AwVRLVXf8F+0PtGuImQZtDJcHbgY5zmmmdoZvB5n1x6BHYeaqDxTC6xKuTcy9Bz5EnMMJQ+DW9ue3sOQHRUmQMnh2uUXQaT9xjvtFnA8iqvB/2dtR+9FrEtV7dtoGpEAwjW7B56sDuCAYGXQwa1f87o/iillrcMa7if/Cp0Q98K4hAyI26P6i7nKXPItqZJltx6YyyX+kB 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)(376002)(136003)(346002)(366004)(39860400002)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799012)(41300700001)(38100700002)(8676002)(316002)(8936002)(86362001)(36756003)(66556008)(66476007)(66946007)(478600001)(6486002)(2906002)(6512007)(1076003)(6506007)(5660300002)(44832011)(2616005)(83380400001)(6666004)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0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hp/66c1crcMYTFGYXF8BwE9KpaMiC4AHVbHiRnV8oaKHfJNKS+YoCeNKaBofYE1qY+cs2F3aJWzCz12BIyX6Bo2chsUmSHQ/bNzDwabO4ro1StAZWfjMxXnEnLH9NTFxPI/loCSzp+RLmjjRvbYjhZmct+ea3rG+LcxM0Cjh4lWTwgey7u7f14Tb61bKuL3erVJ5t6qCEh2mSiztEC2LppgIX8pZtiqAy36s7o0VUNmFc8a7vtbNGGTAp9muHgYF24heLflno3GHH4siEUS+B5KaH6HAfcHbTGkQ5FPway2EDtq7p1M5TmNbusGq1j8AyOb4SaVYFOdnE6kkIk3eT4dwRErcEvFszWKs5ywXgQhHNjjietIcHModCHK+R2wcGlpvUHVuU95CAhfcs6gBeZnuPCbwp4CeNcAZjs1+ijbkiz3kcibnaZGtMYY/rzDLp14qoYbMgQXefj86JxiWtoF7PmiRVdrZF0SRxmNXlXAZBADFCmPbNj7nU+NKt8yDoM5RPhbIp9PPDIHO9fcr/nhMZ43suw6FJf8vq/HmV8eLB8ei23MM7SY= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Mn1+LxWMRes82cDFu21wbi5G/og6EuwXhcqsQ+VsS/KRixj4izwWXIKFwUe0AmAvP4ZEH98x6XST2ol3WHuvARooHkvqRVkWCHtru9bB3eZybomqoGdDQAMtj4YXvw9X415ZOyIGCbJieMgYOZDUDQb0C5JWD9AI82tUTVXgMDl+vKmf6ZIKiKCbxyCEs+zPf3LwwY5lL56KoDO3qi23ZRmRrwS+okb3F7CxixSB8GxZtjfc0+i2T1sWPBImT2MDlPURc0TEWTJp27oQbt06AnOBdVr6rWilJ4NMLwjKU+jYbKQcHdG1aQBD/DoJQgS4G052FpitHTJVOTkRSMjtWKnxF8kGlh+QNspJPlIgPrubjOnttW+SnX+6hp1BR77WGdAjiSLiAwAxXyP8KHPHQfC9VimOew9CrSJ1P4IR52WCdSAmJfVEs4ybSOQfwEoanzdkQ7BrZIMpEDrzvWFIi3BBiDkj0yOT4Kudk0nkp7du2Iws30vRMExCGJ0uBdRO0DFTXS3bqwXDNW4cbnyeG/rbu/quCfgwHwTcju9BjvugWaZxL1cP+6fNKjDCeuB3fFAHYwDgW3n/1RRWvXs9ztNR4TA5mR+j7x7BHF+G0yFIFTx0/8zb9LS+jS0Su0U6sEbjGEw9aMWGq1FvV3CQppxcFlZchWzvDXLYgzvNNAYgmvIfe932J2R4RmkyYXRKmuXUcVy3dnu27zDZAQcb6byX13aGXgt8E1BqJq3nbY7fgtffJ9a1TnkKXhf4DqIJCBXa82NYy2nplW7Ms4wtRbOi6d1lX+hoYsoUSxjl6Y7gXO0QSalsZ/MfoO4wnnutEF2DENPMwcW11lTN+6hrG8bnhMeOSLoAzWjP0Lr4MliUC49vJZ9AA3nOX6cyM+fkgv7EALrV0n3ezL5DeWc7VKxyh4+jF+ByQ3x3NZRUPj7E4Zub0BuEPp2ipX/Tmfcl7omCgPeMrxkGYJDjbjwoULLj+QwfuWw41tiuU3WDxkg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: eda2e2d2-d153-4c37-548d-08dbfb4bf12b X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2023 19:52:59.1876 (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: gnQCDvRgQONUScxij8tpVfiz4nQ9Npo633OMNsyf54dH4HoKq0XZS5uV6oKTS3MZFalD5W+ASAcF1xJtf7TDJqoP3vl0Hz5SFi2Kv3uvsF8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5573 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-12_12,2023-12-12_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 spamscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312120152 X-Proofpoint-GUID: B-n4FTqgwzdrXyqb9EuZmVvtPGRwvSwC X-Proofpoint-ORIG-GUID: B-n4FTqgwzdrXyqb9EuZmVvtPGRwvSwC X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 7B198120017 X-Stat-Signature: pfqf8jkm1yq1byjpy1p5hz7rh4kw6qp9 X-HE-Tag: 1702410798-814945 X-HE-Meta: U2FsdGVkX19NIQcjSeLl+2Atg2Dp1hwjqwJwoygvPIy/eZSNA3wEGa51lpsoDK18yEvBO4W8gHKfQWAzxDJ19v/R4FB+QzyZdvoyE3LHv+MhMJbxeL6EiFyLsNesHqVpKGolpfGQncY7qtRmt277gShmXtQPJP4LOowRpwbi3RXdztwipCJuCoiaGB7/d2Jhkg5Z3iDovErXKz1JhO72YOOiVPzlzuP4gQ9+vbx/hry0oaASX6bt5pIOzTet+/YAkcqdzTGfv8rJP46TvL4DFQdyCxtc65IUPvOV5ALw6GcNpZylCtg8BiZrdgEwcutvaLNVxbIWL0vl8LoFR5YYgKGAnn32pz0SYwj3YZrp5mdl02oDkthw1UeMAVgXrBWUa0Ng39V80w8YhluDTEeFql5Y/yjHI9oWYwEesEWCar0k+XKvHeZTbOwC2m7AHq/1OAUvipi3NYWTyt8+d5GklaJu2MnVMKnqJ4ZN/8Apyd/+9hDsLktiKTRg4vydCmcrSiCw5vPtK9ghimngXETZ1rfLB/5ufcRxZoLMdbOSMApl7MqZYOtm70mzZtCMoho2ACG/ATD8jx+X5GNS4PqiT/bCk1aY+Tcy34qJ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loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: mas_preallocate() defaults to requesting 1 node for preallocation and then ,depending on the type of store, will update the request variable. There isn't a check for a slot store type, so slot stores are preallocating the default 1 node. Slot stores do not require any additional nodes, so add a check for the slot store case that will bypass node_count_gfp(). Update the tests to reflect that slot stores do not require allocations. User visible effects of this bug include increased memory usage from the unneeded node that was allocated. Fixes: 0b8bb544b1a7 ("maple_tree: update mas_preallocate() testing") Cc: # 6.6+ Signed-off-by: Sidhartha Kumar --- This is a modified backport as the patch to fix this in upstream does not apply to 6.6 because the node_end field was moved from the ma_wr_state to the ma_state after 6.6. lib/maple_tree.c | 6 ++++++ tools/testing/radix-tree/maple.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index bb24d84a4922f..5950d0c0e0f69 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5501,6 +5501,12 @@ int mas_preallocate(struct ma_state *mas, void *entry, gfp_t gfp) mas_wr_end_piv(&wr_mas); node_size = mas_wr_new_end(&wr_mas); + + /* Slot store, does not require additional nodes */ + if ((node_size == wr_mas.node_end) && ((!mt_in_rcu(mas->tree)) + || (wr_mas.offset_end - mas->offset == 1))) + return 0; + if (node_size >= mt_slots[wr_mas.type]) { /* Split, worst case for now. */ request = 1 + mas_mt_height(mas) * 2; diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index e5da1cad70baf..76a8990bb14e8 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -35538,7 +35538,7 @@ static noinline void __init check_prealloc(struct maple_tree *mt) MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL) != 0); allocated = mas_allocated(&mas); height = mas_mt_height(&mas); - MT_BUG_ON(mt, allocated != 1); + MT_BUG_ON(mt, allocated != 0); mas_store_prealloc(&mas, ptr); MT_BUG_ON(mt, mas_allocated(&mas) != 0);