From patchwork Fri Jun 7 18:52:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 13690596 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 AC988C27C5F for ; Fri, 7 Jun 2024 18:53:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 599B46B0092; Fri, 7 Jun 2024 14:53:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 521DB6B009E; Fri, 7 Jun 2024 14:53:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 289626B009F; Fri, 7 Jun 2024 14:53:20 -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 02FAC6B0092 for ; Fri, 7 Jun 2024 14:53:19 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id A9E5C8186E for ; Fri, 7 Jun 2024 18:53:19 +0000 (UTC) X-FDA: 82204990518.21.0CAEA22 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf29.hostedemail.com (Postfix) with ESMTP id 4BD5F120014 for ; Fri, 7 Jun 2024 18:53:16 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="IRczB/Ya"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=fnL7zQLN; dmarc=pass (policy=quarantine) 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.165.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=1717786396; 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=LbRUqzQTGgReNrj5x/34j4uZL7gNsaS8wJAQGdq1eJ8=; b=rqLVHgEQ9pnoKJ3wGAKpFb0Tn2rbOtMvMxPjdVkgFOYGb2uIb38DffwjCGNxEMFkVO0a50 w27EjukEqkKHJKXhl5Ozsm2QsbsUbP7y4ODAICpvxbNYPyyQ41pWRqr1J1jOoOFVaxROnB I71kzBziWonxhiNbBaOOJS6cYE9mbzc= ARC-Authentication-Results: i=2; imf29.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="IRczB/Ya"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=fnL7zQLN; dmarc=pass (policy=quarantine) 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.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717786396; a=rsa-sha256; cv=pass; b=UJGK5tgd6c7QyUOcJBKeGBkHERS2BJ7rFOZKiISw1ID/Zu8yUdwd6FjVL5ciIffqx+0V5q dsrWiEM2g57XniVB67dNtMm1DGoaxcpHa3UEr5c7s8rWVBNJ4pw9CUmzCeXjstKIAmgt/B +0MU4HB1lvkMB5/5REPyVvjZ0iEnSEs= 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 457CuWo9020011; Fri, 7 Jun 2024 18:53:09 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=LbRUqzQTGgReNrj5x/34j4uZL7gNsaS8wJAQGdq1eJ8=; b=IRczB/Ya9ZM+uXRzxNER434FqHxwFs76qofFTZb0cNvZ75Yk1uZ7Cwlg0OHxr6by7o8+ 9xzfiYFKTwLkfwK+7MQVUJa3dwsi44Vkp1RtWBoflx44aBgwKF/IsaJTE9T8DB0L3JkT T1lIU6MSTrH8FVBDVRq5EM5Yy+1QPZE4PChqA0N+eCQM9sHjPTuQxfo7JLGl43F//lKf sPutDnIEO+HdwenR0oFWAnIcw5hSsxJ2P/1H/azxdRK+OWzgsWv/PuQsBQ/p9IrSMLDW IqSBP9U6v4CUgY5KHIMnJlrKNkAXCgYmMdSgW3RY+JBYv+NvjqaWDFS6EgA5Y464HpCQ 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 3yjbsye9bd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:08 +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 457I2CcO015604; Fri, 7 Jun 2024 18:53:07 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 3ygrjh0dx4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CqwOvHwXjrD4uLQUWd0ocCSZg5xVEi8Bv2BO14URL+mJ21VwcjFl825+sgSUxGeP1oJGcEALsuhPd8jeHfA2HkQJ66/n4rTBRniEBan8A0oeJ3uMXas+kjGv39I1PWPHMvCZJD/Q8oVG0I0os7Fg5uv1Kn3h9RRJ0hWlh3u3i8kzXXlZUZ2ZW0lZaolMaesW3yvdNdE8XrDytG+nNjiNjmyqvpZYosZKsASabSxkKwYJfN9kyUmuPAeuGxAgulQRFgedakkPjo+QBx+eJxM902NhPSSlxec7lxICni4O5YQ6bwYV6LiGL5rFg1P5h8jcinm4gjZd8RwkpgNCEwPSMg== 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=LbRUqzQTGgReNrj5x/34j4uZL7gNsaS8wJAQGdq1eJ8=; b=RIgLfl5wnL41jb17iyTvIN3jYfYz5BWwvOy7B0jmrGnfuvo7tz0Nh23x4CdV/s54aahUjUUh30z38gBID06nZW8olfY1yuGNuAPeovCuu78StCwGHLnt65zmBbIK6VQuFQxbpmL3Gu28iYW6wR8FAl6AA/LjLUgTGRa+7IER/ez+sLPv3gtdBTug1b0xJnHcplLVzuyM+o/F2c8ajIZi7lcf/pJgIGobEugQAMOyufMA8BcgWIsVw2tW3+hMOtqgOg4hSYnbVU9mxWejTQ60Ed/mD3tFa15VfhIlVay0jtfK0ETeRvGmTks4jK1mnkl9Zj4ZBMKeIKYKeoANflUFHw== 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=LbRUqzQTGgReNrj5x/34j4uZL7gNsaS8wJAQGdq1eJ8=; b=fnL7zQLN8XifaGc9UWzjg1BgEAb5hANHiIcIXatWRgbAzeBZ/M/i3KLvTiVPLloay2Ryu1GFHzwT0QFp1BLctmrSBjZhID9dqkWozLe74OtmO2L8FIq1ZHODSAAkoUe03ODoxlrx1c6Iy8AZJ60/L3GisQFxaUHbkYs/RKUUwYU= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SJ0PR10MB5629.namprd10.prod.outlook.com (2603:10b6:a03:3e2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.26; Fri, 7 Jun 2024 18:53:05 +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.034; Fri, 7 Jun 2024 18:53: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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v2 01/16] maple_tree: introduce store_type enum Date: Fri, 7 Jun 2024 11:52:42 -0700 Message-ID: <20240607185257.963768-2-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240607185257.963768-1-sidhartha.kumar@oracle.com> References: <20240607185257.963768-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BL0PR02CA0055.namprd02.prod.outlook.com (2603:10b6:207:3d::32) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SJ0PR10MB5629:EE_ X-MS-Office365-Filtering-Correlation-Id: 8ce4634e-dea9-4af3-944d-08dc87231095 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: M4veIoouNrwZt65Cs/RQRWiDLqSGpoynm+7xBylhw7kEeHJdS8cYvaJOjjQ+IboRyJ3XXhxS6+qS15vB22FbXd+GSkZ0XIYEyJGe1fdBt03fnb7cGbSyj+9vF/19GXIY40bYsZ3k1MRNSuPWkvJ1++qwUr8KjxfbW05i24W8HqK5+MF6p0SUL8V/2NkvuP0v89uFuHVzhQorRsD5t3hdOvgSsPNW5gHwouCAIN4dC1XXAoChUXG56DX781W8q2EcVZUA7Zmt0VN9rTDWpTbjOio4LPiuvh6umZ+Z3jmHEpcVSwfSLT7aE4QKgQ+z1EJxW40t1re3hfcWOJeqv0tKmenyq/oI+rPzkCUvbxhriWGbqpAFb78lfp97Sbx7CGsChHjVw5Y71FeL3pj70wiJukmjmHxn9n3jDy5lQP9DvGv3PWllvEZkSu4pyrArXnYhlY9oGA/IhqXzV3XJRo7v3y5pBqG1yxiuwXXkaL79pj8IvobAvrGSDwyGLWS2oQsEQw828AB18COxuufljzJeCU+KdGzqwoTaO+xvdLHmV8ad70L+zsC8CTaWxWjkwU9lJ1ECFQR9nAX2tLNZEEbuDP0J7/uPMZnvOZfbEEu3gfzUWbLC9HdnaBGwJvEM3V8gemVwFhwbi6PMHdk5ull6h/+ZHSNn2fKk+YqDHfrccwqRCO8vJcrD5gqkARvTyulIyXAfG2SLId9HdPEbOnLWr2zCOMjNUfuSpLRd6xdNO574t5wn8o399KFQAjBeIyg583j3huZmmLoINEUlygpMB0gV5yuE22mz92nX2wgobkPzJRd1JCfjpleYc5k9snJHzJrZ+o4Iikuwnrzfm0DhJ7kSRjn+bY9psYXYM1FFt1oMjR9vtEdidd8HOSdnYLxNIa8GyXqURvzpMaXaVkbdWFATozonZ3BFS9ohSZm5paVFivdGbS0iFKlv0DyLZqpIJ1LZ1eN36vSegmFNeOtimkKfkpcfr3O1sRgLjrVloD+aCZYMPBcen7yAoYlTngHPRu9Y0dsIfWoOcEiR7kpVP/sUdyz44ov/pei0HHMjo4uqTrcvwm36kf7fvffEV9o4JM9uxP9XikZkhavlXduM2SLb4LZhOgHmGlwiTeoVbR6NXCmGp0BD8Jm9MgZ60GOw7cbeHLbyuRlRDhGYsRjnTY/LgaTdueIpP70rh9NgUdHKTPl8aemkHyxapbolZM+g3UzoIdXKPjJNfJ8UaBB7uAi6R5RRHzpD0+GWd5B6MT37YyDclbJeK0FrxswjDP4m5DGN+1a3WZgr4w4PETcwkR45I72HgMhIiIcf6S2HBvfJSA8kAzvXLjH6VxzFl9lu 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)(376005)(366007)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MrhQ2n5ydVqXd3V3eLkeMGLU6LoQ76EKKsdyvtQgRSlSgZNi/e5DqVeB5MoC2mbJn/ZiJfkenFFZ00rnyo9a5jGIOWiTwvLljRLOUW4qW6OxoRphRIxKQS3NerJs8zZk3oKHyGK0l1Nr+O91K2G0fhggn8ueUJdK3DrLZ/uPbyC3mB1zuOyiexRviGGQOWFNc/6IYeThEZeES7j79qdezjdWirMfwdg9VZQSqc1+L54vfGh8Ijo5tDr3BSI0o6gMhgX9vvvZq3ZkIWG49CQ74zPaKCdEQydb30wB7u0BLT7bAq4q2t2KXzMKcvBaOr6YNxevHPR+CHEnVkjC9+dzzTjQ3RMsfdoMqKBB2Bq7z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z1mkt4DIi9db5Lqf9be3SrHIKRGXLI7QBcJDL/yStq0aDaj2W/CRkGZaM7RFa/IzYYMCo6TJLhqNb462W95hKZfuUn3nPkGiRO2V67SuUnuOT/mk45Il3VyKC778DW2Nss/O6VgaFO3S4/hTJJqZC4ai4l2mpOQLjAt0/y/R5ZIrtbCgsw3oEPrFRy/0u5lpocMilY= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 1t2Ce0c2UI4WczZQOsfKkFMntp5cBwO9NZY/iFsqF3rtJyfE2Gt5aV6BHmtMW/sKvfDPy1c6kCzNPS6vnmSxmwmCFf0r5RAgSpj2dqTyyzbhEmHjGZ09eOi7nFL9zwoLHJdg/43I7aOv3WlAcscV6sVPO8rzywyEquV3N0NK3n8sMX5XS0jQYEWWTKh4khWz2gLamnpksFvRctxXR92mUE7pQrODl7d7xu5CeJRxLr2lsAIjsAJAlxvahfI58++5YN/H62TC+pgXgeCzzy8DYU5fl4tfBA0NdzzH8By5xj9Z8TimGGkMhVUSE5iarYRc9h4Adb3ON2Ang/YO5snqeZ6etK4nOh4QZtXIVwqqK6z1BiZzbkbMAIaedc1Y3YIMfC6Wj/nxBQaczuolXDCeJblsGxGBPDN/6KLfc5g3cTwbCYPsmfNkPKntTvf/w5e061mjhgcMG+lcsQx1AvbOat9woTb+Ns478MZXMuX5GynZz9S74hUjyfWmXL1Dzvai5Tcj7XMCtghOZndJaDwUJne64voFKfmHwWEGrJeUJciP5seXZ/Qij/EWa3yqj+QqRk2i4otGLQmOHhy0MOTiP+kocfGRng2hEb4lEJc/RSY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ce4634e-dea9-4af3-944d-08dc87231095 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 18:53:05.6911 (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: 4C5QC7q7PC7G1BATfw2UUpNzE7uYTJQnVeVFZgXvKQmG5nUhH7HeMNUqUOkJ08hTFPxXAeIgybdsc8N/AMYl7sP73KEz7B36YWAVHE6GAts= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5629 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-07_11,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 adultscore=0 bulkscore=0 spamscore=0 malwarescore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406070137 X-Proofpoint-GUID: hIZLWV9gHGRM7VKUA9tebrIbWu-7Ccgt X-Proofpoint-ORIG-GUID: hIZLWV9gHGRM7VKUA9tebrIbWu-7Ccgt X-Rspamd-Queue-Id: 4BD5F120014 X-Stat-Signature: k4xhsfaxdndm6bd4kkbd94fbxb5t3ng1 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1717786396-436845 X-HE-Meta: U2FsdGVkX19F3Sfm4zAiA7wUvu+QHNHXxfb7fU8AimgjHiKzb3q6ceQne3ZKdhNop4XgUAFWPWUHzVIK9FTMXZyWUJRqu0EZ6a77vf+J2e6kMhyjV6OQ4hgDXdXhyQcT3vY1L4f+jinIvp0C7TvYCOkPeqyiLbSepGNBxsJXjL0OmwRYoYuGdGgoSclL1x/3UQZHHHReedcLrRGB20KIEWf368A704gbB9Hl9lVAgwBGaWoaMn06ap/Ah7SfuLKlhQ127M8TCwuIUDP5je45596KxEh5WeQl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ul+g/GKnvT0RlQLDpqlELNMxfQW1hjqi0H0xkKCdqO3xk1YbQx9Un5T7so15uVvBtowOzJ4MUM6tQF3kXEkzs938h1ayapz3g== 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: Add a store_type enum that is stored in ma_state. This will be used to keep track of partial walks of the tree so that subsequent walks can pick up where a previous walk left off. Signed-off-by: Sidhartha Kumar --- include/linux/maple_tree.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index a53ad4dabd7e..2a2abda9eb32 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -148,6 +148,19 @@ enum maple_type { maple_arange_64, }; +enum store_type { + wr_invalid, + wr_new_root, + wr_store_root, + wr_exact_fit, + wr_spanning_store, + wr_split_store, + wr_rebalance, + wr_append, + wr_node_store, + wr_slot_store, + wr_bnode +}; /** * DOC: Maple tree flags @@ -436,6 +449,7 @@ struct ma_state { unsigned char offset; unsigned char mas_flags; unsigned char end; /* The end of the node */ + enum store_type store_type; /* The type of store needed for this operation */ }; struct ma_wr_state { @@ -477,6 +491,7 @@ struct ma_wr_state { .max = ULONG_MAX, \ .alloc = NULL, \ .mas_flags = 0, \ + .store_type = wr_invalid, \ } #define MA_WR_STATE(name, ma_state, wr_entry) \ From patchwork Fri Jun 7 18:52:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 13690595 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 73C48C27C53 for ; Fri, 7 Jun 2024 18:53:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 216416B009D; Fri, 7 Jun 2024 14:53:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A2006B009F; Fri, 7 Jun 2024 14:53:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DABE36B009E; Fri, 7 Jun 2024 14:53:18 -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 A6BAD6B009C for ; Fri, 7 Jun 2024 14:53:18 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 3B62640279 for ; Fri, 7 Jun 2024 18:53:18 +0000 (UTC) X-FDA: 82204990476.16.DDEF254 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf01.hostedemail.com (Postfix) with ESMTP id F13B54000E for ; Fri, 7 Jun 2024 18:53:14 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=SrZjdlJS; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=feqNBvCJ; spf=pass (imf01.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=quarantine) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717786395; a=rsa-sha256; cv=pass; b=A7ylXiUKFIob02WTDALMFdHkkhgiSnNsFFmGc4Ez3u8l3eJOjXEPCfMRy/1DnrVyJzjBgi 7OFAY1u55afgNwZzlNUzMAdsWscgbph/jxv3sATEyG8TtUA0mBv/daD3hJSHekAPe0PRgp P3l+jPyX3Yj5K4A2XJEoHxJkhs1GKs8= ARC-Authentication-Results: i=2; imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=SrZjdlJS; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=feqNBvCJ; spf=pass (imf01.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=quarantine) 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=1717786395; 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=R5DSk3bdiGslX9Z7wkh3/TmOZQ0ej4zmzvHswv6wkU8=; b=7wKthP0MT1JWInEjmsxO3jcsuUy3iuhL/rkoO5UxoQkWHQ2vbXPjND2Sl79LfKEQ336TDH ukvGe38+07G9/SxxYRKOBTD1/QFMpQlHlFUzpcemzb4ScrbUQ6u+QdboCY74BwbMqCtQ4k Ch/Y+jjNf590DmolzoXtx4RjkESaBuo= 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 457CuUSj023582; Fri, 7 Jun 2024 18:53:11 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=R5DSk3bdiGslX9Z7wkh3/TmOZQ0ej4zmzvHswv6wkU8=; b=SrZjdlJSQi0Or8bhoRBC3BOv+mKPrkFAY2NocLf8u/dww8jAlvLZIAOhW2SBxjEU+62c rb+yTnKewUmUS9NApWXkHzYNLUHAoDa+uc9WNOCFEqCH4HFUCGhR+jBkYW305V/iSp/K KPpLrrKq/yWgun09pgcTnLK5ZJqSb8mzsomViSB/mmO0iot+vW+lhJtb0tslM3D+adbr gwgnU1qxFBAM0NgQ1qVAJ08HZY4nkuUaAl2NIM9mrG1oP6yBF++lw9E68diftVxGzz0i S22mpAQFB4cTFxyCEb9vdeIm5Stj7z6oInJK1WcH0/3PBrFFBVjAGy1MkXRkyeqFL2fr 1A== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yjbrse5ja-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:10 +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 457Ik5lj020634; Fri, 7 Jun 2024 18:53:10 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrj6xy8d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=girx4l3d2GFdHMlJTc7Cst6oTS3+8ad5+tmIUhxctlnnSKuL6NngvXUWlDWJMO/LlI524mBYKLTZLU8FF5ND+OnwCXcCwgjJfgTD6RQxq4amojsexa4tlyAuX/inA/cclg8n2mBPoR3Kb75y63OPs6bQKogpoISmx+jG0wF57UoQpDjR/Mj9PKa9pPd243lVLLTuzYUn7VoLOtckH6TvhcwDA4xcZ/HI3MTlWUOGcTpX8oOjIGAUHf1MTMc5415faNwycWskLi1cbH1c+EqpOtHm2c16PI0rbQq9Ep0ob8tzTbt4gzYCkxJ5SnS/tOY8t8QUJq92GoD4vOEGJDhFhA== 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=R5DSk3bdiGslX9Z7wkh3/TmOZQ0ej4zmzvHswv6wkU8=; b=RHwoM91F5A93wtnWA+ovRRCeIZ9R6FfLZzjn+HQ36nrfxkx+u9qa8jgzeBiDyqtQDGqJN1MAdRJPgN8zl6PpqF6+kkhuG8Lt2oeCqgsOK8e1OD3YrvRFXZfqyy5CHMYrp4QLhvI8bJpqCA7EyKgE/2Y9UGeRKw8+3AEWTtKMOE/pmjSGhT1iHX23kg9lRRY4JOeiUrvfxR/cX7Dpyp8NYuJqaC+5+WDVq9au+lw9kHlRXh0enTK8lhlj4f4X5nbtAZnPJz9zkKmFQ+EH6p47QPGPat57N4M9dXbAsNZW+d9I2V60UUV586oiKfxKtN7P3GAIbE88AaCNIp9VNrCNJQ== 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=R5DSk3bdiGslX9Z7wkh3/TmOZQ0ej4zmzvHswv6wkU8=; b=feqNBvCJ6Q+Lppft7sRsNeeIA+AHvBYGIfDlcOVMwYUkoLRMN28yJcCH2Rjd7Oi0lVQfW4CMUzDFd8LWzj02RT4u+P0Z74s0h1u1qGfBJ/EEOpZI73sL1p5m3V7UjjcGAVq0FcXpT5DjX/zlpdBl8muYujvQiFAO7EUB4Os1vxw= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SJ0PR10MB5629.namprd10.prod.outlook.com (2603:10b6:a03:3e2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.26; Fri, 7 Jun 2024 18:53:08 +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.034; Fri, 7 Jun 2024 18:53:07 +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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v2 02/16] maple_tree: introduce mas_wr_prealloc_setup() Date: Fri, 7 Jun 2024 11:52:43 -0700 Message-ID: <20240607185257.963768-3-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240607185257.963768-1-sidhartha.kumar@oracle.com> References: <20240607185257.963768-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BL1P223CA0024.NAMP223.PROD.OUTLOOK.COM (2603:10b6:208:2c4::29) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SJ0PR10MB5629:EE_ X-MS-Office365-Filtering-Correlation-Id: a665820b-41ed-4c94-053d-08dc8723121f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: Y36SVGahmumVXVN9w/QrGYrQDQZY66ynzTEN/nw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jigxii1cRASTJ6ydQGI4w6VBdLqFXQ2CsrThH3++705XrCLeDwXdHgo1PUlNZIImWgTJG6wkki/h2MPV4yZXdf3wdQXnPJqQfvA4XBiUGukTecXcAEag9VnJJOsQ1ta88Dqm/emZg5E5uCyhkIF/tb9v/hrhvfTEQA55YfWWsAO6jdZxE2YB5t4MhWH/TrMt7aO+rw6Y2oeh2bWFjQhmj 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)(376005)(366007)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WLtB4uZA2/Wf1iwUa4Y8fZqKKpq88SxbzBrqzRVKHnMAXaX3WTeWP5u1QjaTlkqeC3cbBE9sm09Wq1qJZdbRsivyiWaS4HqfwXfEYj7u1SFtl1xPaDEHMfyl0dCQv+/rSnBUALmT9XmKujzVkSp7YSbw9wgpFYb9l4CGE+o8OJ958zPuLI0D5E41to+ZFILWZUBBptZb87DON2CzVcN3nvE9iqmmJJZdyzgbWCqmVVFXtEWkAZ7MvWTAG+1MWTOUsaTMmxH9f0/yZng4U4SxAcKcjbuENqaWLG2qgtVcMetILhZgm6JYM6AM3S1YMf0R6FJBXGBDg0Hb5zVoGDLaYJqdIcWM45smrjrRFUwjM5PiMyrkfbalkVJQNCZZJ8Yd4cEGPKtZsdCmay6tlIj6EA70AEMd6AYSAjj8WEamPUOQ03xjU/xOoofpIDtLwR7XzlOaFU1OPKa21RTth2NmlLW5QBzBAHv/lFmFIrQep8aSqCTqm8rHk3PVCjflIEkRQIvt8ATzJF4ShcY/flLkBqDVUZ+qlJqWXf3CyPWcs/uGSIqWvqet+0sFlZn8auBQ1H34asO6uYCC4dUpAU/uqSsGei2zh4PbcW0hH/ZYhbyKpfnIRVpY/rFQ2b4NS5m3GtOIxWmhGOBECNTj9v6vKbtrXknetsQHO2Kd3S9MtHgX7ztfukvIXzHg20eooyPuV0CMpfM7osYM/PdVkqjK5l56Ja9fEXULTok2arKLTIPTFwoUAn6mt4QA+CbXqt89iEuCpAKGBNqKC05rytv3YMltRP/pNmt8+LMYWMDpf7YOut5L0ZK+119Vq7+SmPBpctAN+F97VrKDtpzy2Tlif3r8/B19j4+WvLOUtxJCnY/N33EZI1cl2x/tFfSZta8d+AeROEMw2YWa021JKzYXQtXRfuPNtnNqSenwug9ThQwJ4LCm+KCQn6y4fQi0HBYaXudm622PjcsnIhFKmV8B8TNbeJDMcv0s7yyymGJOhNzgbFw7KkJRDCrbrR28nhYhaUE/CBXP83Wavclyqg2KAewDFoJyGrOcJsT2sy+UVVAuTLtTseYnTXAV9d7kk6zgdpyDGnTjMxriMbABJQ73aTOYQ2BNjhgi6OKDjyWuvqUYVcZ51nHgQMJWNj97/3phN+/jRl+KLjtddWJMllSe1FQKwd/ELft52HLqauiwJaP976cZv4dcQ0PE/ABYmGeANJ0WKa1gq3vfwlues6zngFO6Poy1Nkj0DEzXxwSc/HWx704z7//2RSCzQSoPOxx+qc+f/JEJLyjSq/qMNwL7zxsN9AYwgDvdtS4N4QoqM80UbsL4GXVxGuINaeFAaThhmF7peWJmRa24mBxi/8ge0LQO0Hk2m5N/2aqugd39jbO0Sh3RtdH5yZkj+IcrODYURzRrpTJC34V4PnsPUBv/WX5ssrjtJrZO5JTJQyagNUhjHkJIadLMFfDGTxmrmHZpfufYE1d1fi8Nk81d4Cf8QIgEbGSLgAGnIAk/p8OlhcdKUeYK1OcXBt4tHqX27KigMhQlXl1G6488AL/711G3EFvgjyo89ST+yYnofHPnJc8HkBQhQarsni3DI9l9CVifcNfeuxrQOPyy9GWQH80m2h4ehKdtJyTLyFIXp9+gWZ4= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ClmEHYhk3Qk6clmAs/K0nudBEz4vpjGzL3rgF7VJYDR7+zMlYy0ZsVRcUDJAZ6WgXmX58gLeOPOlekxhPcoptIdSbO1tNtjh+Xp0N6Y2aXQSPC/FgAtDZCo8YhRMct+Gv490tmOPz61aw72GEJEPxGtKlIZY60Yatjse8A4kJ/ZRF9fzEsaNgGFWz/qqYKooeeARm7Nvr2N7WfMnp5ktlV51tTETPBLOjgrOrlsyPyGE0qmskUsQqBaztJif87yE0KR4kl5+Axi2aIIALIkNv1Ic/ml3MrOwLp5E1Sde2OSg4sFBITPSjgA/HLzA04KugmRf3VIJ9NRvTVGRKRozkjMsJefOKrs3g1CV1SrO6HqdbseDLf46uqfYzVUIh7FeotncGppIHpPg1JYULkAj2To5uVZvsye9+Pj3p+yU7FBx59wWVsnJn4lvt6J72Xhe0xXW9qAQ7WwwzGC+GdlDRpXIGZLPXxVAzVVRVdZm2cyg6dyd3S9Z4Bx7F3ItwayMniyL1bEnGclVYZLYVF8v1uS7OstAFdQ6qXML+AxK4YBRup2t5rFGyEjcomK7Sw8IfyuvMgEwBYeaMEA5zhLE1ynByEOBgA9HkOqZMfrWJO0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a665820b-41ed-4c94-053d-08dc8723121f X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 18:53:07.8644 (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: LGwA4+zctvNE3gUkzfdRbamTI1FL+rDRDbdeG32WcTOHE64lLB44aRnAJzuMCAYBy9MfFiwJY1KrGvVxiskeGSTsfDMgiMivo99S+Brg77o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5629 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-07_11,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 bulkscore=0 adultscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406070137 X-Proofpoint-ORIG-GUID: y0HlS3sp1E0qKoPNvEr7C4JUB0XeEYbi X-Proofpoint-GUID: y0HlS3sp1E0qKoPNvEr7C4JUB0XeEYbi X-Rspamd-Queue-Id: F13B54000E X-Rspam-User: X-Rspamd-Server: rspam12 X-Stat-Signature: 3ad9by88ecz1n5iu1quujsfg9gz88ims X-HE-Tag: 1717786394-902269 X-HE-Meta: U2FsdGVkX19pyXjeBjpppDva3HXlnz8NPIsWp73GhmjHl0FKe/c1q5YlJlurWfam576tRdRdVNrQwBKeZxBj/tjl4xebTKwHzMNfp6OFZshfWVwSW9oxo905jOLr38dILNx9KqQaDdWn7R8U/0WqOs+c+7HH5QlMuJHiO9xbLrPFAcaZvlueEtg3jIlJAxXAxEI1i+s3vMm+Pdx4zbZ67/yhWGRiwfugRHOSc6IvS019AQEtgOkGQt3O026feLMnbBSKZ7o60tgB9WCb0HSgSZLlk91KTHPRtNSnApqaFJM4rTm7b/2JH3xicqgcuGj5YhwZ105jeoCu6OEoQwWj8+X0S9NCoshpy1MBXHXZc5Jd365NHA200b+Pra4s8/ASSyPh1/MGUC2ydjZIhy8NPQtwjMR9D6ougQi3rTpG4FadHculjZJVaGvZ0Li+n57iCy/aqXBr+HpctNe3FaRdMk4GTrW1R4xdLpUrwgMiwbqG7hb+lBYHXycZRve5n4Z2+E6iPfphY3JHkEfwGUZUKSb+xmeOuk63speYz0YBVNymUo7bWj2B9P033yA2ezqE0HsCCGijSmWltzy7xEM4ZEL2Wv297l1iyAtj/3hIebCKj1Oz/8IvAfomgofqPcbDUkuTniyIbrx4mebVtwE/mU3x/bxbek/KceSB723RCNHoHdDeENNQc5lHyWLCZPU75HElK1eP7156vRXKEw+UppyXoKVZHGLbzi0SPlguQTFdLwLNzZatY45tEuUeyhMQqmLFqtNF681M+GiSm0iou/dwDCM+49pQWESR9nLbX1cUuc9VZATiDJuc1VgzkyMfV1FDJVaqzUfeH6d+I/26RP9KQyY6GJQag55tP+kV84pZ+cNyXRac3n+6CSww3aEtPc5p7Mr7osLhk4yS+W5LWmFnZZzDpkHtqJ4Vl2lcqKjSYhilyt6V2AvyGr86jpx3iBFgvYomRhTWnHGCK0b edRF++Zq 8g+8NGp1F4FcBTzNrnvRG8jTSRFLLRX2hqSVi8TwTCSKk2jKrgXX9pj1JMwsg974Sp1aFESydgkzrKIC9V8GQG/MG2+pi3cfZDNPmjSJKtFo4Q0HrNit0zTcMnmd+YkvSIzolk4ITCJKX1HejzhSuXq/74pkwQfp5syE4UdqkUTHHSEtGDsY+BFf2cYoUnjnUBzA0tUe9yX1HeK2fMqWNlActCRBgSVRr8/uoZzK8bbga2iUzB2//KAGyWOs5wZBsYRyi/fkGoVgg32zm56yH8OWQADJ2xJgsVqnBBhRW3Dk0Df89FYK2a0x66eTiZlpsZIUxgrDq6MIIDZ24byC9MTxL2A10UsHNerD4wdz1Z9+bNetmohen2f7XSKkB/4udMUNNsEj58/n/cNXhX/Z3htpzqc9VhFDAL66KO+8cQZ5UcxQW/VatEm29EmQ0yAhQQjRT2j/gXgVVWlzVWae0gBuFTw== 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: Introduce a helper function, mas_wr_prealoc_setup(), that will set up a maple write state in order to start a walk of a maple tree. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 2d7d27e6ae3c..ccbec0f66562 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5402,6 +5402,13 @@ static void mas_wr_store_setup(struct ma_wr_state *wr_mas) mas_reset(wr_mas->mas); } +static inline void mas_wr_prealloc_setup(struct ma_wr_state *wr_mas) +{ + struct ma_state *mas = wr_mas->mas; + + mas_wr_store_setup(wr_mas); + wr_mas->content = mas_start(mas); +} /* Interface */ /** @@ -5507,8 +5514,7 @@ int mas_preallocate(struct ma_state *mas, void *entry, gfp_t gfp) if (unlikely(!mas->index && mas->last == ULONG_MAX)) goto ask_now; - mas_wr_store_setup(&wr_mas); - wr_mas.content = mas_start(mas); + mas_wr_prealloc_setup(&wr_mas); /* Root expand */ if (unlikely(mas_is_none(mas) || mas_is_ptr(mas))) goto ask_now; From patchwork Fri Jun 7 18:52:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 13690604 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 A8E9CC27C53 for ; Fri, 7 Jun 2024 18:54:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 411CA6B00B1; Fri, 7 Jun 2024 14:54:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 39A426B00B2; Fri, 7 Jun 2024 14:54:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1C6D46B00B3; Fri, 7 Jun 2024 14:54:21 -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 EE7D36B00B1 for ; Fri, 7 Jun 2024 14:54:20 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id A6DB44199F for ; Fri, 7 Jun 2024 18:54:20 +0000 (UTC) X-FDA: 82204993080.19.6F9D60B Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf22.hostedemail.com (Postfix) with ESMTP id 70C4BC0008 for ; Fri, 7 Jun 2024 18:54:17 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=PO+2rqbe; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=CeYSPjwK; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=quarantine) header.from=oracle.com; spf=pass (imf22.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=1717786457; 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=4/F43IRAGhI8ljuTq8SfDFEQovm5z5taHx5vw5SWya4=; b=aIXH2xlHyaekJ+yT794+4QOJ69gC7Eb1zSNtVl2vULYVI7DfJkwCvtdlptpj3tpoEF65Ku HKSe6yCfTatDAdjpWdR2GLECnUrWm8Me+XCjRKXSe5s32S/b9jHMu8AkLsFJee8iZ6z8Kp gzFeJtHy/uPH/XLB4GqnTVLcwPnT2+g= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717786457; a=rsa-sha256; cv=pass; b=3c4m/ZwpcTdeRM8QLOXO3kPccF0rzuFXvN/iXo2MKQLUI+HyA/qjp/jZrqo4EnkC+Pb7J8 kjb8HufMdbI4IT5g5FGRSQNrrWLS5HNhw/NOdYpQeJRziHY8XYg1WKaMLc3NMp8sqatnkh Uk0sQTBIizogkmhlPKBUZzxJyOE0uAk= ARC-Authentication-Results: i=2; imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=PO+2rqbe; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=CeYSPjwK; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=quarantine) header.from=oracle.com; spf=pass (imf22.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com 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 457Cubmj015442; Fri, 7 Jun 2024 18:54:14 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=4/F43IRAGhI8ljuTq8SfDFEQovm5z5taHx5vw5SWya4=; b=PO+2rqbeAyNn1P3F6/EaytYEhFx0iAtvU5kbbF6H7Y88+4XuNd458/qsa51AsaCoI3/5 yTzmhvZFTgmyZtWcfeF9k966s2CxjY+KfL+YixfVeqd7wYMubPafuorM/DRXXznVsgNS 88z64U3FDET6x30EsE0PmL9DAg1/WFwWIluUXNxudlhRRssBK6LD9Ly3B46SV4ka2COg qEcPHU3lpyIMHkmappwA+uUs+09J+lZhmV6OBJD9SGqFQ3Rhw8GkFwb5PRyaApN2s4DF 1Z9GUUbLBu1CU2sV9NMFyGYO9ZoKQpGwj5HiJAVJ9wLpA6VMdtqfotrpMbkyu3mc647I /g== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yjvwd495m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:54:14 +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 457IojwW025263; Fri, 7 Jun 2024 18:54:13 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 3ygrtdbxts-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:54:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VD/Z3oaw47JuXBNsg4j4V5rnL6M5zRo/lOqN7kAgDfEjfMWnxV0PK5iEnMVjB6NqhH9pUj5C6MGGc9LyWsVsXCVjkrjSMzRmA3SYYuewKxSAyCVkRkmTxQxzQA2dz1+NRMD6z8DejbjFAQACC5Oxxxq6pXq4qhs1D7iJNHHEzeEYA/M+ooH2qicX5CBQphjyMMv/Zja4HcatQRzMJbQLriCBTHlDKYKgc3I4qeG7qgyww1w4nRbp/9DN+rVbyNcVsLbabSD4zln6Bb+rSijSzFI4IM/3Cwq8zh9sOnb03vD+R4Y2xyvOb0jsInUpT7ab3eIBZKuu/TfNCgUU3MzgTA== 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=4/F43IRAGhI8ljuTq8SfDFEQovm5z5taHx5vw5SWya4=; b=ExjLqBOW9ae+S4HzqTqtQathKu3TOGEwMHYf4/dLskvrXSpLoDt0ttNK6OUO/KkI0z0wUoRvn3bqEglLOBGtqHrkkbZBX4Jty89Qroxtco8jg5pcR9/e3vT3W/5Bf8BzG2tF54YbEO6dCEFKNp/yYfak1PWdp5n9UUnIICJ0iuuYeZNVxf1V712ggnM5sCVgFkDnWgn/uz4W8Dr6v9fUxhKyKlHJLBnMR0Ye9fc8pHcrqsZ5J1aRuHo2Fu6D/fgCWChkVpmOQ8fW70N7keUJB9VNRgTgfLZIkSoVYpuu3Sbk6UdH25K/2b0xhXzgPs8TVLeGSuondrlWkM6kuWxhVA== 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=4/F43IRAGhI8ljuTq8SfDFEQovm5z5taHx5vw5SWya4=; b=CeYSPjwKXnYzXKDMAe32zqalt4sUP82S9Eibf+0I7C/eNqBmEuEJI905VhMq490XSHMYTbnm3HgN4YnSHSxM8no2wgF7MwcG2ZFw0ynwxO/ErPNXu0IGCpGCYyw2cyNFJN2ablcSJ/diq3fRMk6KNDTA3yzb8WO8OOBVP2RwCgM= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SJ0PR10MB5629.namprd10.prod.outlook.com (2603:10b6:a03:3e2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.26; Fri, 7 Jun 2024 18:53:10 +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.034; Fri, 7 Jun 2024 18:53:10 +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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v2 03/16] maple_tree: move up mas_wr_store_setup() and mas_wr_prealloc_setup() Date: Fri, 7 Jun 2024 11:52:44 -0700 Message-ID: <20240607185257.963768-4-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240607185257.963768-1-sidhartha.kumar@oracle.com> References: <20240607185257.963768-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BL1PR13CA0361.namprd13.prod.outlook.com (2603:10b6:208:2c0::6) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SJ0PR10MB5629:EE_ X-MS-Office365-Filtering-Correlation-Id: 92f28d1f-1c8f-4264-ea6b-08dc87231374 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: VRRT/d7YwfCnQma8nJwO2OFokOWGSXpfwIfZitQ8ksZW2W+RA0Au8MmuM3ughCtK5C9SNM5Qce+TtRbm5NoBLZlI6xK4IdPOGacz8KPXlr3T15STcFefk+7v0d5y8rhwxJ/hE7+kuVxykodhbsl5MGArjSHwrtDVYhg244n8cWYceHl69yinxP0fu3H8Jh2knC28SN9UpIyCPX/YCf4RCvFxFK3Yv3WqnsLg9JIjbJV+njv+hBZRcK/nIZwbIMiqw2YrAjzJiavO5CEdVI5mcJ8qbmn1SE9qQZZ1GKkH9oKGZskXLpTpIDaWSzxuv4KHCiy/iDgIswMthY5SYvRR1pp16kw5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YlQc0mHdlApmpLGFJZHP3YyneNGKMFzHv3iS7Hsk2A7r431HzAfA7bP/f/Ez9FOGe0rJUHf5luIvSu+tpSCRM+tMecktSaz9M964YQdo8/9f2KdcB/TrfIG3vUoWt6xWoHDXym09eGeV0+Lul/XhlpStqh4TuIQT+SDzFQXNT/dnUmIOjDZ6OQQEheYMrWQc6kvuNPUBTNnbA3Ph6hfD6ZmB+WDj5AqsQHQ1AB6cqChVE5PWWCRQhOy6msDc+yNGrcqMKmUvHHmXAFikRtY8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 92f28d1f-1c8f-4264-ea6b-08dc87231374 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 18:53:10.0903 (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: raBcw4kWm4WZ7gDXxBrOK1qp7FuIQgUZHIZBvu6DgMCeFKTM2yEX4vr0WxW/eJScgI6SYjMlhmpIWhEDWeAjrns4x8JmmHmA0K3gp4i0wAo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5629 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-07_11,2024-06-06_02,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-2406070138 X-Proofpoint-ORIG-GUID: Vqs0oFtGowhjzcu6ta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Qm5xNXz05TjaWMSm3bfdgFb5ooV0GRkVoHljNG45PvQFtJQH9j2JrUlPUMpi2fYetWif2MqvCLd3fXtCLh+fVedA lLe+m1s1 lAf9DNL+Vsvyvl/J9exLE7EFK+eLd+rv+NcVRy1J5vz1JSnEzASPzy1Hy8gpm+aQv9ZqGbXGMx7MkHFR0+jTbMV8KHhGk1f8sdp2fwdDhM28ZZnkQj+dRUN460BY2JIqPLkNFp0TWxuXfdUUn3UuHJWaATXvkvGNIPxweFhTfeSlrouXSUy2O85c+t4Qc01lrhpt9PccXOulKnCE8beua5LUOVxGAhAsA90FnOk4zjQzDutmkwXJDmAayd76GAkC8+4N5zGXnxyhVNOGPPybHn640TmL0NP8RLp/oZHycazjxjOT/3ZZ1/hyKeU6T0liGaxjqNtK0hmSbeKoXqCDOwSfsrSdQI/enVTMunomGVmZW294vCPoLz2itlMup1WTT2Inekdn9pIJ2c77dUFa6XX4uAB2Fmiwg69LwXXIWC1x33TopQOGmAFlPOo2R/vHWfHbevLpRua4otmwkpTzFPPQOrHLY/xcu3qVyR94CXdV5WTE2Y8tZy9lGILHsp9iC3vnW+fqlVXq8Fj7HNLyzvXQX2dWyr9QVDzjnCjD9A6gTcYGJcWZykJa4IA== 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: Subsequent patches require these definitions to be higher, no functional changes intended. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 96 ++++++++++++++++++++++++------------------------ 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index ccbec0f66562..2558d15bb748 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4230,6 +4230,54 @@ static inline void *mas_wr_store_entry(struct ma_wr_state *wr_mas) return wr_mas->content; } +static void mas_wr_store_setup(struct ma_wr_state *wr_mas) +{ + if (!mas_is_active(wr_mas->mas)) { + if (mas_is_start(wr_mas->mas)) + return; + + if (unlikely(mas_is_paused(wr_mas->mas))) + goto reset; + + if (unlikely(mas_is_none(wr_mas->mas))) + goto reset; + + if (unlikely(mas_is_overflow(wr_mas->mas))) + goto reset; + + if (unlikely(mas_is_underflow(wr_mas->mas))) + goto reset; + } + + /* + * A less strict version of mas_is_span_wr() where we allow spanning + * writes within this node. This is to stop partial walks in + * mas_prealloc() from being reset. + */ + if (wr_mas->mas->last > wr_mas->mas->max) + goto reset; + + if (wr_mas->entry) + return; + + if (mte_is_leaf(wr_mas->mas->node) && + wr_mas->mas->last == wr_mas->mas->max) + goto reset; + + return; + +reset: + mas_reset(wr_mas->mas); +} + +static inline void mas_wr_prealloc_setup(struct ma_wr_state *wr_mas) +{ + struct ma_state *mas = wr_mas->mas; + + mas_wr_store_setup(wr_mas); + wr_mas->content = mas_start(mas); +} + /** * mas_insert() - Internal call to insert a value * @mas: The maple state @@ -5361,54 +5409,6 @@ static inline void mte_destroy_walk(struct maple_enode *enode, mt_destroy_walk(enode, mt, true); } } - -static void mas_wr_store_setup(struct ma_wr_state *wr_mas) -{ - if (!mas_is_active(wr_mas->mas)) { - if (mas_is_start(wr_mas->mas)) - return; - - if (unlikely(mas_is_paused(wr_mas->mas))) - goto reset; - - if (unlikely(mas_is_none(wr_mas->mas))) - goto reset; - - if (unlikely(mas_is_overflow(wr_mas->mas))) - goto reset; - - if (unlikely(mas_is_underflow(wr_mas->mas))) - goto reset; - } - - /* - * A less strict version of mas_is_span_wr() where we allow spanning - * writes within this node. This is to stop partial walks in - * mas_prealloc() from being reset. - */ - if (wr_mas->mas->last > wr_mas->mas->max) - goto reset; - - if (wr_mas->entry) - return; - - if (mte_is_leaf(wr_mas->mas->node) && - wr_mas->mas->last == wr_mas->mas->max) - goto reset; - - return; - -reset: - mas_reset(wr_mas->mas); -} - -static inline void mas_wr_prealloc_setup(struct ma_wr_state *wr_mas) -{ - struct ma_state *mas = wr_mas->mas; - - mas_wr_store_setup(wr_mas); - wr_mas->content = mas_start(mas); -} /* Interface */ /** From patchwork Fri Jun 7 18:52:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 13690597 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 B8DB0C27C53 for ; Fri, 7 Jun 2024 18:53:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4ADD26B00A2; Fri, 7 Jun 2024 14:53:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 45D176B00A3; Fri, 7 Jun 2024 14:53:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2623C6B00A4; Fri, 7 Jun 2024 14:53:46 -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 F28086B00A2 for ; Fri, 7 Jun 2024 14:53:45 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id AD59C4199F for ; Fri, 7 Jun 2024 18:53:45 +0000 (UTC) X-FDA: 82204991610.24.103A8CE Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf15.hostedemail.com (Postfix) with ESMTP id 3CC77A0006 for ; Fri, 7 Jun 2024 18:53:42 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=b0suqnGl; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=YJd83HVo; dmarc=pass (policy=quarantine) header.from=oracle.com; spf=pass (imf15.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@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=1717786422; 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=Ptz/vKOmx/6gJSxm1UZRQYH6YHM5m8G21lDx876xCFc=; b=oE8PSwGsykR2CsL8ahomjl14j5ODYsxOb5Fg+Z7y2OzStKh6yGJ0M9G5iQcayo9vic83x3 2CV8AEAAAB3ck+JY/sp82Q6f/yuC4MkRHxxvbjCHb3Ontc5AJJLKCjW0Yw10+fjt8cbF0j BcXlxujDRTZbN1onxapi61UWVGRflVA= ARC-Authentication-Results: i=2; imf15.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=b0suqnGl; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=YJd83HVo; dmarc=pass (policy=quarantine) header.from=oracle.com; spf=pass (imf15.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717786422; a=rsa-sha256; cv=pass; b=AC4QUFrM56YZtHcjuZeFoXVyQPBqnItXaAk2QUh/lI6jyn/FCkBcp7jjsl3W68QGWf1kWE 909GSzSPmv9aR+irp8LC5rBEVaX+6R9lPU6PXkBnCpDGOediuoGjZ83SZycItBsG0pqH1e FAdumkMxgDbKNMoUyaafWTC7Maw+wiY= 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 457CuohI016403; Fri, 7 Jun 2024 18:53:38 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=Ptz/vKOmx/6gJSxm1UZRQYH6YHM5m8G21lDx876xCFc=; b=b0suqnGlyglM10cbwi5Uc7e1QIGMP1WBcgZK1c7ol2WWRdxMzzlAW2P93f/vJ2XInGr9 CJJvJ+uUaB5ih7U25s5phGRIV2PX03siORFBYNYnWVvmMIBTUsb9Io414zYi4F4Dry/T ofmkfmmSfwHYNBWGW3iriirotMr/1ejw+FEtTGx6JjGJUv+Nh/UGyz+kNzqyZGswWlrS zk/WLiBvMH4yOeXBS3P/q/sZnyRN7DwS0hxjbzkYUy37/+2/AMH5WyRpvjTHqo2aYM49 14mcEpytQdBDwvlqKaWcMeU/8qYbu9DsYubOVr8gdEx/bQ0kEe96ZF6uy/rs1kh/zi/Q vQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yjbqn69h2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:38 +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 457ICR40023938; Fri, 7 Jun 2024 18:53:36 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrr2k7tv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nq1Bz+v1S3u8rH1twhIJWyKLJhu9RkXkUBzR9Z1NaXqX0YIS3uUDVH2eWikkxkZPZC0IAvRSc0dmgmp2A8ekRReCSRA5G8n0RiwNCV3efHb6JqoFjXLEVfn0UPAnHYklV2F0kqFjeJtanbFIbDk7iUEXbzm3Z0k1ThfqURxjP3QrzEiX/V5TrCPPLzm0bMUN6tRr90XWY0WqSv0OB9z47ZwWi3ssV5BH3KylsiKFtz2tnl/h+6G+Gpk3iWPbhwH/Qp7r3UlFrFEeMxHG25MDLc4fPaQHvNWfJbq22+cvO2U5UnPumJDR2InuCDg56QVhUSt5QYqykqdp6zP5UK7Xog== 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=Ptz/vKOmx/6gJSxm1UZRQYH6YHM5m8G21lDx876xCFc=; b=ixs08E8vMk9kWk2lNUeP61VfUQ6WFKV3ItsCQI8W9k9jyKB2/Ih4ErLWn67fF4xlB8uY/oHXqo19L97ajTRKAOr1SI6wAvG7ZjPg2qXlhVrSKj7qSTBjXb1ZsHoCrtkIPqG5dNPLbc+L6RtN0XclwEYiKGuXvt2eYl0rpDJUX+u63i1m2cwRFPG1h+OAy0qII6B2NsBZQLid25r0VZIcnMBX0HCb1gM+b+Qp8S9lVzDCeZGd2ZS8JhifiOhuKuRHZ8pKfEKj1ZIV080qE5jGYsscUIKT+AdxDuPP7EFt2gWPBEOo7ROaBZw15EkRls5qHZqu9Bp2RYfjH450JrvO3g== 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=Ptz/vKOmx/6gJSxm1UZRQYH6YHM5m8G21lDx876xCFc=; b=YJd83HVoCDFIKYJFdm47ldRcLVD3c46lpYMKwt5zY6BGaDcU9zND/ci1SGwFHB1/QHR/LmfsVmkRPW/IdD5zKbPLaRH8Xa1Qthu4ej/y169B/PIAFePtt94vePifmvubqwLWIca25ugB8q2q8ag2lC2LVx9MLu8uB7EKwcXWM1o= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SJ0PR10MB5629.namprd10.prod.outlook.com (2603:10b6:a03:3e2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.26; Fri, 7 Jun 2024 18:53:12 +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.034; Fri, 7 Jun 2024 18:53:12 +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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v2 04/16] maple_tree: introduce mas_wr_store_type() Date: Fri, 7 Jun 2024 11:52:45 -0700 Message-ID: <20240607185257.963768-5-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240607185257.963768-1-sidhartha.kumar@oracle.com> References: <20240607185257.963768-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: MN2PR18CA0004.namprd18.prod.outlook.com (2603:10b6:208:23c::9) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SJ0PR10MB5629:EE_ X-MS-Office365-Filtering-Correlation-Id: 031b9898-8ec2-4137-3449-08dc872314cd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: c5byJYA1XM1xzWjyxgGiY2Oyl99JkOtbyNgB3i8WGy31Rse7HcXefJbHerbO3JfHvD6G57gC/OZEAwXcQ9ioUyB7zX9o43qRlaw/0lTQM73BvkKyMNM7blLlBVX0YxTeQD3KzW/zWevEJ+chbCTfnQAWp+FJd37fVdcKFr+jlISZqjH9XVgZH8QXLX10z4hqyMQFU8E+EAYIuQdBd66VSXZmQovZCfWFitD+2pC7GIYhgTinnbv+q+drIGw3pUtp1++a0EgVf2pTWtG6bLz/ZtpyarCBrgyehzFpRn9DesoJxOJV9HEOP7oSJelLbMwji9UpwJ1ik5iDmLb/g53UAn/wcGkiRUlG5xX2ux9zQh0zpXvJI1LJOH64n+2BoebJkBYpZNYwAeXRlU971yLkp7nl/WGItVF6GBivLFvabtg9q7c6k8WCzm9AE+TDUvBaC7eUytPfemHD0+c/oqI3RuGby07hh7byxcgkR1RmZnGFJNmEnqRq4cT7bIveAtTUeSm2N23jsrp7IiglL6uH9iN2JK2CZiOtn/zQhjyAkF7N+vw2+uIwrMq0niYV4Dbf3cfEPLv8d0/hE0tNiHmqE0aC0fSmsp9X4N6zL1MsG3iizU0mYNNQA01rXPBcB1S4BlJwsSuw1CoMdX4fomcLeNDhLTpyLQacKXuuytc8xL6dPa7AFBBd1ZXBAaSqIIqZjVXQsI/TFJzCOg0CPW6Alf2fSiSDrsQpo2YkkgeLmjC6IljdF39ThhC/aZW1rFPm3iYRK7BRDUBfPEFrZEZ5rqLh9G0XKNRXYBDBpthfuSImHfRjdrR12KhZQHyGXWZN1654MqeShF1gd2T/lpSeRJDDRGZLPQHHmvp9wINx5odKBPbX1qDV4OmsP6m+oeuDxyLgURoi+CMGH9NLu9I/dQvur38grb3sO43S84wSspPrOFJC3PCOlYAgPJsh6+IKzprDoV5ljCEgI6C1pkBFqXOAXwns5Ups2qXYoojZ5V1mJAPCoK+kqFJt4pC3do/DHZVLxMQmdZBlDCMGXzf+YbS6qVlfbR1cYTnQXRmbuYjWshGFrnSEmTArn43FGGEfshSCPFTNYK6qxAvc6t2vpWgZql1jxb86gz7J66Yk5Z2S2TP44H9gh49yhTBBTOqWtRzBHsmFSDxu3KhB/rwk4xOBGqC2a0om/uWPmqo7Dr+27MpgzvfhgkKLHUqpc5OplC/g3bKlHEuMgthKf+wCbPM/J6OpY8mmF3HAHtKmT42cWXV0+XP3AbrC9pYDwU1lia+MjdUdf76Rny4SaO0+brcgnuvV6hLAuhu3W9+Zyxvlk8j45Q1mVdCHw+iWcGX1 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)(376005)(366007)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uLNAqlPF/tmK4tV8r9uSVtoaezrXoXF48+upPSGzZvPYNUAlGP6rTXCCf0w+hPAi1cmh9M8xJeSXUDOeOXafFeukNQm1KA3TMOTVnUJBmLQU2xAxO59uAlcAmYEoiHCTAjTGjic04yfmOhv6fJslzYv03rCjQQKK3Y1VAoW7sJVftcfUz0rGKnUzM4bOGUWnD5IRGpNX8KheYM8/2GMKzaZitqP4RpB7Uj9jcdMjUSQO2LPYJUb3M4UoXnkoGvrZOKmpoP4jR1toqG6Ter6Bw+ZIlRtDgGvruWkgONc28F23oVfkJUrBkV6qWM+fSRBMtlggS5C82i4shO6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zRzS8judhQZ57qeN1LbpLZXYGFNcE7KBR3c457YdvjO7/K89bOJHiowm15atSengep2IvGtRykdwECxU7PuFxHZFC4z+PEbOK5suSk4wri+M60DzzsVq7EtjnejtWiEbNradce9FDwZargY/rfJnKctHffApMh7bsGyfBJy18gTjCTorZY8/z/bkWnrMpoaJ6dkGADPfiKFIbES3DQTlWiuYd8ZoLZc2AaD0I= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: TfeUcfNkb2vfp64fm/m5q0hhHk0b9t7O0cXu10GTzXwKoIsrV01q8N9JygVCJmlCRJ5ZIdd6NNFfAm6jV1wQo233uETnJbYGrd7M8iN/KNUr9mwdchzGUQCwkWvGn+U4to3bFr5DKZ+cXu39cCYQTW5r09hZtrScou8g+OemmXWM0T/rZFr3ITY348oB/qP7uq6UtZ4ZdL9qNsg0F8kR6vhkDjIOvK/7Q5yUGgn977lcEDq3pvet853nu/ds1Vl62jQd7a/8IXoghITjMYW6ovNXzmxGQ9DOuRuACDer6RPu2lUL+4JyixRteE3Nt2hQThgnxDN9F8TOYjNKPBmYeQZFREdEWkVxNo5aU9ebTR05+MZFeFGfieMUj0Q5S9hGEc8DYF0gruvr1SDDykZHh8rcGONidYmbOQ6TiGqyj2SDmBQqo6q5ewyXgBOm7KuBEiZbr8vUMpGUS3xLJhVZl8bxBBObgDzv+W3r7DcYcZXOpq4nRXRAIEz8ZZLvW8Lc839ihhstpsVBP04gPYtpaWCmBvL26A9lunUOF28MADs05VxraZEE5kD0pCc5J1C83M0ehv9YI7aWgE2jjM0DofuwwPpy9wyQZQpLjvWx8sM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 031b9898-8ec2-4137-3449-08dc872314cd X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 18:53:12.4555 (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: zGesItE/yalRH2rqcpawcTIUCFyxV13ZLgLhbj3HrFLkDCAZdwnivXpeKnrTVbwPlzMwKBd21RjHmzpMGilX99xEWY/EmDTQf7OATICfxug= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5629 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-07_11,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406070138 X-Proofpoint-ORIG-GUID: MemFKTPc35gFEsrqAwtlGwUukAx_j2TH X-Proofpoint-GUID: MemFKTPc35gFEsrqAwtlGwUukAx_j2TH X-Rspamd-Queue-Id: 3CC77A0006 X-Stat-Signature: 7qjbjkqpkwf3wizfsco6mghwr5go4k5k X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1717786422-77622 X-HE-Meta: U2FsdGVkX19XZy2+Sc6PYTOWMQ9mZngnHxe4vm6Y/Z+0oCOeJTU9ynfgFMcz/FKdIQ5Sw+8UtkTPSyWx4hYO3gh2jrf+Vqv0nUo8AQpzz/VrfL++AgCC/sAh+hIvXWAc3A/uY65tkCyJM7j3Al0VIR9iVCyMX7h5Y5C6DN/1Rdx1qPjFV4rqlopGI96l33lnHgd1f5zDhkrWR+qwOJqf2BFGyAdCAddO3w6k3zk0v8WymgPEO90bxnOYyFbRGzGNXwUYxQs3JvvOy6p3Az7svMAE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d0Whjc/5YOOgG9QOaQ5A0UGxdYi3z2vlWHtkCWvkP91ef7dZyTRgXGtRtZnrmBtlIdfSxWTNOvR2ZJG7/B4D7AjXX8ozbnB2OxS+nVoaoEIjEHtgsZDfsKR1y8kI3qrl9FZPOlF6pWZISvjWmbaLri 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: Introduce mas_wr_store_type() which will set the correct store type based on a walk of the tree. mas_prealloc_calc() is also introduced to abstract the calculation used to determine the number of nodes needed for a store operation. In this change a call to mas_reset() is removed in the error case of mas_prealloc(). This is only needed in the MA_STATE_REBALANCE case of mas_destroy(). We can move the call to mas_reset() directly to mas_destroy(). Also, add a test case to validate the order that we check the store type in is correct. This test models a vma expanding and then shrinking which is part of the boot process. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 214 ++++++++++++++++++++++--------- tools/testing/radix-tree/maple.c | 38 ++++++ 2 files changed, 192 insertions(+), 60 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 2558d15bb748..a7f585ed488c 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4278,6 +4278,151 @@ static inline void mas_wr_prealloc_setup(struct ma_wr_state *wr_mas) wr_mas->content = mas_start(mas); } +/** + * mas_prealloc_calc() - Calculate number of nodes needed for a + * given store oepration + * @mas: The maple state + * @entry: The entry to store into the tree + * + * Return: Number of nodes required for preallocation. + */ +static inline int mas_prealloc_calc(struct ma_state *mas, void *entry) +{ + int ret = mas_mt_height(mas) * 3 + 1; + + switch (mas->store_type) { + case wr_invalid: + WARN_ON_ONCE(1); + break; + case wr_new_root: + ret = 1; + break; + case wr_store_root: + if (likely((mas->last != 0) || (mas->index != 0))) + ret = 1; + else if (((unsigned long) (entry) & 3) == 2) + ret = 1; + else + ret = 0; + break; + case wr_spanning_store: + ret = mas_mt_height(mas) * 3 + 1; + break; + case wr_split_store: + ret = mas_mt_height(mas) * 2 + 1; + break; + case wr_rebalance: + ret = mas_mt_height(mas) * 2 - 1; + break; + case wr_node_store: + case wr_bnode: + ret = mt_in_rcu(mas->tree) ? 1 : 0; + break; + case wr_append: + case wr_exact_fit: + case wr_slot_store: + ret = 0; + } + + return ret; +} + +/* + * mas_wr_store_type() - Set the store type for a given + * store operation. + * @wr_mas: The maple write state + */ +static inline void mas_wr_store_type(struct ma_wr_state *wr_mas) +{ + struct ma_state *mas = wr_mas->mas; + unsigned char new_end; + + if (unlikely(mas_is_none(mas) || mas_is_ptr(mas))) { + mas->store_type = wr_store_root; + return; + } + + if (unlikely(!mas_wr_walk(wr_mas))) { + mas->store_type = wr_spanning_store; + return; + } + + /* At this point, we are at the leaf node that needs to be altered. */ + mas_wr_end_piv(wr_mas); + if (!wr_mas->entry) + mas_wr_extend_null(wr_mas); + + new_end = mas_wr_new_end(wr_mas); + if ((wr_mas->r_min == mas->index) && (wr_mas->r_max == mas->last)) { + mas->store_type = wr_exact_fit; + return; + } + + if (unlikely(!mas->index && mas->last == ULONG_MAX)) { + mas->store_type = wr_new_root; + return; + } + + /* Potential spanning rebalance collapsing a node */ + if (new_end < mt_min_slots[wr_mas->type]) { + if (!mte_is_root(mas->node)) { + mas->store_type = wr_rebalance; + return; + } + mas->store_type = wr_node_store; + return; + } + + if (new_end >= mt_slots[wr_mas->type]) { + mas->store_type = wr_split_store; + return; + } + + if (!mt_in_rcu(mas->tree) && (mas->offset == mas->end)) { + mas->store_type = wr_append; + return; + } + + if ((new_end == mas->end) && (!mt_in_rcu(mas->tree) || + (wr_mas->offset_end - mas->offset == 1))) { + mas->store_type = wr_slot_store; + return; + } + + if (mte_is_root(mas->node) || !(new_end <= mt_min_slots[wr_mas->type]) || + (mas->mas_flags & MA_STATE_BULK)) { + mas->store_type = wr_node_store; + return; + } + + mas->store_type = wr_bnode; +} + +/** + * mas_wr_preallocate() - Preallocate enough nodes for a store operation + * @wr_mas: The maple write state + * @entry: The entry that will be stored + * @gfp: The GFP_FLAGS to use for allocations. + * + */ +static inline void mas_wr_preallocate(struct ma_wr_state *wr_mas, void *entry, gfp_t gfp) +{ + struct ma_state *mas = wr_mas->mas; + int request; + + mas_wr_prealloc_setup(wr_mas); + mas_wr_store_type(wr_mas); + request = mas_prealloc_calc(mas, entry); + if (!request) + return; + + mas_node_count_gfp(mas, request, gfp); + if (likely(!mas_is_err(mas))) + return; + + mas_set_alloc_req(mas, 0); +} + /** * mas_insert() - Internal call to insert a value * @mas: The maple state @@ -5506,69 +5651,17 @@ EXPORT_SYMBOL_GPL(mas_store_prealloc); int mas_preallocate(struct ma_state *mas, void *entry, gfp_t gfp) { MA_WR_STATE(wr_mas, mas, entry); - unsigned char node_size; - int request = 1; - int ret; - - - if (unlikely(!mas->index && mas->last == ULONG_MAX)) - goto ask_now; - - mas_wr_prealloc_setup(&wr_mas); - /* Root expand */ - if (unlikely(mas_is_none(mas) || mas_is_ptr(mas))) - goto ask_now; - - if (unlikely(!mas_wr_walk(&wr_mas))) { - /* Spanning store, use worst case for now */ - request = 1 + mas_mt_height(mas) * 3; - goto ask_now; - } - - /* At this point, we are at the leaf node that needs to be altered. */ - /* Exact fit, no nodes needed. */ - if (wr_mas.r_min == mas->index && wr_mas.r_max == mas->last) - return 0; - - mas_wr_end_piv(&wr_mas); - node_size = mas_wr_new_end(&wr_mas); - - /* Slot store, does not require additional nodes */ - if (node_size == mas->end) { - /* reuse node */ - if (!mt_in_rcu(mas->tree)) - return 0; - /* shifting boundary */ - if (wr_mas.offset_end - mas->offset == 1) - return 0; - } + int ret = 0; - if (node_size >= mt_slots[wr_mas.type]) { - /* Split, worst case for now. */ - request = 1 + mas_mt_height(mas) * 2; - goto ask_now; + mas_wr_preallocate(&wr_mas, entry, gfp); + if (mas_is_err(mas)) { + ret = xa_err(mas->node); + mas_destroy(mas); + mas_reset(mas); + return ret; } - /* New root needs a single node */ - if (unlikely(mte_is_root(mas->node))) - goto ask_now; - - /* Potential spanning rebalance collapsing a node, use worst-case */ - if (node_size - 1 <= mt_min_slots[wr_mas.type]) - request = mas_mt_height(mas) * 2 - 1; - - /* node store, slot store needs one node */ -ask_now: - mas_node_count_gfp(mas, request, gfp); mas->mas_flags |= MA_STATE_PREALLOC; - if (likely(!mas_is_err(mas))) - return 0; - - mas_set_alloc_req(mas, 0); - ret = xa_err(mas->node); - mas_reset(mas); - mas_destroy(mas); - mas_reset(mas); return ret; } EXPORT_SYMBOL_GPL(mas_preallocate); @@ -5594,7 +5687,8 @@ void mas_destroy(struct ma_state *mas) */ if (mas->mas_flags & MA_STATE_REBALANCE) { unsigned char end; - + if (mas_is_err(mas)) + mas_reset(mas); mas_start(mas); mtree_range_walk(mas); end = mas->end + 1; diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index f1caf4bcf937..1c68ccc1b475 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -36223,6 +36223,40 @@ static noinline void __init check_mtree_dup(struct maple_tree *mt) extern void test_kmem_cache_bulk(void); + + /* test to simulate expanding a vma from [0x7fffffffe000, 0x7ffffffff000) + * to [0x7ffde4ca1000, 0x7ffffffff000) and then shrinking the vma to + * [0x7ffde4ca1000, 0x7ffde4ca2000) + */ +static inline int check_vma_modification(struct maple_tree *mt) +{ + MA_STATE(mas, mt, 0, 0); + + mtree_lock(mt); + /* vma with old start and old end */ + __mas_set_range(&mas, 0x7fffffffe000, 0x7ffffffff000 - 1); + mas_preallocate(&mas, xa_mk_value(1), GFP_KERNEL); + mas_store_prealloc(&mas, xa_mk_value(1)); + + /* next write occurs partly in previous range [0, 0x7fffffffe000)*/ + mas_prev_range(&mas, 0); + /* expand vma to {0x7ffde4ca1000, 0x7ffffffff000) */ + __mas_set_range(&mas, 0x7ffde4ca1000, 0x7ffffffff000 - 1); + mas_preallocate(&mas, xa_mk_value(1), GFP_KERNEL); + mas_store_prealloc(&mas, xa_mk_value(1)); + + /* shrink vma to [0x7ffde4ca1000, 7ffde4ca2000) */ + __mas_set_range(&mas, 0x7ffde4ca2000, 0x7ffffffff000 - 1); + mas_preallocate(&mas, NULL, GFP_KERNEL); + mas_store_prealloc(&mas, NULL); + mt_dump(mt, mt_dump_hex); + + mas_destroy(&mas); + mtree_unlock(mt); + return 0; +} + + void farmer_tests(void) { struct maple_node *node; @@ -36230,6 +36264,10 @@ void farmer_tests(void) mt_dump(&tree, mt_dump_dec); + mt_init_flags(&tree, MT_FLAGS_ALLOC_RANGE | MT_FLAGS_LOCK_EXTERN | MT_FLAGS_USE_RCU); + check_vma_modification(&tree); + mtree_destroy(&tree); + tree.ma_root = xa_mk_value(0); mt_dump(&tree, mt_dump_dec); From patchwork Fri Jun 7 18:52:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 13690598 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 1338BC27C6E for ; Fri, 7 Jun 2024 18:53:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 941EB6B00A3; Fri, 7 Jun 2024 14:53:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8CBA86B00A4; Fri, 7 Jun 2024 14:53:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D1086B00A5; Fri, 7 Jun 2024 14:53: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 446166B00A3 for ; Fri, 7 Jun 2024 14:53:47 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 00329A25BB for ; Fri, 7 Jun 2024 18:53:46 +0000 (UTC) X-FDA: 82204991652.29.CC0EDE3 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf26.hostedemail.com (Postfix) with ESMTP id A4EFD14001B for ; Fri, 7 Jun 2024 18:53:43 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="QPB/Ol8k"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=LttFZupC; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf26.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=1717786423; 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=t2/Od+WpVk7WfFC2jfuoIu2ZEGfVLJUcbhjQt8CRCcg=; b=lblwT17dxngQCeyLwS4wsYZRaPTfDja6hXz1JkvPNq+8Cd76WMy7A+BOxAs+k3JTzwdyYa 9juoCoA/XAcJUX4tj1Co3284GJldJwygUmoj1mNnWe2qoPTkor5MxyUxex1Hu1/B/OvxfT FnhAmUMannZaENqTcwKoor5Alv+xYu8= ARC-Authentication-Results: i=2; imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="QPB/Ol8k"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=LttFZupC; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf26.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=1717786423; a=rsa-sha256; cv=pass; b=LUHIqZRlAYvPNE05qEJLEyIEQZ5LdQJtnHVVRHoGzRqvzSdrsQ7Le/Oj0ir48DDQhBA66H g2gz1bdoOXJ5n+Yv3O6yWD59kl/k7jI3iCHi2ICjRp+DXXGtzgULfanjh1HhMUcwhX/xG9 +vDrp0ScSxXpRVnUhqbeFlhqlE7rnnQ= 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 457Cum7h021527; Fri, 7 Jun 2024 18:53:41 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=t2/Od+WpVk7WfFC2jfuoIu2ZEGfVLJUcbhjQt8CRCcg=; b=QPB/Ol8k+jhJKx87C1HUfohQf7WoLQ0Tx9qYLNXjvu3VKq0jPBtF/AFO3bdllet/gqnY gBRPC5sqR0aOovRd19G26PDkAbW0OLt6N3HmDgollQzmuOF5UUrh25gqVGCfcxKU15UL PAP99qbS4qySd9PGH676GdXMmrz/hQv2QjSqgPpdvZ3saIaLX84hLtB5EapUblBeP7Ey bCf4tHxXwFL9tz7YhuV9c79o/npc4jfqcxoWdBhgxHfouDpxtPCLfEzHpwqVDDdE+cWb hxyFREc6GkrNyLqtubVG/B+1xB8UGJniaYdMr8Ew4a5/8v1y5FXrLoY13bnjas+KBzTM 4Q== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yjbrhea3u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:40 +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 457ICR48023938; Fri, 7 Jun 2024 18:53:39 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrr2k7tv-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UYOg399oFM5DPDu8F6PSyul8rlEMuObL7z7sbklC4i9K91TbfYlWhC899pusaC6SwG0Re6fe6M7QjlQ+vYhsrp6FMOfWCvQ5sI17zKSMx2j1Seh0lsvYg3sXsLcoVfl6kmY7oyaxvyd99+YCP6Lc6us2PuNw+qJ6ssYyxYGOm+zhwCUiLPUDnSSlOl+8jmcLeUwzUrNGirZgfFjHadepwuXdL1Mjqte4wKUlI3CR6eFxWYxIjtz50uI4CppkxhQorIBnb5/rNuqnvvIHxI6XgatycJqhSwBlAvjey806Yn3KsaP2l5qqtH2+j4EZXVc9WUQb1OUO+mGXMlSYmz4ePA== 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=t2/Od+WpVk7WfFC2jfuoIu2ZEGfVLJUcbhjQt8CRCcg=; b=D8WoSiILVaup4Wlp8QebIalf54CeGDVkuUNg8Wn9ifRM+O4pfLjsdcLAddEHS0a59++n/Qr11wxk7MTsbj60tTz67ItV51QbfmpJ5GFvn45PiY6R4AjcrRejL5aMcnkGNsHH26LhJ24sjXFRxh21UzIwikoKKpc1Gtuywz/Hj+IZ//rAYLdU+HIxQWUEcwccv7btKnQamLsGgSAL+wubouXdqlCuBrYBfZCFM9boNuy0VGfs+szYfc7yBO/+yHkbfSElLXUMMrwXkA+8SV5uYZEMUI6r4POQABcLGRamVw/xsyF1VUW8FRYqBb7IOTobZIVpKadvSNTLodikn5FENw== 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=t2/Od+WpVk7WfFC2jfuoIu2ZEGfVLJUcbhjQt8CRCcg=; b=LttFZupCnRDyP4TBhX3tuIHn7dmTlnHF8BRwOaKY/guPbXYaC3d8bFQ1ogkjuIhs4poD3xCFgK6ToxNOzuE5wTGj34Lc43Zs/aPixgRQIdVmJHkRb4wmJod3AJAy+iuq3Mdutab9xX66dns12KNSXMPeY749yrAPWDBPo3l7uK0= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SJ0PR10MB5629.namprd10.prod.outlook.com (2603:10b6:a03:3e2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.26; Fri, 7 Jun 2024 18:53:14 +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.034; Fri, 7 Jun 2024 18:53:14 +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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v2 05/16] maple_tree: remove mas_destroy() from mas_nomem() Date: Fri, 7 Jun 2024 11:52:46 -0700 Message-ID: <20240607185257.963768-6-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240607185257.963768-1-sidhartha.kumar@oracle.com> References: <20240607185257.963768-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: MN2PR18CA0029.namprd18.prod.outlook.com (2603:10b6:208:23c::34) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SJ0PR10MB5629:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d3646da-d32d-4446-4493-08dc8723163d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: 0NwiBiuwch0cpB2oQwe/HrtXB8T7Vec2sTykymen48Blh02DUs9HTSGcDRI6AQ+8rbRj4t/ftU3kY4NGYu392zHHGZWiRwC07Z+ds/rbP705BPTSOiaQ6zoIm5QB/LgwOZ+ZSH6V+kbyMHotzwJxDODZj+VgMCNDJ5IjqJRoMQ7z8yR2t8Vab8J0UPG/FhTd1L+IQYGHafCkKGMHdc4uXsKoEdf0S9y1BFCr8rMgXPENeziY1+XfVF0W6phMlsBJYkG/Ec9LcTW/9PJszJ5N+DFJ3UIfjbhb647ebefJr3gjXhCZoNRYRzPVFA3/Yhte/WEASTOzo8+MEBU4lqxs7gTFFTbniOGsqazF9V93GczBKgE1/JHUM1z1QfxdwQqCC5JtbvVFqpLiJujJo1CzFN293OiDOGxbyJxPgdLK2ukzGX4o7ZbNV7IZMThjJgDqAtd8XH4owMvlrgJlxB8uMpGSjtJVt0lqL3L7vHO5UEam3zFSLDkKQ65ZN0ESOAn/xhHl3YTrNz5FYdBsayFh9xT6vdoD4T/aW3tqDCIN3/zLfpGIOEuMf1gNhgGLu7EB+v/EP/GhGvesaIua4/4QtY2eOJr6ewPfyOCS7iPOhgAuj8xRi5c4m9U37rCyiLXbfCp5wXbZrqk+hhAHOOI5OZxwpPdjIr5TijQwKti4RkqBYge0t3jCTX+UrbIgt51QYhhrvwK8i4A6yvFn2fI1ZHWkF8i9H76+gZiXeEFVRtjvFis976yktziM2hImaSXI07CyRb6lSBTVELo2iHNyGN+Zfl2zJJ7wAuEpwYdaGnRaHcy86uoUruOw2/+sqLn46RUNbruv0UtB1WrK1gtVHMZ40TSeIJFj+0b79XNnlzouu6aER9ERRci8+bzmLHhCvB2EkzEODxXaaRWZ5GQacqKLNxnRVWHix7/Aj6XMLHXYUq0NpFV3dlBfotofMH0JR7Mj+QE9Ayvn0C1mNQcUmlWJdCzgT8TKbhUdSXEUXh5YXXoJ+Ok++XWunSZ3dEMpywM26j1cOkxvmYZ8Se5HLzK2jSIdqhH0EdKnV0K5kU/sHWCElLKfnx8W8Fjj2SoN8h0wIcUcYgQVUB2umqFwPnkj7M2ieV2HiLASbJz8gyjILHSeVs38i70WvPYFDKk2cECImcGNOwpFE6oEGTaFxVimqKCmx/NWiO6jDlVN0tfsc1khuHJbJxVJ2/lSQKScNRZONVkZhaILGoREc0zhyuU1FgHLN/fwyvqBbgMHD4Yn6uUZ+IzbqfMpqmjnKlDoLD9HvrclEW46W59+kQ8aJKSc+FsTt+MXpWdfm10lT+3H02C2/CV9aA6ZrTfCwpn7 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)(376005)(366007)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-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dJONzBiWpzOrWLVca3pxGfZDJl8CD00rfmNPxHapsD3A8c/M8VTue/03XWgDyJ1kCksxhyUMAcCA0TooaDAUzaPMYBVHaM08CpFOxeP5s2qF6BKhJLQeT6nNl3EXMytCmXZ4mKc5/1F1pY56dMkx0120mZPY03DVh0+PVB5u/Ba6CMGgqhrbbXmyqvCOdUoNexa7P8i4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d3646da-d32d-4446-4493-08dc8723163d X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 18:53:14.7867 (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: 3kJ1LkfIyJIHOIqRnXnbVKvycYEnvMzC47TdIWTA4L+oppadu+0kQvx25NbjlthUdBGo4+4958IyyRC+XUV4PAeUJ5PlEmZYiv39eosmI04= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5629 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-07_11,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406070138 X-Proofpoint-GUID: nk2u7n62-OunHNqMhyfLXnWAShqkBd6Q X-Proofpoint-ORIG-GUID: nk2u7n62-OunHNqMhyfLXnWAShqkBd6Q X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd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6VadJQ4iJ2yrJTgnuX/R/euzjSQR7ou/8OPIF2fjYvdYgNZP6hYAFVLWII9RLRocm9MkzzAue3QVN9p82PFk4AYyocgQBxTrfqE2xqZXcp4tbZ+k2hpPj3MTbjUDcn/vEj/b2AuyQtRP4oaZ749ojjH+ub+Ko08BYII00qf5hM+uPR7OY1Sv5j3f+StsQ0Yb+5bkByN+8nIzpLzGaVYDE9x4VzGHsx4bygM8B2ZC1NtmdhWCwUGbo8gFUzHDMeFN3/tPB/vphvp4euuoEnYi9xyf4djxN9tkONXQGhYJLaLdh8APu//U47WbEGFGimtxhF5tEG4bcqAL04hhaAIbVLkAtDhyT2tXoWRwcx/+VwR9zHgasHUZX53XP8UqiDaIOG32Zl318hMc8nDJHakAyu5jUZZB7rRPh+74Zq6s8ueP2kn1jQRYK6hW7yWchYpZBcM5zCZA== 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 | 10 ++++---- 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index a7f585ed488c..b933df290887 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4527,6 +4527,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); @@ -5607,18 +5608,24 @@ 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 = 0; - 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 (unlikely(mas_is_err(mas))) - return xa_err(mas->node); + if (mas_is_err(mas)) { + ret = xa_err(mas->node); + goto out; + } - return 0; + mas_wr_store_entry(&wr_mas); +out: + mas_destroy(mas); + return ret; } EXPORT_SYMBOL_GPL(mas_store_gfp); @@ -6366,6 +6373,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); @@ -6380,10 +6388,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); @@ -6461,6 +6467,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))) @@ -6476,10 +6483,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); @@ -6515,6 +6524,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; @@ -6530,9 +6540,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); @@ -6587,6 +6598,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); @@ -6668,6 +6680,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 1c68ccc1b475..e897f60d1a1d 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); @@ -276,6 +276,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) } mas_reset(&mas); MT_BUG_ON(mt, mas_nomem(&mas, GFP_KERNEL)); + mas_destroy(&mas); } @@ -298,7 +299,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 +35847,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); } From patchwork Fri Jun 7 18:52:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 13690654 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 0589AC27C53 for ; Fri, 7 Jun 2024 20:51:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 902D26B009F; Fri, 7 Jun 2024 16:51:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 88BA86B00A2; Fri, 7 Jun 2024 16:51:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B73C6B00A3; Fri, 7 Jun 2024 16:51:52 -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 493166B00A2 for ; Fri, 7 Jun 2024 16:51:52 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id D34261C2CF7 for ; Fri, 7 Jun 2024 20:51:51 +0000 (UTC) X-FDA: 82205289222.18.BBB84EA Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf03.hostedemail.com (Postfix) with ESMTP id 75F6D20006 for ; Fri, 7 Jun 2024 20:51:48 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=HV8ItSYX; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=TZN2tP7W; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf03.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=1717793508; 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=Y1M65IP1BASKGfJCkUXjq9SAHT6vlTg5aLtT5kQiY8k=; b=3hQ5EgYjrt5oCSDCLbjHJqwKIYQzwPoEm9X3XQyKXDeqdBoD7BJSCvP+fTx4B0Kc/GMOIS Mg5ZM740B27WpMbFAQoKmARKBLN8oQ/cFL6H94W+J71Apbr/6szIReKDiiwGHEXj5FF9rg aVLFaKmFXvoiY35cWaVLZi/ZyfNszio= ARC-Authentication-Results: i=2; imf03.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=HV8ItSYX; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=TZN2tP7W; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf03.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=1717793508; a=rsa-sha256; cv=pass; b=lDgnjdXkwCft4ptTQ4/hGNAMduR0FVQiQrjQsoWQFjiwevUc5f9aIdeEw6Cj4IGbIJZbeU d/+yJosB+WMpf9Ydxu3SLcQcq8dBv1HDcuF6umN/UU2yL62xER7llCKIO1v7/3vrTQEc7S +l/G9aH4Np1fEA/nlgMzbFjmPWHqkKA= 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 457Cup2Z021557; Fri, 7 Jun 2024 18:53:41 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=Y1M65IP1BASKGfJCkUXjq9SAHT6vlTg5aLtT5kQiY8k=; b=HV8ItSYX1CsD29a74PaiN6WWHOHfktWkwivG3ptmkhvpNWKwSa5eSN7GhkG6DZbMGRQG Gudczw3BvpKjr6jI3aZolgIqYWWogCdFE3eB9n7TynbPGLR7tmnGbyxWLUBvjg+yCUv7 B1RZ3eN+UAs0C7j6v8/OERBwEsVewjtWZjEq9/vM5Hq52qRXmzEskLhqxpknQ/KRKKA7 Z717aJff5KmxraHCAcXTVX/gJ4Kx7UvEMgFACPz0BZWxOR4npZMQGUOMEreqnhN2hi+i 3pFAzzWO4fhSeJcGJGWIEREpmjj//wBZUNzVqGM+F2uu9EXqHQ5J+92loGx5Ql9gr7k4 aA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yjbrhea3v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:41 +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 457ICR4D023938; Fri, 7 Jun 2024 18:53:40 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrr2k7tv-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=heNk/O28P1uBf9zXkPFaquniW6CZY2gCQ8Ek6hqD6OyG75ezpe/kpYJsz5oUiRvzPu5fttm9Thkh2es+qgep0zyvzK9NSOg5K7JXPInL3ivCMu4H1G04/3p5j3cbtroHxV05ahD2z/WH4RaQoYP5ssu31BsJcM6eqENVm+Rxm/XeWAyTQ5E+z2Rgc3gAyGoceOUsBdCnRCwojW4XwPDF9rg66oCDS9k/l7IC0/kR+hA+5/iW2HIzSqKzgRyLUjS6DeE8qLs6hgMFqtI/NJ2n3/7oAEgYvH6rFEYWaAWqfga6PqU7hHO/pJxQIdtT3Y46HB4Svlq36erax06/GP9vIQ== 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=Y1M65IP1BASKGfJCkUXjq9SAHT6vlTg5aLtT5kQiY8k=; b=high2Cmsq7P4pOxaFERzstwtmAhnnWUlkWKjwIXRBaowelyHC20kg4UYzgrQc4x8W6LYxvaK595lObaK2b2q6l12nEao5rOYXEo7sZ8wVU66SepzrYWpGZ52OkOmFtxEH/ZXBu54JKgzx9gIiHZy2KN7fBCi0dbKc8to4WOQmaGyHNQA1iGTWXFRYhyhSiuEDn9B/5z2oPRLggzQ8a8Ll3SFIDdpG+PrR4phgzdff+pX87RlXFZnLjVUS7ZQRAMvBO736vbT76OxBysjvhLklDSkYmkkbceghw43EpnHUz/v/ELSFMZLDRmvu4CjzKn5o4NIq7IWN3pzIqatcFwXWw== 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=Y1M65IP1BASKGfJCkUXjq9SAHT6vlTg5aLtT5kQiY8k=; b=TZN2tP7W0g9NYZJ8baVELdDf2LVSZ2Gbc7WueqMYRNzhlYJXpZXUzcDiJqbCXgmj5PlERT5plMfIxL/kfeD9pSy4KwDEX5ENE9Uf+5bFl16+U5vnlLMHDYUp9qMkuchGnXmYKcJXTP+meROUK9RXfqtlB/dlMMqYff1TeZlD6xM= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SJ0PR10MB5629.namprd10.prod.outlook.com (2603:10b6:a03:3e2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.26; Fri, 7 Jun 2024 18:53:17 +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.034; Fri, 7 Jun 2024 18:53:17 +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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v2 06/16] maple_tree: use mas_store_gfp() in mas_erase() Date: Fri, 7 Jun 2024 11:52:47 -0700 Message-ID: <20240607185257.963768-7-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240607185257.963768-1-sidhartha.kumar@oracle.com> References: <20240607185257.963768-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BLAPR05CA0048.namprd05.prod.outlook.com (2603:10b6:208:335::29) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SJ0PR10MB5629:EE_ X-MS-Office365-Filtering-Correlation-Id: 72e4e354-690c-45fb-57fd-08dc872317da X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: HE3tENAAmn1+qEkwRNB6Js10OMc5GmQO65xfQ5xjmC1mBt/MleQwWsxKMKau0tEt9ITHOzv9guIQkDkh9iHNesTVNcO+zbxugCESQlXPZl5Lw4Kbn5Vyoli1hhjsWES4PPcyBuu0s5+qgBP9/cWN4UJtTcmExPUcLTcxiRFdWuAa4GM4u4x52QpVUdNlxiq5DelmlQjkU5cKW2iL1OsuxZu/QJWpT9srgcbz2Lb3gqTg6rvQPiqVsc5TkmKkFmtKACREz0a47r/dfQVIWWJWZaEjxELqtBKO/ieAoDXHjiZ7XYOtixghzEyEslhd76yIPT1XKwA38EhE6ZXDPe5Mmzrudkw7R5mHDddqbgSKidH3KHpGWbjJUZAKLNtWmv1p3Z/SMyvsm9uDAr6V78HMGQaSNf6eE6lqeql+D9OTWeYcx5zw9y8Wl31szHDYQAdTcBxg2DtoPOJF5u5dQrU/zfJSWwN1HiqOig1rBZrspY6w0tzkYH5rwtx1dQRvuK1Zp6DEyWx46x/aRn1R57tDv76VAykeuZPSlbciYa0R8WaGRvtHpiCQ6erkDPFFhn7ukhqODO76m4G8wg48TRvZ9NZaVItK65k/zgVxXaRnJzJiURBNKeRfAMaBr26Y0vgpBB/1pt/TBDVr5nHsZe8odFkjLPf+97yyFq9DG0QblnaFFrOtOMR6u4WUHQILTKjodDZj4zSaqM/VizENBJZ7+T7EX8EdNZBWpiy+lXcNVLFk+t/EMhZsKttN2rhEe5gRdt/ypNz09gUEhGtXpAgBVNE2dDxjGqrw+wbpW/2rCfyjlQFKXd4ZhFv5FaRvllk1cEe4Lkwe1l25HPKwATNh6rkvhpXuUkx4dta5WuEDF5o1ksiRe40mcmAMQHMlSrUjcdjeA/8x87mkgwkNYQyKonS8f0JkLN7fVve/odNX3WPyOTKyE3h6g9uC87n+XquIuyeInKrtcUgF9MHwS0bKlM9cQrZcgYKXDAV7bpWCfjN8FfCh5hoOlOCp9M7pRVVBCZ8SEPGp80GpJF5lgS+abAMcpK+KIFeHjnxa3hEhuecGZwSQQpc6j07gxK2afhaHTzZzxnDXyDfO8FZSjggDP4wL84wSZomNIkp+6aTotKynAnhBeIOJB9QFAmPOzSSAsvdsznng8e73VSPMCiNm3wXKU7kXyGZ898HjaiQ4dvFFgTCrHMjm9oogvo42sc5p/QCQwKTuLam2XQZAbe2tsSWzW9i6r51vRFzh4LKtWf8bk8xcVTHn7645PKFH410KogrvdfIg4noIj6BRSsIeGCKyXNISNJUC7F4o17H0IFzpgppuLn3qDicMB3cqrOJx 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)(376005)(366007)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4Q/WtvBt25+8sYOL+1kU2xfvBTuHIgZEEry+5QRhQAoXs+6xW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CMAI7XBPGmZPqyeRUnx0eLLHbQj6BESjAVt948/KKqomQVvLV8a/d4fW7ANvqCkfkKW2wtc9UXsRo4PRtkI61VeizJ42Ic8YvGsjU8KQ4xuSD7d2WPF8i9GB337eWNK+RspQFuL4Q7jptDyiuMI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 72e4e354-690c-45fb-57fd-08dc872317da X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 18:53:17.4782 (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: JWAqyV7sJesNhJ3cfhylTLCj6S3OjfWr7RAX2mujhppD52m8iEuXQCf7rbyeBAQIdDVGV0ckQerVAvKjf+hF31KCafg1yYroUStObMajZe4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5629 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-07_11,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406070138 X-Proofpoint-GUID: mbuKiPBfaMo9MmfXx1yh6M2n3yqskt_u X-Proofpoint-ORIG-GUID: mbuKiPBfaMo9MmfXx1yh6M2n3yqskt_u X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 75F6D20006 X-Stat-Signature: ueegtjiabmk9phduwsqqjti6wh63ra1r X-Rspam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J1e8r8E0whTTxqpsuXWTnQO6nROGce9tDUY3qed9IGRbTbXp0DshbVyCebcnwRgPssjZkzScbRJt5gIPFAcP8UMxDDctJjSCPRNUEIPYEbdwRSNCtayCxvT1pihchEyjK0ide+y4btg/tMY9mJTn08Pgxf25y9NUhG+TajvUli98028cl/X14PhFI1oKDY5Xm9HKQX93yXEjtPAzdrJn2qUa9Sqcy2Fs9N2vpF10pc6seYWOoz4zbEnwsmMNrYZbkgDmvfyejF/DFiQMoo56UWHrQGfINk2vejlvbxvtcpXwv+v9zOSfQcv97rvyvhpvd25v+XLTGkcDJpo0XA6mVkLz/74OabBkJG0AEIiUf2etI5VZESB3frDtzf+tE9ZDQ1fqC8LnDRJhm7nsZ2VMYVTt827ZFSzRrsuu9Q== 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: Refactor mas_erase() to simply call mas_store_gfp() which will abstract storing the null, memory allocation, and error handling. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index b933df290887..bf309b7515e7 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -6355,7 +6355,6 @@ EXPORT_SYMBOL_GPL(mas_find_range_rev); void *mas_erase(struct ma_state *mas) { void *entry; - MA_WR_STATE(wr_mas, mas, NULL); if (!mas_is_active(mas) || !mas_is_start(mas)) mas->status = ma_start; @@ -6365,15 +6364,9 @@ void *mas_erase(struct ma_state *mas) if (!entry) return NULL; -write_retry: /* Must reset to ensure spanning writes of last slot are detected */ mas_reset(mas); - mas_wr_store_setup(&wr_mas); - mas_wr_store_entry(&wr_mas); - if (mas_nomem(mas, GFP_KERNEL)) - goto write_retry; - - mas_destroy(mas); + mas_store_gfp(mas, NULL, GFP_KERNEL); return entry; } EXPORT_SYMBOL_GPL(mas_erase); From patchwork Fri Jun 7 18:52:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 13690599 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 4BE43C27C75 for ; Fri, 7 Jun 2024 18:53:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 240406B00A4; Fri, 7 Jun 2024 14:53:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C73A6B00A5; Fri, 7 Jun 2024 14:53:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE65A6B00A6; Fri, 7 Jun 2024 14:53:48 -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 C3A286B00A4 for ; Fri, 7 Jun 2024 14:53:48 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 84E4BC028E for ; Fri, 7 Jun 2024 18:53:48 +0000 (UTC) X-FDA: 82204991736.16.C12594C Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf03.hostedemail.com (Postfix) with ESMTP id 2079820002 for ; Fri, 7 Jun 2024 18:53:44 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=lCCfvV8E; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=uuDZQpHK; spf=pass (imf03.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=quarantine) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717786425; a=rsa-sha256; cv=pass; b=VVYH2dar9rAPW+eKI0gq+cKSRs3XZXOCtPS9vBZf2kWx8+TmFAFZXQiydYrWznpWYrlTBQ om2cIIkFUFqe3463BAiB3Xm++4wfbAM+zNiMwi6iUrolhp12WyJvHR7zlx++s/xUcJ0USp 9ezmK5s46loZ6UOLTSQNgW97CnZbCtw= ARC-Authentication-Results: i=2; imf03.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=lCCfvV8E; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=uuDZQpHK; spf=pass (imf03.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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=1717786425; 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=UJaoN99ei7MhPXDYFpeA/QQw4oOI9Gga2dfK1ADbeKQ=; b=MrGqEwl6j0yCWQoys0xddT9uzWd35U14vIblFAfrCPMRKF2xMDjjakFmoLE7o7tqML6OBZ KSRXf37BgETru8fW7p9aQdUm3uwyReflECnHD0tiaRU8x9IoZEzBUNYSGKO4f7uW3MWFjt D7+XFTsQxrpl2Z5grUpQGJ9jrrACXpc= 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 457CufGe021449; Fri, 7 Jun 2024 18:53:42 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=UJaoN99ei7MhPXDYFpeA/QQw4oOI9Gga2dfK1ADbeKQ=; b=lCCfvV8EQWct+MVgNxH7823G05w2FDp5MZ1ojOjML6qOb3H+aVj8l+ujCPl41Mo2lTIw GRAYBpMm8etzxcKbrKZmwlzTQ3iddE4/wWHVQxffXBucwdutCdMMRSX+F1yoHLq82vIZ uadaimxqS4/sIkrPgg6R9BQVY1GdCY2LiG4mYIOtf+xY896WctqQglncnYSFz/Tzr/Ak +yi3hM11YSQLpsTwGXDI7314QWXJEPI+bWGnvf+XD5cdffKh1Yy+3n0a/G0rLFNZeeV8 PJwSTpq+K93yvWh3kXtfJgxYHSx78p68DaNGaU51Nqpa/+QV3jyzh52EKU8rYUKuLIQH EA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yjbrhea3w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:42 +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 457ICR4E023938; Fri, 7 Jun 2024 18:53:40 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrr2k7tv-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C5yTe6dy00VYUQJHk7tXi9O+kozuwAiBVjk6GIXKAUr0uGJ6p21j8bbuuN4qbeqnUpTF1r8iodQld6KSJyD25PGCKkagOiFh1CqkSmYrOdItzK81dcNiPxTFKLin7HIxxQzTiMiDxx0Ifckv5v6TLxIHsAbaqKgKNLtNtk1HvmZUX4IMjcO8XhFV2XTM2lnHFTL1pBKvR0sfaMNw5wzWJ9N0I8YpO6EuCdffUVhc341mqAGWwNB2rF2XuGKG41Q+zR3c55RrLouiGjvhBQKAWMgnGr8K52oXn9/Ggawqk9Z5j/5+y+wwLFdQzq1ibyFB7DQl2VC6UkQVN7pMJ0rwZQ== 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=UJaoN99ei7MhPXDYFpeA/QQw4oOI9Gga2dfK1ADbeKQ=; b=et8UaU6XZSNWM4FksdS8QeTwXawIrHxUGf+0XwgNE1XISpKQYSGhzJUMUWPI3Wy1+V064/8LAEw0m3aPmoiqGhsOnXvbZY2wo6ZeJIRYVjcgIlDrj3oyDj+Lf5Ur4qpnV8zu0ATyyDtmJuxFCKRwmDhp5tHrSuzFRXfUyZrJ6TKeoeuOVnwRutYj0r+gTRQBObI6QU9GMg07KqGkm47IHM2kLwKoJTsbndHQN3bhYAg+358IK/VFGvM/QBCfNj307nQsigqIzu0HVR9DSLKof/fyvOkKBvQO1z+pGoGpYuPaISWG8tSezAr+dbPiElW7lnjPAlGAzYtElpxHDUK2MQ== 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=UJaoN99ei7MhPXDYFpeA/QQw4oOI9Gga2dfK1ADbeKQ=; b=uuDZQpHKByuw4qoZWLgKz0kJaQlqWNrilM3tdq9/dG1LwUz8nYinank7Rbza5nz9lgikTsUYKoPBkchaP4ccYhE0+ZAM37T0mKidrjvRDnXAfGWoUKn0SmgeZwYS3hxEvpvXsy6+c1Y5fTHC43mnSJNq9PdFRqRgKSXrG1fGxBk= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SJ0PR10MB5629.namprd10.prod.outlook.com (2603:10b6:a03:3e2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.26; Fri, 7 Jun 2024 18:53:20 +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.034; Fri, 7 Jun 2024 18:53:19 +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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v2 07/16] maple_tree: use mas_store_gfp() in mtree_store_range() Date: Fri, 7 Jun 2024 11:52:48 -0700 Message-ID: <20240607185257.963768-8-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240607185257.963768-1-sidhartha.kumar@oracle.com> References: <20240607185257.963768-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: MN2PR15CA0014.namprd15.prod.outlook.com (2603:10b6:208:1b4::27) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SJ0PR10MB5629:EE_ X-MS-Office365-Filtering-Correlation-Id: 8cb72308-3c33-405e-e936-08dc8723194c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: XX3EkMZ9PYiTn3KCtDMynu5l+HZGjrIK8MYBjEsCdSko4bG4wAfPNDi/PXqJCAC6bfK+ay7Z7PRjLKGKpHJSi4WOcCxfXaltlChmEjPYX3mKmd1xFDVn10pHm7jzCvus5c5CjZCshPHetKugEkbiqUiSxRvTBXQhb9P1i32l9tdmwnTQ9yea9pHFPmKiIz3czkt5T0ZgQGhmp71BntogyNLHkNwDuU+Nl0gYaLZaE5nTwB33A81s9zrjkRBInJfJDlvKPShF+QCoz+gsYZNNDs1S+yuAtbXxqGr7ksv83Vy94je2UmCqNjMLFU/FAJs/XChz7SmgDHQ3d6AfUT7JxqPIcVPlcUB1UbM4GJDatbtATIVQHdQaxGY64ied7IjHjak+K/hzB8VnvZrMK5N8jfgFxdwhfvD1FmHOqAPCHZW93X24qKsF98HFVG+MCWoFM2KXoiHBUiu6A/8/nn/rV/gk3KZWlTLZHtlTCorEnj11fWZVMvHM+L5XYIOasPttZkDNX10anmkpQwd0k/lsxKRH5mhooPzZ7y0fRuVBtatJ+X5H0R8/ZuZADSwZ+9mEDaEMxwICQgaH8d+XNg1sV4/L8L+Hf9rjWnP2pI+kMPRsG84KvAMWERCLx4LokBEggLAMIU/tFLQZNOubXIljwNkvSJeYHnNWD5aOwjSCX0ABWvKvPXF+zymxOLo9oqOkMCiJc8U5qWtF8VUhEOE+OqmOQeTZNhEFkPWT79dutjHpnomZ4W4gG3OfU+iEYi69y0nO3y9rsLrqAh/KEJyJI4tMVHzIxDEf2Zhax7WIxugHCph/io9bV0OiE2hR0XIcJsOgDataWSMZTthHGwzwH6ORe9vl7CZjicfPGHoWrclyKFztB+lUlymW/E3x3rK/xSZnjv8dnbBhx2jYZ6Ezn8B+OLmHoCEE1646by8Rl+SVjlCNYaorn2beTIiJj1DFJ8hczJiE+TbbL87c8zoBzwuF7ff8xXRV58En2SvQDMDT9366/tKjecDnhaeP6npy3IWOgmFJfUxhL3AnU1iV2RMeA5L+dzTjR22dw21dN6OfE/2EPkJgQ1hDBkb8evT7pPgvRlSy9ts8vs4Jhavui2QvwCH8V2CQocx2GDGdBPWT2Q96h2dal3U4NlyaqEkxwSmoRsw358PtDuTdwBU7pyHsWJ8F5blsmDsEi47MnGcgsTgBGoNFbtGjYsB4FrRQ4+iAlFk6iou+7LpgMfZEhm8jRK91RO97mFkjzew4b2HF8W6IgIV7XbfMTAh6yQirnTX869OoAX7cedGIKquwkGsFCxBjm8S5kJyBqKdjlV2HsBD65HRReHwCi7ofA72K 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)(376005)(366007)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vjhYU2yAcXz47qIIuFAG/FHohrjT+E0e1ayZFVd7Pcy98/HME73djnD+Bel5P0Kw8JllhZbh2LvQ61VzRuJQIH2x4U+QC9QB2IXNyp0yisPhWNVQ97qsmWza5wU/VwW4ORZTVC/AaBDcssjL1PBLfBt+GnMFdLrC9yOFV+2497KodtV/tMBHuCoyRWBOEm81w2mkA9TweL6G69db3gkIibP3U2ZZuRTOZFFuehobXAM87CRE/IiaOYBvPRNW3YFF1d1s1Hc3Mo9MQSKn/qwIj0qBRZB72R/98HPf/aaMhZoLzgv+nh2ZPx9eJTYzmlQUmjchndVoWfyyshFNjAl3EaZ1AublPBIYJ4c+xcYRHQk55BW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5j7wGupb5MA6hVg036JyfYrpG1uQvU+0z8DiXizHYwZE6I0xrykA0g3A89kGafxwvqv2MfL7YUlmHhHywU0frbWhJp1xZZPFIVcfItkPitaOoHQGeHO9bQ2f8eRQCw5IcCekuvTOA2aY1B72y1UZX5Su3WNgDCfLxK3+HqgaVUrTfypB/5ma7Ncdl7VPJx5b+g= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 5FooOIwhayQw3KtO3tZwwZwN8nLFWq8tf4R4MZ9z7vPoKOsP03VGxsplCI1BMZqRRMNq8lgd+yrXetnbBB/pvBIP+suEo5m4Tz7c46khFrM19lJr5heDGF61JWb8Rrz+iXqbuwrtyEAU+3+4xPcfW3J9RIrK/cdQ9q9YTcTdSmAToBduEnbPhHr9QmvXJ0q2zuyUqrklt7dcfSlGocsOL5dl7xV7wmCLhsxViGvQBvjF1WRNggypOLRSkbo/f4gq4lCRmBiJG0bcCVcbx6XH0Migu/pUUu9aXiGdhoIYlZ81ywMjIxldhTy0UJ6jqAF/mn5ZP5FnN0aZWT3270VurV+QB9hRMrfPAU1mPaAuRWkKikRtP3lpY4NlaRfmwTJcEZ6YX5Ykpijni4EYfLG1ogff3/yAGI9+GBkzwO/JFhOkC/3Hn2B0aFzEiRpRCmdA0mu/WZRjhasGhEU/cJ4JOBk6aUj31Ozk02i7TpkLeEDEGuJ1uRZNjM6BMSLN47HlT2k0UaBPGwHXiGpgh3MIg5HUH9WTQZVnnaolnkXFRDVXbsV/na1MUscNcx/gqpn77shmw/6FeRaRcR/Ci/iELjb8NWyObjbnSKG8E5PHFT0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cb72308-3c33-405e-e936-08dc8723194c X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 18:53:19.8887 (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: 4tPqoPxWH465rV2OI/3hBgJZTjX2hmjJUxV4tJb8ypyAO9ufFR/vh8Aa+0rJaRZXq3revQnMmbroMXPCZA9zQegAqw63PfU3Lb+rNOdKt/E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5629 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-07_11,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406070138 X-Proofpoint-GUID: 38jTbIEemBuoqz-hQ_1EJkGhInPKsRSL X-Proofpoint-ORIG-GUID: 38jTbIEemBuoqz-hQ_1EJkGhInPKsRSL X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 2079820002 X-Stat-Signature: oy1xxnos95etsputfxpne5njtjdcippo X-HE-Tag: 1717786424-309555 X-HE-Meta: U2FsdGVkX1/r9LcQicJgVgCX0ae3n5MWCA4Ki3O3gPM/R1yL7nXM+9wE2DVtFDZ3ECCVNM2cvqtSCZCW57DEXskbb4AcqbwBkzdPwjX2+AyDaDZnQZYSvlxzbqj8nch+5A7FEPcQlVlgrLaERQLqmWtUDhDAwtbLhwou4OvW4CHUvqej7WSpAUfz91QBtNmnEbTxBGxDmKjv2bSRkGczzCNjr3DCrrNmzKH0QRoCSlVJS1o/f3+iFLeIZbS15i5BSbs1Sfnup31gqbiYFWljjcXV+6cxbmRzAj4I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oyPfFmmzqKW9NlT+P5elwS1MVT+1P93RM/591Ut3345l1ugYIt6GD98+Zr9ASe8CyojoAh59uZLwe5QTzQA== 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: Refactor mtree_store_range() to use mas_store_gfp() which will abstract the store, memory allocation, and error handling. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index bf309b7515e7..a955316b6745 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -6459,7 +6459,6 @@ int mtree_store_range(struct maple_tree *mt, unsigned long index, unsigned long last, void *entry, gfp_t gfp) { MA_STATE(mas, mt, index, last); - MA_WR_STATE(wr_mas, &mas, entry); int ret = 0; trace_ma_write(__func__, &mas, 0, entry); @@ -6470,17 +6469,10 @@ int mtree_store_range(struct maple_tree *mt, unsigned long index, return -EINVAL; mtree_lock(mt); -retry: - mas_wr_store_entry(&wr_mas); - if (mas_nomem(&mas, gfp)) - goto retry; - + ret = mas_store_gfp(&mas, entry, gfp); + MT_BUG_ON(mas.tree, mas.store_type == wr_invalid); mtree_unlock(mt); - if (mas_is_err(&mas)) - ret = xa_err(mas.node); - - mas_destroy(&mas); return ret; } EXPORT_SYMBOL(mtree_store_range); From patchwork Fri Jun 7 18:52:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 13690600 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 EDE1EC27C5F for ; Fri, 7 Jun 2024 18:53:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E6F2A6B00A7; Fri, 7 Jun 2024 14:53:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D86486B00A5; Fri, 7 Jun 2024 14:53:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A05346B00A8; Fri, 7 Jun 2024 14:53:49 -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 77CE16B00A5 for ; Fri, 7 Jun 2024 14:53:49 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 3D4361219B8 for ; Fri, 7 Jun 2024 18:53:49 +0000 (UTC) X-FDA: 82204991778.15.997B8A1 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf04.hostedemail.com (Postfix) with ESMTP id D3E9540002 for ; Fri, 7 Jun 2024 18:53:45 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="Wn/pWOf0"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=jM47eTXs; dmarc=pass (policy=quarantine) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf04.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.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=1717786426; 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=txVUe87r89sa/r6dkQBB9JXM5MiU6n0BwAusUfBDG20=; b=8HcUYJoG5GHJJhYPrSnkAI8/4hSl3bhalc78yuwQ8idoOmHspwBo6rLPTKygBsNf6suzFG G3kvKyux4QgDtYaEY4vwPPQiUA6s4GuAZ4r3g+7yglwY4F5mJK/i3xjcLmGJLdK0kOT/Kv rQyufEz6cCItqPTdMGPym95DTs9i7hc= ARC-Authentication-Results: i=2; imf04.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="Wn/pWOf0"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=jM47eTXs; dmarc=pass (policy=quarantine) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf04.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717786426; a=rsa-sha256; cv=pass; b=ZyDYfeRy/15dXOHTU3LEmYq435+IVQRNXabo132sNLK79nrmbNkwm3gBeddMQIDLOdD0nj b1Iw8/jd+/h+57I04lT81fZaKO+5Y3vHbbiivSkO7q1UPy2zp7LEgx/RKABNNwt6/eZkcQ 3S3be9YJ5rrGp19X+tCaTOF7hE3LG4s= 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 457Cui9W016028; Fri, 7 Jun 2024 18:53:43 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=txVUe87r89sa/r6dkQBB9JXM5MiU6n0BwAusUfBDG20=; b=Wn/pWOf0w9AcHLetpZHNfsGbe79H8pS3kPQe5/9FvEUSjmfrcHnRVNEArKS+scEly/PW QJ9YwFmKK5KH3wQoEaEoQWy/VLVnd8/wHqcLGxF8uRZqTNNwEgtmtrDQcUYg9KDGh1Js H1Kh6my9H5z3euCfScr4YHdv/4Q7jAEJZ4ZutrMsYzDzgFycHiXtQwrewHmHyuNkCBJO VKmg/aHSYqSbbIjjaBVuDEOD5IHiCqtjxHntHBD/OViyGZK2X27GTwdzCcqlulhIloOx g50pfZOs8Pz4Y62PDAm+RNZ380WXFGRAepyiZqjS++WMNDraQMX6nOd8XX75IV7E8MPX ig== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yjbqn69hc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:42 +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 457ICR4F023938; Fri, 7 Jun 2024 18:53:41 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrr2k7tv-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IVoVgsZEsqtZWegYCqRDDoSpE0E64vnOp9f+5Rl1NAjMeIJx3LkuexlS6aQQdQXUulksOXdH1NahEgiy85m0VoeUaqxhhMxoBJhNGWP18Fx6vRPxNTj0FJbB2nDwvqZE6z2rMPTMjSFiT/OQzI/GbMOo/xIejmHWRXa9PStkmCIk9EnfTKa8KLT7QgFzc0DgS9zu5BP7FJbdK/N92/lvSGHJLS7fG0TIpIeNRi8XEIGwKEKQB/2bxhtm51s8OJsS47ZyZuH6UGWvl4ZHKyZbD2VzTzLcrVhUKyPDbVXAtNFbnI8wxYBzDx7CK4u9YJ9+X6E+aW+WVv1SAXH9TMD3Sg== 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=txVUe87r89sa/r6dkQBB9JXM5MiU6n0BwAusUfBDG20=; b=H0hzFyjMpWefWOBoHqNvDNJ1Hmv2/wgknJe0SiFsm5xHfmwqBUH2AO9244BmLll7cLiV9U1vss6QKp9eApWTrp9uNDB4VF8AFjA2Sx+dvOPl9TnK/GvRu3cN0AGjPGKbwxLWyooG5McNfedjdhk4J5DgQIzMH7doVvGgLFghQEzkiNBx88/bllqmFStOInJU7ivCqeMpVwKT7ixIORYEK8U6PUK0Lm4LWB+QkBnFrzZLLSp3H/2A+drm03qlaz904juC/hoJckI7MXe88YYBx2naOmA3GDuui9hl6n2mdKt+EP5jXDA7cLCNDPGYmKJg4SnF6WDq6RYcRN1Bd9vjKg== 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=txVUe87r89sa/r6dkQBB9JXM5MiU6n0BwAusUfBDG20=; b=jM47eTXslYt1uw8v8AuLjjWHbNtBaqZjXuV6sN9fHOB8HIvHckmtV2aHdTeu02u6wEL0Cv0tTq6DxEXLrLIBWHtIPVRpdu/EsdbTA9ZmzTkOQ7T4hCGcpk9X0zsMQXwkv9nOtbJ7BmaOhZq+bYCyrgN9B2CvtIBUZte6dShAF/Q= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SJ0PR10MB5629.namprd10.prod.outlook.com (2603:10b6:a03:3e2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.26; Fri, 7 Jun 2024 18:53:22 +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.034; Fri, 7 Jun 2024 18:53:22 +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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v2 08/16] maple_tree: print store type in mas_dump() Date: Fri, 7 Jun 2024 11:52:49 -0700 Message-ID: <20240607185257.963768-9-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240607185257.963768-1-sidhartha.kumar@oracle.com> References: <20240607185257.963768-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BL0PR1501CA0028.namprd15.prod.outlook.com (2603:10b6:207:17::41) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SJ0PR10MB5629:EE_ X-MS-Office365-Filtering-Correlation-Id: 8205936e-3d8c-4830-264d-08dc87231ae2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: RlLfwVqGFaFyBI2DdDSqSQQZ4lWLVY+x0flQbRDFrCVHlU7NW8aNCW4NLGOzR0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+GgtrG7HC9XXK78w1RzpyzkBtdHlcWq0OoIYPtEe4a+usMatlL+GK5E9cpxbbT7WdRz0DyZdMOsIW8bcygvlR/rHw8to4cNjdJdTefH91IbXlakHKZfeYDrSEDKtKlIGmb3u5IoYcA50yVQbgXNETkQItOCTL5AGYpYkhKGDMh8mRqDdJH2xL3g2Lw= 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)(376005)(366007)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PsLagm3uE3R3CfrAkba5WxifHESo/ANJu6upD6LHsjh786htgGpSUz2ogKzNsavQ4p3o/TJ46yu3cIaq9Zu3MVQnw5ItXRF7B/xB2YMeCXKmklZkHaSBgzPjQ8R2tyjZ2Bq/iZtAx+Lb1xEBdqzz/NIOrwR/ZLxnKFq36OTd74x4xplpPmtN4NAd8OJBgKnr223hbtXEWcPPe1bXWbMS5XfbuNO58Go2zng8i4/Ogfrb+hOnQhWUVtWzQyGDmC8bFh6eo2Awa63KVCsaLd2WI9vQ4qRwW7QyGySCwXyNVclEohe9VmldpsISajZyBIaXr/iLDGQbafrYfOuptC+dU0ur7GsSXGsNDIc9nH4mrpNUmJ7Id/BdvF9UOj5grVdzCsYdi4aj0c9sxH7j6aApMgB59v/+VgVMVXHgHaN+TseAth139EeEOm+qKfFJtcW4jG86pvrNOd58zeINRDEwBCxdb/mAM2j6+gq41irRrgXaOlVft0kndwc7rqXLviXLkKxZXKi2syEvbnsMf3hF4OExVS9DPFLWUOiYttqg3SvySBUBylBIJtvn925vD4YH4Jb3tymbjZkVLthipn+ZymrW/Z4BqoTi87PoWMO4cfExhz4io7ZLAxMS5pCYL09c5rRHZzXr170RuWA1bY99QB6TPRDjunRJ5zOR78DTwtKt701MEkw7QmvSt0yRYXlCnIc4NfIioW3SrjA66K/1uvNGgwcSXc/XfLly7z3YnqfbM/H4ODa4BeSSqLyG7rHvGqB8I3YFcR8TMaPgpaXFAhUn69ZTJLGfGIWK8HPBD+PqchL1HkxsLeToAhfcThJRRgMP634mumFeWwR50cMGppC+VknvDrDMnA5tXVy6Cvmn2xmRuxcvndx3r7wDoty4DYNuFlmIFGNJgPT4io+Vz0RFlG4/A0X0klCrfcrfW9x5xvtds5/iYNW8bwLcTDJkuOh5zWs/hXH/4tR8hL/Mm1roojaG0KxQ7oPuUXA+QCVi1PZeUYhli1UCAooT4Jnk/HTneVD56Ra91FX/c6jJrUEET/OwPhfjyg4ng+2IultYA1Xav5ZoIhXJP7ryXd6bxKvmKdRV3+GhsvOl/R1PX8OPBuGTqpjbmlHEIU7fLIW3/hxm3oFolz8C6L9qiajqrHBlAfJ29aRgClm2HryX62nNs5wRWW2lMkTToiXsrotAHU/SpqktUjl65GVy4IXfitBWf5PyYKIsoUieWXTKz70CinbJOc02i68prOp/EqyAX4mXWlIs/qKiZIapY9fxFDmfBIV9FP8mqICWHxELT6Dh8hHqaMKW+PMNJvKTReHFFlFPsDfpwRbBAONa1FEWfnFVAJCCOlKc/HlziSsMwcCLSoTedGnCm+/BWeQwQGonadLKCZJ8uW89w6X2PmZdUpNz5k7SMJs1omfWGpvaBnrvJbFRxbQSX0A16HTA/ow1fAdrroXgk+EjiT04xwHnp1qkcOQPeu38ogi3WjYt8merl4A1SpZo0LAN4eYA2DPEXse5p1TdqUCFpAAOwTD444dZYHGq8iMq84+YXVZB2Yz5Rspy2e76kl7LrJgSfei8jpXNG+BtDlk2A3eDO2kL0d3KvjonGuOoqwwdUfjGYG1VGrrsk4owPTwhM7yHw88= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: SiWiWLru+K+HbHdhMwbib0oY+BAMYkV2oFsO7d+ZyWM81CSRZuGza6v3RDfaUMUQtPRw9J6VS/CAdOAqe8yf9UCiEjsY15JBtsCunWWYTrACql/tft8cVZc8dzkOELHCly4zf0oWjhHOKt/TjXlCsKHVZG67tszKsidsCvLI89neYTvD/5EWfliFnVlMg3SGvtyqzMrUp/dlAypfgwJkTLRr+fgXYmgtyq9Jl6z8zPkVIfW66izw/YvB2435erevYJSEMe/8rXHCqkNHYWln3JSgviAdSphWV6EHhpdCUieGaqTeWYiFixFRjW7DuqzuVKbCZtxEozq6eQ7Yvm4vS+y0cYJuBBTXx/AtYwWz34xYXAeM3ddGrvTqijNWaZU897Q7CuCP6audKQFZ9T8Yib+/fpmOnYI889Z2WGg1nQkJYOQXD9F4F6Id0MRAH3PIA62Btve1QpRzud/GjP07duUiv6beveLrwZTrHS/Fw32w4eflI78QwaGAeS1sKK3T99xKLuPy1xQiHuaV+h1waScUlet898qVwiCPZGOAsk/mYYS9jyR1nj0ohNF4/feyVqGryUKBcd+egoDBIbh7Je4uBi6+dK9JhBLCSt+QXQU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8205936e-3d8c-4830-264d-08dc87231ae2 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 18:53:22.5718 (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: 6QXiWF0iZtDb7cGI5GYCOIpiUZmXhSkGhwPwSgLlBCzUOzcL0WGu7eBHEVWwt9XrzXW86HJsgcRgLkZHRtUuvdfEa2+9L6q4ycpRVzT90hI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5629 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-07_11,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406070138 X-Proofpoint-ORIG-GUID: iMfofkIRx9jhm6tGWk7hDfqzHcNiBV6L X-Proofpoint-GUID: iMfofkIRx9jhm6tGWk7hDfqzHcNiBV6L X-Rspamd-Queue-Id: D3E9540002 X-Stat-Signature: u9cptju1pr3ict79nhjja5apfsada54z X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1717786425-514231 X-HE-Meta: U2FsdGVkX1/KbuUOS2l3l5YCoEXyzU60G+7nv1He7Ur8wOFOOZf3e6GiQfzU3QOr9y88yvJnDzr9eAcdcMUHe7MRwqCkGCKhLFm9rkkzkE8MDNlkIy2B13kGA8sWMwU/4dP7R183y+b0J8Kq08F3XEpAwzh7yBxuMt1yaud7IZ3BVFzi3fAv+ZKiO2PH/eSdCyrq+PD770/YMbgL/h7sGh/WXyJEf7td6jV0pF1Wn8jGbqBci8GtCLf6qg0klP7mGFGi+NzcmwELXEl/+TVrrT5CRl2fWVHydcBmcPzkCUgZs7rXkyYFjb16V8wg5UQaFrSTYOcxCVkcImi0JJgrV8RCcqon2JmdMiilwNpLnEQTPqg1tdtVyuSrPQWyQ/A65iwoudFsghfgOR3aeIscEzCpyhAreDSVrqY8adca5KGevw5paTqww0IPvurxnzK/mnfQTUPdCAFsGHbfaAN9vcIja8vhuzoBvRHC7sHPdUVsmS9l4T36D6sUWzIqexXsiVUAhgm8qkWvJ46WtGAagMQfAX3bxJwH8YImr7nmVCM9MMJZRKyEgmryhyU3SYDWXMBvc2J+ApJY2OcSnLNnng8Hq3HvFxqkMe8S6+rgZRN758hSacjYS07ejvOwUbn/EImVudeycetLza3hpG1vKti7vnHs6EcvcMJyJkZkc8GnalStVmryQWIhwj9uIYJckoKLbctiH71AEIqk3pAKHXkB5ZrY0nF796a3kRKHfkfX5YUWItNCcCWqaHmJh9fVWIAjnTh9G9huoxPDUq1rGnNNvOIxQaH46yBVr34K450+qvFRE7VxAr1O0KHyGMf13rWZ/58v8F7CbaIMdn5aFXA/ymwwOXqfA9jEJQrnoJ6/kUoD5HnhoC7tWJDAGaNN/tPGidm8rarSIHAhOge6nS1W0UMO3Jdk451Pkx95T/wxxQh0jEl6n1tEkWi3D/ciQJwwO/6w1kzSIxbqBY2 CwUJ2aQj BvkugLxmgOWnSgtaLAtWrQMvgdasfeW1gpPHOPT5TRLqWIBxWP9D/7RQAdJqeunUpMuY4ky1Lgb9C7sLFx88clrCJl32d+W3qpbzgs/LGu3c71oPdMHm/Ql+vQiiXXqhcmalaI2fyVBZLxHNyvElUba2uD4oHHH6H7osGo7YB64rCRPoq5Tw5g7L2EE32asXQIS1RlcXWeY0B0T0OwTKXRLMI02MacYxv4sB92we3so5Zom3qGuxTmPnVOl9bofem5wb9T4DO6me//xnzLQFsAj8ge/xASDNrrUC3VtppmGELtSVDdQ9rTFern2ytdrJtrekt4LIms3qU/45cg7mnVCjbdhWOGlCxpnV3jGUYcVuU8ihA4anB8JLVtHm/o7G1EEWZySmb71VPvVH43hpIVrWcBK5r28ygrZQdnPN0pLj6wupdDhR+gnxeskpdPcGWJAX5qRrkxxgweH/xdSl3OGMgzg== 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: Knowing the store type of the maple state could be helpful for debugging. Have mas_dump() print mas->store_type. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index a955316b6745..91b18eef81e1 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -7731,6 +7731,45 @@ void mas_dump(const struct ma_state *mas) break; } + pr_err("Store Type: "); + switch (mas->store_type) { + case wr_invalid: + pr_err("invalid store type\n"); + break; + case wr_new_root: + pr_err("new_root\n"); + break; + case wr_store_root: + pr_err("store_root\n"); + break; + case wr_exact_fit: + pr_err("exact_fit\n"); + break; + case wr_split_store: + pr_err("split_store\n"); + break; + case wr_slot_store: + pr_err("slot_store\n"); + break; + case wr_append: + pr_err("append\n"); + break; + case wr_node_store: + pr_err("node_store\n"); + break; + case wr_spanning_store: + pr_err("spanning_store\n"); + break; + case wr_rebalance: + pr_err("rebalance\n"); + break; + case wr_bnode: + pr_err("write_bnode\n"); + break; + + } + + pr_err("[%u/%u] index=%lx last=%lx\n", mas->offset, mas->end, mas->index, mas->last); pr_err(" min=%lx max=%lx alloc=%p, depth=%u, flags=%x\n", From patchwork Fri Jun 7 18:52:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 13690601 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 69BE4C27C53 for ; Fri, 7 Jun 2024 18:53:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 271E46B00A5; Fri, 7 Jun 2024 14:53:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1F35E6B00A9; Fri, 7 Jun 2024 14:53:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE9986B00AA; Fri, 7 Jun 2024 14:53:49 -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 A3C156B00A5 for ; Fri, 7 Jun 2024 14:53:49 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 59F8B4191D for ; Fri, 7 Jun 2024 18:53:49 +0000 (UTC) X-FDA: 82204991778.08.945DF43 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf28.hostedemail.com (Postfix) with ESMTP id 0D317C000B for ; Fri, 7 Jun 2024 18:53:45 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=mmAZov7q; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=CeUOI6fe; dmarc=pass (policy=quarantine) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf28.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.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=1717786426; 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=FdLnC6elJcTLzta3VDOmOxQ9vkOouE2N1SeWytMh46M=; b=ce1OEJjzoXU0tvtEjJpBzTkvjHwcCqz6yGmGcZIodjaP2Yt7NHfCHZsRxg86vdwSseLaYe C6gqoY+966Jzy8sqzWHhYbuEx9YKuvj3QwekB1kHI6cetGton3OfBLVX54kQ6TEEboTivP 7nQi2MCI3cwu/XBTesn9fvHJRACALVY= ARC-Authentication-Results: i=2; imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=mmAZov7q; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=CeUOI6fe; dmarc=pass (policy=quarantine) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf28.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717786426; a=rsa-sha256; cv=pass; b=YKu57TaluS0L1yh9qLPnGNJmwH5Gq6yJjQIMnszEiKo/yFXDPpuX95X59BPe1J9MvMSDLD /MYRM/7QPZrdtMDe+4gr7lciGtzlUEB1JT3SMSqxrs07cle0V+1VHN5YOwTuxcHo3fX2k/ C2B6F9fYWdPgGkBLZ4/UoDnw/QGzvdg= 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 457Cv6SL010387; Fri, 7 Jun 2024 18:53:43 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=FdLnC6elJcTLzta3VDOmOxQ9vkOouE2N1SeWytMh46M=; b=mmAZov7qNpW/CQ+J7pvpPoJ9rERDO4fr3jJZI5UDjuO0vbeIZJr1ij9CiryO9Naif8VU 37lOX2S+lToXi/5e5KQSgeoj9bGxJesgMhcRjGNGVWixtYrSxAL9kj02sl2/pXU61EjJ 0bhZjfKL82ThOLotCsDk2S/Ak43xqMi667CTJqsvf1PK71fiFm4IiLs0M374hc/ZEon+ LzwNu48Q4heSPUmVMAQxGVZAaUI2aIaxEJkelOK6C2kNPmBBvTZaVgcSBKdN9Sc/kB+a lu3Yevl/wjbj4bh8/g52BEqgaKwC0z1CpjKGcMB0xFCwXUOVAgwNrdGte0SR+XejuViC bA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yjbtwe89a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53: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 457ICR4H023938; Fri, 7 Jun 2024 18:53:41 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrr2k7tv-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lauC7seCsn1sPsf1tyJm23MhZTicEgnI3c+jWwhKiVBLjLHaqSqXQNlYVxznqKfS6yot9N1HKTEcLCHHS86JYdRa8ikypD+J/D27cE1O7bLxAro5r0+WwzMeg/bZ+3BodmYieYIZvi8aNs3W5B/m86oSQwU9tEmKfPYHpYO16KzLDKPof6PMVJPvS+/c3WHQuGg3Bf4PrlRtdFUYBUXwTHrj4Ajdg2LiZgYa4bFMMOY2pYic4u9bCWBLRPy/brS+Vi7kkJ7v5B3KnqtB0uZ8B3LV69mGD8MiHbl4WLHxJO2KReFWbMMVtaWKvwK//fk2Dyi2TvafvwjI5whmq6MdTQ== 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=FdLnC6elJcTLzta3VDOmOxQ9vkOouE2N1SeWytMh46M=; b=KlyO6JCWMQOENTQsL378WuGDQt26akF6kdrhYHkwEnEg+zfRlJ+a+dUuIhVJLM6pkPeN7vD0eidKa3ZRPTqhYBHP6vIc3g4z48SSPW9Gp/GO0szYH3h/B5OCOYaOrJt4B9nKDFQgezX9kk8S39HidVXHtDkxV94mP3NAS5fHvTrPkK5Al/VQ66QFUGKM9KYr+xWFpYykCXYy/H7vu7seYxa6Rc6gsBFuomAisj1mXLj8LUigAqWm89Tx2znwXOjLdTPWLEuXAj71+RQon3UeJyo2zDo6hzt7EkWFGbfcL0eOmum7gfgTFoOy85slAq4Kyiqc7NhqfCwfEcPN/jDCWQ== 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=FdLnC6elJcTLzta3VDOmOxQ9vkOouE2N1SeWytMh46M=; b=CeUOI6fe9sseLBeffNK03C40fud03HNC4nKgnKGCK/7umQerBcX+PoXqj2zNYPF0b+y9SI0usfmYZHxclwXm9G4+hmkscVQ2WdWmw/cfr5uzh8QgiA6OCVs7J8P3zGhBCDx8l2Z31UxznbEeOZMFAmKSg9ftORfDsnD4wMRbFVE= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SJ0PR10MB5629.namprd10.prod.outlook.com (2603:10b6:a03:3e2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.26; Fri, 7 Jun 2024 18:53:25 +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.034; Fri, 7 Jun 2024 18:53:25 +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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v2 09/16] maple_tree: use store type in mas_wr_store_entry() Date: Fri, 7 Jun 2024 11:52:50 -0700 Message-ID: <20240607185257.963768-10-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240607185257.963768-1-sidhartha.kumar@oracle.com> References: <20240607185257.963768-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BL0PR1501CA0024.namprd15.prod.outlook.com (2603:10b6:207:17::37) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SJ0PR10MB5629:EE_ X-MS-Office365-Filtering-Correlation-Id: cfb1a767-1a42-49b5-b21f-08dc87231c75 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: SOrt0XI8XnAPZew8pEleIYc0pqE3lq/s4L4eIaqUwyHwPTvMD2vpEGtIq3iti2LRlcsFVPwNuiFcpGJS9BePNkEwuHt4Jy/p7Hux4iXqql++b9P3PKmnYekrn7ymsF8cEVyQFWwoj9DGDTE+BXxgb0M4zWYB8T/SVUrFiBqqljiiapCnPdemDMUdFSWsTYe9qOjsB9nthd9olSpVZGSK98IyCN+qhSJuAUeuJOQafHWO6BFLg4LiYmDHD/2nYEg1N/JR7Ngg01sgSsFLd/cEsB7biTTolmYHNzywe8v6+zpeTr/rx+m6GYYLgUY+gfNg1Mbt+t48kyM+h6jAAE+576SGcoAZixf88osHpEQp+k11UWXi3O32DWxh56mM9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230031)(376005)(366007)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RBH6gLPWmishdK9gBpk9s0jWJkpqwagLssRkdcKt/N5Ipin6B8NmWchAaDdXH66nEnEUCYORdyvUXZqZTto44J6Lkxyx0cugUlk4AB3uOAYc874/Y5GuRIjJt3HxkmYU3AbkU3LumKIGV4+kgvIVRK6ircmJuXTah/cwwaacMkl1xsz3QKpvx1wvf0uCuPwLrudl/cDRatxlxzRDO2qIGVRN1OAD7uT68zCBcCxzl14ARsxtrjncORxTn3ZKyJEGPl3sdDzvS0Vr0mlT7oBnV26qpdKxumukbU4uYtoNg0I02nahCXY39sgGxLIFDws7aav5DWQou2j+4YjhsJJWyheHWLmTAKme4mVQatLJWfY3WjhtVCfORTN+W53Fe4VBLCtglch7xTBzbjQvZztP/EIAO2JKraR13qFXOMs9IUFD+Zbo3A202Z9kH75CjAG+qxxkY31Lz2r7lIIS2XPzDOjHEY+AfjynArmBBqgk5REyQEmr1bzQHCpPj+e8/JvnZgcilxo90tToLps7SfloYyEi6uyQlERFs9PWNSCqaWBOOvG7zQzf56IF2wTI4jNWHOfngXXGx6Seoe5h1KeERQt/hXZDaQ69mBY4hYwvbHMNxcb8wPpGQCSzGzevTccF7LghZ+2Xl50dstHZKUlkkmRbqzQBmhj3LuZfyB32jKGhjpXtJJeQyfhdnSpQgSmox+HFTTQEUBM3xFnkyLyxElGAGYhE/vnCGdaniQtoaciPRTNmrl4JIhmz3nktiPNVTjKaA+MZ5uLFGy6W7iJRDwIeRzAmPX7GAKeZsLs2fOfUHof5p/NFmQqbqBGiXSV2CeZXezrVRuJpCmxcEawBtb/XfUeQvPbqpBC0KjNW6IZEuvmiaLEr+gCHe1316YHA2Y/GP36tkDO0/8KGHQQIqgdIySBjQCXydfKpcyELLKYnedjVF+ZmH+KjXOqqQVPKt03WR+a4kyh3YpVbbD0nHvL7D29SK9EgxHuqB071gNHK5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uC+rW25czSCgc03WK96aUus4joYtnwYpEburWcq/hM9law6/R1nT9nmD6H0T6w/GxOGnWReSBbYuQV1Cn/RTxnrKiEf80qoFoawdFRyYVsktNabzAtlpQVMiFRtp37uxEwzFUt1mZF6Awdm+yFh1dzAgupFtxILcziw/9+oqWXAeNcmCJL+mqCMnYfb06DO7jM+Od6U31bFrB6qdZ8ZXIoFLIan5IuWLe9Dt42xEVlMhj35U4pmcVowaHgg7cPbilRMeM/2Q= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: cfb1a767-1a42-49b5-b21f-08dc87231c75 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 18:53:25.1942 (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: 51HFLJJBeNcuU66D0H5AVBF6mC0NA9xyhsw8lrlAV1otaidoPFCvNp5RZuNyl1Nskd88T/1DdLWZ9WG81Vj4ZD6Zv+kundTB/du+8cnells= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5629 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-07_11,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406070138 X-Proofpoint-GUID: 8nkelKO-z_5mcRZ6sUp_6VQLTK08V6ol X-Proofpoint-ORIG-GUID: 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ZPp6/BYIlrroLgK+hu/x3kMCXB/R9VlGEW9rkQlOj+QcyVegJZUEd1 aI4xigmM Dge+wJOPkFrE4pUOv7zHtl7velc9KJUIOY/sSPM+8W9mmw5j89m2MwKT0ET29j+WkdJ6L/OvppiRxnAVYlPOdup/vYNtnySz79fHlon7CLpC6R7ScFSL6AWuvPclZuKdZVDH9xuF1Npq7mHDknCUV+pv5xU0il+zyr8/3sCG8e+NJdkx7dk8Fso/XZldD6G7khG8m2JLnkyEh5AAmmlAZObmbaVF9RotwUasmPLZ9/kfQezhKIYIwKMxQzazwd0xM+bXzfPLjOrDKVmsBLS8fwW/1N47u63GkEZoM9oifySZwmON7IPYAKJC0Ee8md6oTrOIRdvLeuBQW7o1mphSPrKX4NdmHTm+cpHXlL/su4DRNSRLAHD+6JjoDZc6iUy7mOtC+I7BpiwYQTCLzu9yknIhM0E7WbCaunE+ByYQ34YQB2EH1hEtiSHZKe/M+2HYa+ZU5QLb6TlLMNI2ibBsQ1Jmjsw== 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: When storing an entry, we can read the store type that was set from a previous partial walk of the tree. Now that the type of store is known, select the correct write helper function to use to complete the store. Also noinline mas_wr_spanning_store() to limit stack frame usage in mas_wr_store_entry() as it allocates a maple_big_node on the stack. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 55 +++++++++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 91b18eef81e1..2c42e99c400c 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3780,7 +3780,7 @@ static inline int mas_new_root(struct ma_state *mas, void *entry) * * Return: 0 on error, positive on success. */ -static inline int mas_wr_spanning_store(struct ma_wr_state *wr_mas) +static noinline int mas_wr_spanning_store(struct ma_wr_state *wr_mas) { struct maple_subtree_state mast; struct maple_big_node b_node; @@ -4206,27 +4206,42 @@ static inline void mas_wr_modify(struct ma_wr_state *wr_mas) static inline void *mas_wr_store_entry(struct ma_wr_state *wr_mas) { struct ma_state *mas = wr_mas->mas; + unsigned char new_end = mas_wr_new_end(wr_mas); - wr_mas->content = mas_start(mas); - if (mas_is_none(mas) || mas_is_ptr(mas)) { + switch (mas->store_type) { + case wr_invalid: + MT_BUG_ON(mas->tree, 1); + return NULL; + case wr_new_root: + mas_new_root(mas, wr_mas->entry); + break; + case wr_store_root: mas_store_root(mas, wr_mas->entry); - return wr_mas->content; - } - - if (unlikely(!mas_wr_walk(wr_mas))) { + break; + case wr_exact_fit: + rcu_assign_pointer(wr_mas->slots[mas->offset], wr_mas->entry); + if (!!wr_mas->entry ^ !!wr_mas->content) + mas_update_gap(mas); + break; + case wr_append: + mas_wr_append(wr_mas, new_end); + break; + case wr_slot_store: + mas_wr_slot_store(wr_mas); + break; + case wr_node_store: + mas_wr_node_store(wr_mas, new_end); + break; + case wr_spanning_store: mas_wr_spanning_store(wr_mas); - return wr_mas->content; - } - - /* At this point, we are at the leaf node that needs to be altered. */ - mas_wr_end_piv(wr_mas); - /* New root for a single pointer */ - if (unlikely(!mas->index && mas->last == ULONG_MAX)) { - mas_new_root(mas, wr_mas->entry); - return wr_mas->content; + break; + case wr_split_store: + case wr_rebalance: + case wr_bnode: + mas_wr_bnode(wr_mas); + break; } - mas_wr_modify(wr_mas); return wr_mas->content; } @@ -5590,7 +5605,8 @@ void *mas_store(struct ma_state *mas, void *entry) * want to examine what happens if a single store operation was to * overwrite multiple entries within a self-balancing B-Tree. */ - mas_wr_store_setup(&wr_mas); + mas_wr_prealloc_setup(&wr_mas); + mas_wr_store_type(&wr_mas); mas_wr_store_entry(&wr_mas); return wr_mas.content; } @@ -5639,7 +5655,8 @@ void mas_store_prealloc(struct ma_state *mas, void *entry) { MA_WR_STATE(wr_mas, mas, entry); - mas_wr_store_setup(&wr_mas); + mas_wr_prealloc_setup(&wr_mas); + mas_wr_store_type(&wr_mas); trace_ma_write(__func__, mas, 0, entry); mas_wr_store_entry(&wr_mas); MAS_WR_BUG_ON(&wr_mas, mas_is_err(mas)); From patchwork Fri Jun 7 18:52:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 13690602 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 073B8C27C53 for ; Fri, 7 Jun 2024 18:54:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 880386B00AA; Fri, 7 Jun 2024 14:53:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B9A86B00AB; Fri, 7 Jun 2024 14:53:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 572DB6B00AA; Fri, 7 Jun 2024 14:53: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 2785F6B00A8 for ; Fri, 7 Jun 2024 14:53:50 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id CD6041219B9 for ; Fri, 7 Jun 2024 18:53:49 +0000 (UTC) X-FDA: 82204991778.22.04E0A19 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf02.hostedemail.com (Postfix) with ESMTP id 648578000C for ; Fri, 7 Jun 2024 18:53:46 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=mPwP9hu3; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=llvC4aRZ; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf02.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=1717786426; 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=eVZpxqxt2vbi+6AHnTDpG54BWzJdcL9VsTS5wEF3vJs=; b=7yZq0JYfbB1a3rYLlpTgw3lLKfTip6oxdtq17bWg6xeLKMYN/RQyJYNa1b6+HxKTW01GUd Gwwco2OxacAif5eBVkWg4sV4z+FZksSn39KT7nbsCtCw3q+ca3GYPhYrg/SMW4lv4oFlF4 Ur6WqxujSZhQ1dANXHP5EPl6k8qpodY= ARC-Authentication-Results: i=2; imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=mPwP9hu3; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=llvC4aRZ; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf02.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=1717786426; a=rsa-sha256; cv=pass; b=Uv8oZYu6Y+BxMLG4gjsUfxDZ/8HUfw0ZqZbrfeMsc3H41Y5SEtpR3hG3b3RcLJ1gInhP+j t2PX5lnbjOMHiU8dVAWm2xRMnTFZ0rP/r15MoiJcKmwxzWpTK/BIzEW8lkSdyAtHn0W0rl sB1iYFSY8tGfk0SmE404knod86IqGls= 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 457CuhbN016014; Fri, 7 Jun 2024 18:53:44 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=eVZpxqxt2vbi+6AHnTDpG54BWzJdcL9VsTS5wEF3vJs=; b=mPwP9hu3VOY9Kqs1fK6qeMA3kblbfG0DfdY+y+pg7rvPNY2LD+kaiyiglM+qRequpEEC KFSpmjyaQEJI1GMegHS9LWC/xzhDSxmhFsKN2GrSqUPzA/0GdE5pSvfijmOpccXFpdZ9 rmlQgyTZuSl6RkK1JFwGYGxyLWiei5nDA9lWdm9GLZ86DcLWt4hpRy7z39gdMSxti/pJ 9uGx76/dnWv9o0Sqe3qzcDAzW1B7ywyt5JejmT+c1Hyv+b/EB5NgsS/WzBzAQ2/mRtjk nPN2Yd9z7UJ28Gmtyme7MSke+JAgrl5Oqy9aU60fNWXen1n53fXsWASo7fBSp8j5/WT8 zw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yjbqn69he-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53: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 457ICR4I023938; Fri, 7 Jun 2024 18:53:42 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrr2k7tv-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EmaLlyBgxNSIEqnduUU82QI162cr6IS37Ux9Vr5607Tkt9H/iyWcK+Rnl2G5I/JWP4FEsYWfw1vVtm8E8pk1X2sFjd0Cfa+ifn1a2gAp3eCX8puPe7DTYyXy0H2dSAU6EXcR8PcSPoeDip6R5uTS9vfvawzS257M3hX1H/wa2Ap0bmeKDzZ6Mb+D9cKAukne7UOiTfi86XZDjAVvzHlLmVAvnT8/yOWeJSDX6e0FJPh9ajhNex58It26nFCTrHQ/yNkZQDE1Sv57ROU/OfyXwG0owZoLeAK8+eTMTK6BItk2L2EYMoaJ7EA9moxf36ndXbmSBxVNRcEKdb2ay7im3A== 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=eVZpxqxt2vbi+6AHnTDpG54BWzJdcL9VsTS5wEF3vJs=; b=enhX8DtfuakhAlNQYAcYkTyZcFKS5rIdAspnsxsKqvHcYV9aXADrUfaEc21QpGMLXVX1ddSiIpS2dz9YKlqXcChL01naG1DFKJlFShohfADCes+C6wM4E0e/4yR5pXye0ZLbVz4eX44EyDKlS3ZtpU9lur7OIV2oMAaeSAREYaY1GdrZkWe2O+t+V38yA7Jl6Z0a0lQI19Gng8XtE8OgGxwvcv8w4fa6+gD2ltULQvCSOFpSsq+71Q29BaG9iBye23IfbdT1EjYZpocTpspCmIEkLNiUh4wgUPx+7oePHBI7yXhN1lxuGQ8EwLnbMwYvm0133356SnWnc78TrsYyIA== 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=eVZpxqxt2vbi+6AHnTDpG54BWzJdcL9VsTS5wEF3vJs=; b=llvC4aRZHe7l1kM7IoIaBGp9DisDTygD7+Dc38+d4PUh3mKFgTW//SYXhoTPs1ZUJXKaWiNrILlqZ0glurFtnwIVqgJ6EKujvQzS1nfj+ja8iVF5Z1rkzTH5C8wLiiKf29tkf7qL7g/FRl7XiWMqPoRFERPHf4Q8wL1ZSfxt3IY= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SJ0PR10MB5629.namprd10.prod.outlook.com (2603:10b6:a03:3e2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.26; Fri, 7 Jun 2024 18:53:28 +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.034; Fri, 7 Jun 2024 18:53:28 +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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v2 10/16] maple_tree: convert mas_insert() to preallocate nodes Date: Fri, 7 Jun 2024 11:52:51 -0700 Message-ID: <20240607185257.963768-11-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240607185257.963768-1-sidhartha.kumar@oracle.com> References: <20240607185257.963768-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: MN2PR05CA0057.namprd05.prod.outlook.com (2603:10b6:208:236::26) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SJ0PR10MB5629:EE_ X-MS-Office365-Filtering-Correlation-Id: 57e3d91f-7cd1-494e-3d3d-08dc87231e1f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: WTEbk7w+Wz1C4OdBLx31MYD0OiiMSF5bvbTnSUnVrGU4hlxyjaJ57Gi1E9hjHMiAFYZCI96mN3YPVwscudNoP88TRS6ZsL0D/J7x71zJJ/MiGVsKIi79qSOEllLiz7LfV/JOQ1tCpFB5nQFPgq8Le0k4CttaYIkfKIm4A7PZK8Quq40hIce/Kfh/3cYYrbBmPk/YgPWnOYlIOFMba2NfUU4X2z0qQ8XLYnFX78yxe4IouCxYyMeHH5Jhck/228TusT0xNmYx0taZd9w31k6kpRiu131b6BGEfDt2EruZbaff+sIpXOCCIBWKWp6T6CJpdJu1WJaY0yUgEdGcchT/BeIoVFtx/3hlE7tfRY6ciu9LmK4QU8O4uU75yITHqtS7iYT6mGw680N183CHq5vgyDDWGRtyEHPGG3SqxXj1inDneSBQ8TAPAsiHpcVOyezl4LUaVNK+eroOJhQ0zbXbKSZ7+GJ+aD+s6U0MtgCtLEbsVdGMO5xb2AR+n1tuw15Oae/S3TO4O48Cl9i96f7WQjLm9IPr3P177vx5yF3Uh0bLq3KzAqBnr7ntmzD+RdM/zDSvnvGcSFd35PwJuyshopOskbz0VVcI1UG81q4oT7NHIRPeQEdLDUibGN9n+zURji7GTjmYvAeOkwXOYejwYiRArcK5j+hs7dD2y48Wnnr8a//LRRDqZT10rk2n76ep7skFDjErhTFhwb7712Kpb3zMoPDp2rnP+OleG93+dwGR7j14i3SBxsCORTvuUxE7/zXqSDOBb03PPpKMxEz7HHsciOJtMLSz6/2W/XdSaLkdNy+BE1AVd3MkG4MNLpfb/qXJLVUwWipfZcGeu3jMjx+M5fWW6zRf/uyKMYLoI3j2y3gMVscRAgfhs5abruqeJI9QfD1reqQbKYtGQ8+o9xXzYeLzmSJxM6dvNzD5eH3Kvn2APDWBGgajV03eCn6H4tBI6LSCIAOfyxl4FQ0FqE/ZcNqKvA0IqFBbsOGEv/4Wo1q+Sk+9sMSRFgaz7J4CGAKiMmePuYBVjjEVJqxzLtLzyla2qrxqpEAWlkm1UNhoK9+gl1o7Yq9mnUEufYiiqlQSUcmI8giFARq1Hi8RS5AiT5EKJBLt0L5oAHJQvJxVmFN6P7JzmuUfUMBxgNp4e2ovLfnb/tMrnqoifw44mSG7f8nDsAP4KKmzzxAd2reDqE0lSKTPZUhL5bCp1mC2rOv1HijK1qF6BYzbc8LBDMLUponCAlF7uSGRIiWuhrzg9GJGP8viFUfic3OUnfZUa36rVjoipeulhA4cLMD+eoPMgkpgaNoEOB5nFrJqfO5ywb7SjwsqSjq6tjPV8cVY 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)(376005)(366007)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8mytOo4cbF1iQU2cULe6pyu9qR6EwI5ngVTQWyoAb3bXuV2sOHs2lswMnSsm9m73AiJ9S95mPKTpKFBeEy1uThjSbaA/D0HuyIvYTghK8O+NiZssw0+8i3/OyE3y0YO7Qh1zGt6ZnuEEEr/tucTRElrxt1j+BW1do1D9S/p8xe4mI0TLLQvjQ8Wwk+JS9oXcXwPseevCMnuGBzCQrnHY9RmI8p37xVHfupYJU8YMUWz1ZKrX/3k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67nk8pxG7wv/OHjVXAU32c/D4LVkO9rvUeigxrIAilaTD400vYsdAXFPeLhyGgJgBkKIPh3U/pcwBCvO3ycJ7dk1KNnboNyJL2t1a6fe8aQo+T0qXUuP6+bH/MOWZ5PWLLl/BvDvm1Auv2c2W20g92b1pkrHMuM61hSvIZVOyynoaCoUAyfVyvQfENRgAEnvdStAeXXSjvCGFfvWxLF2hErJDnVaaT1WzLjboKTrq3La8YYEz4WDE51SstUfM6BgU1tGmztc+F1q7pjriKJxgp7J0/yRZ++4CDfmScxJMnOaNHeAlPB5QklRspcHHB6tHyKvRY+pAg= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: fqagOroq3N8zXVEUqcH0zbnoF8a77p7LM3yBOlnAsIkqf0BnRMqUo5oHguL7POXg9YveZMhidHldNK3K9sHtT+abBB1U9S0yj3KOZQo3N+296wrR8RRReVijuyEz5JA5Y+/1LiOMp+RakpqDzJu0DXtR373lRzTCdVq4y5w/tZ6wYUHoLABvSSzgTw20p7mKbh6Wkgm8QvueS8Ncn43yP32VVaw6j8fggZAG0wIK4hzhIxdpKvGe/MBeDynKuZ7viB7dF7GfxOFGjPBv7a5B0f2EqxBJcHmOzc0Q9jo01Iw2aE4YlMZQY6T+NAsBKAKhxSDZ9/1vTNiAcVcizdaw9PrmxR/qtZ9wIiNKK925VuIzuXWU66kwDfnMqgKkknGMNoBgYUI1ulWBRodF13phH68dvDX9rlVBMkpMmy0s7NsVBQNPDOX5/lVKRf7JsQSNkIXvEUtMWBAb/s/BHRSkJRnxNT+aEwIgtQbMeYO7YrLapExnDRSj7G3qsknp73/yKDbPfhAmG850oSIhQszAvIIX/YoZTfUNNLDMozptSL6PbQB4qlp+ZutoOcvY8n1Q6mKJiniVkH6dO1jPVaNYeKbSFv3endwWfLAsyHBUxO8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57e3d91f-7cd1-494e-3d3d-08dc87231e1f X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 18:53:28.1157 (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: qnwJ+apMvAJsbvjAjjGhA0HrSdRq02IBAlMp104A+qxH16xqnkOHzrwrczC9II+99xK+4AsY9gkgPt3scCbnx8M8Hjb1xnJYcb8qGH58GBw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5629 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-07_11,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406070138 X-Proofpoint-ORIG-GUID: WfjCc5LVIUqqxIfatAo4ADc8W21uDvhU X-Proofpoint-GUID: WfjCc5LVIUqqxIfatAo4ADc8W21uDvhU X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 648578000C X-Stat-Signature: r8mqbordkszt6u8rfrnj1ceb7cehru91 X-HE-Tag: 1717786426-588784 X-HE-Meta: U2FsdGVkX1/dN1EzOl2qjBkkZiHYyUMrUlIxsMo1732ENnM8Gbed2iYj8rM2McIhn5Y5uCvFeR1WNXSQeiFBQXwAOuxJ8k8jiYuNQ0IKCe0xwdhkBwihyQSbfOYyTFpbTWAosdsZuRxsaiFILZOzRrqYSzSoppqMJDK66Du9gI14T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8741MIP97r0pRwnje8YihV3SBEC4Bndrzru0PROoDszP+Cx8xSW/91wMqjLFLk45WmEUMlsGms6la+sOKG/l03ZUuMn+OxhRdyft8U5os+DHxnvtsVI3QXFzHz1VhqWnk3kCy4vk1FJcnO7FBcaqdsG0iubI64BDy5FL3P/bB3RAIWEPbkw7hO9gGfqyVIpBtowYInbQuq1o2nKwNNuJCav0SEp6yV76t/Q== 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: By setting the store type in mas_insert(), we no longer need to use mas_wr_modify() to determine the correct store function to use. Instead, set the store type and call mas_wr_store_entry(). Also, pass in the requested gfp flags to mas_insert() so they can be passed to the call to mas_wr_preallocate(). Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 2c42e99c400c..c37bfac4f622 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4442,11 +4442,12 @@ static inline void mas_wr_preallocate(struct ma_wr_state *wr_mas, void *entry, g * mas_insert() - Internal call to insert a value * @mas: The maple state * @entry: The entry to store + * @gfp: The GFP_FLAGS to use for allocations * * Return: %NULL or the contents that already exists at the requested index * otherwise. The maple state needs to be checked for error conditions. */ -static inline void *mas_insert(struct ma_state *mas, void *entry) +static inline void *mas_insert(struct ma_state *mas, void *entry, gfp_t gfp) { MA_WR_STATE(wr_mas, mas, entry); @@ -4468,26 +4469,24 @@ static inline void *mas_insert(struct ma_state *mas, void *entry) if (wr_mas.content) goto exists; - if (mas_is_none(mas) || mas_is_ptr(mas)) { - mas_store_root(mas, entry); + mas_wr_preallocate(&wr_mas, entry, gfp); + if (mas_is_err(mas)) return NULL; - } /* spanning writes always overwrite something */ - if (!mas_wr_walk(&wr_mas)) + if (mas->store_type == wr_spanning_store) goto exists; /* At this point, we are at the leaf node that needs to be altered. */ - wr_mas.offset_end = mas->offset; - wr_mas.end_piv = wr_mas.r_max; - - if (wr_mas.content || (mas->last > wr_mas.r_max)) - goto exists; + if (mas->store_type != wr_new_root && mas->store_type != wr_store_root) { + wr_mas.offset_end = mas->offset; + wr_mas.end_piv = wr_mas.r_max; - if (!entry) - return NULL; + if (wr_mas.content || (mas->last > wr_mas.r_max)) + goto exists; + } - mas_wr_modify(&wr_mas); + mas_wr_store_entry(&wr_mas); return wr_mas.content; exists: @@ -4532,7 +4531,7 @@ int mas_alloc_cyclic(struct ma_state *mas, unsigned long *startp, return ret; do { - mas_insert(mas, entry); + mas_insert(mas, entry, gfp); } while (mas_nomem(mas, gfp)); if (mas_is_err(mas)) return xa_err(mas->node); @@ -6536,7 +6535,7 @@ int mtree_insert_range(struct maple_tree *mt, unsigned long first, mtree_lock(mt); retry: - mas_insert(&ms, entry); + mas_insert(&ms, entry, gfp); if (mas_nomem(&ms, gfp)) goto retry; @@ -6585,7 +6584,7 @@ int mtree_alloc_range(struct maple_tree *mt, unsigned long *startp, if (ret) goto unlock; - mas_insert(&mas, entry); + mas_insert(&mas, entry, gfp); /* * mas_nomem() may release the lock, causing the allocated area * to be unavailable, so try to allocate a free area again. @@ -6667,7 +6666,7 @@ int mtree_alloc_rrange(struct maple_tree *mt, unsigned long *startp, if (ret) goto unlock; - mas_insert(&mas, entry); + mas_insert(&mas, entry, gfp); /* * mas_nomem() may release the lock, causing the allocated area * to be unavailable, so try to allocate a free area again. From patchwork Fri Jun 7 18:52:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 13690603 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 8AEC0C27C53 for ; Fri, 7 Jun 2024 18:54:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CECD76B00A8; Fri, 7 Jun 2024 14:53:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C9A526B00AB; Fri, 7 Jun 2024 14:53:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8A4CC6B00A9; Fri, 7 Jun 2024 14:53:50 -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 63A206B00A8 for ; Fri, 7 Jun 2024 14:53:50 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 1D9E4A2B5F for ; Fri, 7 Jun 2024 18:53:50 +0000 (UTC) X-FDA: 82204991820.03.6F458BD Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf06.hostedemail.com (Postfix) with ESMTP id C23EC18000F for ; Fri, 7 Jun 2024 18:53:46 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=HrV3V7Gz; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Gw7y0BEy; dmarc=pass (policy=quarantine) header.from=oracle.com; spf=pass (imf06.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@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=1717786427; 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=kt5Zf2IFc6VA5/9HjTZW5u6FOaNmBnlLUKNfDocuGoE=; b=JGK5eP8Y3Hs3ERUDkYO6q42PYyN1ccMZ9W+K1vSzIOcAPXbvgdQN6/Xak0DbATy1oV//tS DNqXciSFqLyiKDndRCH1jnAEhOlP3liQfRTbd/4nrGxhI/t6nFXpbs0uus3Olj/FohcShi bIz3dNaJKI9igQ/d9cXpXf7L6+B5NaA= ARC-Authentication-Results: i=2; imf06.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=HrV3V7Gz; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Gw7y0BEy; dmarc=pass (policy=quarantine) header.from=oracle.com; spf=pass (imf06.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717786427; a=rsa-sha256; cv=pass; b=svn0Uo3w2t6tgv0tsSxy9XYRUhYp9xdVH27RJTbp1hU108KxykWIKL+8oQ7tkwAeh+hJxM KBKU6hdXt67uzxRrwEICaEpC4+u5XiHDvGUji9sgX0OWOmIWSfVu/jOI8sIhTQeCSaUXE5 lKqHoQkEF4e+Lf4gZ5cVLK3FXzs8aHk= 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 457CuYeG009377; Fri, 7 Jun 2024 18:53:44 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=kt5Zf2IFc6VA5/9HjTZW5u6FOaNmBnlLUKNfDocuGoE=; b=HrV3V7GzI/atSyRDw78AFmfs+3KmD8NpYTaODqkXnBMeVUC4b6Ikg13j8PYo9cJ6OCgN Au9ifBOm2odR5P3NjQbTMJ8pPpF/p6iOGlKXMfc0PCc2SwuiNxpG5PL2tPDwGOi9or5a cPIGMrjKLiOfbvP6oakYukblAZesOmEUOS7UYLzdyg5yp/hUnoFW4RuhYvFXFj6tmz0X z8tWX9uXl8tO9SgNN8GLrTu9+v2yIB7yUN25HQNL1DxmKdVHsgg/IRBdRqmgZTvxYlfK 09AnsgEbWQLHvVO0fPYZensQm3p6/IwauCT1eY//lK4nNkv2oU/GK3euCSMjQks83+Ys rg== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yjbtwe89b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:44 +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 457ICR4J023938; Fri, 7 Jun 2024 18:53:42 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrr2k7tv-8 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nnFfVHHAFWU/Hq1WUVusdVtuZmplfJzQN622k3ivv833bFGjnaHc+Da468nx7HiE1qeVuKDFLL/BMdjuWco5M7Eq8RQPsM3f5UuN1f2f8LElQhbtiBvj/tTIVd+sJwxpXiVJMmyZVYvOd3T/tCPOfHTXNwJhI/t82AejLHHbpiL+uUil3wR2V4uYa/5HYNyFt5msTnYx1pwpLTPEvgltXwxNyGCOVKmeZuZ15cySmMpo7FbihXxODv82wnMvZMA5MoCXwwGiPizma3X0XgMqpmVkvisocGSnkRP6Ge0Pk4cExxfK/yFrpj2vqcPWoI5wdiAPpMOBtWt55+aEeGbx1g== 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=kt5Zf2IFc6VA5/9HjTZW5u6FOaNmBnlLUKNfDocuGoE=; b=EFEeGcyef2hyfx225w6RXwlWK5wWL7yke5mHaGcQ+c8B6ZYoWLRpln6hV9wurA7biMkXLtkbTjo+yl3jcC87raXQvEZN+F8gQ1MV/PbvUf6Iv4uvaE+HymbMxOy8YF/VxkLcKUnYkC2F5hHkfAmoPvqOO/65dZPAFqMMhkHgrO8QH1TIuRWY+FLFWx2latCQPYgMO1SbBJZ21yBFHV/XqtsDs/YlcfP2HEYHsp4C1IX24y7Nd82mymAoiP9PDlfp8alj+5o9aF5zYtoy7vJz7U6F2hKm5Fdm9GNL82BXQdIMwvhU/7DitnGcvSlXRcdED9jFzasd5NGXRxtCdNAV+A== 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=kt5Zf2IFc6VA5/9HjTZW5u6FOaNmBnlLUKNfDocuGoE=; b=Gw7y0BEyAt7GKWIJ/MuJDsntzaIa2JTQYYtwBP1tTnv00oKgt/dC284FVLdg6zkxJBU1Ee50zO3XSGE6B5mDzb5lHhRlIqCN9j8zs9mzwBzNwzsJ5QJJBFsQPnWcbdSH2lZ4NOoo18FsUi9vSDLgVdBdThT1CyaOE8GoW0UtB9Q= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SJ0PR10MB5629.namprd10.prod.outlook.com (2603:10b6:a03:3e2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.26; Fri, 7 Jun 2024 18:53:31 +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.034; Fri, 7 Jun 2024 18:53:30 +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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v2 11/16] maple_tree: simplify mas_commit_b_node() Date: Fri, 7 Jun 2024 11:52:52 -0700 Message-ID: <20240607185257.963768-12-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240607185257.963768-1-sidhartha.kumar@oracle.com> References: <20240607185257.963768-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR21CA0022.namprd21.prod.outlook.com (2603:10b6:a03:114::32) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SJ0PR10MB5629:EE_ X-MS-Office365-Filtering-Correlation-Id: c911a8e9-5670-4d87-a511-08dc87231f6f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-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C4mnaf0vswachhDH3kkmwymagm16d+bxgjNiBzv40CtEHuMdENS93D0KiUGEIsDjQo0L7GroWBlZkB6UC0cT6XZk8QKZJYCQ9GKPDhMUFQIseeyzHF/pcVpSE7u+VJn1ixkuuIm9nsKplj6Dz18Mh9d/HFxheco8eimtPnNZjYl8AzsONVUZ8FyJ2r9lX5Rbv72pxMfxxVHX9GIEbiVjbd2D+0DLAY3BvxA0XV6iGjWqOk85TutrcdekeoFVkNnU= 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)(376005)(366007)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: S71ULrciHvLsCkSum58H7/xvV005NdCrJglsqEC5/TmgS9gAlptmKEt047T1TIrOvyRLZW2Su3TEfvreJTif8QteLrYMFIVpXY258lwQzQ7ILCcQuc3rNp5QPrYiZpF0HV+8Dgz439NTf0l9Aot+b7SijvCxDeuuYs3GISWXLW2FyPq4CCF2ORP5WIz/TAHBcyBVueFoIHYL1Lt/yubvdG9vZUbks+5eVBeAyuqBK8GHWDZfQZ2xscEZPVYz/VcQ3Azn/9PdhxHga0KeTkiAaZR1lf5ni1STm3IRDfI9BC/E1Cp+PpCrUPLcuIQTjp/TGmcEOz9O8zybCZJqjkwwYMcIdSK0LZ0eVaik2v4Rdrc7Nz/QDmEX8mN0R2vuH87/cAjUzwnKC7xe60LoPcQgld6Ye6sh5bfGKA/toCDOcXir5lKioPWMsHhJ0Fj9GZWes+0EbC+j28Uhv5DoZOQyadesiKJngyI+oHlu3L6LOvIlgn/3fSAFkhSrqrdrljhGPsfuTuazqk6dhaa8CuUikPwCIo59IWMva8Xm+pxsgblzL01+jg5SZMhlwpXoQXr5XLJAauMNZH838T8AnPVpybUm+VlVmJAk4/wefW6XF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AntiSpam-ExternalHop-MessageData-0: NDUgEMwwY+LyLHz4sgnqPUbNNIEN7IXv+8qpijK3JkvdPgi/D5OtOihLGEC3kWPa1HSP+K6JAnJsW6IBlaOXAkyKAvhC/W8cP+Q+AVbSM31AYXk8yQUDfp/7wxR3SQKRWS7HyaLg+QOzz9i2hXaaL0EVxBT06BE75APD1GN4kFo4y4K8q4WjNZfhlnBsweCZE9PE2IWUOdMYlL/tcTegxkZM94c199/d3FgSfGezXxaULnlhH1E1mSPA56mxnsupB/LnFtC7WoRcKJYZplieYiT25OSFIAzDvWEk3nCL3IsiMc2FHw0twSiA1iq+qxVbuBg5n75DnFLg/adOlKQ7s2G4UD5S2047x6ZJmn6Wpe9Z2QNNEKyIGCbbckvKK3/Xea1uFmCDRShJkamXRAFlPQ+D4mqPOLym0Dx+3c/ncecjj5xg9T+Rx7Q5xFnWbcxJ9glsUf6kb25bQj1fbJYq7f6COZpK44jH2nnA+KOcr2oT0giAlrIDuXY9FNCkmAoo25qm3YZgGaUmI0kjFFnRS1yJdgn3SubFXkLAed5aSyilyAVwI8Sl3f7XAN9HrpRvErhLuRISQK3LjOkOCohFPha6YGzNLfmAH8b3Hk0wErE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c911a8e9-5670-4d87-a511-08dc87231f6f X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 18:53:30.9125 (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: fLgg3NvhhuhHew1lU1WogLLUejR9o8pMcghB5tYaZhknT1yZIVUyP63KZJO5yYrVXUs1RvsGKTEnkt15ykUYEfAJynldO9cpyKH4ZMDQRB0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5629 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-07_11,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406070138 X-Proofpoint-GUID: S9nHsH1Q15BLfpU4Jn4wWudH6qlOeCGm X-Proofpoint-ORIG-GUID: S9nHsH1Q15BLfpU4Jn4wWudH6qlOeCGm X-Rspamd-Queue-Id: C23EC18000F X-Stat-Signature: h1x14a378pa99xyr1pkaemkzhukinpfb X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1717786426-676602 X-HE-Meta: U2FsdGVkX1/rnlNLOIjDgTCdN7S4F/QnZKNI0U9FFmHzk3WZtmkKkD0nwgfH02RyCEhs6aWH5hFbBNPsuoz+z5OiEBKL9RjVPWJVxLZGDa6Sq3mk04qIJ6+ophX8SWziVIXlOPMZtL/IdiA2GkhJmJiGSPHXMzq80JqmeZJoMaeK4S/o9MD01ooeCpLVhcw1B6LmoLe1vMqpuNDtpizEzGoqBTcLVY09zsjPRJGqUOeqAvCLMAYeVI255bFdtva89ZjAfVsiZp6XP/c3xCFVeTcXqmkE/y1buU5fJau2boLeSFc0FuTwNK+lf0kIlAfnRvQbzbVrbcbjc9gqwH8p/JUMGX9xyQdPips5M1YX0y5N4wJTjY1GSkMi2gtkUhFE+2badPbFglkal/Y9cCRewoe/Ri+H3h1y5hb/18devDbTvoWQQFi57PTqoHvGkynKIX09J0yAib+vSSK51L9vgiwLXSECQh4+thVxsyesEgsy1ffs4o4jIBITkHk48nQOd/TYt8Zw9BMHykUHt1y1EsV9fzd7nC4E/P2xiKdCw6xq9Uc/+jwaRwnauPao1RGxMywSePwOt8Sq7F01Y4suq0Ul6W/uKk+G95S7DHqWMjPEgHn2sPSyf4LDq6yl1ppQii1IrkEMzpehHBD2a5MaqIBHpbYjHxJ3EmfGHBuC2+GZROU/1kshI7GVxsiAdLVrMZo87v5kQ6I2Qq+U72GmiZhbvc/bqRFjZ6w96NG2IYpNB+hb3hWRrNH9+xzcxc1014VHRn6+8sNrqSP8Aaf5COgD5ggAp97FsXJWGCUGEq4qOe3UD2Ivl6pjAVEv8ABhKS3SxSr533vc4LMdZ6uwqMD9/BZ4j3O95J9s5yN+NptXv48jiQnBMEOLR8kMQDxy934nfvqP8WYCb6LO3sudp0PrwbauyGPKl4SeHSlQ805kw11fNmWfpo6HtWupyWAEbs/odPBIlo0CSzAJujR UiJqrax7 LKe+RYfFqr3drEDYVhYfqC47dhdee7T5AupBuhqCXlhooY+yqHMRXEqIoTdm+Cl4eCARLJq77TsnNWEpXbkl8ZuycTQWR6FoiIke/D5CpV9dEkBi16ZAyitqTb78zJ2mIwspWyf7BsEHIaVakf1aN5Gum+iK2v+Y9NYjb0tPDKrrNNBHMBRb+VfSDyi1GED4TFaznstOULHxiWO3FunzAMCPI8iBhBxDrWXfaVhhvbJIQD69uPzVF6bdHNKgJ2WXREzNlVopl47hp/Qll1jVSKbBgTb7DNGSBgJAnHlDxrRznQ6HhDs50/X8rZk90WfYbAnrehqRLxAusTdBX3MbheYzdOGzc0aJHZy/ZKpauhNneodc7SdBn3RQNW7+8Flq7kBma42Kes6DhRaNfDLWbHf4FuyV6pkowmLlhkPXO2P03jEb2+UD1+l2G8nDJ6afTX5GvuUHOJa1t6wGIQkM+iYjjdXjpWi1Ofip6hxuK/yIc/Y4rgX6gf9s3o15hx5yh7T4r 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: Use mas->store_type to simplify the logic of identifying the type of write. We can also use mas_new_ma_node() instead of mt_mk_node() to remove b_type and clean up the local variables. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index c37bfac4f622..743de734ba0c 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3431,18 +3431,14 @@ static inline bool mas_reuse_node(struct ma_wr_state *wr_mas, static noinline_for_kasan int mas_commit_b_node(struct ma_wr_state *wr_mas, struct maple_big_node *b_node, unsigned char end) { - struct maple_node *node; - struct maple_enode *old_enode; - unsigned char b_end = b_node->b_end; - enum maple_type b_type = b_node->type; + unsigned char b_end = 0; + struct maple_enode *new_enode; + struct maple_enode *old_enode = wr_mas->mas->node; - old_enode = wr_mas->mas->node; - if ((b_end < mt_min_slots[b_type]) && - (!mte_is_root(old_enode)) && - (mas_mt_height(wr_mas->mas) > 1)) + if (wr_mas->mas->store_type == wr_rebalance) return mas_rebalance(wr_mas->mas, b_node); - if (b_end >= mt_slots[b_type]) + if (wr_mas->mas->store_type == wr_split_store) return mas_split(wr_mas->mas, b_node); if (mas_reuse_node(wr_mas, b_node, end)) @@ -3452,9 +3448,10 @@ static noinline_for_kasan int mas_commit_b_node(struct ma_wr_state *wr_mas, if (mas_is_err(wr_mas->mas)) return 0; - node = mas_pop_node(wr_mas->mas); - node->parent = mas_mn(wr_mas->mas)->parent; - wr_mas->mas->node = mt_mk_node(node, b_type); + b_end = b_node->b_end; + new_enode = mas_new_ma_node(wr_mas->mas, b_node); + mte_to_node(new_enode)->parent = mte_to_node(old_enode)->parent; + wr_mas->mas->node = new_enode; mab_mas_cp(b_node, 0, b_end, wr_mas->mas, false); mas_replace_node(wr_mas->mas, old_enode); reuse_node: From patchwork Fri Jun 7 18:52:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 13690653 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 91C9EC27C55 for ; Fri, 7 Jun 2024 20:42:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 21E9E6B009D; Fri, 7 Jun 2024 16:42:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1CFBB6B009F; Fri, 7 Jun 2024 16:42:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 020916B00A0; Fri, 7 Jun 2024 16:42: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 D945E6B009D for ; Fri, 7 Jun 2024 16:42:51 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 84F30160449 for ; Fri, 7 Jun 2024 20:42:51 +0000 (UTC) X-FDA: 82205266542.14.8F77B2E Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf05.hostedemail.com (Postfix) with ESMTP id 2F8CD10001E for ; Fri, 7 Jun 2024 20:42:47 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=kbGSX4FZ; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=o95bq1hH; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=temperror (imf05.hostedemail.com: error in processing during lookup of sidhartha.kumar@oracle.com: DNS error) 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=1717792968; 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=D4ZA8OWgwj5vBfXfTEiiu2poxtY0VzIKWAMaeLisH6E=; b=bvme54MpvO7wRHpfJeGx3ZCvdWY89ekiI5oO4DIlKuUoFn38aXb31uPqcIPNUrMF5imauN JE7T1Auj3QHs6VDoBMHGdaARcvSrp/FIV3fnX8LViKQRRh8olN0QvHS1aTM4SdlJfNOpH6 WOyi6hU3N2iNZfN15xcNO7CKGUHoM5A= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717792968; a=rsa-sha256; cv=pass; b=lB3ZIrUQoCJl2kUClD1TNMtoWDWukPlb8lSQiG7cwb+FrO0TKk3WbQEzUw2KlH8KbFrqa8 5evhv/P3xKL3np4CVppHnyFNDz/jYmy6qZMB8GDQ37kCB5qLap/+VfirlO1ErBjh8d5VpF wOZLzCk+1+JOQ7ttP0E+2lGetZKU1gs= ARC-Authentication-Results: i=2; imf05.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=kbGSX4FZ; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=o95bq1hH; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=temperror (imf05.hostedemail.com: error in processing during lookup of sidhartha.kumar@oracle.com: DNS error) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=quarantine) header.from=oracle.com 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 457Cup2a021557; Fri, 7 Jun 2024 18:53:44 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=D4ZA8OWgwj5vBfXfTEiiu2poxtY0VzIKWAMaeLisH6E=; b=kbGSX4FZog4XkT/zrXbp8ofpaQFuw9ao6eP1A5asLhXyzi0dt21IFKFq3P4G5AUBFjQp AZJ6EqTTNLqOYrxDGcEylQF3hGMCqCgOlFosXuhTTSClTvrLhOySW7mEj4i5VhmWWC88 CNTcuycSPQNJbYBVolQjrKdlT0sbJekczdbvdU4ozTXWRNtNLJD1erxH/Ou4yl173Pxi jLfVn6YeCprsSj0GvEYbYmahgO4vGjIiPwjekfnhrg8dpQ/Dgkp8CFZxc0bgrbFIXxCx pOQdhibralD5g1UVDE/mVLsVbBkEpSVyTrHKPO8vKZLQxdu1ZqGfhmNE3ZejWLPiIpex Ng== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yjbrhea40-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:44 +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 457ICR4K023938; Fri, 7 Jun 2024 18:53:43 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrr2k7tv-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J0rr6NYAxqKqQ7ILMvbo46UU/d4NA0vKBTKHldljGo+7lOgoztGbbBaqQlekLuP1R36szcnUc8FcORH4T/Yk+40rHBMSprd+j7hv2/3XmShAcMjDHRbgqhYrR3Vz2Y4wP6crtoeEEK6lac+G/bYJZjbIc/+wO6Rsdq7IgrTCKBkF8ADoUeAZsSxW+Nz6g1TJ7pHrHlc6zT2PX+6dPxoz1sAgac0EeX+EftlOZTt69bWjjEgrYQk0C4be2BThqMcMn+GmuYp1a7liTQ/EhLmXQPTTUUNxfvwymGOtBu6LCokZ+aMKit2o19m7LTDNVWv5dNqaUDSEJLp527wRqUU/4Q== 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=D4ZA8OWgwj5vBfXfTEiiu2poxtY0VzIKWAMaeLisH6E=; b=jKStKMg2lyIcjR5gXSW9KLXjgL/Xe10IpdN14PeH/qZMgmcpyLeGX43p8cljaNyaWt8tpXcYJOzyfLrj81vAyoqP1Zs36Dmh9COn7v4mxZDonmXvLVOssa2v6sYgvMUZrUgVfQbfN4HCzwP+R9f8OvHSMF6fzwlmMd6IzJeYrE+wGVOkf6SvQZKvKkj3UW/YXyGLq3Joc82DeDEFnYrGm5wGzzjBMzGvgV44l9INzOaeyKMuuYCZ6EqM/p/iTFCrxejWEsAY1Bv8+j2DQ++H5/YWdry6ff32Fy4igw54uo0BC3T7TfD7U7P2rzl6lNya0q+3uRh7vhvfEy/uYZwnmw== 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=D4ZA8OWgwj5vBfXfTEiiu2poxtY0VzIKWAMaeLisH6E=; b=o95bq1hH/7Ow/csxOmHTX7YdpdCpMSDalhnJo3Ao8cVHxqc6CNvzeM8j/2mF8Qg+VkibWS9994Js8+olYKgmDwkV6AYMascsLveNQ5I8jFiFNiR3zUY1c1JO676Fu0UZB1NmltcbL5vs7SyypM0Sqxod6Wy95KWJO/T+fcccY7s= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SJ0PR10MB5629.namprd10.prod.outlook.com (2603:10b6:a03:3e2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.26; Fri, 7 Jun 2024 18:53:33 +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.034; Fri, 7 Jun 2024 18:53:33 +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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v2 12/16] maple_tree: remove mas_wr_modify() Date: Fri, 7 Jun 2024 11:52:53 -0700 Message-ID: <20240607185257.963768-13-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240607185257.963768-1-sidhartha.kumar@oracle.com> References: <20240607185257.963768-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR13CA0006.namprd13.prod.outlook.com (2603:10b6:a03:2c0::11) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SJ0PR10MB5629:EE_ X-MS-Office365-Filtering-Correlation-Id: 8357b1d3-8502-4778-c28d-08dc8723214f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: S1ZcMMYZBxXxDsBUSZufeFZ0uu/r93hhr90liHL5e3Q15kuYEW9kYpB4gLb51ATBubdUIJ9Vdhw1OssxNZUr1gLuY71go9Eqo8bnXqc36PFVrTtge8stJoLY59hZFG47GhGqon9HGnQdylMvESVso4najS8IQpoXfu+Ypcsd21+3y8XP8+cm0M/MumpgK4+bfmt5JSjZOA1gImBzjEpHaD7VwCcicTxHYHIyZtg/TlEqSWfuyOy/B0I27SQn+EPBn2HI2KeUdImVVWE+NBcd1AFX1F656TV4C4QricsutE+Laxwhn11EVCUn525l32JERMCPUmTwJ3Fb2+tvmcdpXXJeXVNKOW1d5tAbmldbeqBqC5wVJIW/KaczkQKgKpqMo5/nbBofOvfe4mecOkfP8uX0XceGO+tUbIdP0Xwa7cgdU5Ymb0Xhzg/nElL78Vs58YRrJ3pmlCLW1B/zVFjfyYxRoN7a6KP4z5/kiVFHHmTF1/lFsiumWW2iwQQt80l5+CsmAiHZnT9j/wq0rNjsZu6P1bYYVUHs+riXYt4nkkUL8iY0rc3m8Lh6lmkBUV4SkM1EboYWHfbSGXWpi+RiG380mDeKA0olGSyuzJJT1oPgDCTpfNdCzIh3GNNV4o5Bg8By7zrW50Q+dOUtjN6HaMp+nnabJFm2qYyyB1L2WcBMOxm3/IFxxlzTgwms2RTSExqlgpBW38C8rxTWuv5tDJSbRJ1P509agQ99/pkeP9ogjKWa3B55pjStYPP50zaFB7tzIxwRoH5yLDIyU07H94DHc4aYNZWin/btnuzrfdWsQrxiDxnNVtFuREnNuJUm/ciF4TT1cxe6MbfUhY5xnePCn9hWI+wYxNc+f6k0CbBKn1toUlF5DCNJRzJRugcmYHHES+uPHx8NisaNhlNBSeB+xhr/YFRkNGUjPXYPAz/MKZQBU047scwLO4mjJGMtV72fGx1nqkONQKpXm/mynuUHpsciBcrJiJy2ILOgslJcT+tpg78qdxyt9xZfz4rQPd9rI8AiYKLlxWJ93kGtwo+FFdsEvJXn6hdYXJy3ZQLIoNMdnmidsFOZO0hoMtlqFo+oEGfvisUAUBCXgJp4HeZvJRP1/eLXq2YLbuuAegPDlkxHuo+VtIuQO/1p4umLLgNa1v0Z2L5CzYDV68qBnapPNyDWEuNh+V/FkeFTW89asdvy8MIYaAs22LZPV5VbwA8n8CwMcfa+QP+c9KDmd2GSF4aCxK4Z5UTKXRX195qdRAjr4ifnRk/7XqYhkX+p+XS7g5WXmDhmsqKvf2o4DTuKhcPqar8tzEyvENw9RAA= 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)(376005)(366007)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0GHCaV0GKcQKQ+AQMcUR7t2JZU2LDjMRUXvWQXnMEzxOU8Ah5pGHDAd7KI54AxnG5siY3D9wEUQIpu/9nUC+iR0dmnpEq2pbXi2KIg4DI17h9us9UD3NO+3NKc2yYGr2XJzKiBItw8vumpnGB+ypzIbocFHH3K8EhBUjaH9P/FAAMcixULBkKfpAOx3m7gR603ishWDaBNXK7Ed0YKFsaCMt1WA36CVooc49nveetY/LFiSPj8Z0WZ1bXPKuKhanAAoIzmUbJkLTs+7+wTl5MKGAMH35HEpHF2xrwff7fV/RnWvmHl7Uv8OYcjXsMUWYV3dtSax7RohkD/TM0gXkV7i2BM82cF3jukT3mfA5PzGxeRS5BVx/SMFz0hQQr4G+H2uvOPzKGE3mgQ1AbEMg6HMgqDlcbWsOa5xrZUQdRB6MfafsJuPLJQGMNkO+U2TbQ8paP1jgSlWz1KK2tkRSkgjKR9ch/mAOFVExbv8ECUdUWsHweXaBfp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dSOIt4qBiabzGD+zufOLwfmCbu+ThFmOiZG8F341cMTKGy5PjfPbhdgVL4ORomTyMt4FWxg4= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Vg+nPWoVa17rbnDt5EZKzd65T1F7L259RQtqzlwyazokdnodVewfyjDJTbgrtSJU2iU/+2ld5A6CfDsBtWIz2grccwyjYLzFksAl7HqDg9v6j/S0MplVuN1iAB3GXMNan0WF55tgcD+0UX/FOiX7hi4VTjewjhDhZ89Jkyj01q0CWJTdWIpJd4zY7CctxGMhCOE7XMCTLMfaT/LWdsMuYYJk4rDnnuFEJobcoFnchMRpEA5Ndr/1tX0h8eQJ8T0p9m9+JsTBU5tCrX/agcaSKvpKt1vQu+vJ208jZax3nu9lLDTJJ+YT08wfmgk8o8Ewx5X1WC2CDYZgRvRRfWKpRzwORK/g8CnkOeqE2+wxk5VdYq3GD99O2N82135nhXrBIHHxaHUN1nx6DfC2oFSc5IKX21FrSC6d7lzg6Er2CEIRqnegz36a9WwNSb6FsRWeUXMNwMk7D31IWktE2gcPD4OKpDPpFI1/ObGdMUPigDVauXXcr8d1MOzAta/gOJUKJqIpgHiAtPA/RmkrnBw8+6XSA3gWQsSLqZtQ44LaRMv3tXd6rNwqgLLoD2jKdU10TuWy2kRYIsukYEpexdhbO3gDIICw0KxVo8Czrm8cYv8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8357b1d3-8502-4778-c28d-08dc8723214f X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 18:53:33.4187 (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: vf80W484NFh7Zus8hD7NT1q8XRVWqSb9HO6XNcZCLKVSHGN02OjxLM9/uLMj0Zxo99oPXJIxb8b3CIduKcGPs65UY4pXzW7XRPcujTAKRJA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5629 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-07_11,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406070138 X-Proofpoint-GUID: 5BCk5MsOgFS1Liu5RzmPKhdq8kvXqCZ8 X-Proofpoint-ORIG-GUID: 5BCk5MsOgFS1Liu5RzmPKhdq8kvXqCZ8 X-Rspam-User: X-Stat-Signature: hypmt8e6fqju5qyrxx9cc9pb5oicqukn X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 2F8CD10001E X-HE-Tag: 1717792967-322366 X-HE-Meta: U2FsdGVkX1+XSvc7+OZ3fnRKIDwq46ldZEWD2NEWdJrSOKxUEuXR7vku5PkEoFTmUjOYLkXhDBy6Qv264qAInwSHWezhwxalGZ58FM4Xtz+rFa68RNteBTyWsVrIIhs2/KygLTDgm6In1RgzcBb9SKO0qg5DPcueqOi9S2jQjrP2BCnEPZkOYWAEF8p+tr9ZKQF4WWdWpYQsliDZz4OvhP+uFen5Hu8pB8LYx1aCAxWk27bk1XEIGAdXWoZpbycnDXwZhQqCiTZrGy7GRN98yYpYeCd6PZ4Mz0f74u+po55CNnxGvLC6c6G+pZF31hyG266bAKCsbQXGHh6QlroGbPwQTRrmQPnD0pBU8ySLKLQ4dga2k5P1UvFINCTGVY+WziYe6j728vvy7V+YMnDB4QUrtAtlltRor2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.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: There are no more users of the function, safely remove it. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 743de734ba0c..8b17768db5f2 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4155,44 +4155,6 @@ static void mas_wr_bnode(struct ma_wr_state *wr_mas) mas_commit_b_node(wr_mas, &b_node, wr_mas->mas->end); } -static inline void mas_wr_modify(struct ma_wr_state *wr_mas) -{ - struct ma_state *mas = wr_mas->mas; - unsigned char new_end; - - /* Direct replacement */ - if (wr_mas->r_min == mas->index && wr_mas->r_max == mas->last) { - rcu_assign_pointer(wr_mas->slots[mas->offset], wr_mas->entry); - if (!!wr_mas->entry ^ !!wr_mas->content) - mas_update_gap(mas); - return; - } - - /* - * new_end exceeds the size of the maple node and cannot enter the fast - * path. - */ - new_end = mas_wr_new_end(wr_mas); - if (new_end >= mt_slots[wr_mas->type]) - goto slow_path; - - /* Attempt to append */ - if (mas_wr_append(wr_mas, new_end)) - return; - - if (new_end == mas->end && mas_wr_slot_store(wr_mas)) - return; - - if (mas_wr_node_store(wr_mas, new_end)) - return; - - if (mas_is_err(mas)) - return; - -slow_path: - mas_wr_bnode(wr_mas); -} - /* * mas_wr_store_entry() - Internal call to store a value * @mas: The maple state From patchwork Fri Jun 7 18:52:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 13690608 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 35339C27C53 for ; Fri, 7 Jun 2024 18:54:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 65BB56B00B8; Fri, 7 Jun 2024 14:54:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E4516B00BA; Fri, 7 Jun 2024 14:54:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3C2A96B00BB; Fri, 7 Jun 2024 14:54:33 -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 1238F6B00B8 for ; Fri, 7 Jun 2024 14:54:33 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id C8FFBA02DF for ; Fri, 7 Jun 2024 18:54:32 +0000 (UTC) X-FDA: 82204993584.01.D47E202 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf13.hostedemail.com (Postfix) with ESMTP id 890C420007 for ; Fri, 7 Jun 2024 18:54:29 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=MHrlq8kZ; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=wWKRoBXq; dmarc=pass (policy=quarantine) header.from=oracle.com; spf=pass (imf13.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@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=1717786469; 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=tFwzT4b7TDN8LupwfhTxyMGZTb5M4uMCFAvDfp7nMBc=; b=YuId3JdG/+YTddc4NKJiS3JIKqRnduA7JpZWLjPDujGQ3Eb8cJGTqnUu8x1HXOyfRwbn8c uYjSL6tCHRh96WKhNkIwpK9opzloEI4Rdb4QnGkNQ04W9ukNCAWOdfdWSQWOWCvwvz9OM4 iEgSeEXy38gxZhkH4j4U1XG7E9h5k1g= ARC-Authentication-Results: i=2; imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=MHrlq8kZ; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=wWKRoBXq; dmarc=pass (policy=quarantine) header.from=oracle.com; spf=pass (imf13.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717786469; a=rsa-sha256; cv=pass; b=FEQK6WuUMLiDlqwlApvXQDokZQHUdfQHp808AdZSachSlUMhvVI/HoEtlQVFFt4hGhnfCE Pm1N5yPptSHUhN4egk/v0e2ZtQCxdiaAf0Vg2EdSEg1IT5FMFHqMULN+tsJiENt8L6Naod H31cpPx4OzC5ptVMzEbHKc33EMH/vz8= 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 457CuVi8023604; Fri, 7 Jun 2024 18:54:26 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=tFwzT4b7TDN8LupwfhTxyMGZTb5M4uMCFAvDfp7nMBc=; b=MHrlq8kZ4mlfKiCX6SQYeRN7RZFKeUlLf3iFZB7FKUx7GYSxpOd6YLl8B00M6qjGBMNB se/R2SBcwVhM34nzUEp90PyyMRo98YPRKQ7u8XWK5fyFvgnSdP7jWTA1zGSb5YvB5dNJ 5X0ZjITvdUo0x9wFBKZ0mMtUeZpbpA+rXXAvt3Ry7U3q1tqyHZO4uODM7LINSAtGgYJo FMt6jpCYYD3Lyq5Md/lLerusiGkwmphYXLFsElFcX8HXPoK6HgsRudzVldFF5w1fGg+y pS3RefKynBtCGr9ga1hTValpcL0Ix3dWekIDcCeJ7vPRMzSrI7VMfM7ti6EnBsKs0WDN oQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yjbrse5mu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:54: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 457HKoA5016160; Fri, 7 Jun 2024 18:54:26 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2173.outbound.protection.outlook.com [104.47.58.173]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrseudmr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:54:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O56hIkUdAA0GLLxTLFoUehIW4laKjHx/RMGrgNvvJgQaBeZnvkTw35pUZBNVMxynl2vcEljZDSjal4bVNPE9KnNQUFd2gezCWLs2Zuk8s73u56fLA6ZBtrsU3VNNzxqwd6FnCgew027PTjefWWOjCvBZEcBMAf3foX6QBa2C1jhAKaEc+9iJ7IIDr2Cegr5/URq0FDpbFQN3acJYARvktBTFBwohMIZn4GteKIrtgQbegJHTtKXphW0CzzxocQBcpwt4vsBADs5Anaa7xskwPD7OC8HUyJBXFPOe+hIocZrb+u3gvvnhdOU8GEuFpr6frEBfsSeVHrLtl5NDn2E+9A== 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=tFwzT4b7TDN8LupwfhTxyMGZTb5M4uMCFAvDfp7nMBc=; b=R2KiCHrArWo296Hv4+E1zIpwuVITu1mjPHtXSUQ/NaHJ52vevCvEntXMf7JFNSoSuBslApumUefMU2yO00UwXTTK87T3NGLwxFq2sqsM3MxzBQocO0bWNaThpGIxJQ7R8+9f1ltGBmLd7JTvbRGjN33bFML00piccPfWS7a8RTbOb33B3e5LjTNlJxHMkOFSipN5IZtEB4tSb3qbevPBGp5n//UH5IDrEiOjBUUsHATHCiAZwT4o0e28QXb8XlmqZlMalaueFfNuU/YXv8pYabTGIxWZvy71t1zA0xZAyEkTJBnwxccMnxV7cIlWTKvXZ79P7SI1LtusLma+bniy+Q== 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=tFwzT4b7TDN8LupwfhTxyMGZTb5M4uMCFAvDfp7nMBc=; b=wWKRoBXqdalL4CQtdLCH2OZyTXh4UiRtBtQ+nEMM/4loXm3NsusoFmLvJ2HKaBbQBqtfrzXaUohUXid6P7QnSGTzr9tzF7mdHMyA7cq+l64Pcatd72BxSTrBGPLOh5ka5Yft5mnKdidBtHOc+4v/BdYg3TEct/nOd/AgwyBn2iY= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SA1PR10MB6640.namprd10.prod.outlook.com (2603:10b6:806:2b6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Fri, 7 Jun 2024 18:53:44 +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.034; Fri, 7 Jun 2024 18:53:43 +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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v2 13/16] maple_tree: have mas_store() allocate nodes if needed Date: Fri, 7 Jun 2024 11:52:54 -0700 Message-ID: <20240607185257.963768-14-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240607185257.963768-1-sidhartha.kumar@oracle.com> References: <20240607185257.963768-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR13CA0022.namprd13.prod.outlook.com (2603:10b6:a03:2c0::27) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SA1PR10MB6640:EE_ X-MS-Office365-Filtering-Correlation-Id: 7d5fd1d0-3b0e-46ff-0e86-08dc87232671 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|366007; X-Microsoft-Antispam-Message-Info: R3jJnELtoj6iyAPX1kl5kpii/V95z6McDsyztJVlAGJ+x+fQa0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WR9VWZd6qbrO4Pd4kf8fEEXhZLFBa70VFOrG3qtr54NG30122u31E3LWIcNaMqVAW4Ml+L2bNKQ0SV3lPbbwxTZplJ6B0bz0pC5NA7D0ATtht9p1siZyJiABRYU36aw+r1jab5B1xJJtMRjEOEXvgQz/yaMMJtNzpMZ+lKUVHoJW/JbZn0OADsQ1AKj6xklkvugA62P7+Y= 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)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UAkL086aNNkJBVJ6KNlYuk7wJPuOLFlzsEkiqUKJrhmDC5qFy+Owabgn6Nt7619FAvy3gslew2Am9dQ74jUWUY4dnX1YPnSs9AZF+0Ui6DIpDdGY1vtIvSQFOMRE2jDyD2sXtML8jmn9iGDxuuLDMakWJsTw97nC3plVjy3Wu3U5/DdW6zv4WLwvvX0hWS/dpH1if7/RUs52AhU/hBg/ThdqLO0AUDvOwu3DrBX66ZMenRSx17SF1CZi3q8C8KYNMHOiwP7XWWt2q4obeNkHZIrcKR9x6qrBHdrXa9Nvk/QRV9mfW5Xr3t2Qbo/X13QWnm5Xj+4URogKrbd6Y93WcvVV//ocG81sWYwRmW8mFxSXJE9S52kqS11ZXlhk2bkDko/dYjmzP+tIBMn8P2o+dJnxGv8VSFoy94rV547h1+GhIZwnm0zQ0Hukm6DWAnrxHL5ywBtrXGtkLfWQ01SpGv/rv/RYnXTvitLG6VvQJKFKx3aEhP6VQqvWSr9awqnjOqux/rrPggXo9Km5ws37M8ah7QvkFgAsCGhR+8C4lZqbaE9VcPZ5Y0QXY5DiHASAI/9R9mlebZeJrplMsBRiOIL3bCLT89LBrc39gAxNY0Jf+MhbD3IrPWowc1W1PI/2Dt2/V5+Je4+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X6prQRgD2Eigb06bq5OSzoICFgHJ3bjLdaWD7Nfl7MSmH1Zx4SNn9F2c6DX9eIc4uL6AKnvINQSVKKNoPZez3gwKczIz4Ltx4Bv7tZsiKDsNWHD3qDiy7HrDxD5tu+qUZLsatBTRbO8c5eTGcWJjy93m5LBniQSMLNqyBkATgQDR+OOrurQCfLDL69NM1ukU9gIuT080Y36QIUxwMgH5/SIYpe79N7PS+ZuHXR89hOVb0dy32J7+Oqrfxgl250snQM+7HSIeBxN1B+OK0YO6BwqFeWKRrdXUgntiIaSMg9KxNRJsIZ8hMNEWSXI6yXADUgOBxd4K1wSWwYOZhmHwqTejmgo5aP+u+dzmPKssO6J9MMl6uldLUIIR58GvoUPglxxRPOtI7z75r1MSUDf0see+N55WYEapDEqYEjjNpbbYicO4uKIx12W01IGUrErMYPVfs3PSshgGRQNe743VdES3Wfwstg6DJeYmWdWzXUfnhncltACWw+EqLzkrQK/03VmHVClnWPITmZRLPYG+OBIxJK8veYgodXaBNvAAHs9Gq4SkhbUCmfVvQ/tPff/uwAdM4waPx9eURxftDMhxSj3uGvzQkcReXhijPY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d5fd1d0-3b0e-46ff-0e86-08dc87232671 X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 18:53:43.6410 (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: 0KuC6v8vzSoxfQ8bqyafBMwx4z8AK2/RhbGypHyxSmgmImQxv5vbWefcCYoS/8WDuSG4PGEjS0JeTg3cZE/QxcnEZ4ToOgJciiFRrQR0Q/w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB6640 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-07_11,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 spamscore=0 malwarescore=0 suspectscore=0 phishscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406070138 X-Proofpoint-ORIG-GUID: kMzbxoZGb6okFKYZ3_q_lPtin-gZ5thz X-Proofpoint-GUID: kMzbxoZGb6okFKYZ3_q_lPtin-gZ5thz X-Rspamd-Queue-Id: 890C420007 X-Stat-Signature: 9fmdp1oy3gbdwuehowciumtaen8fj89y X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1717786469-513065 X-HE-Meta: U2FsdGVkX19PklShD+jRScL+u/k3WBd1A5/hgp4MCVN+5Tkocdmq1bt1Pi9e39WvZEzs5qjm+Y6i6yodosufzv1h3z+saYFS2Cb1aVNpTYUp9W019GHlGkRA1hzTPez2w/S7P+WyKlXJ8jOjwHvScpCmhcKaNLaCAwtiLaEODr1rzX1tbqrLNZ1rkID0CXXSwe3P5M94yX2hbQxUvQNlSyqnopDEGCMdaDMVgJuV4G1qjrRabzGgkvOf4a9S/2rHWQa9oRcKtxcgiWjeB9UrghiZwaBmk5P3VZv6OEIASsDGw4LcBZMD0RGZu57JOBHJnXpH4oUE6u0EthEUHlUytoMOLjbDfcxzqlQDpUP494eIgGf0DXsM6mAD6ztRIUO9TPFd0ZOcZbgDz04DCMzNB32kseQINR/LtgsCXEE84+lmgT1TsTa/JiDN+K7c2Y00S8u1fBK6NwcMcM/o4LZC39DAEEHaxqIY5RxusRsr+l6IpGy2LrfMsH4fhUpFdn8HNosyHdCjI022+cl2OjcL1DbfjLL2t7AKM5+RTLHTFp0SA/epYXmyCBJ1j77fOtCfrn7yAo8xUrm9OxUQS4SvepQA7GIgpJB4gx96RBjvFMh93mYn4Y7qlAoVDTkiM7OAOCb4Sn2qEIWNzf2k+x6+bggQg5tO8vzImRtHESVosRwCZ8fYcfIV9Fzq/hszFAq97LYsB5+f6SU+nWxnwMsno2b4AXSUqBwpOUI5bX50FHSGDJee3UyrYCpe+QLy0Px38qylgNYZqwbRXoWUGgGL41bB5FLMNTo9Itqb5jEkLNTyXf8mXeggn0uA6JVjaUu5u5OqnBt+Uh56Uev+yoc8peLRzJGfdKUA9oFFkDtTdT0PeuTDOJc9ziS1o4VcqEYBBZdlz3FW8X/adCTff9TETz6AJWJp/xxb8DhwBK8cWvnLwcW0uk8OzPNKZEAIMlqIVX8YZ3iR2McXMhPEwP2 LmgKpXhc /0NVnh+vTCnTWiv0t8CRof4R/9D89qZ2pTMs3A9vSwKZATAPPtmKYcw4PHOXZjs/Efo6Gq9ttTLFniBg/HDAoHMBTjmkk5sXw7O8ATv8SFZtKh4KThTm17jcyvyiue7SWRAeVoBbA2Lizxyz51OOSw2Pd3Sspbr+m5cdOgrztfke4vQnZmZYybXFWc8VNiddYyb7Ih456yP3+LdmWUmiM2yZVNaz1J+uWJeF4eT0NYwu4RUgv/9yg3xiVbM180v0CPDBrVsuukIyn8hx2sf3OOpYK5TQ3wuFpFm0Dke1k7iadreZ93uiWJgaOMIv5co7LI0Ng2yZGCIxFR9PPh/NtoPd47HNeYV07ZR80zmAPep1ecK8KGBWlaGXGA+6IUreyChVVMdqjPqs+5jiKGkU/QLKzRCRv9CFQIpjsl1ObYUoqmqpiGW8iSwIlE8f1BbuqKUug7NNuhjMoIkf41kmhXpNiBxFqkZRY4g033WFHttDYapw= 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: Not all users of mas_store() enter with nodes already preallocated. Check for the MA_STATE_PREALLOC flag to decide whether to preallocate nodes within mas_store() rather than relying on future write helper functions to perform the allocations. This allows the write helper functions to be simplified as they do not have to do checks to make sure there are enough allocated nodes to perform the write. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 8b17768db5f2..92f133ea5f00 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5528,6 +5528,20 @@ static inline void mte_destroy_walk(struct maple_enode *enode, mt_destroy_walk(enode, mt, true); } } + +static inline void mas_wr_store_prealloc(struct ma_wr_state *wr_mas, void *entry) +{ + struct ma_state *mas = wr_mas->mas; + int request; + + mas_wr_prealloc_setup(wr_mas); + mas_wr_store_type(wr_mas); + request = mas_prealloc_calc(mas, entry); + if (!request) + return; + + mas_node_count(mas, request); +} /* Interface */ /** @@ -5536,8 +5550,6 @@ static inline void mte_destroy_walk(struct maple_enode *enode, * @entry: The entry to store. * * The @mas->index and @mas->last is used to set the range for the @entry. - * Note: The @mas should have pre-allocated entries to ensure there is memory to - * store the entry. Please see mas_expected_entries()/mas_destroy() for more details. * * Return: the first entry between mas->index and mas->last or %NULL. */ @@ -5563,9 +5575,21 @@ void *mas_store(struct ma_state *mas, void *entry) * want to examine what happens if a single store operation was to * overwrite multiple entries within a self-balancing B-Tree. */ - mas_wr_prealloc_setup(&wr_mas); - mas_wr_store_type(&wr_mas); + if (mas->mas_flags & MA_STATE_PREALLOC) { + mas_wr_prealloc_setup(&wr_mas); + mas_wr_store_type(&wr_mas); + mas_wr_store_entry(&wr_mas); + MAS_WR_BUG_ON(&wr_mas, mas_is_err(mas)); + return wr_mas.content; + } + + mas_wr_store_prealloc(&wr_mas, entry); + WARN_ON_ONCE(mas->store_type == wr_invalid); + if (mas_is_err(mas)) + return NULL; + mas_wr_store_entry(&wr_mas); + mas_destroy(mas); return wr_mas.content; } EXPORT_SYMBOL_GPL(mas_store); From patchwork Fri Jun 7 18:52:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 13690605 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 62A13C41513 for ; Fri, 7 Jun 2024 18:54:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E4A926B00B3; Fri, 7 Jun 2024 14:54:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DFA2C6B00B4; Fri, 7 Jun 2024 14:54:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C26BB6B00B5; Fri, 7 Jun 2024 14:54:29 -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 A15DB6B00B3 for ; Fri, 7 Jun 2024 14:54:29 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 5C8B08015F for ; Fri, 7 Jun 2024 18:54:29 +0000 (UTC) X-FDA: 82204993458.24.F1F92D8 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf03.hostedemail.com (Postfix) with ESMTP id 0A1BF20002 for ; Fri, 7 Jun 2024 18:54:25 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=AdWd++sl; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=E40s4gzI; dmarc=pass (policy=quarantine) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf03.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.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=1717786466; 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=67y5PxiIBaFqmkSpIhwq/2i8iScXQ5Koqe6KIRjvNoA=; b=F/dZPh/+8Y898/J64TG2CTLXlbmwE/OGRJYxsmHcHHCd/WvKpiTHMXDkXVp2O//OAcc8Ha j/YAtzFqLyCZXqpWzMawpOqTzxT1qmszMNJkyioTQzVtyMjFD8NioSQt9GdqXsVVuTrq4p n7s7Rl/iJ06OzAQZcGw8Rn9wI+vvLk4= ARC-Authentication-Results: i=2; imf03.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=AdWd++sl; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=E40s4gzI; dmarc=pass (policy=quarantine) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf03.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717786466; a=rsa-sha256; cv=pass; b=vc6Q/uQq7k4w5UUuR/zA/0SK5XimA8bRfoDYcZP88goY271jddO10sSHEJx/3aHcEJWA2j uCJEUYp9JCTBIqA2gFzJl1OOtpRbmo0PPLkvZ6od4GUHPFtbeI6/Favt+iojg5c/63VsGL a5Vir7WNnTdyVYrq//iNl3dRraAU96Y= 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 457CuYTW020017; Fri, 7 Jun 2024 18:54:23 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=67y5PxiIBaFqmkSpIhwq/2i8iScXQ5Koqe6KIRjvNoA=; b=AdWd++sl5jK04kz1e+lT8/38dD99GXF//hrOrUPWHR+u/qeEcCAN6rtVXXHI5tkOMYgG VBIaU36qkPBTMpYBmiGwnj6S5MoiW+CQmoWmuLvAi8hG44HKQSOQArV752Rx3DpcyHOZ 02ruW6h1j3V+vhVa/qy+z84tTcnq4A4EffwTRzDAAMJ6ywYmBXRC53d76caTvXEj0pSK DhcUbXFVcvZwXlv7A33QjpsSBk4hmSxvKYOeF9PeKdBTraPcOTdq8jgQmw7SDuD6cm+1 GogZKdqZZilLdyY7EVsv0D9CHeT6MA2aJ4Ftdw+MvReKCmVW26OSC1f6yl3fqnmX8MB6 PQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yjbsye9cc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:54:23 +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 457HOGFv015573; Fri, 7 Jun 2024 18:54:22 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2174.outbound.protection.outlook.com [104.47.58.174]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrjh0eud-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:54:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fTA0jmM0qv3pTPn6KqN9vahr87VCZKmjNWzDEeCxO9o0Hr66+xmy2h/XqfpJUKAFPE8isJZMWTCyMN7ttge0XqzLgQEOrr7RIxLejJl2xXyLD0t+AB/SZI9X+egy3g7O4TR87By4jbhcbbK3Pgto4EixIFZd1MFsUi1QseTgaI7EAAKwGZO6fqhR3gr+rzYJXmuv6guG0jj7v1kqlasyjP0tm9jqaSGrENzRPrEuk3gNqmsN0pzrl2ruBq2bNcJzbVH2/R/C2AaJT9hdbZD5TrL9mhJz/smhaZOz5i0hYntsTtXch01BoxznwihNlCTb8GDxtbZWd0chhKGoe/+37A== 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=67y5PxiIBaFqmkSpIhwq/2i8iScXQ5Koqe6KIRjvNoA=; b=R8xSwdz3KJEQPI8+kF4g6QhPQyM3o7yFTrlmNlr/q1MQczZ5jhUU++ocAqt2XQT/8qPvbDPOq+Z7AI3HuyIaMJQgqIJ/3HyeDU4jIZkqgB9ej/YrrDz48Mvk51v2lGgaoQnspwcKLYBBN0UEk4ABgNcOvIilhCWes77900ME3ihkqpgEz3TZvWZc3jjIkZwonyBvZ4x0t8gwj2uE69Prjs2BAVh3TqzQaWl45HC5DeQJpOVTKRgOF1a8UOeB93ZjHXoXaoKZRq1/kUsePNeZHQ7p8F1ylljYp2CTpZIw/9OxLpwwG10OyJKnUTAsx468xEHvHmpY0QGTVbuvq/oM5Q== 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=67y5PxiIBaFqmkSpIhwq/2i8iScXQ5Koqe6KIRjvNoA=; b=E40s4gzIaEb8UIjTDjEX+71yw6TWDX7kSYs8SgalmXFeY4ccBlbrUttKfnRK+5R94fbV4TgWnHQ82qvm546TTbVRPppC3ONYEBLIKO9Ol5tXYcnezEtq7ivZMF/q0lDoE9c3S/I8YK2NYzNf3/ilkEHfALevyw5BVWGqmzCAhxA= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SA1PR10MB6640.namprd10.prod.outlook.com (2603:10b6:806:2b6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Fri, 7 Jun 2024 18:53:47 +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.034; Fri, 7 Jun 2024 18:53:47 +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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v2 14/16] maple_tree: remove node allocations from various write helper functions Date: Fri, 7 Jun 2024 11:52:55 -0700 Message-ID: <20240607185257.963768-15-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240607185257.963768-1-sidhartha.kumar@oracle.com> References: <20240607185257.963768-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BL1PR13CA0354.namprd13.prod.outlook.com (2603:10b6:208:2c6::29) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SA1PR10MB6640:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c46340d-80f0-4b5f-cdd7-08dc87232985 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|366007; X-Microsoft-Antispam-Message-Info: 9ezmmxu1GnBA3A+AVrTtrAu/GypN3S9cfCEQgErY+Bw6KivOEan5sxOUCUQSINx2GzXoziZsa0rOh8mEe3kEh2D/soFQgCzhkLBUQIvWz2Qnm5F0SsmSIHWaWAbFS00eBdMn8Gb48Z0VVoSf201Kt7nup5/atfYsiYKCxeNsKSYc+e6MrtkmjuOrQFx9YQx2kyY5eclM7HuNDNOUBoznc950cmQ5CQ1rkf0pKAWpnpvmutlkSq51P+0XS9+cO9y1edgpm+fGg+UeiuJ+vLWEcJnBbwR1IsUA8DemQW9YpwyaUFyDOaB8kRrTTEs1gGsCkN3SRMOGjHwOfuIuknE4e7mbvghGFx/5kn/aoXB1Qdfnfd8JOyi345y0k5wgU2WXruaN06NLIqbaFFKtoxQd495smiN563okHCZjnizALUhE1pRGv8QGnvUpTqsRdEZxqruM0AbWI7Ia4hpZslEzYfnYryU4U0r6XUyOoKqny8HNEg5prEL3vP1UGwlhztaccjbOk9BmOWY7pDZWkMjLmu4dbbf39QPqsUv46Vooqht9KNyV60gqsJFi87F1iKesXrRb3GbpIlE3fTe75flEQqkxHfCHdObDp2UmhGv7oj++vQdF33MjEsEVnMok2k9Vf3h5tTiVk9PVy/Xk5GqeSkIHL5rRmSCxu3/mmjMwQpOqgN4OdbDeS5/4m+n1bPHNAWKDfdS55eOvBNssrge1bItBI796H9qvL3ninvbAW8rZOktyNRQXEPD5kaLfBW54Mf3xl7hHRPzEXLCsgCu+1nzWaK6fpArPuwaRemjmECoMGmjQCyDPuJNbbzV8rP8VVZy2hpwDxchog/bp7oltH1vYsmzLG5/FlkqXDw86JbNXK/SXTxch71LhOiMGuWgJVJqh+7pPprveEh2kQ3qhgfZ0cw1/B2dN6aqKdAxSRVG3qExglnusMDhQnHWMkWrUkYSnOHAQX5qvqRpIc4Pd3O5LTM6RZE0zlkVoRx3o8qIwLGtgb3nOntBr8R/GukzaMMskxBfyxBUywWG496Qydgs42o6BVPfOr3khRDmpJVwlfeaGYihR3o50o+u9iPtHCJf28zcLN2IGwFkelQak5ouzE474nyymG77jgf4cw6S/Ie/J9OTudfiMNU/9LWIEO9jntHtcIsAURSlXfx6ko/21LGnw1GGwM3+k1hdMe9BUJGRYDO+LRz8cxUUcdfdrH6KuHkWBj6nxyKzm/e+5PLafiVzoaSKvwI231t10MtEwlnnqDHNszE7gO4XbLoEydcTygesQYoaSrxHpDR4pxCIJOT5nYCc5oUq4QyJOlPmr0l3H8QbAoYVh7qIK4/5F 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)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sw6wW/Dop2S7OEuAPegNqQzIZ/l3BdQ1SnxZh3XhIPYjK//dOs9nUwUuw+l9Ff8Q6CbdrUtFqRoyc/Yis90yhUZ1OpzQdmPGMFIxNOjgwP3JL7EExdXE9SnsDfIfnwSS9/KzWtlfVmzo7/FT4wq8xhTz9QubSdSjx4gLmTSFVpzKhWpWdWm77KiC6BTkhSOw214BRoNjH8zra0qH10eNiIr7U2ufOqBr2i4VE16awmGXHhOJmiv98bbnaAzXuw9JnUdz9FBNy+/8GEI9rgioX90+cwwoY3NbvcBTViF5HRpWCUAeLJjUrCnKkojaKf9GHR7UwrDyxNuSUQclkoFeZb8lv5+vuvq+EcMH1H7NldujO0++8cZNc6jqFqrchQ0Sk2iljf6sGPIEXjaSczuw7s0rc2X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vMKxEQ/zKnxaiRoy9EvvzkQIpfcMVCd+Grkpv2NcAop/6i64Xe3z8tODTghOxTLxqvPNKgY0+gtCgze5M5Ezy9BPSbje/DDeGxvsP4N/VuN0duEjS2iGJCG2WwRNBICog4cfrGzbuiZ/E= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: d1oZFXEMa1p6LdLBaefg9l2+IRTK7ewyJi5A6wfTgvGtAzMZ4Mms/k98K3OmJKWAGyP2erGpOzCRa+mG36C0VdQFguxjVGER81QT49TE2sgvyX4+3J8FmU3qLfDxn4U9xZXHbTAHPj91xsscmDJqrUyyYkkYTBY4n9cO2H29kssuzbsy01c+Ssx5ukHYckZoR1pzK0JQB0TlSm4E2BS3HlJynbPW8ZCINpTi9iaVqZt9NIP3t/RjZlhg3RcUsCeh1+hkF7F6u5EYrarVuBsP1M4aR+HNMPDDX8OxRMZIFYj5ZN+gf10e/Z3HrbZ3PEIC1j1I86JNyJRQdP9OXPSTQGhIFqTMP3H0xUad6SFDrzucm44SA9n+8DqFi84pEGfRwL3us8CCbj+yf2Ei20Ym28tYJKT922uqwyXZJ39aSuxRsviPOK0LGRW5htJI6jKCvxTXLe0iYB0CTwF9taP6iWPZPR6pMEVkxnE5vHdmXcX9N7FZde4nb6WXUyXAc587BVoruv7tpnO1C4BPx1HVgL58oepuw2TKKgK2ZuFzLsoddaNLPTCsEZySz/AJEV4VxxCFwa/AZTGZ58cOEqgeXrwd5SOVbqpuTNli+ReYz44= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8c46340d-80f0-4b5f-cdd7-08dc87232985 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 18:53:47.2944 (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: QIMLdvuH1pZxBvoqQe4ylANKlkUJHIfB3VNR01bfU0xKNNhWSs0dnkVBnCXyYSJWrLPT4IcfugYDN3Xz6O6fFnHegWF/cKvY3vEA+9Q0UqA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB6640 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-07_11,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 adultscore=0 bulkscore=0 spamscore=0 malwarescore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406070138 X-Proofpoint-GUID: ZG7X4fZCJIAfj4i3M2m_xxxNRfgtGhw3 X-Proofpoint-ORIG-GUID: ZG7X4fZCJIAfj4i3M2m_xxxNRfgtGhw3 X-Rspamd-Queue-Id: 0A1BF20002 X-Stat-Signature: ngauqyj1cme3fzm4jdcguhb9yq7aam5z X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1717786465-963015 X-HE-Meta: U2FsdGVkX1+l+MctUPmCNCNm6f905mFaSjOXdSkCeFs6P58lNY3yotdW1cnc1Pcm/8UrBeHMBfMTbas0gTQEdZUF5X2pl/xU4rrPOT+o4Wt8N2zDluSc6J5MBDDz25/XcRijZgmDQiFsSSLd7O52pQ4GU+buks7OVx87LOZvsGEkfI1uenq4wJ8mNmDxS2jDNqfN/ex2uLEwllYo420bPsDSaxExtvwr8vPQZNnzTfmV6/JwEki2rq4pxrxGyUYD+hCoZJ8dPTdsLMCzZ7bahOkfOzhdCo4kUKXMrCWXFLLSQ5rbIfZNfPwxOeBC9w8KcK9NEGGv5Rxr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VOfvWDVBYhnUZA9mauIsFpasTuvVN6O/Gog== 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: These write helper functions are all called from store paths which preallocate enough nodes that will be needed for the write. There is no more need to allocate within the functions themselves. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 92f133ea5f00..7e1f64490662 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2976,9 +2976,6 @@ static inline int mas_rebalance(struct ma_state *mas, * tries to combine the data in the same way. If one node contains the * entire range of the tree, then that node is used as a new root node. */ - mas_node_count(mas, empty_count * 2 - 1); - if (mas_is_err(mas)) - return 0; mast.orig_l = &l_mas; mast.orig_r = &r_mas; @@ -3029,11 +3026,6 @@ static inline void mas_destroy_rebalance(struct ma_state *mas, unsigned char end /* set up node. */ if (in_rcu) { - /* Allocate for both left and right as well as parent. */ - mas_node_count(mas, 3); - if (mas_is_err(mas)) - return; - newnode = mas_pop_node(mas); } else { newnode = &reuse; @@ -3341,10 +3333,6 @@ static int mas_split(struct ma_state *mas, struct maple_big_node *b_node) trace_ma_op(__func__, mas); mas->depth = mas_mt_height(mas); - /* Allocation failures will happen early. */ - mas_node_count(mas, 1 + mas->depth * 2); - if (mas_is_err(mas)) - return 0; mast.l = &l_mas; mast.r = &r_mas; @@ -3444,10 +3432,6 @@ static noinline_for_kasan int mas_commit_b_node(struct ma_wr_state *wr_mas, if (mas_reuse_node(wr_mas, b_node, end)) goto reuse_node; - mas_node_count(wr_mas->mas, 1); - if (mas_is_err(wr_mas->mas)) - return 0; - b_end = b_node->b_end; new_enode = mas_new_ma_node(wr_mas->mas, b_node); mte_to_node(new_enode)->parent = mte_to_node(old_enode)->parent; @@ -3474,10 +3458,6 @@ static inline int mas_root_expand(struct ma_state *mas, void *entry) unsigned long *pivots; int slot = 0; - mas_node_count(mas, 1); - if (unlikely(mas_is_err(mas))) - return 0; - node = mas_pop_node(mas); pivots = ma_pivots(node, type); slots = ma_slots(node, type); @@ -3746,10 +3726,6 @@ static inline int mas_new_root(struct ma_state *mas, void *entry) goto done; } - mas_node_count(mas, 1); - if (mas_is_err(mas)) - return 0; - node = mas_pop_node(mas); pivots = ma_pivots(node, type); slots = ma_slots(node, type); @@ -3812,9 +3788,6 @@ static noinline int mas_wr_spanning_store(struct ma_wr_state *wr_mas) * entries per level plus a new root. */ height = mas_mt_height(mas); - mas_node_count(mas, 1 + height * 3); - if (mas_is_err(mas)) - return 0; /* * Set up right side. Need to get to the next offset after the spanning @@ -3898,10 +3871,6 @@ static inline bool mas_wr_node_store(struct ma_wr_state *wr_mas, /* set up node. */ if (in_rcu) { - mas_node_count(mas, 1); - if (mas_is_err(mas)) - return false; - newnode = mas_pop_node(mas); } else { memset(&reuse, 0, sizeof(struct maple_node)); From patchwork Fri Jun 7 18:52:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 13690606 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 9B03BC27C5F for ; Fri, 7 Jun 2024 18:54:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DB0BE6B00B4; Fri, 7 Jun 2024 14:54:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D391B6B00B6; Fri, 7 Jun 2024 14:54:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A7A116B00B7; Fri, 7 Jun 2024 14:54:30 -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 841956B00B4 for ; Fri, 7 Jun 2024 14:54:30 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 4091BC03B7 for ; Fri, 7 Jun 2024 18:54:30 +0000 (UTC) X-FDA: 82204993500.08.AA1996D Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf14.hostedemail.com (Postfix) with ESMTP id D7536100013 for ; Fri, 7 Jun 2024 18:54:26 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=hB3dmpwt; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tINR6m36; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf14.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=1717786467; 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=qD9T/3YKT0sotRrS3Aan2Vhb5C5Ldo9fYDTe76XpBLw=; b=HJNvn0NZamx/5V7CKXt863u/ploX3p/q80aT4d/sa96OjihPVbgd4ZMLY6mW4qspFpgwwr gPM5pGbnibQV7nA3sD7Cz4U7dsFnVS1LoLav3FQ2ZJ5QAUEZQoY7wp1ezM65pdbD2U3I9y gcUrpVzM9WOXlX3lrGB3HNn62KwHvvI= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717786467; a=rsa-sha256; cv=pass; b=ph4SUaMkMBXoYW8hbYM6CpWs/3kkX1t/j3IMRS+H+yWkXBgwinR7/V3+unQJ++gt6zPWho qWmiE5SRrvzEegvhz9CGCR7Hulx2Y7TnItCf0vSpJyWAyvlKc4mFDXO8zRUq39kjr/ZjSQ vpFXoLP1K4uK6VeJW+33EAgJfTEM/1Q= ARC-Authentication-Results: i=2; imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=hB3dmpwt; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tINR6m36; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf14.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 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 457CuejC009427; Fri, 7 Jun 2024 18:54:23 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=qD9T/3YKT0sotRrS3Aan2Vhb5C5Ldo9fYDTe76XpBLw=; b=hB3dmpwtzhm1diw/a4epSgZnZI0CrwIZ5uzeqVkCrKNv0mYiELNI7Cs75zIxxFNCN/f/ ENcpQctPQl/Tnkfd6/lG26DHASd/9iyytuMfcXYhMBiXDTQ+me3WrWpQcZ1ye32c49xq gZza0J+SkfjisBCE/ZXutY7gLHkSUlhkG9nyxfSMvKP47BR6u0PeuN4Cp9eowY1NSPdq iMtW4GIJ/2adBDBxpGHH0DQbH+zdj8fJDa6O+7xbZMFMfr8oG6DUOd2z1lNA3Cjov6lS 7TjMglL+iBXUV9lF1dZw25YkFTmpbfS7fP89HpxmNzwaYCyDNllTDlnPgANYl3CZikVy tw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yjbtwe89v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:54:23 +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 457HOGFw015573; Fri, 7 Jun 2024 18:54:22 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2174.outbound.protection.outlook.com [104.47.58.174]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrjh0eud-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:54:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gN8E6wblX9o6BXfmi6/WciUPqKn2QYZj8HPdg7b9c6BMDz9GaqR/mlwcIC/DXyY+IkWwoVo1qSe7OpDrxUxU5zkT2w1e+zvFuty62jB0N3D3/snjZ8XjAuECDeeW2b/KBCeKepzxjACN8EYeq5pZHxMs33Q2jXEhUl92Ypzx+xZoGN3OaRbGg1vSNnCMSYErugsxGjFSbP2OSVYbljG+fczWgp82wFEnKk/qJWYRoFI8aeNxsdk2Xv8h9WFbwI2XQvMKNsVrUGqcAEW/LU2NxXVijO28wYjwwtwCvNhmS2YPT9QL8YAIPXBzRchgqFsBl0QLCgDcFvTU/B80/nZRqg== 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=qD9T/3YKT0sotRrS3Aan2Vhb5C5Ldo9fYDTe76XpBLw=; b=a3+EiorbpSuXy0gRtPoWV/hhjNHh64yWTIl7ge3zFwqQevleQwTmPXhqAKqor3Pikd4tlLRZE7S0QcQKe7G80dguSXYaP8NFuLrb2GmilCKltLpzx1ayzpc0FCEbtO8VjvWheau5MteiwUglQ/O8zoFB3jsxvygLCl3uxX7apfdqhx7U0oH+x6cpw72xub67J1ShSneiq0QZ94AwFV387XosDzr6QjzfQ5lN9cJvn61Nno2vlwYmHdf57EL6NKLSCEFJksiiOurNFbzqGtlYzAqXm/JfmV3HygdKpzbhZRLeUVTX7C2KLEx6bsTkB+2xjRjwMIe5p2PweYTkbe3/kQ== 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=qD9T/3YKT0sotRrS3Aan2Vhb5C5Ldo9fYDTe76XpBLw=; b=tINR6m36nhXBZPE37wmA5o0s/Nqm0aFsK2dw3t1XiS7EdO+LSP48sRN47tphNL6ikvpi5XBs+4oAMaxFLfAIDw6hE7tmJdOgCRO4yAeOQGWJv0mw5zhD22zDHJPpWimcZBCfqrvDmqLjztJxwpHEV3+voILyR6vrN3epM17sOSw= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SA1PR10MB6640.namprd10.prod.outlook.com (2603:10b6:806:2b6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Fri, 7 Jun 2024 18:53:50 +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.034; Fri, 7 Jun 2024 18:53:50 +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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v2 15/16] maple_tree: remove repeated sanity checks from mas_wr_append() Date: Fri, 7 Jun 2024 11:52:56 -0700 Message-ID: <20240607185257.963768-16-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240607185257.963768-1-sidhartha.kumar@oracle.com> References: <20240607185257.963768-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BL1P222CA0030.NAMP222.PROD.OUTLOOK.COM (2603:10b6:208:2c7::35) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SA1PR10MB6640:EE_ X-MS-Office365-Filtering-Correlation-Id: ad19298e-5ab0-4cfd-80d1-08dc87232b4b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|366007; X-Microsoft-Antispam-Message-Info: g+KnjpAIm5Drcof+9+ZjiQxYbdYe3S9WdSpnOJ6bryfPf8BSkuaiwVWJ/3/mMTAqpsb6iE8CUsVYDn4kBOIRBT+LGArbleihSR5PzZBbyHhPcG/ib245m94YCOXLqas4yPmVwC9OMwCgP8mJz6L0b7V9qw//YEqR8yTFq+C0+nXUBaJbpcyOrMkYmXeZqNo43DkAYIuCmH5lruRx47ifxTeje/p6gLP/127paf1vaGYnEnU454hy3n7qQBDCyQARVtDTDGhs18g4iuxWwxMuVWRDG2s2iEPzrzThHwdb21iXzsGgiusAfO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;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nsB2iuhWAqqTPKpKAbHU7OtSE6dDDv8aow8MXzJ5HIRVp3IcjtaIME/qyZ0oPU6IIRnnwGwB3DSKWROiU4hBw4ZY38IRtp/itX//ybybIaR+Q2IDeJDRnE2+NJkkoId2dmjwMAumvRi1guQeN2sRal8FlRDalY62LOnwkRSMfM8LEyZVGYoHHn28Aue5rDbr81oecU9JBBcMmup3dktTmmO2JhcAOu1qBqvaryMRz6wQeaD55Ba91cm+ZSGltTkzfKScxlEVigkZp3/3OMZXj4pAbBykW4nBgHEoSxzTs5UNDKBezXLNSGqIUFlwfSShHdCDiJNURMMslRieIc/Y5bj5FgyGMiO2G22IjggsG9UAQ4zo7OcfDM//uGadtg8JTf35clDllRIm4mjNDTkP2/p7yXbCwUZQLx2rlPZ7baupm2h90lrcKfpFl+hcpxCdE4bENf819zwYQD7t8e82MiOl1E2KKxKH3f4VCbvu95+sHQaKKrMBDB3Snz7TAFoZFjJJDsrABr/J4OIPeazMFbw2E/PzTqOjfTd9gmr+5Om5WtpwC0rTT508SDiPNmnSyZDYhzNfrA+pUogAqUvgV/7QWnnkuV/SHM55D+nacl2y5cjrn3U4Kk5LcBLmqWndNWhfFUXAtCwTMsZ5F527Ws1D1gJw7GNxUiCNAVruOa2TTVJq1cZQvzEv35a/55QzrYgey50eY7znI/Sxjgq8aNGLVq2keIRSuvCA3eo5Wfa7X8Jf/WxxE54klIHd6Pi11p5OAWKbLJRNeX7YSthSvdTYHhKn5M5IM7oV0hQIuP0h8YXFwwrATJjJEmf5okcljuJMQp5V44u42+XsKYfEAKOfydAgD+aGNkf/RZzMThozZKq04M41KWIGdwn3PuYsFDgY6xLu9uZxviFByhDfE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fm9O/XPb/YCGv3TzzBhF41wHozXK/sK6At46YXuggROoFuDjB6Ew1XKhfY3r9zFLpwst/NgzEXn0qMTDLSIOuBiFj6YsDYJVbJERTW9R5bCNz7sZy1eIo6sqVUrqoMVfeimGdjkDjcy66mgpw/EzSa9LmihgpG2GlNhxP3fWelC9j9EbgeNlFBHAwft0EEGhvl7AiOlwRSdAN/wudRKdXR1k9vCSETD93rGCnXhA2JngjkJUdlQvfkplfxmjMOTsdTRtzt0UVWOQNJfx6XXGiG7AQuAmNMxChx/+TiABjzG2cs29WjvtyrWY4zjk+MMccFI2Vtw356pwMEFkiZVc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ad19298e-5ab0-4cfd-80d1-08dc87232b4b X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 18:53:50.1525 (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: qx7uA8Gmg3RhZFMoZNnlLZ0f5YrfKoNgl/TuCsc8ijSkpikDO3qWIgGIr0fBu54uZ3OBN7rBT2Vy09c7UVEY624kHKQLvhOYmrVwxV1rRf8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB6640 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-07_11,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 adultscore=0 bulkscore=0 spamscore=0 malwarescore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406070138 X-Proofpoint-GUID: fmwPz5ngUnBY-ED8L7xBSPWBZw_do3pF X-Proofpoint-ORIG-GUID: fmwPz5ngUnBY-ED8L7xBSPWBZw_do3pF X-Rspam-User: X-Stat-Signature: gqoib475djfsnik8tiwagufswwim5xif X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: D7536100013 X-HE-Tag: 1717786466-876641 X-HE-Meta: U2FsdGVkX1/Z5Drom5gXkJTQ4+6a0U3ELgL2czLNSSODXOVZRDCPZxoYBH0ASKV8pOERJ9EJ3uGNmTkHkM9xOOI5edqyUVwRz2uY4UoYZ1WpdDsl2IvTfkVFI4/lEUnxPY/KAcCUBffweNWfKhEMUw9lB0u9H1laN+efnMOGdqfOYKZVJN77hGde2IKy/TRXZknu3IUFebfgGIrbSEAbk0/mCrYoJYQ8a4FyIaU28x9CT671jScPwKC7YhbkZ0wUUUvbNVZaoKP+KcpB5vgagtwyk1PkN1Hxr7vgIu74/2o//9Q0Lsm2AUYZ5OreaN68Ii1xnBdmY3jGwl40CWOYygJkqrC8RcIg4tSeyP4v8miqVdzaooqyC5F8YSZNwBqz5MDsZrHl2Z7Ate9OtgaJxKASrloFVnIOb47leU3opd6H744oOtg7C87EcXlZ3oRBrlndTTH+Bb4OdmnhIb+1Ct9jDOpc6kyJ/1Nx5vYbVG83upfF6Cl4n3hmBYydO0+W7vnWZuizI0OUwOUakB2YGkv1STjTrcqkCZkoKGEA3qu1IZW02lWB4DcVjdqAcJPTG0f9pZ2q+IkPWFwN8QPuiMvmiMVyYDVOQ/99DEcC2eVwfr5aOCFXO7LNZb1K0moLDc+P7JNg+1XeU5SGstEVx333/O+57MHJkGOc41Wgy42pE2zG+Z/u1DRyv52KZmjv9xZ37tWDWYhlQo51sdmi3y5lPyGyywrK/Wdcq+RAKnzu5BIPpj5yt6VmKw7Wtwy3eew2B+qXvgaRCb+JNyCi08z/xjxSpZlbY/eIzWwG3fstahnN52YzbGHhkLT/qLOPd3K0tE0GjtOQOk0/QINmc+K8iTEXA900iu7cm+eoY2Gioo9dL8Ww1xE234SsD1cN4BvuWIp5QyA/l6iFEJMPBZ51W3Nar33eI7G09vHMGeAI/sjmaSjpOR7xwOvTz0DiijsaEAzXUWW119yCurv 8MBerNZB S0Ieh/wD7shxFdSslK/isi9e6/jwx379/poFmEv94L9l7M2vWT6wMJGUyqKSo7ioK6dkmqZh/pfJM2zmi+n5BjJyej/e8ek2cyTfStgT6Sqi3uwKhokqZGXLc68bhJX6ZvAmP8Akfr5nLE1DkX3NbHxPs7aKzmMvr/lDqCBXg5Xz2by5SgElYINI+uBtXoKNLcozwO7x7/aYzyY9Ayxj/7ypeT/AVOq6+KQ11vRsgrvBqPzxef56xTxjq0cgQm4/d1IxjX7qw+7Ms64TyYAIvqyXdFLsSdQkNhdOtDcuGJn5DGwZxE2IAr48AfAT9ieoeZAEb5lEjNnuPU3ERbQmkXDG1bb1sxRcKS5SiSY1CarAbWY95TzA8z0o2j5v931gK9Mt2n946cpqJRVRm+giTh0aK3GjmzBvyGifQTdp3N6NRWNLb4fSfzy0bwxEjLWA6QUseAESY8NGjs3sUDBmfhDjGHQ== 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: These sanity checks are now redundant as they are already checked in mas_wr_store_type(). We can remove them from mas_wr_append(). Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 7e1f64490662..3d334e7c19a5 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4061,17 +4061,9 @@ static inline unsigned char mas_wr_new_end(struct ma_wr_state *wr_mas) static inline bool mas_wr_append(struct ma_wr_state *wr_mas, unsigned char new_end) { - struct ma_state *mas; + struct ma_state *mas = wr_mas->mas; void __rcu **slots; - unsigned char end; - - mas = wr_mas->mas; - if (mt_in_rcu(mas->tree)) - return false; - - end = mas->end; - if (mas->offset != end) - return false; + unsigned char end = mas->end; if (new_end < mt_pivots[wr_mas->type]) { wr_mas->pivots[new_end] = wr_mas->pivots[end]; From patchwork Fri Jun 7 18:52:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 13690607 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 0A84AC27C6E for ; Fri, 7 Jun 2024 18:54:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 832606B00B6; Fri, 7 Jun 2024 14:54:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7BAEA6B00B8; Fri, 7 Jun 2024 14:54:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4FAB96B00B9; Fri, 7 Jun 2024 14:54:31 -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 229486B00B6 for ; Fri, 7 Jun 2024 14:54:31 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A4E5316012A for ; Fri, 7 Jun 2024 18:54:30 +0000 (UTC) X-FDA: 82204993500.15.D9A2198 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf24.hostedemail.com (Postfix) with ESMTP id 54D7318001B for ; Fri, 7 Jun 2024 18:54:27 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="gaB3ho/o"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=gEeJ+Gdu; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf24.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=1717786467; 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=LN9dwNd6OihPg+ZrPmID4uIjxFNM2h9/QkvA8wi9P2Y=; b=jGIy2J+ipf5QIi4ZLPZEvuHghGBaHdtbbBSyx4nKmkOjZZ0wDzQYgZKDLWcGRNtCSo67st yHrgk0hoztZQvRmKjWIMYXIkaR/mFtylyG1hyQ01cFQNAIOZQVdFW+kVU5DRCXqQZMmAZd 7QdS4Sa4Ot3HyEGpQhZl+WBo8lUuR+I= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717786467; a=rsa-sha256; cv=pass; b=di1MDQFP+qY7Zyh3QG7dSflT1fCBFz09BPn0vRh/ny91toe9FrdASMaYaWXcxLpU2gGltL 2K8wgnior4HaLerIUOBxlIvdgc8MUIaTXzfbhDsOi5ZR4G7plDgAHMjFFUqqWNUIfTjzB3 +0AI0lGECLyw6z87QYZHYTRfEPkVUTg= ARC-Authentication-Results: i=2; imf24.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="gaB3ho/o"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=gEeJ+Gdu; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf24.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 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 457CuTD8019997; Fri, 7 Jun 2024 18:54:24 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=LN9dwNd6OihPg+ZrPmID4uIjxFNM2h9/QkvA8wi9P2Y=; b=gaB3ho/ozowoxX2Mxoe4izq1XrxprzFbRekUCfPa406GOgRmmS7HXFWWH/TQvb6/F878 AGTE6WMHZiR4voAFlwMb3vx9EUyx4VI+HgrisDLkwYrofdekuqtdZxd3tlXh2bvR9FIa QEw9vZpe5m4qK+8YJhC+Ef/tSdv+AFByYfogdsbLANIjI/ai8mwZT6lbm3K3+y0a9OCA KQAVR3sU0GpoRa8elpQFj3ekjcr37aOBB/3TkqKT3ujsZlmU5KEkYQaai7ncjddW2/0A pAG2m0vd8AKk5SotRvx+JEB+IOF+KwKCKuRKAb/01WWcw98f9ep51GA0XFr1LWa/d/My Tw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yjbsye9cd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:54:24 +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 457HOGFx015573; Fri, 7 Jun 2024 18:54:23 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2174.outbound.protection.outlook.com [104.47.58.174]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrjh0eud-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:54:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TzOIIHN9TA03DbccKkOVCVOvtQRi1UdZ7xyoiR5gD7x79OhAX17IWttds3UQQ5jdkc6oJwXQ90dWcBtaATgHpWIUBEhgUhUcWa3cIKLWyXLhI/fnpwxS9/bA4zQUndNZEDYjhCxMSn5lHJp3gggYKeWLgcdTqUtUsiXW67YxkP1WXMAWrMfU2v3a7EbGp80794JPFLH1XMarBRTKl5pmJ0ZNW2J2oNa/earlXpr0GzMOEAwPPh71mn1DX1RDjySZJPH7BT+a29JzuWeroU3X8D5bA7xeV5I2fYHWr9mCZ2I7voDzLzdM4llTRPkWT8IOASJu9kAq47fdXnqWQaWbIA== 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=LN9dwNd6OihPg+ZrPmID4uIjxFNM2h9/QkvA8wi9P2Y=; b=Ta4kBGRBI0yLH03dsS3A2rxZl0Zx5DFyj2UlqdEU7FaSf6pMFrYp56K2v/8BGq5nkJbUrutloKqsY0/FOf1Xw3WmXLdr1A3hIhkvGB4/GB/F5ajdBnjSLJ+6qp8NYzy8xyolJvvQQih6Fd+a+fI4QZ7xDlx1no5KWHRunWmUb/IYC8EAk+4vehbj+iaVzrIaorAfs/qwEOnbYa+UltcnTR/B9475BWnAkb9L6PT4Uk95syHuIMVT9/9qAs67r0c+U0SYUCESRUPQmW3oDdqagY7gLYCAhGdkI+rqXlIeXk34P8rbeiCrJOXN8L6NuUksBanxQwTEAyQRSaG9u7p1IQ== 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=LN9dwNd6OihPg+ZrPmID4uIjxFNM2h9/QkvA8wi9P2Y=; b=gEeJ+GduASQUMrYVMwT7qR4fhrXNMq7Q6cM8/L6BB/BhgqVlkz+2XU1FnzCQdyvDvnCuXGDk2qRG2TjBqcxc16WukjRbSq0NxLv94vtaUEyqAZAzK8ppIJZHrrNqn97Qou5BTBHfC1vyA0/BOvjkxdlPHciVlKSUSXfTtPQa75Q= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SA1PR10MB6640.namprd10.prod.outlook.com (2603:10b6:806:2b6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Fri, 7 Jun 2024 18:53:53 +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.034; Fri, 7 Jun 2024 18:53:53 +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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v2 16/16] maple_tree: remove unneeded mas_wr_walk() in mas_store_prealloc() Date: Fri, 7 Jun 2024 11:52:57 -0700 Message-ID: <20240607185257.963768-17-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240607185257.963768-1-sidhartha.kumar@oracle.com> References: <20240607185257.963768-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: MN2PR19CA0030.namprd19.prod.outlook.com (2603:10b6:208:178::43) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SA1PR10MB6640:EE_ X-MS-Office365-Filtering-Correlation-Id: ae91e1bb-95f5-4401-8aa3-08dc87232cf4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|366007; X-Microsoft-Antispam-Message-Info: AwAQwDl1kyQjosB6tEji8N9tcbDpK41RQEmP6S3JEmelccFpC8EH3mhQ5yLs0Kbz4RjUvYJ5obfrvYVSdiq1wKQLrbdFQwDVL1kDFgE6nrkVNt/E6QHjAyEEc+xluG6mn/GyaXccq/UtR/G7XC0g/nFHJoE65afRmuCwWEhkZ7+BCj6wSVQy8glrdZ9+ubjLW6xJ3dgyzTOaA8aAkubfA3uUQR4mFBaCAcMnopGjKo2rCtYbW0gLB+EurThDHN9BeIyTDAnRoxl3TyiB71/MgwdhPHoJbjOEDqaqbvrpi62c9eiP9GizFF4qfDaVbIo2pxdUa9sOL2GhzIaUMougfS9TOpJX4caOGK+WVb9NkdHIqiXmY33JDXOLjb3OkJXKc+JUVudNV1zCh1C4msS1QcOXraGfC+QVQ6Am9eDrZUIL45DGdYuVDyNIalmA6YC7csoneNE1eDn98sYwOLhTRb1ygGUArIfgy1zVCSKeYP1Y/uqPKKuoZI2cvzyWJzqclNNOZeT7j53e2zFTF9S1TjT9jO+jSzN19GP3cYsxYAr/XAKK+rU0+YBPR123e1JiNHCakd6xvA3pKR6+Lb5JJsQjpnfrUOZlTPs8zRQaLIzO8FQIKMUGtke0B9wLDzmQEPmMQaQiJTzpFviTcOLdTw2HGyfg4R/2D7g1K9/On0varCdjeEXYgSxzlxiOcD0/V1Y4GbDP4oak7OZ14B41TH68yFhF+OlGh9UfnKFi7cqKswjrv2KKna/HFmYz+Q4WVI7O7ZEqFQSR/bbVY96fJfJXNYXBB88rjZtq1DcGP2IkORAg6eCRfOpszTMSynlEOXaJ0+ovVAi5PqAgWnol1GsMVW+2QHazQ8EjuXQQNeGMh6pv8AUkS0asvLCmftYoPiCAcMsTFVAtLZNggOakRaMW6EkImX/JEuNJ13V/jc2S81WKGPk4MaNKUEY8U8nRMMygZDv6EiHQFnVmZ2/sV2nT7wtYe99M7SnONtvrIjKIjxptkOHb5xWmKuQQWTbkG6D0CvBA7B83F4Am6uvsv0xsXZp/y3yE8QkJK5xdC1ZERY47i9rY61VQODNTkWh/7fzZYUcSxMiMcM3u0wOG4Mni8IfeQhq48Dm4AvfKplMUEA8hjES4YqINX5fMUusmZnAvpHeommKxHHwV5r4htpcvBL1CYVF7b73JETWsntGVp8mzylFQ5/zjiaxrWUfu//5ByZ9WhW2f2pHUJKnd6kHfIyYLY5vse9M/JL5QiVzD0PxL2dyoDXCA7bRtbimu6Om2cnJnj03e/duSY78RekxNqnGr4K6ekvNURVVoMLY= 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)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uMzg8Bs9fAUvmWxZy+/+yTvvLbGvyIcRwb+SNJhRGVpDRfCWc4RH1JpmlMXvjfZ3K0L4ytKJ5Esi6YfvY5CwNly9OzEWo/k0X/zIBP7DklEHEFYC9cFXP9LXgy162QXvREyb/EM/ZMhmnbljLt9aShIYocuhevenYknTjiE2bp7sEaKKGU4X2QP6AFgP/Gs1vN1eivWdztuOSZoG+QMOwgu+pdNJb+zTPj+8v0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LpPSVRDBCGFj7G09Q/pkdhH6wJgHWl29TU547HLHSGhsKWNKGgoqP+n7A/JimI1tbW9cBIoUQfQMz/gauoj9E/oVcOM16E1B/z79mvCOU9dxQYcMNPRC6HbhYRBq+svXKdIvEEYaR199jCKZUOc0Y0e5vaLGGX37LkXCVav9cD+b7DQy8GZvGlV89ZRlY2ReXlPfB67ohq3AQFumu4GK3xOrs1o9R4VoyKPBl9xG6xVggptbUvuimwiVVysRir8IhS0IvDxnvTk67YDgkXQngFkYNy32jcq6vyCwR3NzTJhB14MLTXy/QXp8HYzU15TyF5sJli3hc4Y= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: eE4rMOqgQkci4XJDxvus5lubg/5lL5Iyc/Kspzdk7g5mmgNOyPqebYfgFgEb1XWz/N7+Xxg47UjVDDAY3rJY9daL+IXzj8OM4JObtuIv62ZSz339rwXNVusAwcQKkVxYUcxIefM7sWxnxMhT8O1fA1Pqzc9yANxqkYwhDlpSI/snZ6wGVMgOuPRPKHs+Kds1Ul1QtHIr0gogPegQ8u7QTp66Flsv/P8pM4vMhLedZEHxeQuOGkRRBt/+D6djhHTyCayh5Zm+CazbFJGktH5c0cf5CZ9zQyEEGOGY2DjTWQh6Wj45NVHDlq6WXOTNVh3djq1EtTRyrk9odxG6w7oh9VDM7OCfv18LpSAzE1UFvqNFlKcS/dNlUQvKO1ndzsMr6UVUxflM05n+ihhXhVtEqVKl4Lc92tq/QdFNIF16xVlfSqf1CSj7Yj5vRaz0pJupm5fjWI3wWh5sGNP5jcEvvy6YJEUz3lbVuIy++JEl5ClBWv6UzvCrqxMy7O7Xibll+9mhfkx+I1cY2hgzDFSYvK61kbVRBnl7uwqrwPh67KQEzB+uFzpWWecZPXb10PgFSDZJY9oKxneoo6q6VxEjc3uffKm6PzTU41LU8g0ANRo= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae91e1bb-95f5-4401-8aa3-08dc87232cf4 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 18:53:53.6289 (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: scQQd5c31gn9YE7Yu7RzM4yoHhmzDE/SYRbpvvPrdgydzWa+o3qEICotaKu0bkpskVO6ZF3Ltlqg3AcvvOedpiQ56cXPYZFEK2snG9aF3aU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB6640 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-07_11,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 adultscore=0 bulkscore=0 spamscore=0 malwarescore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406070138 X-Proofpoint-GUID: lsOVYUOxyU8eo4HtaI5MiKA8cv9g5mab X-Proofpoint-ORIG-GUID: lsOVYUOxyU8eo4HtaI5MiKA8cv9g5mab X-Rspam-User: X-Stat-Signature: djofnx3m8r9ghh3oa13sfy1uytkb4dab X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 54D7318001B X-HE-Tag: 1717786467-952843 X-HE-Meta: U2FsdGVkX1/wTCfKjbJLYK4uGB3dJiFdZxpBGxk0LVmooUHXssNDUhLMGje70oN1FZaphJpjOrwZDu0Ypg8aC9PI/0mSmQgSbNlWS+5lKYqXpYDIZRUoVm5dC8J//LgWZ9kv5o8C5Vmv4zhT+J4ncP5ByENBFl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j6f2cjIf5XdUsB6DCG/O3ZgvL/jNFzQxgQk3J+CIylJ/JzKmjnWKUMtzdA0Q+joNpCtYEHHuAO2o0Z/6pD87TaADyJB/LG4CPFDfgu4ciCGFSVOtRQUOGkQU9SgpX5su1xLW8xZcJKt+JO45wJ307Bi/IY85C6ZFtdoE4y88D+ZwotfPrq7pMr0QFgpSEuhYi2ttBY7ZL4jkxyU3g7Q== 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: Users of mas_store_prealloc() enter this function with nodes already preallocated. This means the store type must be already set. We can then remove the call to mas_wr_store_type() and initialize the write state to continue the partial walk that was done when determining the store type. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 3d334e7c19a5..5854f25a4ae5 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4027,9 +4027,6 @@ static inline void mas_wr_end_piv(struct ma_wr_state *wr_mas) wr_mas->end_piv = wr_mas->pivots[wr_mas->offset_end]; else wr_mas->end_piv = wr_mas->mas->max; - - if (!wr_mas->entry) - mas_wr_extend_null(wr_mas); } static inline unsigned char mas_wr_new_end(struct ma_wr_state *wr_mas) @@ -5598,12 +5595,23 @@ void mas_store_prealloc(struct ma_state *mas, void *entry) { MA_WR_STATE(wr_mas, mas, entry); - mas_wr_prealloc_setup(&wr_mas); - mas_wr_store_type(&wr_mas); + if (mas->store_type == wr_store_root) { + mas_wr_prealloc_setup(&wr_mas); + goto store; + } + + mas_wr_walk_descend(&wr_mas); + if (mas->store_type != wr_spanning_store) { + /* set wr_mas->content to current slot */ + wr_mas.content = mas_slot_locked(mas, wr_mas.slots, mas->offset); + mas_wr_end_piv(&wr_mas); + } +store: trace_ma_write(__func__, mas, 0, entry); mas_wr_store_entry(&wr_mas); MAS_WR_BUG_ON(&wr_mas, mas_is_err(mas)); mas_destroy(mas); + } EXPORT_SYMBOL_GPL(mas_store_prealloc);