From patchwork Tue Jun 4 17:41:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13685728 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 628A9C25B78 for ; Tue, 4 Jun 2024 17:42:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2F6C96B009E; Tue, 4 Jun 2024 13:42:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2D92E6B009D; Tue, 4 Jun 2024 13:42:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0A2F76B009F; Tue, 4 Jun 2024 13:42:21 -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 DBB8B6B009C for ; Tue, 4 Jun 2024 13:42:20 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 83F2980B7A for ; Tue, 4 Jun 2024 17:42:20 +0000 (UTC) X-FDA: 82193925240.28.098FD9D Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf17.hostedemail.com (Postfix) with ESMTP id 42F204000A for ; Tue, 4 Jun 2024 17:42:17 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=LaXKDs2G; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=w7O+KYjZ; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf17.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=1717522937; 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=D2Ttdv4jO/M0NZvyd6x11j417E8vjm6zIIzfz5tzgbI=; b=Ie7JJA+EbiXbuIwKrYgPGz06Wl/8cjT4JLW025PaQSxXv6l5+eG11RoRolefQX1m4ZT6Pi Vz8QgTWvu+Q/gou3a+HpubK2RODSsitLHTvhYkcAXF6+H3XKO4GytcImWswFypfKwmuu+Q 3/Kma0fm6F1F4qiW9icB571NviNcZ1s= ARC-Authentication-Results: i=2; imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=LaXKDs2G; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=w7O+KYjZ; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf17.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=1717522937; a=rsa-sha256; cv=pass; b=hP2+LsLNIrIksTDurMKHmPNSewFgdu0Nw20blI2jkACQoQCP7/eCsgA3jnWrNuDTcVkFSl dgVD7n3Sps0t6CpdV0CpxkIiZ+VaaN6ylw9+9FLWm9F6x6QxwBGUtbDhaO/BtBNdApWjCQ 32lYq7hmxfh4LzpkdAc6ZgBWcUfiI4Q= 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 454Bnw2E024630; Tue, 4 Jun 2024 17:42:02 GMT DKIM-Signature: =?utf-8?q?v=3D1=3B_a=3Drsa-sha256=3B_c=3Drelaxed/relaxed=3B_?= =?utf-8?q?d=3Doracle=2Ecom=3B_h=3Dcc=3Acontent-transfer-encoding=3Acontent-?= =?utf-8?q?type=3Adate=3Afrom=3Ain-reply-to=3Amessage-id=3Amime-version=3Are?= =?utf-8?q?ferences=3Asubject=3Ato=3B_s=3Dcorp-2023-11-20=3B_bh=3DD2Ttdv4jO/?= =?utf-8?q?M0NZvyd6x11j417E8vjm6zIIzfz5tzgbI=3D=3B_b=3DLaXKDs2Giq9Yuc54as2jV?= =?utf-8?q?LDEDupf9e/TZPD5XbNIm/1HoTOSyGiQGLLHz5J/KVDnymwS_YNFJbepAWHnV441MC?= =?utf-8?q?r4orQWnbNMfdb5Q1eQPONXzmJjF7JnW5WQ0r+srbgcZhKiriLUk_NAfuNQsQml6KR?= =?utf-8?q?M0qY6rI0fMN1vk4Q2m7wEql4XHDd7B0gRo9hwVuV5urBVd1nbvhBiVX_C12O6mXr7?= =?utf-8?q?ORBZ2HpdQo/IWeFE+xmbHDA/2qQwCFo4zeD/8A+Uz69E+yoxzhoVsFLN4zX_xYOM1?= =?utf-8?q?xB5vWSGgHFnmo2QjdZN6wicqgKCIwlAPwOn3nPquxeSbDdUvDERiouWFhVVEXc9_s?= =?utf-8?q?Q=3D=3D_?= Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfv3nwhwr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:01 +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 454HAhWd016185; Tue, 4 Jun 2024 17:41:59 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2042.outbound.protection.outlook.com [104.47.55.42]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrsaf2q2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:41:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nMkfEYE1dVmdukxOxeJpBxKntOgXm36vdKJG1Z65mWrS1jNts1+f2qRgkUE0YK+18m+XqpUYxN4h2iQHjeAzB7yuTyet2pNZBt+I3mnUvSaE1N57hdFFGl4J3KgwEoPewdQN5JanfoBNAd/JBWrLvcnpO1xpwSrHbQgp7+IOQlNe4YH9xFkhGQlTgJj3ATtLsVsSYk7lSTMUp2V9YNzw8LZXlErRDy8YpIGPe/9Kv+cLJQuDqHWuO/B6P78vi4FqcrATLoGkUK3bgpFDeXkUUBXamNU9hrzoKTjur4MIRcTRqa8VAZUBf4t+zWYBKr3YiwczNU/3BCGQbmJfCiNOrA== 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=D2Ttdv4jO/M0NZvyd6x11j417E8vjm6zIIzfz5tzgbI=; b=VcAzZimpBVO5OEOJAou8uGkEDPI7apVmiIGl0KJDVq+/euHB0o5+3qghpty1U7fGtsJ6u40PbKqueq8FJu8RYS5JRu/tcSwQsO6XKRaz8rn7UUw1NIRQGh6Otf+wDeRjnJSAbHVsDquk4Jq7ADw+4E1G87+RZ4jdjs1PbuD/7Hty+H1cuYXRHlnDCvBKr9NMYwfdCvwH7JngW4ynXUCqz17Z+ObRmFI4AheE5ATzLvS3aMKmD1NIItNwauyWgi9iWGVBQrl84236cyfKW9539GPwbdpN+VBW41q4uUpmbjNl/HYts0+o+j/j/HEwc92hUxt4A3TvPdfqn+3flqFPUw== 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=D2Ttdv4jO/M0NZvyd6x11j417E8vjm6zIIzfz5tzgbI=; b=w7O+KYjZKmU9BOtLQ6aE67KqLjJEHv9OQZBTR6zcxCF+EL8DfS8m5JxRq8Yp0KkMBDtGGdB/Q+9CcHp6vMz3FyloxJ62/10GId6fyxEvWGR2uJOReV1JjBOhUwhYBkMkPqOVKaPXcKULCG5PR2mrUVrrD9Y/zPN2z65KzXrMJb4= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by DS0PR10MB7269.namprd10.prod.outlook.com (2603:10b6:8:f3::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Tue, 4 Jun 2024 17:41:56 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7633.021; Tue, 4 Jun 2024 17:41:56 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, zhangpeng.00@bytedance.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 01/18] maple_tree: introduce store_type enum Date: Tue, 4 Jun 2024 10:41:28 -0700 Message-ID: <20240604174145.563900-2-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604174145.563900-1-sidhartha.kumar@oracle.com> References: <20240604174145.563900-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR03CA0024.namprd03.prod.outlook.com (2603:10b6:a02:a8::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_|DS0PR10MB7269:EE_ X-MS-Office365-Filtering-Correlation-Id: 73949498-f61c-4c93-d49d-08dc84bda0f2 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: DOh0i3nkhKHNXBwirOQlS2weKyPNNHxgKECB0ZP5WoPgZsq83ftclstqtOSXZxPGdgyFH0ul1PzJriGw/ZOHiAVz9HiWV5GuPtLzb9e5LKqdWAz+cjBuBYo/+43KGwr8PjSOjdHDzCUD4YcGSD1OfYu+WX9AgWfmZS/0jBkzNeEJNkkQsEs9GYtX3dr4ES2SxjG4tyaWc15KQf9mz7Y1gPCco1SUCAP/7gp+XBzpgeZ9bsR6nsxbKRARPeXJ6ajdMXIgwPUKDBZ0ac2D9gKGnR7tcNQ34oIgUBUrNYWfp++ugaw1rJRp1l/z7UX9rBBNo0PPOBCP3547lQa7BJa9WksJaYPW1bn+QfA3IJY0ArJ0cvGr1p+RgsNNV03QxTDbEPkf4KzwAJjq+TNftu1aVm3H57JSq7qVhZkQJs7w3rt6b1PbYjDGdWSc4KG1SJnIe3bjbwmP34y4H84micMwETrCaW7broJZUju1dgapLH/WotfZmEcIesTv7kaz+g5QgbbL5RG1LdWIBKdFoThs2srtZo6wMox4HO/t3K3bH8rmU/1Ljcwl2IJJk69lrYpXja05jTN/7YITNfDHRyX8o8t8vqBofwWzDxO/b7R3X3WgPhYjdzcFJAdQoLmS0vV7utpjm3U0VWS74/JUCGMAPlInVePvDbXJdq7RHVvc/NHSPp0f7EANdITmQjplAXwDMNGcEjxc0QXpNniTWiMrQeMP11ILCJ+R8OmIjthVapXVS7Yta/V+A8CWL+KpEWXz1Kl7MjitwEy0FMiy6Ucjg6wc1mz7b8H2guhzavDr5v6HS505+mUkQtTFmSGZ3CyDepe5SN6NRpW+zNl4Zo7UpetjdWASxiiORKUe45v9yn1ED0QmSzRIS6pmuEqiXhKNtvne78M3FT6GAwdpIhKX8Zkn1VXsMnYAeHwoS+fM7hzHioHpzCMGe+jeDjtbBaJD6gR8lZ0/ouXMCFAswJInpbgX4FB6nZCcDSP/yphXAP0LtgYZK5+/YDA5P4xZe9Zli3A13+Zu67tgm0Wf4RhDGfiRwHkgTxZnl6ZJqji3A43Ujp+XIODjkupnKfJwprf2ePkJqaEVjdb/tej2e9kiQgHS1YRHtGUG89KGVFS4fZMIATEgqAKSzzPFjzN2YSG2+0kWXhHyTMVugTmew8ZuX5XZzOdCbmSRZgTa2pZ1WQFD1rTkbX9rCT3+vZn0dAkXvAYAMGDABPFnfEi0+z4Hj0W6v5h+f68SWhhS+57aWwN5kvJs6tbJ5favp0dgHeVaa8ApP37vluTd4VIzX7w+zV5n+hz9dIWFcxN07c8D4op9dbBURNFXR0SvYraixLqX 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: mfEgvLeG/1oPtY+xqD6EAimGt02rAaprEZN0BdHjrgfTd1a/pkJJ96i3wenST7nXEdtz3sb35ZKGzhZb3mQqrQzyDHEh6vpKCtSFNuNrm9j6XCad7iIGW5DT2Y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7Qh9DeRJd7pD6XwwkDk0Lgg7Ci56jU3h2Gj3d9ZycLL+EeNk5kamqNNmsHxEYf+4sbOSFSTObSXbpHosXUkSPvEiYCe9PTOZfCdOQ1Ady0BOAm80AxEpKpfrT/1zuib7lkq1s85BY2QQ3C+6ybiVXu9wak+LkTz7I427DmQaLQNn5jEDFP280mS5jRZe+LXlym4Me5XQIyNyeGRqZK6vimtM1gdcWuK8/3dXSHfeKJDAF/7NWBSA890o0GTN1J26PDlM+DVPAuoL3MpbxYulYj9Z8of1DO3z196ESojipEoy3e+vZmWUV7a23fXCst9q928eO73tF/CLqoLn7zdKbTBj9csCyNXPyMojfkMHM5wCVb5aRlKs+rWEdUvM3JtjXD9G3mrjoUAVImldN4wZbikVK2GsP5IBSzgTrTKsROSIuuGprLneViz+slLNIVg= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: UZX1VP1sHP22WiCgfsZW7EWDveHV64WGyfyjMuZEKGZTqY7UThYmefIVj52C2Ou6/N9XfW93qUMGolb1cwlfhWR6dnVNX9Jj7CgdyDlw80vhsQudJ2u+fJwwBDIO/T72Dgkz6oQpeNUN23MjAoxCrQHZDEpfXfJQ5Hip0M1nknwhgftcZ3ePh7//4I0uNgi6J7jecIY6Bhp81fZZYwV9yhbIPItYkiEfV0e5SxTu5scyNo94NMqyPXcg1hpp1BcuZ+lGDaib5p2/V8hjSiJOAGHeMZxLXnqQjBnBneFBVt4mFHx+bHviHbJ2b+EHbvPm1ReagAI9Mvv/j3H8fC3CyKIESY/KY5B1O2U9OLfSAvajFPeZzDd0zij/8qdkUj7wl1PKjQCsmiDC6hU6WuropS1Yygk0kRqptQbrgjMCZYGmylrZMhCm8NWBU+xQ3JzTdKY2wh6leEFBBckWtS7e3YHMCx6YbUdwnNiEhofgVxYX5KECsWCZcIme025fDvjjtrZqchdg0Bwhug3adsL0YdlkDaeFb5J/vT2gEvrKEqjceMctcSWZenTw4FXcRpZomgklyLm9IvRXPPSMmHU8McR2uSeKdR3Q80/PtcZXx+k= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73949498-f61c-4c93-d49d-08dc84bda0f2 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:41:56.5411 (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: 1fW4a8/G3qg/B8UPQi9+8g6yfvdFPuIRlwlEuTq+B0cBnL2hBn2PTKhcG3NbEtt8G+o0+EJ7V0L5NheVIf8IlA7zYcSP40NRUeb5jzfMnss= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7269 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 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-2406040142 X-Proofpoint-ORIG-GUID: sGOGTHmQ6zz-9d67wTFsxTze1WxafwcJ X-Proofpoint-GUID: sGOGTHmQ6zz-9d67wTFsxTze1WxafwcJ X-Stat-Signature: kabjob4fzb8hiher9gigo8a8uj3fqwzi X-Rspamd-Queue-Id: 42F204000A X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1717522937-651586 X-HE-Meta: U2FsdGVkX1/5EK7khPHrUA1LOhec/84LZHJgeFQzJPJQwqejGSWOzRHn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KstIZ+Cze8UKJEeqARV1E3AA4NEGNjHelHGyLbr4GgAEcKp1itqNa65bDi70ydgt9Fb8TfZpQI0vSWwXuGS8aASYlx4fcMmcy2itHBn0hOXa8uMAcib4Cx4TspIbnSpk5tMaRJFwketKiDRXxjbgt103BevgY4sC9mBYd0aZD4WHePG1zvWKUZeMWc8a4D2sYlOnVj66W8hg2oMKmFvjxtvssSEfnavcEHWmCqZ9L5rFzOMSMJFLoRnhce/1vG318uJEPHt9FmiwbtDVnQXBXZbl+Ijp+rYG3bhrvcSmbVXZ8WZZOl8JZEkwV0a/2Ak4e/gmYIng== 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 Tue Jun 4 17:41:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13685727 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 8662EC27C52 for ; Tue, 4 Jun 2024 17:42:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB4B26B009B; Tue, 4 Jun 2024 13:42:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C57176B009D; Tue, 4 Jun 2024 13:42:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 84FEC6B009E; Tue, 4 Jun 2024 13:42:20 -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 5810B6B0099 for ; Tue, 4 Jun 2024 13:42:20 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id F005380B7A for ; Tue, 4 Jun 2024 17:42:19 +0000 (UTC) X-FDA: 82193925198.21.921DC6E Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf06.hostedemail.com (Postfix) with ESMTP id 9288418000E for ; Tue, 4 Jun 2024 17:42:16 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=TFj6PSl5; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=KzoQK3E7; dmarc=pass (policy=quarantine) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717522936; 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=J2czIooQkE/g6w6qgk9SmtCs+2RK3cL0MxygBDJoS24=; b=Vqm912q+WwEN0PuQc+lP48OZJLlHGP9zl/GVLibsOuQro5ULzTfAmBdOkTovc89hsNw7/7 ZHEX/rtgJTuAi8rX+XEZyg6j2BvN3mefz7NR/iEIa4JPsgcRsIj1sf/Sg4RE8KgZM4CXBc CaItDCkqm9tbgFdJwUu4g7qJEjBKPd4= ARC-Authentication-Results: i=2; imf06.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=TFj6PSl5; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=KzoQK3E7; dmarc=pass (policy=quarantine) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717522936; a=rsa-sha256; cv=pass; b=YLawqWsKwOFH8nKjT5IhpYmGdSEQwoRe9K+Be++gqNb9o1K0jjY+Xs6vVM6ppPeis+dH62 +3OLKqYhuAw3HBxn6lNoueVEoVHW7UAr4e1/iDWEnSaIwm1RYHed2QU1fxRzA10BK5exmB 7nb+NawfhbL+A+CyleLfN+A+8hLPayA= 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 454BnWuW032255; Tue, 4 Jun 2024 17:42:04 GMT DKIM-Signature: =?utf-8?q?v=3D1=3B_a=3Drsa-sha256=3B_c=3Drelaxed/relaxed=3B_?= =?utf-8?q?d=3Doracle=2Ecom=3B_h=3Dcc=3Acontent-transfer-encoding=3Acontent-?= =?utf-8?q?type=3Adate=3Afrom=3Ain-reply-to=3Amessage-id=3Amime-version=3Are?= =?utf-8?q?ferences=3Asubject=3Ato=3B_s=3Dcorp-2023-11-20=3B_bh=3DJ2czIooQkE?= =?utf-8?q?/g6w6qgk9SmtCs+2RK3cL0MxygBDJoS24=3D=3B_b=3DTFj6PSl5ia9dSPD43pquT?= =?utf-8?q?RwxDNVFUN1Fh/7n+SM44iPwcssTfS61W3nfXjM7M0bFvMIh_YsnwEDmtm2B5/verp?= =?utf-8?q?vAfyv8wGpMFMSjWwtBaXw/b24vIU8QjInAOg6fejMTd8RMfcNLT_Ppu2AJ0eFC7aC?= =?utf-8?q?mgxggK/CrPPeHfCYbfRp4sR+YrtVnRMck2fuOa/vVg9rg+XU691pluG_l4jwDklxD?= =?utf-8?q?3LrdarnuXANzb3F4QQHtjJVIIcM+L2/VOWCR98LskK1MFvwX/erPJflaX6B_t4qel?= =?utf-8?q?cJr5JRCZI60pQh7zk02aw8U4CShDbc6dOLZxiF2XCk/pbqh5671xbHFAQsaBA7m_y?= =?utf-8?q?g=3D=3D_?= Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfv6u5jg6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:03 +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 454HL73d016288; Tue, 4 Jun 2024 17:42:02 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2048.outbound.protection.outlook.com [104.47.55.48]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrsaf2s6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=imMNGlxodska4MKW+/c/GVXdCwTy1wscKfpLgWFogRWuFKkVdih4JcYWNt1luxDeStziLVXwreyonO0y5qhh0KSdD4CeHGl40761v0I2oIv+0adA2rnTcc8qM0l7gAi0TVKaHzwcoAAMS4Cnrx0+Gbd2srqtecuO4Klcdi3UeRAtGnT59QbCiqmFYEP8XFh7ABMNN/1wZqW6micajYHk8SkmfQ+ZTW2r48Jrr3Du42ZImJL/RUJ7FmV+SANKVydv69s/rGMIWVjGjxCw+hCSUHan+NfosP5YzdifFKCfSaOQT4CcNWTLwxgseE4ikVyCIvVbBiKdx9ijDh3nGOSkDA== 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=J2czIooQkE/g6w6qgk9SmtCs+2RK3cL0MxygBDJoS24=; b=D1IP5T/GJPREGxrXj2sANkBlS4LN2V0XCgmDo+MaAubzIyYrorOxh5PJqZllD70x1M1ajlH/upZl2PsRdvL70w3Y/Uisdyk9d5DYnJOra9fMTTxpnsRo36M4jp3U0/ztUwIRAghV56BOJA8tnHkqocL31rGOgZZG+XfMTvHdQe2POY7usdDpF+TxlebxIJx/NfTeZjvmjeJb8z9nJ+xn2x1itFo282DTVdd93M455N5uRB6zjcy+50G6u/I7ZFVkBm6u26QJJn+Tizt9p9c5hEcTk6DVQ4cNd5dfUGvI5ects1HJOCWYdRl8qft8HNmo1N4dRIOlxNRWIB9vrNEv8g== 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=J2czIooQkE/g6w6qgk9SmtCs+2RK3cL0MxygBDJoS24=; b=KzoQK3E7GSgCxaF4ojeYk8Rfk1h4/KZ++KrFezraO+Y6Ze9VUUCz/LpxdW8UZQNemae8h2+6Wzznw59khKo9+k6xaHtn51JrayYJfDeiMYV4r7GtbnVMPfdJWIwLIANIwS4c54K/vQTIGmIkx2E53ivYYG9H6l4kMhAOQ1IrzJI= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by DS0PR10MB7269.namprd10.prod.outlook.com (2603:10b6:8:f3::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Tue, 4 Jun 2024 17:41:58 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7633.021; Tue, 4 Jun 2024 17:41:58 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, zhangpeng.00@bytedance.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 02/18] maple_tree: introduce mas_wr_prealloc_setup() Date: Tue, 4 Jun 2024 10:41:29 -0700 Message-ID: <20240604174145.563900-3-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604174145.563900-1-sidhartha.kumar@oracle.com> References: <20240604174145.563900-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR03CA0012.namprd03.prod.outlook.com (2603:10b6:a02:a8::25) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|DS0PR10MB7269:EE_ X-MS-Office365-Filtering-Correlation-Id: 93d3113e-246c-4ebd-3752-08dc84bda21d 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: iXDGFoBW/C25LblL/Bvqk1yv4kP+n+uR8Co1U9FDUM6Cdn98ecVADQxeWfA90fNo6aTtOUd26bVpJdk3miF/DOtzWDob6LsHNsXfd/nV1yQoPk1OFPZHMB+U9iJGtCOqdPVIfLGkCtuakHyBg8qY3KelLWbAUdYlbsX1uHmrIPdJSEnuSjJUOPnCkH8yMxID4jO3PlIZ5vTQGFFvxTQMb2dWb/FGmW8GSpvDI4pN4i44O7l9sijl0p1FXfwcgG94Bl6E93v7GTw38I4xu2WVyOxjXL8d6M+tzGhDC0D/RA+JtILT/6MAp1Ie3pQM2HtE1QXFWhWMhfCHt2yJ+D9Nq/Uf7dXISEGLDZTA0B1cMU81KGuQcWR3OnqPJe1xVbzrgCGdE0rK4AvaEo0jVnn8ROWLfmwKOKu8SDW7mugw8RLHu3CHjN8yA3+Oe6g/qKt/NAjfzuIZhmTxFFww2C5H+iTtRKvmE65TXu67/zz6RCW0QPRDArmiOIekATcv33tuPnspIouHTVBNLNquz70xX0JQtmS1UAIoadocf3kEp5UdJGGGIZFXQSbzXypAlxgWe4sEpJIujiUlRkkxvO7AMhEAEgc4u6ERXU425YhzKVa13S2svuA54wxgn8mXSGCev2Jqdx26MVyskGJzXOV2XJNC2q939PqlS2/rDAVLxH6aixhO9smNGb2vaIyzXwmlK2IuEegnRF8n8RgXLuL1o/f4cOm/P5LQzO32q4EkDt8bHYQigIRUbPQFAAVrfEnz6qSVfPsru+7e0Bx3V62peud3HZFsc7tLjoSspAV5oLYUqwpCCPPHV5lCgMgbtelMOoubzRfnnfnIw94iI+SOgQ/YiZ7At3m7j35JIZYYoZMkq4JbN3WWojy4gzvLCmYMkpu0AyWM5tVU6iW3axcW0y5HyWYZrU8oPWZ11rNwviDMOFvlJfC5SraT264FbIGP4qXhNW3QI5cBAQiULYAwIWO+pjFrT+UrrIrHZI59BfpBExA+AGAXhsLEV6HXVCYahNzeS6enusb0KGj4zHIGSsNgDi8KEIKhoLWvDKN2WDh6jXOiUkOzw18UJQAfLkyW2htmSednks2Y0PlCmuAflmQezWrRaTlS612x2QHijGWoh9aDihFxNNs73Ck9n6Q722Inov6wvTQi3DpMcsjUQvd4+wnwGV5Kp3JgMTX+gqjIGRXlWcZbYQPIBi9EdrZOx0yMLBxrS9O21U6wdE0pXVKJrxfNvprEqrZTs2FLmCdhkkfaEGSmsY9dHCODyN9g/AtviZRicUTzzxuk/kWsFEc1aJR5zO5vy7QxtkNRNPax2oSJMJYxcz8b23/8UBcG 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: LIg/uQLUtEsQmWItXVqxiCjE/HZbRTndHGrxJf+iQkPHdb6xuaoRvNICOXHpUIIp0osRE+Lpa1+EPzKnYlcEnMkcbtvcEY8H7FJu4qWivbKlL2MMYMV8bVCkhB5XeqHITXP2p7+ICTzIzxC81WvXtEqTrWNUxwBo+j1waDUB4Vg5p6+mGwnEkiZDiCcd8i3TXfEglgokqO/PniQxIAstbw1px3N+DA+Tzj0aQ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VhUMyl+VUHONeY9wUDh2V2sklrNrWAQHBIC6STtmPqsHoRcGjBiH9dKhDNjqRPdBPbXKx/lucSg8oUzLnIoE8zougPzxytscHEWswmc4y1fjTezdBLB9DhOz/7gIW+zTenRktV06xHLhuD4qp02gDPIA1RbWm73QwHhdb0fY4xr/s4TRcAF7grXqo2ZHmfMpoMNAVV8z6IFWgpwBj3mpoUKjasGO12zRgJ1eAmpoO2w5MsfBfYMpDbHN5YVNXJUFn48lMH0UCB1Lp9lyiSOhxrymI8JqDpKgJ7qwO6nRFou7eHAaYxVeY9xGrNOXsjrBepoIFn4z7zOVRgEM3oDq70vg= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: bSKb+f8WdJN5s5kXb85jfPsOKNg3wHGKnpEQeXY86vJPSR55PVf+LPfh1HpV72pPpLVwIJAI+QXfP+8BcpsXKM1Bc/eTlfqYC4Uww3tMPPcPSzfspW3vF8f6WXgGG9F+ST/5YRJs7J5iuKUqhOffCxF6J5ATDezhIUJ2fxEO1jtrXicpmqbdAEtJ8Ltnka342ladJGSAchD1FoG5kcdbHN0hfAH/+rNS8n9ULCfPEp/0Og9Uruzhvena2FOnH+RM1+Nj5P7q584r0tJktJig95Yac7LMS5JnNiWXofUpOT1DJaHZY+TstUatHHX6F6nD1ewe9b8UWwL7hryOkdemOGY8z+sFTpHBZyS2nB1o71BWZorHpJzch8KflPW+zApnzxM7rrE7Bb+gtMWxd2XYius8MBGg9vQEj/7t7fbIUmsK4qM5j/gf6RV8TuaKPmCh32QD3MKyFnxjBdZMaKQWCLxT7FBb6554FtjG1VeaFVaCJ2J23tHfPy2/eGk9BYjykIO0KVDCdTzcAwgLmGzVlrZY+DeV/4j4Qy7EhG9ucPgAHdzs0wqbLLNuir6KkJjoYmY/Fn3Zo6sQ/QxTb0OpMIoMYj1gEj8UOrpLNtFpJ7Q= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 93d3113e-246c-4ebd-3752-08dc84bda21d X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:41:58.4517 (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: 2e/tUSeSe91+pI5CP5Uk9gX109exqPNIg3EjDQOlALS5TNGXhwBQUBWr0/PvHl7FoDsKqs5N0Ffkg/DowowSAPZ26CxJSPh6MRSrtaoXqMo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7269 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 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-2406040142 X-Proofpoint-ORIG-GUID: shO83HU9eRyOQbTsTHd4u37qy0g0M-R7 X-Proofpoint-GUID: shO83HU9eRyOQbTsTHd4u37qy0g0M-R7 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 9288418000E X-Stat-Signature: xq9i17dqgbs69szizoe9uatzdze851yx X-HE-Tag: 1717522936-370684 X-HE-Meta: U2FsdGVkX19/1JV9B3n/IyxKfNZG6dwDLCwkrDPfVf2yGf67GhJxYgmY+g5wePYwFRsaKmNlWmEM3z5cZa1xGxoiSWASrKI2WdC/dIebcHbPYpZCH+AiUEodzTOT0elWVV4vCUtmmakEUHo0Bm9t6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QhCQFNU+FVg40HLzm8ngtYUSaESKy8CSfCKq+/0cnfDUI+yEI0iPD6/5bdcY9TunWnFP/QqCzZviiXJ9kK1NfxiSi7zligDVz67xu+/hdQEpMaanmGOw1KQmM0fiH/5V2SbdLsE5Hh+BLZ6aZG+1opNwvAl/aFCyyHXKbRvx87BUw9pRquuRlT8f6cyfYfsEwo4juQhKavenqBAHB0+3YeVv+hXQeMc/ctbFwddCHf+V/WKEulACFQ== 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 Tue Jun 4 17:41:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13685725 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 EF859C25B78 for ; Tue, 4 Jun 2024 17:42:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6F9DD6B009A; Tue, 4 Jun 2024 13:42:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 650246B009B; Tue, 4 Jun 2024 13:42:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 42CF76B009C; Tue, 4 Jun 2024 13:42:20 -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 258D46B0099 for ; Tue, 4 Jun 2024 13:42:20 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id A5130140D99 for ; Tue, 4 Jun 2024 17:42:19 +0000 (UTC) X-FDA: 82193925198.15.823ADEE Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf22.hostedemail.com (Postfix) with ESMTP id 3CE42C001A for ; Tue, 4 Jun 2024 17:42:16 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=VRHgwHDU; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=XakMCM3A; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf22.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=1717522936; 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=IFa12ztC6344mQoKk7BmgG7Jc7jYdExwlXq1ZppxlRg=; b=ktSsIytuXF48tyJCv8fkLrtr8G9gVkcTAPVHb9FNzuC8KRl58OgVUHIm/0piR57V+9L/X3 8K9q2Wr+JmcaxsrqQpk66HDB2p56k2kLBOtoliCayHdPwX3aW20f0quERZm5l+clRf76kx wCmTw1c2dyWkjD57uZoRtRqaA6SD7vQ= ARC-Authentication-Results: i=2; imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=VRHgwHDU; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=XakMCM3A; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf22.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=1717522936; a=rsa-sha256; cv=pass; b=vX4ZNaAuJNYS3TXFdETNXVbzBgANud0tJ/+U9MDpL/zRAOW5Iqw2OP0KEZKk0NhjgPTLOR wJ0HGcOyqh7/v45jJtys3pjUiv9Yh6y9WorUfFTbC70hEdndunoPCDR7iZ3sA8HS+7yH08 u1pjbdllIPklDLzqTsCIIPQLcPAU9mg= 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 454BoOW2000986; Tue, 4 Jun 2024 17:42:04 GMT DKIM-Signature: =?utf-8?q?v=3D1=3B_a=3Drsa-sha256=3B_c=3Drelaxed/relaxed=3B_?= =?utf-8?q?d=3Doracle=2Ecom=3B_h=3Dcc=3Acontent-transfer-encoding=3Acontent-?= =?utf-8?q?type=3Adate=3Afrom=3Ain-reply-to=3Amessage-id=3Amime-version=3Are?= =?utf-8?q?ferences=3Asubject=3Ato=3B_s=3Dcorp-2023-11-20=3B_bh=3DIFa12ztC63?= =?utf-8?q?44mQoKk7BmgG7Jc7jYdExwlXq1ZppxlRg=3D=3B_b=3DVRHgwHDUnOlAdjcyamNN7?= =?utf-8?q?L4J37enDUziA0fG6GG9MHExQ5Y+GXnBKfCV306dLVDxUcTd_KZwcMYqUUBwudfAzm?= =?utf-8?q?SWmVkC4FLXvMIam4wINlNqEdu9Xsg7BrS9/J4XCd9Okrh/aX4Wg_9coEiXr2p97Fb?= =?utf-8?q?Fu4JIHYE4tuQGjKdBRzCEpqNY2VP+EzVSim/3istU1abApznMkPuYTc_ewhZwaqwn?= =?utf-8?q?5DFYZvYrPZTDJ4GXv1xJAMOYnEPIXHoWEYWHf9H1y2YoQ9iCGPUyU4M9Amn_JxOXo?= =?utf-8?q?t1m2sa4d3CzORoMjlvv7hKR/j5pIxeb05RiVMjbmxbsAV/s4h4YILp2bKgzreXi_D?= =?utf-8?q?g=3D=3D_?= Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfv6u5jg8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:04 +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 454HL73e016288; Tue, 4 Jun 2024 17:42:03 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2048.outbound.protection.outlook.com [104.47.55.48]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrsaf2s6-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bkNDAv1AlDySpzbUPJZs6BXFzH04AuO6GiTScyYhJovGCIWFcHRAOadzAbg5+EhAIBWur0/tTLgp7fWt0NT2lFg4LXy1gKeRHQzgGmLevoQg3/4q1ymjAeRMGDo8teWl54M945LI/xrUiiXMHhpzy+Us6qQPAAdxG7crXohnm6yXADAeU59OlK7NIEflWIFQ0xvDSaJO+28QiY5dTvMQCTgEQT/B+AITUXwpJeb0hwM7WlSTkfLFUR/IF5Nb/3BjK7F2+pPHgOGtuPQo3CKsHRyMCwr2qzW5erpeqt8jvTWzu5uAllb9hJK7ivLGJDnQ4cRKmEVSIpa/k3SCRH+XYw== 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=IFa12ztC6344mQoKk7BmgG7Jc7jYdExwlXq1ZppxlRg=; b=KArCMdJ9k1kT3mHnrVm3k21H0Q8xrkLybCYA57Z+JzkLMriwLUf9qw36Z7SoUagkWJT9+kwy++OXNDnC01UxuWXnLz3B6XLQKr0pjp1x8m/l+UIw4n7ImAxSvKFpwuOCba5FuGBZNhaiDIKXVknYhQX0fSpgKmfBZyGZ4c6u7at2RAUJXrETPgwQ4Fv+CPksrrOmpAY+6uUg9tKSA+OEnZMUTVoeXvm/qD8oGF35HbkIJ1aZokeUemHQF6hEjqlJUIPV2nuViBPNwz2S97VTe4O7KOapgfiq7TSf5tJl64zfuQRpQYavg2uWrVUlULcPF2Bs621bXlquPw/o3TQFOw== 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=IFa12ztC6344mQoKk7BmgG7Jc7jYdExwlXq1ZppxlRg=; b=XakMCM3AfyljSSwFBE8EYUmgdHdX51t0FwxKu3GenjdAh56c1Gt1AUBY6fw4yan7IUhA7wH9w1V67dro7M1e3kDIAi7+8HlltCNoUZiGMzUxyMox+0mKC+ihRqaTA7I6pmg0CR1dF13FyntH2VDrPLgG3vtGP4rYbZutiPyc/tw= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by DS0PR10MB7269.namprd10.prod.outlook.com (2603:10b6:8:f3::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Tue, 4 Jun 2024 17:42:00 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7633.021; Tue, 4 Jun 2024 17:42:00 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, zhangpeng.00@bytedance.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 03/18] maple_tree: move up mas_wr_store_setup() and mas_wr_prealloc_setup() Date: Tue, 4 Jun 2024 10:41:30 -0700 Message-ID: <20240604174145.563900-4-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604174145.563900-1-sidhartha.kumar@oracle.com> References: <20240604174145.563900-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR05CA0088.namprd05.prod.outlook.com (2603:10b6:a03:e0::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_|DS0PR10MB7269:EE_ X-MS-Office365-Filtering-Correlation-Id: 189ec041-9209-413c-0d4f-08dc84bda311 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: SPo9OZeyy2vibTrfnc1UJWiXBAXKYOOv6WP88bNYi1XrPY7HyoKT+2tdrmwD/sddj09/sV77EvvqRSk90OgqAz+KO3elfxedluSZHY+SJjF35LIeuKALlXdT86iNCnyULQgDvizej+nBJsDTEDH1/A6dX0rmWmnHRgSYyMnMTuW5zSrvoeFvm6zN/Gzaa4S2AXo1ALSbx+D8wyqAvKRHTxYXTA47K8/0EtIbWayHFE3vSD50TXQAjrQ+SAmo/8C8sp8RLX39BFA1iaMT0fKxQVLNvd2KeY5niQCaEVdwy/pLHUhalON2WolT/FkvvXuhUqmylZsscFa0zwM6fHEQ8BaCFrbl8qCpEJnUDGsnY2GN2HP9fHgWokyGx9/3+RJe1gKpjZ5mNm29Sve5hnofkvAlSeCYo5uvNPE7bqJ7Z4AaMGAf7f2sR3/HPnsafbUWIdBaW/K0C9OBhI2Vc47BNKM6cdxXqD70Qppdmiy97L+PF6Vp6wY945qGXqxmFbZwE/bj8c6HL46oFRdjYKxgJMUG4JL0CsrE4epQsMedujCfiod7T2V49beufJMc8owDpcDJvSTl8uI6afNP9k0Q++a3Rz0JPFmg0G93gbje6H7igsQFy0ESZm3pUj5W8EOsMLx1e8iIz/h0DQuV5neQyu3+6fyZ4Wm6ONcbhikwPTiHLvnQr3mGESqoAds6xq1/pj0Qualvz6rAsJN5O0UIyuLI3NdglPoLcyadxsVDayxpTghlhbBZ+rWNygWMzCFiK1lkAyWV+otyehHmCoPHsK2+Q2NEqOim1ZeN8mx3weIHHf9Xaq0SYnwACmOpLxxOyPWFmr5IyvKl+Ow3a6+APWvAbZzshRKd0+NlRCkiyGwMD75pkquKOb20FxQRMD9DEmpo2YeIB74Jn94cm4mJYDX1NJQG8VguA1A/xgPaSyk4OXvGLf+SWt5XEzHrVHtdy43+XzHG346BsXc/3okiu54wKxf/FOCF+rgQ8BlBHIJtY5sZVFX7Vu8hc4MQLBXJXnqT/txhXSRX895pGTv4PWWWBu29FZSIQYnIfgOLMBM/JkA+bIddvGzgWKmOPglCJW97MIlIQgKCKOiJVbhZCPyRqfDBDpOpLQRnUftz/gv74qKT3rWaX48s1lEISzs1bO0URQZ03AvsU693axe3dUVVhqyV3RBeFm2uWNCvn2ql/YgS6u5v/aiQqO7kmu1710fk7e9ZP7G+FQOFHuk+a3CnQzTeGDVKOiqsYjipwDvKUtmV0xwMFvCmlN2KKjDtaskmzvna5SD5mau4fn9eXe4fyXkn1w5JSAS5HOSXYpo= 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: +R+Scbix0Vxmi1exU3+pZKvVrsInYeb7iDfLg7qIMIkGsLwySm/7eyGmZJHiGAOGKmiAW9yqfDy2eO9gJqz3dqGkjGZy0qT0oKTYX15yPrwQXgA6oK/wFNJV9bYIz/n1/vVqDJYhhmtxsgnS6VbCZV3Ma9xKcbCPzmxXgbN7HgzXqiLS+3/V+++wXod/oX2RYY6LjZShDAsimqhjd8TX53oFOCCvcQc50KgnvK8JnPeBsADJCz0/pWx8cnMKr4bRF4XxQUqjwcBXVCnw/6zqqNFPYZmQX6HxxZOQJtq/huV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ktkJ+yibU0KF4WxyeyXpfmWpf+uMpW8z42zEh7G11dMM/zbMETSWGKTtgwFNxiv+OEHOeUQKwyxSp6odaB+j85Ta7BUpVuNAlwrdNmuny8QdnOluOn+tRXfswL2lY/RJAdOBihAAxL0waKGNbI5aBVkpU62S3TgJHbjarcGZBZdfky+b57mMQagr6K9PgrFjQkaAxsEgHMgl49t5J6/4SkFAg0tZYjk0azI1DU3Jy1Mq6qWP8h+GrMAOwJD0iBzuckBnd15HjPnuFM= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: IF6zp7jFyF3ex5Kipyg8YGJ911Zm6xn2UjNYWoUNWQB8pw/yu+9tUvvEPulddz9XTWrGVjzO08LbDchaa2lfso2N8icmedSD5G68tZEtzebpqj2HW2rE+FJxYUxzktQb+enefU32EL0iWBd5hG48f9+XNkNzKEmhLVTbUTY8eqHyh3MUiatCHt44e9QuO7ZJj0QLN5Vu0trFHlp1n1mmJtNRx3x4HJIXtFt5+LTQ+l6DZAapzMe3ta+Buixl2v4CPQPVqsb6NrKrnZ6ZiNO+33RatokRuY20KBYYySG5whbCDpt7KqzNMvT34l8rjXp7ulPuiJdOy218WMcggaTgz6EMosqHW/oZYAS/QrAQ3FD5mGscr6YqaPOKk3FGOaDHFIteUHGBGMZULYVKqCJ0GukJ15Kn6rl8t6BSX1BxVWHXP0C4LYe3tcovnmovMQpuCW+PjxA0geyTTkfAa/vix8sClUg2zdeCcjFxgsJq9ZGP1NirRugfrVbXy2F4RSkFsJ8i3mlxd0zsAnMp8xiyL91azNWzihIdPFrYV/ZtWolLFgCokShRAfKG/gsbt9poFbjgyQ9c9bd10cKp6Got2hRkTMLhRLjoTywzccE6re0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 189ec041-9209-413c-0d4f-08dc84bda311 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:42:00.1196 (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: od+GEj1D5yWLvI6cJ+bapcnSEOF/IM2uYF68lF2q1zsLWYThhsar5MQ7ix0NpZ7YXqeg2yQA4sRT3vKe/azmBQWJyvVsdSsqSaTa+Ma88P8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7269 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 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-2406040142 X-Proofpoint-ORIG-GUID: imfhJuZMVcmblS4F39nelFij2xIZ3W1T X-Proofpoint-GUID: imfhJuZMVcmblS4F39nelFij2xIZ3W1T X-Stat-Signature: 3enkmk67g6wzrnwqzbwrmx9nsmo5pw6f X-Rspamd-Queue-Id: 3CE42C001A X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1717522936-645599 X-HE-Meta: U2FsdGVkX18A+ifkNsLsH4xjh8z7Da1QnYsP2vs96sTos7UWfsFTXlWOIn5GRTqz6OulcZ+nC54KvR1m7dC6gJU9VNW3dHm5hW87T+RMKr3Zi0jYiOoPRnd8YGFg1nMWaRGkuWds5dAGCOHQnhDaoCWdGUJKwL5IEAnQuhQ6iv3ZG8J0fJO+OApn3u4EQzqCoSvZpN558yH6D4hyyLhjRU5hqAto6biOr+0aRZgV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hrDgadGGJZiJnZ1+4KY0aXUyUTDwFJIk1nzpUuhV2gIIZm3UVBv0a1qfOr4DQva9YVati7N3nRALaWIHT7/GYjFJQNrjTfBZRhwUVDbVyY7uVxw+9By9dYjIrCoTIM5eKktKjiyUNvOUQw== 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 Tue Jun 4 17:41:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13685729 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 7F3D9C27C52 for ; Tue, 4 Jun 2024 17:42:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8EC3A6B009C; Tue, 4 Jun 2024 13:42:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8C0BC6B009D; Tue, 4 Jun 2024 13:42:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6512B6B009F; Tue, 4 Jun 2024 13:42: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 41DC26B009C for ; Tue, 4 Jun 2024 13:42:21 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id F0521140581 for ; Tue, 4 Jun 2024 17:42:20 +0000 (UTC) X-FDA: 82193925240.30.52C2E77 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf21.hostedemail.com (Postfix) with ESMTP id A8C361C0002 for ; Tue, 4 Jun 2024 17:42:17 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="K9iVMb7/"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=IO0Y+gKx; dmarc=pass (policy=quarantine) header.from=oracle.com; spf=pass (imf21.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=1717522937; 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=sxrYTRYvoigB/XkLSP2+ypvpJsb1vcDv+m8BGSQSO4g=; b=zWFsOy3wv84s3Ni1mA8xczhp2YfGA2kpyUDcS588VJQ/FPx+r1od6s9M2jbvzwOihxCoAO OXWsejUjzG4xwcOaKtMIQ0BjIHpKo4lzjdccuHRKSxAsWVWL2N1b+5yMAbXVL748+qn8cS 6uJ1H2fpa8z/kP50PLFei2TxV5LNNtc= ARC-Authentication-Results: i=2; imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="K9iVMb7/"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=IO0Y+gKx; dmarc=pass (policy=quarantine) header.from=oracle.com; spf=pass (imf21.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=1717522937; a=rsa-sha256; cv=pass; b=DlLBsih9ywuu+MY+ubDbXSJFF2zG9+R7LhXb+I/K866djocvyfGB83eg7u82dWJlIQAJZ5 QrDlEE7T/5aG8BGNkD4Jna1lEbDXYfB/PnvWp8dP0ROfvV1m4yXWNTkaGdr1Y+eHrVT21X HFnA3Vobc5OfgabGj/6gL+BziTVnZzA= Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 454BmnYg004596; Tue, 4 Jun 2024 17:42:06 GMT DKIM-Signature: =?utf-8?q?v=3D1=3B_a=3Drsa-sha256=3B_c=3Drelaxed/relaxed=3B_?= =?utf-8?q?d=3Doracle=2Ecom=3B_h=3Dcc=3Acontent-transfer-encoding=3Acontent-?= =?utf-8?q?type=3Adate=3Afrom=3Ain-reply-to=3Amessage-id=3Amime-version=3Are?= =?utf-8?q?ferences=3Asubject=3Ato=3B_s=3Dcorp-2023-11-20=3B_bh=3DsxrYTRYvoi?= =?utf-8?q?gB/XkLSP2+ypvpJsb1vcDv+m8BGSQSO4g=3D=3B_b=3DK9iVMb7/8bsugmfZETKm0?= =?utf-8?q?cbXrbUuvJp9IaJYFs6qrddoucnDb1PtrhJ9Kwb583j6o67r_OIgakkIqNr6etshfV?= =?utf-8?q?RorFV1Mv2YOAleZPYfRW3vENA4vTTwCLndXyFOZ+Gn57ANyqKt1_I6uhsuaiUwhhL?= =?utf-8?q?G7+eVgZMEFro5Z8K+fJ6kj8XzBaMk+T8g5K18BpKZN3IC0oBfYaTt0J_YlLXlGXSy?= =?utf-8?q?k3NEgtm4bEd/itYGHA3coyMjLixKYA1+B7YXYjga6+t9I/zAx3R4H8ZOClS_GObyC?= =?utf-8?q?RAc//IMQ2Y7rwCJB7ENISba0d6CMIA/KsU0zj7rF2LOYc4rtkgirQLisYYCWdPS_C?= =?utf-8?q?w=3D=3D_?= Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfv05dm6x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:05 +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 454HZSFH020575; Tue, 4 Jun 2024 17:42:04 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2040.outbound.protection.outlook.com [104.47.55.40]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrj2bm4e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TIntDJ9AefBFwnVgkwPCeyeF85kBcEGH9s5nsgtKEKf/EJ8oyXe4znbVcq+113iePsEsnxQtKAtqEwJb+KivTDC8EIPimb46svE3v9cgY7L0EEek9avuuXayEAusOgyB5XLEBoIqeh4aQrapZD0lEnFYLmiVz6YaoifJrIrPk4Sug1IpTMmXT6LZKeRFXd3oiNaXKNSkmXhjjjSuBRFCJTnrFQaxK9/i1KO9jXdLysbIfBk1N7dsDkL0NMZAHXk2357nMr3L+r7TaH2DS8Gsq3SENkoIfBF9KJ91adfRGUC0A/S3q3FBMr1Z1Z9EkeXRz6uJ173sUql5athJC8q19Q== 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=sxrYTRYvoigB/XkLSP2+ypvpJsb1vcDv+m8BGSQSO4g=; b=XOAvCgeBw1Xvzv4S8Ed9PGHllPJ6OQB0BGJh7WmutkjsAwcVaE3gl/bkfjagKdyXfhat+5O2jlJEAhomh6g1IxVCPOnDOhFyJFZaKSlIU+LtBfd6Crf6FuMg878HNmctLZNR5eAVxdFo8zRDuk/E1F5arhFDdB923X/ebfx1hixZPwuOIg1gieSbu7xlCaEE3HpaEGL4YvQ7CTfDjPOYq5jJQH58kXfM2kEbaUqNv4I4y1Yj4BQNAQJL65bTHiNd9afsmQy0qy4sjX9gFy9dKdMUZ2FPtCEksdmqnh7oGTTGhH6lXT4fWT0V49sAbrts7Q0uW5yeR8qr1SInnKfhCA== 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=sxrYTRYvoigB/XkLSP2+ypvpJsb1vcDv+m8BGSQSO4g=; b=IO0Y+gKxTgSPwS2pbDvR0b5IXXKxHkAvdypkUy4iddaVkFvYqK5+uyv/JwNQy6VhRChf3Nqr2xJiC21JsvBVHQe6nQg5cdZjqiIFoHxJ78IsidI615QTaFO6IrHzR5AA3ozOmsQNu/KQKqCWKI3ZTtQoLdzwDTVcRNt5SegQRMw= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by DS0PR10MB7269.namprd10.prod.outlook.com (2603:10b6:8:f3::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Tue, 4 Jun 2024 17:42:02 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7633.021; Tue, 4 Jun 2024 17:42:02 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, zhangpeng.00@bytedance.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 04/18] maple_tree: introduce mas_wr_store_type() Date: Tue, 4 Jun 2024 10:41:31 -0700 Message-ID: <20240604174145.563900-5-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604174145.563900-1-sidhartha.kumar@oracle.com> References: <20240604174145.563900-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR01CA0027.prod.exchangelabs.com (2603:10b6:a02:80::40) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|DS0PR10MB7269:EE_ X-MS-Office365-Filtering-Correlation-Id: fc28ba54-eeee-4838-f824-08dc84bda424 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: 8rfWh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9P8WKrpopniZDV/IbKqABoM5TigP76xyUudjTkQrx8wc2y0qqiVOGt0EGmJkTRr4GSAoA44LCeob1bCZn845mW4fQVIPHGoYdE/1DIr5Qk6GnSlRzzBIAj5s6Ym4JqxBqWLgUmYrTVoG3sGRr48YrUqVAe0Kvuu6d+4aDBglGd7WWbcTd7FAsSejCNOhbtmCNcRVq3JVScO1j1Zs0mn6paQsCdkNF1BjEiavrtInnAxcYuazoEXSrra7aVRB9sS+5O0F78n9LiB 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: whU6QgvMljXOxjbgFfOqml0HuJoJYuYJEIRS7kh/K0lIm8lz58JLu6A0eUwtnfFSH1COsDBfhKvsnIJPCQTYTljKZxwdCYTajV12FjCK8CKkUAL9Yrtx0IShdbui9UKE6sU3jdFnGqAaZpswLsbxcfOQqkxUD5MIaFmYuAIFT923/nq7V5UN4wZhOUCltXDzh0UveWgIjhTUBbgLakq9uJFDCigD71JrIecS1KHpOSQuuMQvc9VZTiEXxL27jW1jkzq58boyiHR+Ee4U1r0b7oqAfOucU9flIIt3kbhjPQ+uppXobh4n9uy+sGqxtCiJVoSRd0GirOmKtF5yysssV4VqOaDH1tX/VgG3emTOhDxK7ED9N1UbUrHEGaY6bJgg5gRG6I+xH1jhXlknqleZvKQGXdDQHah1c17++rg+f9LCup42HrCCbyJW5cDoua3qn+C+K5BOZMQ73kF5kJ8M6LJteRHgVeLkg0iu1Cb7wEa9gl3de8cbkSEM/POWsAEFObkMYxLhqPYdGMIwSuksO3OkkM5SHHV4JDYBDCTNG+rIA+rwju0ve7B4wqLXfuZcuN9iUR7NJ33sCeKr7JJnCdSti5cD42YyZPkrNu2SVDx5TiojLFwKlxdMaMjYfEwiz4RBjMrySYKwIfgcn3X3by1MNTFWs7BaMRnhir9OA+W4ypXP5U3pCJapTpQEZ2kXgI2hgbVLzKPPMHhnqz0OAiBys/c3f5lIORs4L0EMjUS7repYhY6hcRdpM4Mpov8th9WCXSCAVFF5ajVADiLERNTRWO84L/Mqi3zb8zRoLcGBoS7aQKJ40DZ+dj2/zIxXLpz6U0K0XB2kB6x6EbTynDfmjQA9PNGHlLsSGpvL8Ov83K3kiBrb/eTwNWRTLxMphNgug8DB7c/fPTXlA6i3eo1KQDKZbF6oihc9MXhxZPQudqljrkUd0f2C62YhHUG4ueL+e/wow4eDZBX0HOoM9ApkJEiDB8bBUXJ3EWLcg4/faBtqw94HiyQJeFSw7VN/pVE7ae7jccalcuOgVlY3qNjiS/zeEIW/MRo96biegPDNyrkuYSSqMG0Uqa8bx4tNiYDRAmjW1PIH537wJEh+MJAjnfwR2STIOi0eFJzodwlne8/443DfmoPuGc7RU1VKQMz+iASxMjRwaiJxGUtHQxRkM0YptvTU84qBLU0/ikqa4JFyemNakByAwkVEfyWYT96jsnCFBta3FcNaST5fPLacSxn7oQ3RHh84vbQxXRxY2sUb6ZdzxipyTNraJbqKe4v+EulQ0rSWmCLutjECyTuP+23epCOwy9oHGvB7pUh/oOWtubydmBFoZiHu+oqOwGilAEngeG/siT8plaeUSyrHqnnHOy2iiNNUx0KxYjksVVuY2WNtjJpgZt/X84rFlULYjUluKFnLzWdB8RWDVOpRxqE5YfFgWtym/fhkzjpo3KytxEI5+HFQFknAudGTTLb07iPja+OPq/Co1q3HSzXeiyfM3hqlw677qaqtHTB2jaTSh+BwLtVKINR/pb/IL4HOyj8edVFwD5La6SckFTJnnlmuBQ+L2d0DNfi8JlbxdY3cbT9InPGLtAgC/fNW1GptMqX1shiUZ6vC6v1/7nruF9WkHBxgN1g2A8fEEnw= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: PKmCBa6bXhPzIPNaYpJjYkhN1I+eGNpEFbECtU26nZ2VG9FX4HyYtRKsKKaEvBxvwuWuQB01qc7xqyvXDZwPfa7f91YfhhF9kO7ivKxi6ZUqdjb1xZmkAShn73jmHdWwJ4Fog4nedl3mgydgZlGH+TUuGjo6GdK1xiX+QCSHeH4POMGC4tEa5KQqYievM7moV4IsFii2HNQNamGNhD0+t0rIdWoSUJcpOu3RqsSFkHhQo837ab0WGX8HQLP2R++vCsf9WaGR3EHv180HSykPLGpCO/lOQlgB37OnVMJC2/KvwnU2krcgv0jecAKGj+qs96YCl1v69g2WLYGGJm9voNACgKsNx2wIMksjV8JI9J4rTR3I9sozTYlHQxTaIJ+EUMNOiWOx5CcdOGjFAra1YdAP4EIWBlLW3D49uFp5/5RqNztOXvkNIybxAOZ+BJiyhULmBCezx8H9L4rmsB5Z8Q4fxnxBNc1IEq9czB2EDJMXKJaws8LD1F4k93ofqV2t97yk3zcLDAa33p894bT2wYMirrcfoIlKb+xtiMNvTu5BbhWfaf7IhDQPiMSv3z86uucw9lvEvOsqgrYV7Mc4+55lE3G6294Us0HrIFZEspA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc28ba54-eeee-4838-f824-08dc84bda424 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:42:01.9247 (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: AnFpy5mhFD1h2bdkdlSEsFVGh+g9qCQSrklkNjo5PAOUUZ8VvaqXIhcEbVP6/vZQJxshVOEUtBUL/cxkHXCJBdAHRZtBFF2fjOEhhFptZ18= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7269 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 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-2406040142 X-Proofpoint-GUID: Jgkfsp6eopO60sV-NnsTncDGs413UkCW X-Proofpoint-ORIG-GUID: Jgkfsp6eopO60sV-NnsTncDGs413UkCW X-Rspamd-Queue-Id: A8C361C0002 X-Stat-Signature: eo54eriiirz59a5t39bnd8r3iyeriwx9 X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1717522937-503429 X-HE-Meta: U2FsdGVkX18MW18DxR391tS3K+kyibciEqnPGQi2PEfcUJlwAlyWrN2oa7FhpI0huqEYyt1877QS/SYk+nrAUyhYoexZOVtLNK59stBVKYU68RGkoD4sMgu7tGXGj18M885kH+dZYQraXZFA652LJy/7W6wWWiv74+xC0IY2GJy8ML8SrUsTe+yEfafuvrs8qE97Oxu+pYnK8HvebEwfC6AMGZOPVLVxIxlatpJz05J5YrDunj7nUGcA7/fNWW/PIGl8P7ZH2EBBbFco2coc/wfujxOy0HfxrGa6uGpgJyOBIS/7rh+HWmxO65IgqzKtpsH3MlNSaNWDp7BB2oOILtK8uF/TsjOi1Wml/FLaT6pfSKmTBO/TtBUWjgqg+TwNzs/69Dad2E9QFByfxh92gBw/MOIDHCio6FgBy5DMPggQU70t08YOYyYBMedDjMYXV36Z5ev1/oIS3xPtRxlbULJcKigPy/fNw8er3K2fAuwmU+Fjo0wAOfQSjNUJ1gr8oCyFDulGJnX1ZD0IOz/MSIJL/kUp5d6gEntW31M+osHD/Imfr/XQshW7AintG9O+YQuDPAPsREbxCDyCrLms3MAAhcryo9YvNm/1gzUQ++NE72zl8sFuU4AmZERXJ7LeoXubGo6VUnAPLqSKTSmse1d/oZ5X02xFthwe2/H3N6JwcUNQjTsMHoTSzrUI74M6s8dwgLIbzu8bZDX1/jk6JxdNmNZv+eJBuFhjjlZ8uv69JPXToqode9Of/q/RmAuHue/RugiHUSDwN3/SBGST14xKkWeMSAa5Bw0D+ZW47TbkUFazQaM2vCqFwbekXDi2+7nQt2iQmrRoM4t/UC9f1+/fQzjql6tP7eM5ZwChQP8cuDxdUw5gipX7tFR1ZvwZjUiyJe4cuhvZ8VbEw0QG0RW12/sxv/2TV2lVNMfMGXeaPHe1hxJ1suAZGy0mPS7UIzejzY+B7xJ9Ejib6w4 +omqrH1w gMhLGhR8MmR5+LWClkAzcVfvc52vZfxS0MeEv/ZSjc9PLc9+iwuTXiUVsf7MsDk8Sb6obT90fYVs52elvjHWhC8SvRmJ9WWoCRktbzUDKBIhu8oC42rKKIfqc4vLBuu+B8/iiYFxycVevT+MaBsFRKA13xLNEAG/KbA7cByhGEDr9BnXz+mVwZyuPcwdv/6M6pcRbHxJO6Htcxi90OvLfoSmgh8WWgiH33qmldAqRxWEnqjYcuVmiyq0oL88KCfEvuh7oHuhqIItI+T1kU5D80+pgx49DE4irSdg08552Ps7d1z0sqagr3Gy8tO8MU1UjLKgHH5ko7uNeZqbj/sksGq2s0DiQGN/qW111180OcNdJDDs/ERFiew+pxJWFPsmPTOVJboJPZnIpyJHoHM8+PsaJo8xgHSqAd2+dsBbqDqWK2LO5iwfuwlOJM1srORsgb6OhYQXFkajD4SZjo04/Q7JPrYArQACLtAe7EsRKBoHebbYmiD0UsZCoraMIhQqyxqKg 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. Also, add a test case to validate the ordering for store type checks is correct. This test models a vma expanding and then shrinking which is part of the boot process. mas_wr_preallocate() is introduced as a wrapper function to set the store type and preallcoate enough nodes. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 210 ++++++++++++++++++++++--------- tools/testing/radix-tree/maple.c | 35 ++++++ 2 files changed, 186 insertions(+), 59 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 2558d15bb748..b37fa8690558 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4278,6 +4278,150 @@ 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. + * + * 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 +5650,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); diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index f1caf4bcf937..c57979de1576 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -36223,6 +36223,37 @@ 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); + + /* 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); + + return 0; +} + + void farmer_tests(void) { struct maple_node *node; @@ -36230,6 +36261,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 Tue Jun 4 17:41:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13685733 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 E81E6C27C52 for ; Tue, 4 Jun 2024 17:42:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C216E6B00A4; Tue, 4 Jun 2024 13:42:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BCDBD6B00A5; Tue, 4 Jun 2024 13:42:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9D3296B00A6; Tue, 4 Jun 2024 13:42:30 -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 7A9336B00A4 for ; Tue, 4 Jun 2024 13:42:30 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 42B1D1A0FBC for ; Tue, 4 Jun 2024 17:42:30 +0000 (UTC) X-FDA: 82193925660.23.B26DBA2 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf16.hostedemail.com (Postfix) with ESMTP id C7EEB180006 for ; Tue, 4 Jun 2024 17:42:26 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=h4l5Ltgf; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ax6mLaWg; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf16.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=1717522947; 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=hpxPtaHCdDpGoM+1JKTkz/eDuE9n6lt2SUfsNJBwVt4=; b=mI+uguIGNRuuimYY2FaKUYEC9vcCIOxt/0Qa0QpBNX+hJaLzkRzvGhh8xjNJkp1eWpiV+u cCZHxKQyol5j5HMn2YRuugVPKRjHl1UdWpn891hun7MB54DcgkTtc/gxhf5s7Y8mPb5Ym1 HtukgV2bNIsQWdnO+Gc9JY7b/4L634U= ARC-Authentication-Results: i=2; imf16.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=h4l5Ltgf; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ax6mLaWg; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf16.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=1717522947; a=rsa-sha256; cv=pass; b=ZT2pN7Xr/Jb0QQsikA5bIozkdeWnxuFReWGQUqgVT3tsEw7cMaKjP5/PU6xQ30Oc/s10lh dsrqzuF7ygsxl/yp1U7gGGSsO708ZrMynrzpYW6iKHadS9q7u9Dj1Vk9tcyowaeHsIFqaZ LW0T2zNdwLH8JkKnkbDx9hty5vKeJBg= 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 454BnHAU028058; Tue, 4 Jun 2024 17:42:09 GMT DKIM-Signature: =?utf-8?q?v=3D1=3B_a=3Drsa-sha256=3B_c=3Drelaxed/relaxed=3B_?= =?utf-8?q?d=3Doracle=2Ecom=3B_h=3Dcc=3Acontent-transfer-encoding=3Acontent-?= =?utf-8?q?type=3Adate=3Afrom=3Ain-reply-to=3Amessage-id=3Amime-version=3Are?= =?utf-8?q?ferences=3Asubject=3Ato=3B_s=3Dcorp-2023-11-20=3B_bh=3DhpxPtaHCdD?= =?utf-8?q?pGoM+1JKTkz/eDuE9n6lt2SUfsNJBwVt4=3D=3B_b=3Dh4l5LtgfYZj5B5hLfTjcu?= =?utf-8?q?tms/80uCorByqv76kE93qFfsjTK4NLGfvcExmtfyS8LiAo/_qJrL+WY28iNVjIhRO?= =?utf-8?q?Eg0hqXXjUot13w9xkphB1SZtdYQKpI5RA8PXbFLOqZ/LRWSB0FZ_2XDsZuvIY2vzV?= =?utf-8?q?ArB69lra+A8VN9UPJIIK2U4/b6NjqrM+t1ColB5/wugUxZuoueVK+Bn_LtIzLem8d?= =?utf-8?q?kPbt1Sv54S8b9h+JVzVnLtW0wL23rZQqoTXpuAiHBE1DJhw7EYeMaMJMmIg_2a16T?= =?utf-8?q?/GmpRWXwTIZ+JiNq8E/9pC59jlfhTFQiVj1WWVY52Tc15V0yJVZfsGq4QvERyhr_M?= =?utf-8?q?Q=3D=3D_?= Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfv58dj9e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:08 +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 454HNoQi025242; Tue, 4 Jun 2024 17:42:07 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrt8xx21-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LknQQZaBI1mNucTss9YmFc0h4gqVrCZkL3TU/5TLSDe+0mD4t3R9k6sji9gNyYiMMo9lidG2m7Ny803saGZAZH7CKZP+IwosxmoFpVZ2y9sveGzkDxjb+7mM6zawcxpAu5AaMG6SP6V7IstOKTJ/OO1kqZxlv923NayxeMVyA21RQv/cOVjBehyFxQAEOEEhOVtPsZwqLsdbkv7HUwGzNcVUpK6fDWPz8rW1U5+T2IUQACsBulkaZTJQrg5YlulGEVmuvhV9VVjpGe5bTRPEkbmizSQmcVwy11MA7kITlagq1lM8byEJ7qUg7TDHB6c4S20DxQKqJCHffT6O5i+Rdg== 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=hpxPtaHCdDpGoM+1JKTkz/eDuE9n6lt2SUfsNJBwVt4=; b=kIDR02RlnWuvRgpZKE1IRoYsKt58YP+LRmNRuDnSnJP5Po/DMu1Y1wYdhgbiQsL6zw57YLTdEiyDWqrQAxwF1LIO2hQ/sTT1e94leXQdLqiPe1/Y/A5VMuGHZjQYFZArXaRisMrr0lItWOzaVZX86nzOAgQjRrBKZ9dk+c6FKBv3+TLlbSGaq+VBSaEZeEScnDbGh3WXJ27ddPXoJ53d0FQyN4xuPV2e3KPL+/Pr4+nDy+B/hu/yLaMsKfojV9AC36+GO5epcPoJatf3y6nAdynp5zxsswTun/6Us9kK99paK7v5soVp7OFnArpqyGePNIFpkS0sIE2YZxxKx+CLRA== 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=hpxPtaHCdDpGoM+1JKTkz/eDuE9n6lt2SUfsNJBwVt4=; b=ax6mLaWgDp84sIGjyVuypjWaD8Xo3ca3IQDcLly6DF8uSTTS0QGnb6ibaaXYLsAjWKS9FHM6OgtzHfaacDFs1yb494pLEC4OA3i45RR0idOty6ZFgLnMOBMIj+vTiUIgJZ9nYepqD05csHRqKx9eDdFb0uYMGhqhjIa3Dqln+c0= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SA1PR10MB7593.namprd10.prod.outlook.com (2603:10b6:806:385::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Tue, 4 Jun 2024 17:42:03 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7633.021; Tue, 4 Jun 2024 17:42:03 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, zhangpeng.00@bytedance.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 05/18] maple_tree: set store type in mas_store_prealloc() Date: Tue, 4 Jun 2024 10:41:32 -0700 Message-ID: <20240604174145.563900-6-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604174145.563900-1-sidhartha.kumar@oracle.com> References: <20240604174145.563900-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BY5PR04CA0029.namprd04.prod.outlook.com (2603:10b6:a03:1d0::39) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SA1PR10MB7593:EE_ X-MS-Office365-Filtering-Correlation-Id: 342384cc-040a-43fb-e110-08dc84bda522 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|376005|1800799015; X-Microsoft-Antispam-Message-Info: 8Gea9MI95ITbr+/FvqHwP310XO2SmTZRJSj5hASsrZlhEgcksVmpP13nP8lUG0HRy/O9vIhEKu9Gg8ry+3kC4dYyzWeM2/j6/MQCqxSuxgkHWfoITPaDUagBt39phlGqSpsOvsK+ZASMGSDyaelfR5tl21OxDW8OT0Iupoa1n8biryCEQ3Y9n68HOSWWtYNdSFrsU1N2cp3MC+c007ox1d2KyOtZI8K9BLHjxnZ9YX++/LPkPHb6LJ7xLQb0JTseREI/CgFuohOFC5f43kgycQqSrXhxR6kC+fLH2K4GMeH/y5C7/Rz6OTL6Tnevny+FRieyTVoj49H8xJjYK7UeAfm85mfflAw26JH/aDgpATTrAxjBI2YzuwvcXGQY2xpxD3DvdNDdBjmmRPe6no3IWzuDufcMZsdlxuhS9vqFduMco7sFlqre6IFcE/OLrptePHYybsQNcWCZIbjI/aXq+BAIf6sqwH8z8Ax1Ufm0zUgU7m5LPYZQ/NMDGmGSQksFPtqODLMyw38I0xJ2RtpOofS3VtnKh27KVuhL2bP/eL5j9n44Tdgy52S8mDoWYWkxzXd3sMydDKYnFDQGgZx+BlxigkWY82sUqT3jXNbqrvoyxVlGJSKRrQ9X9vwbrl6ig/OiCpSscacjc68Am07fv8fesmXt3W33/oQQ3albkdo2NO8DzCuW3cLpV5mKITkB3NMZfG7eykZczM5cRQK1JB8yPBNpUiXxBbk0OBdVfG0Ft4OXgVPRA39Ib86s6DHdV1jl/n0ICqeAMOd4/P9RG24iSGHd8QY8gT9TPH4QHsC5s51+9PkvSVxSf4Ui5NrLD1zRdHDOr+BqytNtJOI58yOzPFvWHBvqPIhGa15tM7JEIMGTtp7DaCMrL+vC3jgdFf5+pDaw8xn/Jvxu44jenxL1UIFHhEYg0692uZLzPnhOr19slDRiskI2K9YqX5rRoDdyIyWAvSpm/PsepNdcUo1AnryNv6sQrWxIHQJy8+K43S25iqbsmy/lFjoDDxZAvj46Ihal4xs2dl6oA5Po+jpdiDajINZqNwni7sVCd43+ZgCWLcZYF7BerD6YTuAy5CiR6/dtMMOUxYlLmauyK6SssZS+Yzmj9F2xtTYUhZ5KAMLy6s/aXLvZu4qb/v/oBf7k3nZKU62GxEJQzIbSUrsU6FLc47IHA8bvlZZWaDeSb747LZvkDyfEWIeHzYgFPbrF3xIUjnf26QFYafp23hn5Gc8O2YiA+fJEd/g8POwJ1P7FU4MPDn985mo0sVduYfibNHydPGMcVF9o4xJR5Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4fXeiz7DXBr9HArSAusYXbeTFeiZPLkWam0K6Jqjw9GdD+b6NQgUapvuIOkO/0vJwn4Uoo4x1dejQLPNDAzIXYduD6YnblBfRAz1czZjM6VNLIYM/rQVFXBL/r/k7QpohzlbF1Db/8qIXTiGhDgQ7Z+ktMT5ld44kZvgR1MUTCFK9vcwH/9y2K3ftQoxcbRUueG+f78ryCOoieIVV4DijFhBwuGgRu2TvEnS9CrKPK3ElR3llgumCvieqHeS2Q99NnroBU2QQWvTgnpKKP8iv6wDA2Zimyq051phs6MeMup47mbwQbQMNGBp6GElwioIgixg1orkh7w5N3b+bY5SCShIdZeQn3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BFQ6aHs/xD51uziPVwCoWRBoswaxKpW5O2DIq+5oFlPYvWlGyf4UaNIzejjtTEyaKwLG7G1KZvtT17hZKwHdMP/gn562swLYTyuxNRkuUs7DQGYou+grmWfUaqhMggK4l8eWI1mK9Vq0CcoyacU8AzUeMn9kirH1I+0r9Mjp+1JKlflIDT8qd6GERWzj7/iejkBrVWeXftP+/6PjDcmxI= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: x+rydlpwwFuEtsfOmCJOe7lv0aRto7mmUPhDYtz8JCE1HQ2Tj28y3UXnNDCorzqgqv59gRDjL32N6S8MRZyaK5bdktGxnO5babkwrX1LtyDq6XDende0VVSGAcLB/x4tgVrXTjm1kJb76mYQDvX6RLl5BgaB1Fh80qt16yQ3KS4ttjRkIXFoRzMdStn0ohb0OkcrCVSWvgkUVoO1dAQTujRuMjxCrqBZQ3ynnlxupQWYzCFThQzVak563fLdxbXhD09IbUVtrdZm5qRG0V2iwaZBVpsV6JMH5oKxxhsUVr01/P7QitMmS9maPxEQQ/luG3Y0ZjSiV75oX6j7txQGI7g9zCJ67wb4z7GI/xdDmfmXeiLKSV0FcXj5nJIWRLrickn9VlGVudAyGJhYET0rZzngYFeig+9dBNsJos3YjSXiZ7w2Dda2SHitG0AhGReW71sEUwZsmljRfaWkJro8P2PfrajX/G/CSiWWcbboyzky0mDhjy8KFknvUQqqGSbMhlrppImgUvr0D6UX6xhlp/WQ5jIgb4mRfaGy3DcVaWBgOYwTAG8E5cs3oLBg8FSjrfoTn+KSZ3NDxokYrFEDOySdXxFXuImVrbGiZ2DDIu8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 342384cc-040a-43fb-e110-08dc84bda522 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:42:03.5154 (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: Dz27FlE4T0QzQUNTukT0jWSiwi5nA0lmssbbnwSeoWkXg0e0IR9mQLouLT9g2hMcDlEug4Fq0E5bHoxg7N4PMoOMQ2BcHpWwfOYHkBxZzzE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB7593 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 spamscore=0 adultscore=0 suspectscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406040142 X-Proofpoint-ORIG-GUID: 7jk2jXqsA4sJBvNYoJnZlLdJraKQEqHl X-Proofpoint-GUID: 7jk2jXqsA4sJBvNYoJnZlLdJraKQEqHl X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: C7EEB180006 X-Stat-Signature: tg9yjk1dqkxi4oz7ezq88pdughneeouh X-HE-Tag: 1717522946-399474 X-HE-Meta: U2FsdGVkX18NnSrzTijWbX726U9S6bGYmKz70XK4fWd8LktlC9pfnOzNN6EBSbk2eDe53B8t3eqBUCixIDewFmkPLpq9Gv+1iwFncGaJ3RREZCfBEFTM2laAHYzRwFFcrbKuoH4wwnYN4+ANSssS2izGiZPCOotiZZbA3xedpzvCJmFNUhtyB4E9mnjwQxpDg/OukB3vDTszb0eIC2DB+9ammt200aXwVSgZl4175frQUv/ZoIH5aZzIO4fx3ZpgL491EDV5E2D1oiqLSzGZgYofGlulTSsocRSedkeUgid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7+v/n/s3f06VlAs+snKXHV07C3HBKNPAqGWwdCDIzf34SPFtd8PpFVsjN8LtDzNuOdgEbQJ+nyuBgY2cLCpSSvxJI4vtVG/hYuw== 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: Set the store type in mas_store_prealloc(). This is needed as mas_wr_store_entry() will be modified to read the store type to make a decision about how to complete the store. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index b37fa8690558..3780d4bb0415 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5631,7 +5631,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 Tue Jun 4 17:41:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13685730 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E701BC25B78 for ; Tue, 4 Jun 2024 17:42:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6A3F16B009F; Tue, 4 Jun 2024 13:42:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 652D06B00A0; Tue, 4 Jun 2024 13:42:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3E0A06B00A1; Tue, 4 Jun 2024 13:42:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 173296B009F for ; Tue, 4 Jun 2024 13:42:24 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id BECEC1C13F5 for ; Tue, 4 Jun 2024 17:42:23 +0000 (UTC) X-FDA: 82193925366.20.2CA7001 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf27.hostedemail.com (Postfix) with ESMTP id 5C94740021 for ; Tue, 4 Jun 2024 17:42:20 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=S6Tp4q9A; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=fxqSD0HJ; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf27.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=quarantine) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717522940; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RMx6uAATy7QTVcRAH9zV6tiagLCEAV9FtRSVTr0+QWc=; b=AtCsTGLyp7LL53bDI155fuPLPT8xMqDPfv98ktj1r3mB2zql6nO0AKJL7e7mNbwj0qX4cb FHrzeTfkE9ePvTUrbWr6PVD2YFzo6BXVXlOUVIviBY3CGkXrUSyA+uRP9qglw4hHM1Ucsg aXO2MNEJbxFM1KGAwUbB35RJKfVMcf0= ARC-Authentication-Results: i=2; imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=S6Tp4q9A; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=fxqSD0HJ; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf27.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=quarantine) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717522940; a=rsa-sha256; cv=pass; b=n8zS5gvWKvuUgC6wsQuwJc+xBZM/PTzw/RbtDDCnmNkhAqucYuGmXPFKE4DXPFpPCd5uBG vmOwPhUqtKxYrhzWseCT4xE5SU9j6KZn7mPUhEQK+eDEyB7FMszKZfDz/b1V9sTuFamlSI UIBP2ZTMkMsatPIkmldmuZKL/eWhyGg= Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 454BnNwA028131; Tue, 4 Jun 2024 17:42:09 GMT DKIM-Signature: =?utf-8?q?v=3D1=3B_a=3Drsa-sha256=3B_c=3Drelaxed/relaxed=3B_?= =?utf-8?q?d=3Doracle=2Ecom=3B_h=3Dcc=3Acontent-transfer-encoding=3Acontent-?= =?utf-8?q?type=3Adate=3Afrom=3Ain-reply-to=3Amessage-id=3Amime-version=3Are?= =?utf-8?q?ferences=3Asubject=3Ato=3B_s=3Dcorp-2023-11-20=3B_bh=3DRMx6uAATy7?= =?utf-8?q?QTVcRAH9zV6tiagLCEAV9FtRSVTr0+QWc=3D=3B_b=3DS6Tp4q9ARLvKipWqH5fth?= =?utf-8?q?gPfGLhfKkOAKqmqDll6lMle6A2SKwNXztHOAouJwEmNYNcj_dtFVO4FCq8s3h/1gD?= =?utf-8?q?kcmKFwS5sOwie9Gmca+kK0z0YYLx46TCR5cFkezSfjXf/S/yzMi_tME30V57An+Lt?= =?utf-8?q?CWun6miwan720YRCab96A/5rjJzJ8ch0x41JJxgB3M3fm88Q9D2e7xC_oES+6jE2Q?= =?utf-8?q?bbpHxQbU3ZLwGpBVmfWoH/NBWu8It6AcDZgVuL6MTsGI+gQYqYbSFyiTLUO_7qilI?= =?utf-8?q?xsMVV6Dx0O+7jXHIl9lPyXmZs252EniAqtstUSlmwO7/8UtcS9YB0qF7rrAebnp_R?= =?utf-8?q?w=3D=3D_?= Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfv58dj9g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:09 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 454HNoQj025242; Tue, 4 Jun 2024 17:42:08 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrt8xx21-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l3WycuekYfUB04VJuoVa1sQQ5HLXtOrpkvEj3cSdBilmnRy/sB0AtHXTIQWwKNtc/Vj6XbuAR1lVH1rI4nRXYCRhvUNmvQ+o1QYlPVKW2gI7aUFcPlXnxOBxBbb8Pj8x2sE/l2bn7w3mLla77xSlC0Yai1TlCxqRr3WquXjS4Xhky7HNTFAsfVAluBMVWDlMRF34lfsC8/y1MhGvwQxR20W4TRyewZsRmp13wL3IUSkzYcXrTqVH5yvy4HJ1atkBo+6XtvEFGSzduGkZc+qWAvsWdwHDWtsr1GyhWSYdWLgbPO5Y2N1ZVm6YuAIutzkGnC+K6lop1vPj9TXSOMgGGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RMx6uAATy7QTVcRAH9zV6tiagLCEAV9FtRSVTr0+QWc=; b=Vi5NxHzXt3sycoGzRBXd0OEf6Ymnn0fuhXWXGJ/+JDA8yd/kT6OsSVLZUgCdmtu/Q1l7MfqIFe+UwVJMyspYJY3GuKOb8sa9HTzFt2LaA5Oooqt9PEIwU3QRZCMLHxf9dSp6EYTX881Y8R4TYJysnO1/q2YYerijx6j9sGp7SO4+h06aI47mtTUPU2WO0bZk7CWWABAlMi57Tmi3OC/KA9s1/C9tUV7mIOGsjlPIDTP7GQkMmJ8Ox4uvK9RJo19tTsfBc99eOSZxArrjv/pmJGtVjBOKsXi+hGvsFQxelkgZH7n2bhiyJ8+F9aUg2hiihsZ3VhWf7tgCReYU0ikKjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RMx6uAATy7QTVcRAH9zV6tiagLCEAV9FtRSVTr0+QWc=; b=fxqSD0HJzvaQmYkGEEXUhaD1oGOypL4gaCytaWuyFN1oelsBVKjZe7bzxqDUAj+gIXpi/Qe++GTmM+ShmDvLI1RqSWbJ0EU+osogZGcGC8WJR5+gapcHCsezCvT0BZgj06vDb22UgQN/8lCOiJNsQjv2E6oWTHY7Ty7jANJPKwA= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SA1PR10MB7593.namprd10.prod.outlook.com (2603:10b6:806:385::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Tue, 4 Jun 2024 17:42:06 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7633.021; Tue, 4 Jun 2024 17:42:05 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, zhangpeng.00@bytedance.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 06/18] maple_tree: remove mas_destroy() from mas_nomem() Date: Tue, 4 Jun 2024 10:41:33 -0700 Message-ID: <20240604174145.563900-7-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604174145.563900-1-sidhartha.kumar@oracle.com> References: <20240604174145.563900-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ2PR07CA0011.namprd07.prod.outlook.com (2603:10b6:a03:505::20) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SA1PR10MB7593:EE_ X-MS-Office365-Filtering-Correlation-Id: 96b9b646-c952-4df8-9144-08dc84bda64c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031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vulQJCPm5hDPRUjAzsetU5go79TCd+xOH5XqpZLL39WMN6RunHsENou4SThypCi9cG38SgkdVtW4+o/aYyC0kKUf9iJeh9LN/hvHuDgqF5FBn/efR5XpgzNoN9iDqO7u0ugC+Zgc0tERlMd4vimJklu/v71EqyEout6Vdd9AL9oq3tq0Me8DQhVlSmYjBP+JcssJliHZbYlFjNZtZRVcYRQq0723mMp5RvLoggLvjtXU/W6V4T4CxDpglsp6Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Nd1wa1ulr+wrHbN9dgFwv5mYonHWbPzWO9b8Jsw4UEdNR8jmJ6s1TRzX99o0jtQCQu3Uzm4grPg3bDESCr7NflIXAZwrLidQzE8TWZnwm6WIJ4Ts6hh2Q1FZtOTX8OcP60U1aMv8AYgjcINOR4MVUP00LICbGPDOvO+cKB/JLiQeqdUvnVdcSbYu7B0ec1rI6XSWolPSjFp3doZ2AXUgLNf2X5WIGYkq1/HK1LnUIQlNjfC5eMHiXD1V3p4bRBceC88r4S+Gjd16KyGuQyT4YbN2c7bXiIHMbA1Nfwk8kAM2z7f5hcocat3yS1F+7gFv5W7+gwfJ0sb7byVva5q1JtBRqEds+NS26YPUcoD4vs80Xm9XuBHpKKTU7LFMmuHzcNsdpxklONQGzOiEknc909SNhKP0UvoaVeOG57XgWAA/mvwBhj5+JGxnnTqV8VyKRISMmaRwm9KOagQjJ4ZedgnC9Ka2N+fJFvGJ2Esm53yyIiTF1mb4y1CxSgvQxEAjLlPEMCAcaw6hR5V4qpQl6JJtyoaKpxOx7AH9qFdwEIMkNmrj/VKqlErcH9QU5muhwxoQKbMnPRbIRmRmP0K0aPpkLbeAZJ3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ternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: OcsPUAW1XtaFRMsrPAHgAJSpevE8beW+JGRhIYqL/YMo1xAsZdlkv6h0nQfc1BAc17GUbMlsHw0tYOoHPSnMrREmNYW/ouqdgaMeuZ3ndJrnVYifGP78mzvOq0gYoX3XUVg4S+e0/y55zuvrLhT6ILR/0Ub02ebaqaKlbDHKdkf2fiSFHmWnKAvt3+rlnOc2KK51kc0UyxcmG2ZBXoy55ycOR5liLHgiFz8oU5LySFKkwvgj/FsfBRoqSRvSQsbybM/9OfwhN0RBJwGOzaUkO4syyKt0wA1R0HPOUG1FV1BeHl9l+jFciN7o3Kc8UFgFPbCg7SkBdIhZdVw4GHjNZFWWafO6ZO2ym1CtXVDp6l8HLGG8X33G++wQZlDvTC71a+sl9Idiv5t1zSdOsBkjRVE1Oyev4D51Q9rBmnj0Lcv484ev38Xpg1mBu3I1ikOI1aiFvHIOQ+OtvRgSPdBYjf/z17s6jwdB7EW4W/MggicjHcVJTD/UU78JCHsw+42rFpmOXGFG68UsNMwC8OcLZeuK+AuztfEJVNctunNDi9NBpmqUbnUYWQqFYVQjwNNUuVFVfrKaYr+E6lEfpd+SCEuzHQ6lkimLjeey1fqEBvI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 96b9b646-c952-4df8-9144-08dc84bda64c X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:42:05.5732 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: I/H7kmfCRvKTO8j+9dQwQYTsyE5/O4jKxJjkg1Iq7l8LcLSOyzIy4qcU9GJ4zFjLrrzAxDYEp3emaX7OQWGcrL7VFNEnxVAgnbzn47kk68c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB7593 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 spamscore=0 adultscore=0 suspectscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406040142 X-Proofpoint-ORIG-GUID: ZqddAFvbfuPVpoEFuezy6a7vt05sgPvX X-Proofpoint-GUID: ZqddAFvbfuPVpoEFuezy6a7vt05sgPvX X-Stat-Signature: c4ixt65tstjf4isoddkw9ipheopquhuu X-Rspamd-Queue-Id: 5C94740021 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1717522940-304123 X-HE-Meta: U2FsdGVkX19QQT5QVggzuy23NslK35Yb14c9ZPowu9/sIyxCb+bTs7Rgbly9ZueRbtjP7TPKAPiAbSseoT722v5J2Jm6A76tC4O9/NER47UKqOn9Uzcm9SPRGyoRt+Y9nikCErCFumT2zcVaE3vNSoegq84QBKhvj12BYHMZpACDPZm3dzsL7OPPys+2ZM2VnGJ0U93JZ8M6+ilE+r16PyyQ4axntSa+K3KdJODif+Se7yAyK2Mrddw63Li4PxTHKHaSri0ANPYr5n1i4mwEyyUIwo7olvdnFEJYOM05BNqO9Ch5AuUnc+WmiIB+W42+U3qMzeZHN2U73Ht9kcBVhltDwj32CjJ/ZcrgzKNFe/W68R8srs4vufNlyITQ3+FfGQYhdPGnkAFNX1oXCOSHTEUaq6zTSpMytceFbJs5bRRs/TvUTSan9AGb5z86dPdcquHcZi6+XR+c867tgcpjtEn66qKWa8fNz/6R7aai8u2r6XFdN41xnoqFJuOx2q+HHs3vmiPvDYE1hZZ+m9Cttw5c7go1yTSIljd/NpSSn870ZIY5AWt0Jt6ITMZPrSqdQY/CDP7VrgEqh1iwX8rZav3vJ31zpc/06Dj72CDZl7IqhnraaWiyrOUda1UGmz9qGvXnVyPgl13apsW+ZO9ZmGpTI249HYQwyVzl7hlzI/kLpYofVfMxpHTAzOWuDqNSl8hQnb+M4kNLgB+2QDR1wTJMGHpm/fI+QJvuUDnMESu4YQgDt+9VnFJWpELlr+U49fBTt/ZMYOoQIQ2nhwpmW8jERfa/WBeBA03I17XR9lyYk1HuR+kACmxdxIESOOJ7MVEcPmdMMLOqKsQRp0pvL+Sp5mGBg6Y6YObbCG6WVMLVD3I2o9afa09bj0FER40KxtErdoR7dHp2/2LMMi5EURz/wNPi3sPwgeFoRNQrQlsZ2ojKxxOCGTZDm1vm6mJYglZMK/Jp8Rmbq38zMeO 8nd+hgR5 987xNZ/EZWT0CLQi+mnynp8NDBlgoOslFAoyRfuk+9XxdbXbXwenNVKreGxYQtDv8XyvElM4J4Y4WaIZAMmi+mUlX8+MpQh4Cs5d7bp6go0QGIsc148dYJmysG9rQxoXtfNB+fH03HJl8af6AqtUznNgjj0nDFbJE+yjGIzT5WHu30/fGW5AxvtTnmavxB5a8g292VY0mVKws/dJExcGoCuHm0SyoGfWEeabjTbIZPzyCfwEzC5+D5C9/Uoj5hhBc/mAdADKF5Gagb+PIk/l/bn5H7KtvBIHpZ9Gx2huWANOdMa6JDF3aavmXVKsQKPYFZfCpEVQx/uiAMf2RaWcnECdSBPNaoIRQsuHR5ARl35NAcrCwqsY6aAVCZtFUbTy5Ro+8ZPclWGQgcxgS2qbUfrkkk1Wj29eZeuXGBxQZpYTxtYGSl388ui3yxU7ky+J0fcLAVXjvlycaNZxSnWxJJoL6Cw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Separate call to mas_destroy() from mas_nomem() so we can check for no memory errors without destroying the current maple state in mas_store_gfp(). We then add calls to mas_destroy() to callers of mas_nomem(). Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 39 ++++++++++++++++++++------------ tools/testing/radix-tree/maple.c | 11 +++++---- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 3780d4bb0415..f1496817e52a 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4526,6 +4526,7 @@ int mas_alloc_cyclic(struct ma_state *mas, unsigned long *startp, if (*next == 0) mas->tree->ma_flags |= MT_FLAGS_ALLOC_WRAPPED; + mas_destroy(mas); return ret; } EXPORT_SYMBOL(mas_alloc_cyclic); @@ -5606,18 +5607,22 @@ EXPORT_SYMBOL_GPL(mas_store); int mas_store_gfp(struct ma_state *mas, void *entry, gfp_t gfp) { MA_WR_STATE(wr_mas, mas, entry); + int ret; - mas_wr_store_setup(&wr_mas); - trace_ma_write(__func__, mas, 0, entry); retry: - mas_wr_store_entry(&wr_mas); + mas_wr_preallocate(&wr_mas, entry, gfp); + WARN_ON_ONCE(mas->store_type == wr_invalid); + if (unlikely(mas_nomem(mas, gfp))) goto retry; + if (mas_is_err(mas)) + goto out; - if (unlikely(mas_is_err(mas))) - return xa_err(mas->node); - - return 0; + mas_wr_store_entry(&wr_mas); +out: + ret = xa_err(mas->node); + mas_destroy(mas); + return ret; } EXPORT_SYMBOL_GPL(mas_store_gfp); @@ -6365,6 +6370,7 @@ void *mas_erase(struct ma_state *mas) if (mas_nomem(mas, GFP_KERNEL)) goto write_retry; + mas_destroy(mas); return entry; } EXPORT_SYMBOL_GPL(mas_erase); @@ -6379,10 +6385,8 @@ EXPORT_SYMBOL_GPL(mas_erase); bool mas_nomem(struct ma_state *mas, gfp_t gfp) __must_hold(mas->tree->ma_lock) { - if (likely(mas->node != MA_ERROR(-ENOMEM))) { - mas_destroy(mas); + if (likely(mas->node != MA_ERROR(-ENOMEM))) return false; - } if (gfpflags_allow_blocking(gfp) && !mt_external_lock(mas->tree)) { mtree_unlock(mas->tree); @@ -6460,6 +6464,7 @@ int mtree_store_range(struct maple_tree *mt, unsigned long index, { MA_STATE(mas, mt, index, last); MA_WR_STATE(wr_mas, &mas, entry); + int ret = 0; trace_ma_write(__func__, &mas, 0, entry); if (WARN_ON_ONCE(xa_is_advanced(entry))) @@ -6475,10 +6480,12 @@ int mtree_store_range(struct maple_tree *mt, unsigned long index, goto retry; mtree_unlock(mt); + if (mas_is_err(&mas)) - return xa_err(mas.node); + ret = xa_err(mas.node); - return 0; + mas_destroy(&mas); + return ret; } EXPORT_SYMBOL(mtree_store_range); @@ -6514,6 +6521,7 @@ int mtree_insert_range(struct maple_tree *mt, unsigned long first, unsigned long last, void *entry, gfp_t gfp) { MA_STATE(ms, mt, first, last); + int ret = 0; if (WARN_ON_ONCE(xa_is_advanced(entry))) return -EINVAL; @@ -6529,9 +6537,10 @@ int mtree_insert_range(struct maple_tree *mt, unsigned long first, mtree_unlock(mt); if (mas_is_err(&ms)) - return xa_err(ms.node); + ret = xa_err(ms.node); - return 0; + mas_destroy(&ms); + return ret; } EXPORT_SYMBOL(mtree_insert_range); @@ -6586,6 +6595,7 @@ int mtree_alloc_range(struct maple_tree *mt, unsigned long *startp, unlock: mtree_unlock(mt); + mas_destroy(&mas); return ret; } EXPORT_SYMBOL(mtree_alloc_range); @@ -6667,6 +6677,7 @@ int mtree_alloc_rrange(struct maple_tree *mt, unsigned long *startp, unlock: mtree_unlock(mt); + mas_destroy(&mas); return ret; } EXPORT_SYMBOL(mtree_alloc_rrange); diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index c57979de1576..c834e91e6810 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -119,7 +119,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) MT_BUG_ON(mt, mas.alloc->slot[0] == NULL); mas_push_node(&mas, mn); mas_reset(&mas); - mas_nomem(&mas, GFP_KERNEL); /* free */ + mas_destroy(&mas); mtree_unlock(mt); @@ -143,7 +143,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) mn->parent = ma_parent_ptr(mn); ma_free_rcu(mn); mas.status = ma_start; - mas_nomem(&mas, GFP_KERNEL); + mas_destroy(&mas); /* Allocate 3 nodes, will fail. */ mas_node_count(&mas, 3); /* Drop the lock and allocate 3 nodes. */ @@ -160,7 +160,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) MT_BUG_ON(mt, mas_allocated(&mas) != 3); /* Free. */ mas_reset(&mas); - mas_nomem(&mas, GFP_KERNEL); + mas_destroy(&mas); /* Set allocation request to 1. */ mas_set_alloc_req(&mas, 1); @@ -275,7 +275,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) MT_BUG_ON(mt, mas_allocated(&mas) != i - j - 1); } mas_reset(&mas); - MT_BUG_ON(mt, mas_nomem(&mas, GFP_KERNEL)); + mas_destroy(&mas); } @@ -298,7 +298,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) } MT_BUG_ON(mt, mas_allocated(&mas) != total); mas_reset(&mas); - mas_nomem(&mas, GFP_KERNEL); /* Free. */ + mas_destroy(&mas); /* Free. */ MT_BUG_ON(mt, mas_allocated(&mas) != 0); for (i = 1; i < 128; i++) { @@ -35846,6 +35846,7 @@ static noinline void __init check_nomem(struct maple_tree *mt) mas_store(&ms, &ms); /* insert 1 -> &ms */ mas_nomem(&ms, GFP_KERNEL); /* Node allocated in here. */ mtree_unlock(mt); + mas_destroy(&ms); mtree_destroy(mt); } From patchwork Tue Jun 4 17:41:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13685731 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 CC254C25B78 for ; Tue, 4 Jun 2024 17:42:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9FCF36B00A1; Tue, 4 Jun 2024 13:42:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 986646B00A2; Tue, 4 Jun 2024 13:42:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 78AFF6B00A3; Tue, 4 Jun 2024 13:42:27 -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 511676B00A1 for ; Tue, 4 Jun 2024 13:42:27 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 1A07380FF7 for ; Tue, 4 Jun 2024 17:42:27 +0000 (UTC) X-FDA: 82193925534.07.929C4FE Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf08.hostedemail.com (Postfix) with ESMTP id A735C160011 for ; Tue, 4 Jun 2024 17:42:23 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=NxXKnhXC; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=S27tGbpU; spf=pass (imf08.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=1717522943; a=rsa-sha256; cv=pass; b=THTP7RgsEIiogCTv/jUyyxqbzdAfSt3VM/OLmwrMnsjOQzHCSIMAIOkVB9KQ0wMN873W41 pwSSdzna8gGq4pVy1TModQdsVIYvgpT8jy+ufhvrDc95IVJCb5HqS+OnIuKNv8OlZFbGUd N8WZD1WLuWxQ/vu289oOmBlcWiUop4A= ARC-Authentication-Results: i=2; imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=NxXKnhXC; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=S27tGbpU; spf=pass (imf08.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=1717522943; 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=+orkQoZyCr3o2TgK74ExV+dlpbYMr8fB1RpcQ+RXSw0=; b=mujOV6lfZPsddqq+TgX7iO/hbGLl2K7pdH/KDieRzAtK4KfQJRGWXKjdjMCUA2q8lzgR8E ZeQ5CGoPG9sr6STT4MBpwOF5KT0b+3KsUX+aKwWYnHyA8N5b20aR8mrlqchCiSmMEKZ4Hh 6jqWbWo0uhbJ2BkJSzY3xrHoNR4MNEU= 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 454BnW2Y032115; Tue, 4 Jun 2024 17:42:12 GMT DKIM-Signature: =?utf-8?q?v=3D1=3B_a=3Drsa-sha256=3B_c=3Drelaxed/relaxed=3B_?= =?utf-8?q?d=3Doracle=2Ecom=3B_h=3Dcc=3Acontent-transfer-encoding=3Acontent-?= =?utf-8?q?type=3Adate=3Afrom=3Ain-reply-to=3Amessage-id=3Amime-version=3Are?= =?utf-8?q?ferences=3Asubject=3Ato=3B_s=3Dcorp-2023-11-20=3B_bh=3D+orkQoZyCr?= =?utf-8?q?3o2TgK74ExV+dlpbYMr8fB1RpcQ+RXSw0=3D=3B_b=3DNxXKnhXC3KJs+OGMWrWoJ?= =?utf-8?q?MFKOFFSSl3SbqHzdUQILRHf955+PN4wspyoeyXgsGIRFR9N_DTUoIDWi1PbAhsIBI?= =?utf-8?q?o2NwHpuMDGm8lRCTLWkNVkz/iRBo4YKmfOCIsvi+5Ahfn33gNZK_NLCHSFiDxOI+x?= =?utf-8?q?6TTxbKn5PZjTg0ji7mvVU5ciJ2qOaqChlcwAqLuGVzjVf/QOVpG8i+4_eHSe3KqcB?= =?utf-8?q?sJQHoEaQ4D0YGJ50S6vL6Uyd/1p3VRSx1mlkntoowCTf4E3lxPsO0tTWtkA_3G9Sy?= =?utf-8?q?cVfF9l4wNASfTh1S+kF/74U1FVp1iGOOYXWdeniJp1quKrCLW0HziKAAHNDCQsP_j?= =?utf-8?q?A=3D=3D_?= Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfv6u5jgh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:12 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 454HPTRn005496; Tue, 4 Jun 2024 17:42:11 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2041.outbound.protection.outlook.com [104.47.55.41]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrmdwn4u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AEkEINlsUInWOwV5zEyPxbQoSILhe16T7XqXCmHKh5SQUsvUejuy/YSak9GFAulmIQbSNCvgRfC24h/GHx7GxgB2C3ivHm25YNdXw41RhU6c8JD3wlUgvAAb414NMqlD5obWtxElPjQbKu4Df1YHAMOXqDT98w5GtB82mKuAaHhBug1LWngCHZqwyKXqgx7sS3pjgR4LoY+nArJPSJxz2ZDmsvKFpOuBvTxzcBaEf4u1Kc1h9lTscGHql7+QGuTiHJ44mtTroRNeNyCYpDTYYjN6rotlBogmi2EN2xMtZU7o66NT5JJSSIQT7+IVanb63PfeNYFnxz/zwqDv/ImxnA== 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=+orkQoZyCr3o2TgK74ExV+dlpbYMr8fB1RpcQ+RXSw0=; b=cljElUESk1qLQCtfjxMDTRINyghR2bZkvA8wAt7RBLEJmed9woSw5lJCsWdcfYsZ+zZ2vP7jZoRrdXBQ/5dmOQNbyKudDMVuNNUjXLF7IodrofDs50ljCeY+Q4hFdJ+C0BRTCNDWu0Ty+Lm0aOtRgjAwjoetN1Ak2M5eEYe0YyVNCs+Hs3Zm2gpaWuQSPOsrGce3jMprSG7xl7Ptv/IrGw6TeJbf7dHbnIVvvdz/dPwpZNaBz0/eJ1oe0qf6LRC7b7MW9zBKY6nV3mSFLMmaEKlO6fEY8J97XBpxIiaVPsoUHD1WKVkm0loWHS7OlD/ZJry9ZTZtnjClQwnuXGDTgQ== 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=+orkQoZyCr3o2TgK74ExV+dlpbYMr8fB1RpcQ+RXSw0=; b=S27tGbpURJJqL9PYkETmrjysNWH+yWXt5AnY6ju87t5ajTsx2w6mryxhj8inOd2a7eDmUBEcyKrA+Dk3hiT7nJWe65pj7FJaFjgIIJyT1Ft9+9g0ex3JzRCLCMz11XCl6bmkVpu7ir78zmsNeu5QOw2j1Pcze33IMFjhNG3T0to= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by PH0PR10MB5893.namprd10.prod.outlook.com (2603:10b6:510:149::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17; Tue, 4 Jun 2024 17:42:09 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7633.021; Tue, 4 Jun 2024 17:42: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, zhangpeng.00@bytedance.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 07/18] maple_tree: use mas_store_gfp() in mas_erase() Date: Tue, 4 Jun 2024 10:41:34 -0700 Message-ID: <20240604174145.563900-8-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604174145.563900-1-sidhartha.kumar@oracle.com> References: <20240604174145.563900-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR13CA0015.namprd13.prod.outlook.com (2603:10b6:a03:2c0::20) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|PH0PR10MB5893:EE_ X-MS-Office365-Filtering-Correlation-Id: 50728357-e1e2-4c51-d5df-08dc84bda773 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: OBrYYCebI6xF5GSuK05RpGef9AjGnFUvhmt4WxnNq6zFLlcUJWaq4PyOjL9kTBjuYXLk7oHA3K1NlN4YkG/9qwr/CWDcL9kfiXNMGQR9L3qIN5cd2FzXXsNFi3jFpt3H61FyIzTIBgSfCxxGDSksfeos/cB9npyueUcJ1GoNf8zGCUqGA5/KlRBximFOJdTAi7j13wHgyF4JrkWxxgiIlNz+9tvKq7EPgLnz0kgKFh1SoBbcb/UfbWHIfUIF+1EIURa6WhnJQwivR7pfA5z00CpsiLfG6LLTgTeSgUGP41L1ZXrb3zoAXKSKPA4imi72z2Kx1Fc4mG0/Yy/9czTv2jw46OCxqW3ibS4pF+1NnrGKGRS2hkqENB6ra7Wpcd5+k6EY2iXSuBQ1y7xcySUNR745kJdP3iGjVtN6dCQKAih2KaPQ3xFYnMh/hti3yxfZSXKYwIbFMdiqT/VRdMICM5x60kS7iBqyf9UwG1qFc7+KT8XawxtWAxYzpXiBwcEYD2lnPnSksD0M6mcLUcX6fPBKhkCrU/z7Kps/+InU/6rV+Jpr4lcCuCKRpInGZQT+rpXDWyK3veD+m+rkt3oP0LdXkAm3ahXFneqP7lIdk45q4fe8t35nNZWqra60KtAkG3YJSg+XxLFyCsOEU9jFVaRa4l6GU80xUFvAq3sVlws7uRVIZZ33ghmI4tmUYwAnWmG2DLIvhrklvIYRDJQo//EjpjDReWPjQDYfskk3BFFIFdR1qq2WtV7PMoNo/srlB+zPuSamoANgMMG5h+mwtqp1uZS874hd7YBxjGCe1rWL5cCyv3TKq0ZA5/29l6RZHgZMoqaqn8Wp8PqczikH8eM/jVJDrSmG5CmTIaSueifctlo2GZXAAoqQjk/OuQBg0/QBYK8Cx1qUA3F1k1WACjoqCPdCWwPuwDXsRh33mOKIvsJGN3CPEt06LFg14sicr8T5omu8hyqN2+8r1aWDTwRr9p5kVAZUbQ3pKi//8XU3x7jpGw4hoPx08CzTA85wFfz+N7QuUt5Doz3rsDvgMRadFeyHV24+J7dcAZOPy30x2VDA/8swMRtqUnWEVYBByF6qCD5e45k6s7vrnEXEAUb5nPqTnUFj+snkIJVyi5K0C9C9QpjIiw2/9pQj8bie1YHDLdcbtJ+dAgnRybxHrJf213CBf/6U70ksfguCrqpqvVUj3/NrjoYQLoJ+AIvDLw/fpzUzXSpd/fGF8xk1rPTlYpB5SMIi2BY2JvLa7shK/lJ2uAOJaXscw0EFYrw3RWZlxXs6EEprWv44pcU5Tww9qIqqtkO10prQpOWg9NLaJWeL+sHp8v1Bld5lPm2w 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: ZDG0Ji+r1AVodrTU5zsTS0rHjqJA+vnONnlE2yJdva/eqpqqOziwAv3zMY4L7/7CuJaU7OlThDmFJtOhrWnPGqdxggF7rph7hRcQtAgHo05ueWu5LjKRzDgVJlIOJ7Di2BTizxXA3QzJYCukWJkVZIcyiYeoddy1r14vbEMeeqy7nzlefqSvp4AY3JpxJuFhqlf/166v3ReZTDNDRcwbb1tgpQq8OaJbJm9nV5snlBsB6OqLy0vJfcC+nau5YX3cTlkWsKtENyQZaHAiuelZ8lW04a9oF4RM16I/ba3pl/qSbTxXVVwMRA40CHIAbwGrC4ILq/DzlVHHJzdsSkdo7Q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ZNIqKKmEhDMsnchcXUak6ituJiVj5Xagou2+5TcjFbFrASeySgiiaZ400FO3oSEg0mVWUWTCUHbe08JCgORgNNmV4+E36EqHYS6bbOXYiwppbItXe2j7qDaYh+ziYjvBKwuRt/Bt07rx6H2jYYJTAb7HirrGjP+hV5hlfYgVwC1f2P3n6/S6+vCqaufsIwSpwPIu6YkRz3bxVQcU/wvhN99JES/b0Ngw7V+EcQ= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: qsV4eGQcNweP9DQBURVlbrWgPJ++6TLB7yqnO/ZEJIDl9X0/XtkeOCN+vACpvopD49d96fQTL33GK8wM8haBIYIHcnPanEyzv0WdsKcTq3eqXYSVWzg//ilhH04g4oHtwr6K/zP46tOzhesvNV/ut+RmughdFN3PHvXGDbu70S+HQ7g0UZOrF4tNmreaqfgcfxWNmbowFhorZWzFh0PHs3SBYZeOlKtsGUnaiXXSBdsl6esnkhW53a9JOnHpQktzNmh9lNBmbpn3MOLEth3COCplWiGOC0znWd27MRSdKGiAcOjJWQDczMpQXQ4dS/muPZLFw0yR8wHK3A9P0SrMVatpPpErWrpfEa+k+qrcGvSE0XtRvp+u3YL2kB/cWwT/ZevUyR7RIcgLkqRcU5Ge2UVXlmVoqn+Tqey2UoU4KFm3ItgKTCZQIsG/M2vo1xDk7SGgnVYZdSAY9osQ+PZakX8Qy3hIgqZ0H6zVw8TtbOyX0cdSynAIFjC0ikd0DDut7gucSvvJsMOaZx19uCoGzihIh8hrOULI+L1wg1GTa1GLDfUNFT6pTQITYb10/Idp+npr8U/xNG8EjvwPbUU45pGOtLejr/smdbOkwcy7np0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50728357-e1e2-4c51-d5df-08dc84bda773 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:42:07.4914 (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: jM9t+DoXvOXLgppLklRBezSxZxDZwvYjaUsCtR6o4uyczbPedAKzwH75n8GSez74uBF5ntkbmYsmZ919+uqWWu9ENNJNWtgbITdXuCXrAA4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5893 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 malwarescore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406040142 X-Proofpoint-ORIG-GUID: 4o4uQdcgftKhPeQh0lcIiwrGNsrdqlam X-Proofpoint-GUID: 4o4uQdcgftKhPeQh0lcIiwrGNsrdqlam X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: A735C160011 X-Stat-Signature: ag3hhek7oy7i8h36pikwkk9qkkqar494 X-HE-Tag: 1717522943-870612 X-HE-Meta: U2FsdGVkX19/whWkYZbXoeEd1AoDbUNNzT3Xa88PtefGZVxV7ermQao4vWEN1mLOVkssYbXZDnzf1hYGI62jQpVaIERtLkddKjKLXCXX5748o1sfqpIHoY1AuPgfAg4jR+pI4D50Xv+YQBXS/mxDdXl1tvE3npXerRmwC7/hUgXNJTb1GDhRMIkt3IgZtL3TMyNtBW1fOouzV86P0SS/gEjEDk6jPL+iAgRzDozGNvpzcaH8hSbztqPOUKRbEzYckLXJNWEmXypK3/zW4N9lIRjBztr33NN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0DRi7IwX2LnapD8VdRI5HiN0K0Yd6NnsESxEmDUaT8iWa8xufnohYNz0IJqk5Zj10DLO7K1F+sgtW9u4BUKQm4x+oitGiDNJegE5eTKlq0cybHw== 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 f1496817e52a..d74847045bf7 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -6352,7 +6352,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; @@ -6362,15 +6361,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 Tue Jun 4 17:41:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13685732 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 D5ABCC25B78 for ; Tue, 4 Jun 2024 17:42:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F2D226B00A3; Tue, 4 Jun 2024 13:42:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EB6CF6B00A4; Tue, 4 Jun 2024 13:42:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CBB026B00A5; Tue, 4 Jun 2024 13:42:28 -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 A98536B00A3 for ; Tue, 4 Jun 2024 13:42:28 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 66DA214103B for ; Tue, 4 Jun 2024 17:42:28 +0000 (UTC) X-FDA: 82193925576.26.7893857 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf04.hostedemail.com (Postfix) with ESMTP id 11E6940003 for ; Tue, 4 Jun 2024 17:42:24 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=XTwsaOFm; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=mp9UkpSx; 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; 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=1717522945; a=rsa-sha256; cv=pass; b=LiP7q+PIxAI7Ud/HSFi1AmpCSuRTHFBUbeLWMuVZnVQawD0webXiupJ8ovuSYwUkoXug37 6iT2YjceBwah7uKZ8dR4HEaNlzE8+n77EEEgnX0UCVEtGYxHBFQ/5FAkrT9KpdLqkTEBHH S8Im0VPuND3yoJR8Vv8+5JgE3lGeN38= ARC-Authentication-Results: i=2; imf04.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=XTwsaOFm; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=mp9UkpSx; 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; 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=1717522945; 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=eFU5J8MB6LX0FTsp6LFmCb5nYDKq0rtoXYUM8NbzpBY=; b=InV6Oos9NBsT1+Gn2QxQiwaFwjr27Yg0kiCo6el+LjO5tizf4umIdrwN9KTvZd442CtJOU OlAx6EePDzPqah/pTUFSkxlgQiSu1SMQkqqk1hW+t4D55vRVvvP21AZNckIV4469wf2iKZ 3O4E9+7OAfIyoWMmPTykQR8WJ/kt2Ws= 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 454BnSP1026512; Tue, 4 Jun 2024 17:42:13 GMT DKIM-Signature: =?utf-8?q?v=3D1=3B_a=3Drsa-sha256=3B_c=3Drelaxed/relaxed=3B_?= =?utf-8?q?d=3Doracle=2Ecom=3B_h=3Dcc=3Acontent-transfer-encoding=3Acontent-?= =?utf-8?q?type=3Adate=3Afrom=3Ain-reply-to=3Amessage-id=3Amime-version=3Are?= =?utf-8?q?ferences=3Asubject=3Ato=3B_s=3Dcorp-2023-11-20=3B_bh=3DeFU5J8MB6L?= =?utf-8?q?X0FTsp6LFmCb5nYDKq0rtoXYUM8NbzpBY=3D=3B_b=3DXTwsaOFmZMHeQS3dWlzkj?= =?utf-8?q?/cxsV9+STQZ/Il88RiDn6LuqRjkyKXt6J09CNViWyMH3OY6_XymYCidPs4r7+dQDb?= =?utf-8?q?bxa/1ADpzt7eKJrtFsnqRSGQHP6PRV2FYLLmso7OyGrdQQ4AY/e_Dg11nAVp5fVfE?= =?utf-8?q?1rvqyKUecPqqKDk35yr8AanQ2uh0GIMtXKiinrZUjb5ugF6PjCQy79W_nZZA/UzYp?= =?utf-8?q?S98Ncc30J7fASCLB5PTLCcyp6qIF0LX/cyUAP/Qd1ep6RDyJkGk//6diu7s_KM8YB?= =?utf-8?q?s0RtsIk1oE5qRCiGjzIKdvOHuWSOJv/1GquiBhkA+tvOBuhxu3I31Nkqwsc6lP7_w?= =?utf-8?q?g=3D=3D_?= Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfv07wjxu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:13 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 454HPTRo005496; Tue, 4 Jun 2024 17:42:12 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2041.outbound.protection.outlook.com [104.47.55.41]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrmdwn4u-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dfAcbnZVtej7HG6eQwxARfw7w/8uKVkLuYhGL2XKimAPMgh+dOomwsdgr4n543J5R64it14duSaNh+JwX7FC3FkjbO2WHgeHq40x83HYIh38G2wI7HQgVIq8jW7BRpcwqyeYkSR6LwE2IIl893ABHj3wEi3/9kiDdth2v6ToGrMiSw4YPUGJB4OgiFPQW+TBJIV4f51gN38y41hQ6RZaLLw5caB+3oF13vGE28aAfBOik+S+pPPOU/FUpcmYgctvXUgxYOc/o36FTa+LdZpjfymJAZK7MVe5cMFJyBT8gx9858qm2uw+R/l7tjL+iJOtg0HgywCOHPxFMMf3yrkdbQ== 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=eFU5J8MB6LX0FTsp6LFmCb5nYDKq0rtoXYUM8NbzpBY=; b=F44uLQhFhmCXFXK1kge+P9GUtR/PoywlWru68zCz2KYB+13QATkSGHIXmNo+wbxwj6KimOXHsa8EDgrpAyuveFXM7o3U2q8W37aI7ddkTSOmmQ/tWwpTPPO4eBHhdeBfHZ6PRdmXD/BZure+Ta87wcSXrnTMYCWFAkWXrH8BLQ9qNoqfMQJBSxpU8VjirQJDc8prv5ajQrxl/0I4iTIgA1qvfxhlymubPYMvq0qtmdmeNZpXq5G/YCUfM7qMi+yHYgswu4ire0HJJauaKuxzOpHJ4ucbWke9bdXYQZoG+K+dNUezfIlVdA7DCwNKk8ZZdOk3u6bE/aeREnp2lGN+NQ== 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=eFU5J8MB6LX0FTsp6LFmCb5nYDKq0rtoXYUM8NbzpBY=; b=mp9UkpSx2nVGRLa2SXNXdPki5h+VYc/x2p0IDZC3JFRv6TjfE4L1RBplCubmXX0GJQoWtSrC5sfRppgrNovqyiSLiCdXlGRn6dt1v2LBHt+y7WW3Vm/r1s7q++1Mt50Q8XjOwSNu2EKMaFvFCeP/7dtYyPSKF8A5xHpnj2QzJag= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by PH0PR10MB5893.namprd10.prod.outlook.com (2603:10b6:510:149::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17; Tue, 4 Jun 2024 17:42: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.021; Tue, 4 Jun 2024 17:42:09 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, zhangpeng.00@bytedance.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 08/18] maple_tree: set write store type in mas_store() Date: Tue, 4 Jun 2024 10:41:35 -0700 Message-ID: <20240604174145.563900-9-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604174145.563900-1-sidhartha.kumar@oracle.com> References: <20240604174145.563900-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BY5PR13CA0028.namprd13.prod.outlook.com (2603:10b6:a03:180::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_|PH0PR10MB5893:EE_ X-MS-Office365-Filtering-Correlation-Id: 7d8e8304-49c3-4f30-1ef5-08dc84bda8cf 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: j4wOM3u3oW5uDgSWakgQ1RYE5W0217QEMgfYp+lm9+FvMXJeTsM5Vm5CBYQwbyDkYe9hRdtl4hLxT+aADMh8frBR0Y5epWVbOzK0sZr4ZvLJgkpp4y/gzAFIaSkDETwtzQz2iasr95X+fLi9xvqV32MGzdDrivtEcZpNwXXVGzIWw1+gArm8OiY/a3sW4d4zNhrSiuW5rLoYxWH9tEr7R5nDTu0dnf5zQIytUjwSIOBKKmcBcmrAyDlhnfZ6Ex9lpoTH8xPMyb6WztIhtBjCezgrPUnNU0AvwxUO5lWyVgEJJRiuVXdaVtVBvY+BgyUTttuajvSE8zRwdbQ9gsQLPBayqbD8E1d3gJvhL5To2+RTIApROymawDB+T3Yu1wMBiWOA2rKFrOOcJ0zIKcfOey6xcjvrrKnER8lX/sZJTXm2FF/Z1YK8OcLah1+jQ1cVVB3D+GseugugNbsahG3aVcNHT/IFgvdRW789jPpHvarE5yz5fXhr3K6yEiH1Y6uVw8lzRPLcws5ux0zUpMFNJ62RMc+rlEPsG2HpegWRMvoVxzrCwn9WPj31Zkc73zMu3XpE8VXcYz28DGTCedwg/jf80ibPhlfUU77vDWrJWIIDm7CFiyv6k0rkH9in1GFWOPJ+WTw3++QR1Xnu1d7vLxTL4PBF3diS5ctdmrd1DWJL5BFLvn5HOwAIHadZsfz/plhhknjD3+fvm1wnC6peH199vyaGiQHqv4RWvM/KkeI/uSeG9hgMybVlVPEUhWVl9VuH1GMAy9XHxt0X7r4bkyI9o6F+SQEOzeLUdPYyEXQCZdVgeRRddg7LjyLvDOpVv83jGFb1/OrBwjbllhBvSw0CX+Y60DgeCtBdw6unVJxf1h8ckIkwnZK+BnEqTzgrF7sXWXPlFxrcpC8EWWzzpAqSKVys4K013Rc6yexZyLjEI5ZDAQFdNoc6Ccu4LSXHLWkZQCXLuwU8IR+M2KrjddsGGM1uidxepdPwEKAbCHKpSVubzO7BZr3VOE9O5ue1S26x+kQunw2YaPZCj2TS8kT00maevCuShAIlBgUyhcMEf7KiyZWnUkGaFSkD5i1SOf/PrO9jKimguqub05eja8AY/wLUwcWLavPzJs1xmPvVGTzGe7mhcxaoDl75fWTDPe3FwbhT7w0cEI4Gq06/2TXoBlIky23uCL4jULXDcR/zZqizux7flsqj9pk0i3WC6j3x7Jv7BZ2udvNUj4JOMSH2A+RKL2eTN+k3qquqH0ASKAWlPykMTb+s7XHl1sT/RdQaoXyUIoU15kbDwYrubW/2yg08Zq6Be8W3jLz81hkT39qNnRAShNCX79CFGEld 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: g7RLOpie6ar/sHnxs+M+dlKmWSFXffO3+h/Kyq0q8iv7XcAIrWtoB/S9Vbz7CP888UbV0NfzuFAqEpwkGtdfPvXSial1NcJMBp06c3JhcmMb1KZcXDupkf1S4LOloCNnsLNmNixZAZyLHce41ie74/fybQ/mbFW2OC5ioMBZXABv54LX8niOfA2/xnvqNvN0sDVaniLqyztgX13w/0lbjAog1X7Q3pyVo3zstqxmUGtUoTrIQ9PN4oHNUnF/QTCZJuOGLNJsZsPnho6fYPFSTBS0gofgrQncqP4CeVPEtgMlBqybntu2JpghZWcH8idLf+ycRcgi6S3xlDFh58NsUVoUYTX+I1TCRLbrVPiPNIReRjYxiXkQ2wx350R1Af1234kTSg83ZY8gK8dMRYnI2Z8tFgkHsQ7W21q4rpB8YAJhzV5wTTC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aOSZ/zFYMSsAXEWnrLtX7gf9IQjLBRpKrSmxNXwjUduuWtr63yqAfWnf5JG75iM0kM/7PVstzUn+JinkN+I4F8GiJht7kwjdKDuybTdZVvUkVuMhugs= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: a1Ikr3Ge6lqPz+gB1WvphDlbXyIMd1prSkLkUKkPhW+c7SjI6XBsNHYYQklzYJY7b3yDGHbPjrz+TP6AKjxPQi4NX7sUM4eHfzl6YMjr2fPzVbZDF55CH8pG8AZlVJBne9GHnviWC4bgoqn0MBGEO9mYBza0VsZi9zidgFRVOgy7bi6ZTAUHT1Jrviwbm5PFyYbyHx7Qhd97/fewoD6lYvLFBmlqShvluh0d8PgWX5bk6KoYuTd0SQpdCzonkZ2Xz6f1SfB2V1RUgpgZF+Sh4NuV3TLhcqLobS63VgXa1GvyWA28uXD8gUtSwfW2qrvaSb0f6nD79n5zVeKW55IRNsiEQZrc1ux2ec5RQIevHD5kgeE1HEJYRAJ3ruOTGbjqn63LxuVUOj2maQNCe31idZBWyXDXndnP9A1byzlxAAM3WQ7OlCNvIGlhzW55UTVZl827/Rbjq+52uMMZOr74v/MTF8lgKjbghgA9Ku8wvsh7w8O9qLHvbdcO5WpDaenasXdz6cJ7j+PmxVh66rgQiht2K0qd7M6YsxM+hWcO44D4bWazVMpnXhhBW5KAJu5GkeR5RNN2FsMheyRo/4pIMe8i5fd/Aik0rxWwHijofAk= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d8e8304-49c3-4f30-1ef5-08dc84bda8cf X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:42:09.6525 (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: JmjlCerX0nPBgEhBGwkYAvw9ygo8LIO6jJOYgXTd8nhbkS+qI1ep/kqOJG/yb4KKy+Qc3TTnt03Mutn88uhxmEu7eRsPoxBuLCOn9F8NrgQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5893 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 malwarescore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406040142 X-Proofpoint-GUID: rBw-hTFVFaLW1hhHoccrVQ1p-fgxij7k X-Proofpoint-ORIG-GUID: rBw-hTFVFaLW1hhHoccrVQ1p-fgxij7k X-Rspamd-Queue-Id: 11E6940003 X-Rspam-User: X-Rspamd-Server: rspam12 X-Stat-Signature: wt7f3efn5yfg56hsb5xjsndwokkohg6s X-HE-Tag: 1717522944-688241 X-HE-Meta: U2FsdGVkX1/NY8Z7HlZb0hnTiVaDPOhYUyDTiZ9IsZi1xkqd+aWIiL3+IWWwE8zvyeiwCLfco1WJ8msouwDBfm13lGjQPScwMxMKipRMw3CXTwYUhXn3b+VC5k+88IMUEwfL/FD/PXhn+5twGKRXfI6dgTDvy811bPjSPfMLYKwDKRZNN1v00H6bRgyFdLmvFuAyjVrF2QA9kIVLVtaZj4QKHTyU9pVZelK6EgFLnRTBPPbN+BG/lAOeQjl/r5ENsdknCCXW8oQ5ObHIAG9ZYdL76h1dEJlkZh9UFvAHTzVpgZ9XACS4scm3riKV4VxRFARDiA55w+U6SBtihxkuUMgPWUHEajKs4MtJLIv2RFroc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is6j0aUxZbS2STZrt6yv3Qe4F1H32cQEBG4= 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: Set the correct mas->store_type in mas_store() so that the subsequent changes to mas_wr_store_entry() can use the store type to complete the write. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index d74847045bf7..34ff1b3f729c 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5589,7 +5589,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; } From patchwork Tue Jun 4 17:41:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13685757 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 51723C25B78 for ; Tue, 4 Jun 2024 18:51:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CECC36B0092; Tue, 4 Jun 2024 14:51:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C9BCF6B0093; Tue, 4 Jun 2024 14:51:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AEEDA6B0095; Tue, 4 Jun 2024 14:51:42 -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 921E66B0092 for ; Tue, 4 Jun 2024 14:51:42 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 0F4F5C04B3 for ; Tue, 4 Jun 2024 18:51:42 +0000 (UTC) X-FDA: 82194100044.21.6D1A426 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf06.hostedemail.com (Postfix) with ESMTP id B734C18000D for ; Tue, 4 Jun 2024 18:51:38 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="VQ+qVnQ/"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=MNrhIruw; 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; 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=1717527098; 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=qE3lKRhOHhotDxRjulc5YenacaU3n5Sw0mx2DUmpLno=; b=RWckDN5RNBPHxOADHbFdSMXgseFtq7OxuM5b6ok+4ARRQQTe4W7ELYF/pscVQ5D4DsvGuw f16sSsMW06iJlN2LQ3ukxWB7qsF7X0P7K2hcfUXi0bh5lmdsV8bT+C2CLXZa3jamVXwzgy 1if5PmnIez6gfFOVbG88u+NKZ3+2iTs= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717527098; a=rsa-sha256; cv=pass; b=2wvLC4Z11GjcFkO6U8/vJ0pB0M3TP7BTzlRkfeaN6DA3W8n7Tcxc+liMIwA4wpDrwreien MieIyUUjiYn1B0FXSDSzG4xFJorY7bp7TPjx2L4UotHF19LseSkxmArhrIlPqi5F95RFLp 3LfzTT+BAj0SbVgMX2Vq+YWfzta7Iyk= ARC-Authentication-Results: i=2; imf06.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="VQ+qVnQ/"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=MNrhIruw; 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; dmarc=pass (policy=quarantine) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") 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 454BnIf1028071; Tue, 4 Jun 2024 17:42:16 GMT DKIM-Signature: =?utf-8?q?v=3D1=3B_a=3Drsa-sha256=3B_c=3Drelaxed/relaxed=3B_?= =?utf-8?q?d=3Doracle=2Ecom=3B_h=3Dcc=3Acontent-transfer-encoding=3Acontent-?= =?utf-8?q?type=3Adate=3Afrom=3Ain-reply-to=3Amessage-id=3Amime-version=3Are?= =?utf-8?q?ferences=3Asubject=3Ato=3B_s=3Dcorp-2023-11-20=3B_bh=3DqE3lKRhOHh?= =?utf-8?q?otDxRjulc5YenacaU3n5Sw0mx2DUmpLno=3D=3B_b=3DVQ+qVnQ/j7pW678Xd4fK6?= =?utf-8?q?t0AJDRTOfrQd9/MjLSmD4I/HZ8OXNuM4cUGX+QEE0H1mM1d_rXjHQIk+JW7eDrX+8?= =?utf-8?q?jS5NfohFoqAw+yAfJs0sdToHnCfdfxMwK2eSn/+jftn7Dzi/2Pd_yF/eI3MBaLgab?= =?utf-8?q?C3/OQbtGshBUPJ2F8sqHb4kuSxN0o3rd7SeisQ9d6Va0gVF/jc+OR9M_hpWJbqGUI?= =?utf-8?q?i6QmHBshjFF5ZD57rWH1C37ZIV6xoytYyg7H0dG7+lVXLNeFEslWFUjpjQy_5hC3K?= =?utf-8?q?clEAQF+MoOjJmLfvGSDyVB1lIeVkwlmzvXo1gfMCrnkUVRKhWPyyIzBOzSjnYmQ_V?= =?utf-8?q?Q=3D=3D_?= Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfv58dj9r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:15 +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 454HNoQq025242; Tue, 4 Jun 2024 17:42:14 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2047.outbound.protection.outlook.com [104.47.55.47]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrt8xx7h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GwMlPx8vqvqj+ydH3uPGrbCdjuihKo8X5sR5rsd6ZEbF2zu4IIg+sdmybegvMuT6/3KODPdrTll8io1jmjZ4zuuH3es0h8aVc4eqOf3LRQEIUR3EhzKzrYIhqIVqeF5m2nrn2uBrqY2Oxj7RJUqY+epd3jTj2nn56fwLWOGuqTG7B1rxvBCVJ9mLneVTegxuTq+oUAmFUJQWBCCrpbw4A3vWNvNKRnijGkQsg5stwnnKFVj8rTsb/meSfRR5zPWBHOyvQGDIEnIsn5sT5A9yXMysr1QXYpCydQ57M0XU8pWAF09S2KihE2GZMW4o/N+8PD3u+ZuO6lqhIB5MXuY70w== 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=qE3lKRhOHhotDxRjulc5YenacaU3n5Sw0mx2DUmpLno=; b=AODb+289ncSrKSzKIAqF1KcpE/C2kOM+qjrad6XaK2HG/ZLYKIEpnW3qgSUgxd3Dsw0ABDiiPSvIGZ3+jjuBgTLDbCNth6YW1tOtk32PsU+JVWcBnKbZNutkUhSjNB0+B03GaIZPrGSypj43y+gZ1TmPh9U6z75g5C5euSqY1pBKD+iMpgAweWhGy7RJ2IV+CoTtlaZaxOmEPVsAOqtymAUpflGeQwfPIlF4+WC7+mcfU9W63lEvuz8a8DqIfhK1uvjdQpzBq+l0BAvjm8c7lZZIRa2FsjIHxZAZj+jO96hGEggMxZuuWXtguhFAACCr7XSkxCjR5IhZ15PHmdqHJQ== 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=qE3lKRhOHhotDxRjulc5YenacaU3n5Sw0mx2DUmpLno=; b=MNrhIruwvRBFz44zEE+YJVRij3EF2cx77wImL76CJsiebN+OX6qjrilyg55cVvGaiDqt1wv9YH8yxdfnh1BE7DDjtumRxeAPtAr0B3+Kp4gZq5Hk/Y2z4MpksH3Y5BiinIOSX7c7jIbhzwJ/qssIdjjmULq0ZOBE/3kkIPYI3eE= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by PH0PR10MB5893.namprd10.prod.outlook.com (2603:10b6:510:149::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17; Tue, 4 Jun 2024 17:42:11 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7633.021; Tue, 4 Jun 2024 17:42:11 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, zhangpeng.00@bytedance.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 09/18] maple_tree: use mas_store_gfp() in mtree_store_range() Date: Tue, 4 Jun 2024 10:41:36 -0700 Message-ID: <20240604174145.563900-10-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604174145.563900-1-sidhartha.kumar@oracle.com> References: <20240604174145.563900-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR05CA0030.namprd05.prod.outlook.com (2603:10b6:a03:33b::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_|PH0PR10MB5893:EE_ X-MS-Office365-Filtering-Correlation-Id: 242bdf31-f1cd-4638-0e83-08dc84bda9e5 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: IXzwxLq0YvFeuU6zZm2QzGuGqfiUlohmJzugPXs44LJHef9vuCHU2+BG2hIM0z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FTR2YYWvOZkTY0n68Zfaovrhuyx52rzbf8IDLsIJcJUMogCtWsSC79hU8hHPnQOT/zupYEdHBy70pql8hGP2zzRPvLNstGSyy6wifi/YRNGtaqJY3uZT+PIA88PnjLff7jRyv3MOO4wn/cWcV3elwo50APf/vhVPDEK64JZK3jySuFVYy6SD0iyc77zkoX1mWNQScfmnDOcAA8C6hnuQV7CyB7+Hn 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: qz3gg/tYo3HyH3+xeMOp5zOQcwC9eOeaJBrnbV9cd1DvXn+BChSK3ENUV7vafSVmci91UgS+UXXB68SbRAD620Yj80bIqkqeTxKDIoDbYa+pa/lPvqH/bl2+r1DMRZM1yw8VKlH2SCXzkU22G5kmWKthqHV7ik9UGCZ8gG3otmGofqpv1repQME+f/vCV5geXU5rPwLutJzF47l1P8+R/GPTe+nht6mQ38jRyDy3g5MW3UaFD8pRKFhf3AlqTKIzz3hzfM1Fe7aySi9ZlvnJX4GRbU2HPcdDB892o+wRTTN76LIN5irhbqnw1nGZjq7hYl1kGlug8rQNfFCW3LIUQK2Oh2dLcx5zr8rlS+it0R0LtUBJDB1ri6Pdii8JJC1M0EmczwhjPUgBdHswGljycJm+NCG7OZDekVrV1zKXso8abhMOMW6F2UVzrgboeR4V0bh48kUNj9iblOHShF6U75OE9PrI0WkkdRz+B8zSvVpFbCz7A2kJtQBSXwfODI66aa9+82I0Te1DX1g7k6g5www1JUwd51XrFYk2QXzbzN71zn1mPXrgeoq7GgT1//nGu27u9B7FzMFDfDH4Ka4IGtSViT1M9gVi/SbIwbTkM38AgOwgr75b3mkCm89PQcfxJlvAhJag3gSXclTV31DX1GGb/V68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z6XTYh/bX2MwYMJAORQM+pIq0JY5uISAcmzFdloLxdJA9T+Turo0FOh/Jn9k82jtiAgHziYY7p+H+0H55Yim1v+dlXoutP6F8jaB4PKLovwpgpaCvIEvs0hogaQjR7Zgjjs2lJw+HQB8HsvGm9w6X6i3l9RTDItcD7a3pAh9/gYlaWneHKCgr2tKaW8OU43oyGS86LzZPxCjZNSae443/uHfSghda4KSMBesYvV2C7AiTp/bFW8WYjObpqZLhMBtrWRvG1nWFo0I/kxdfTLfPLQSoO9CDZZAmxRCGT2AVXoPAgBU+kB9bSJXCjkqzUEVepwrcakeZBsOCktjG5JwyEZG23an06nDsqbXsrJKOIuf6Uzgx50yLnWRgH0UQGe7EoIJVnBS3iUxg7RN/u7AvDsz/4p8K10HOVS6zyf9rRYEpaqilsoDuScnXS8reWcuAXa6obY5iUACwReiMnADc/MSLtNDzQBfos8MEO8QfWEw/wUjhpAl7Rz1FpToOsGB6SldYFiucH9WBkZmhsztgV5L5iHkvBnb2z0Af9RZLdd5zfyC2j95ULqouDrhKJJJpn76oyYHTSz2giUZQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 242bdf31-f1cd-4638-0e83-08dc84bda9e5 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:42:11.5062 (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: PwM1NUKD8GvnhIWhG9hdh4iTki9PWtMFIiZxDJn5hiV4ITbbhdiXjiYoYwmPdmsQg5AcPAKNMas7EY1J6wuZyZpKxTmPzbCaQa6WQtmj1DQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5893 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 spamscore=0 adultscore=0 suspectscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406040142 X-Proofpoint-ORIG-GUID: fpFyMsYOsUmCGYh3QBXmq5tmS-FwDlOW X-Proofpoint-GUID: fpFyMsYOsUmCGYh3QBXmq5tmS-FwDlOW X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: B734C18000D X-Rspam-User: X-Stat-Signature: ygxw34zywmun8p1bfa7iohi31mkhjr8m X-HE-Tag: 1717527098-925951 X-HE-Meta: U2FsdGVkX1+DTFJlucOqi7CVdGLn09SrnYPP4vOECah5XWYHt603MN1OGiAPwFxvAMAruv0JvGoSu/iASS9O6DNUjUIQ3lgXsJvHvvXrgiBYEgseAdjW5yPYfg8bcNVit9B3C1X6yasHp8AyDKARkfO5jcdhklcB5K4zXQmx9WSujnQoQqKwpDXHSvkTtyEj/2aUT0RSbS21KhjXnqur6PmBmSaYiNP954ynz7M62ZCJfl01iYMvfAoAmGOia/+AmDJjjYiym7zoMwEfC1yOxYD0Ya9Ip2zD2EiIys4WZCj2CdvWQqMVnid+6FieFVN3qWG43BpYVrx8L38cvDqn4LnDMMG2HRzr89gJbQqDmABbUz3Nv2z7ToEa5J+YIAFij9tcADkr2w+V0fgD8rfI2x1VZpD4jQG/5d2hrwxMEI2fodeKl2DP0thT/FDMVChN+Ix+24SlP9UwpC+cuVK4hqYpReEDZZsLsgpCs1yt/fxA9VScghhy0x7mN8FpiuAnKE2J0ewSFMw4wrxgz5gS5HxBFkbJTgjL3LTvickVLdFC7e3XQISm0mCcSDwPm8LcUR5Tzw4S0QXGxjh5Ng6MeUp9s/YB6rcI3Dlq1Ikdk+w6lE82YNYWXZPS3QT2e0vWgYvD0xGJHFTrTnA/yFQht1Xq0r4E61zvHmPM2f3XlvSER3KHG9Kgio0m+fewCEptSEqYnHFyVXMXYBXG5LDVqhcV3fh9YZsT8umeFHKKGoxCUl1f/snrfB0vVrCPNiAiZpogOQ41wYxmypR4lLG1ov6WjLoHJhv4VSlRiH/FYvVxjpFSHNtnop5R2QJgZsXmlJf1Ojwl0ORSyMOkeLHxSti0fhvFX4wGJR6l507LKnc2Cv2ZH6sX1SFXoI1QmHHr9sSPiTT7Cc4mIyh0DoTL5f4tScBgA+8eDsnxdrJ3ReGUpPVuepZ98V70nmlDDZAYkFgCmvQ+5mUsO6Q0LF1 eez8PdHt B0dtbqoWi0Gf9H88rwNN5gddXdR0i1BbgBj0tjZ6UK4PDiny927mCwwQ887nIsXciq5F16TB7cubPw4PxCg+uqms9WsSDUIaBYQtpvN5S9t0FU44ZdXYWWAnRFlsLmlRAJh/T4Bg4ALqKIe6wXnI3LX/W0ecm/ZYC8AXQ2FlX/t+CkSrmuwPKDsQfoPdGkaMjg7PRcvezaKdZfX7m5gg2kreapDtwgf0eVKKqhf8C6uNbd0yx9xPORXr0aX0O3+F3wgWTw4aZqrXFQZHkve1jziraETFmlZW44CqPOffOi4U9C5gv1DevG3k96oJCXAKnLNdrnczk6qD/ZUWIuaEfeCSFZFuOlo48LD1gu6zlrBqMZnvWiMaDk1zmgKF2alXlgk3SJ+/xR7ChOVwvBsIYNgRhHkLGYzhOLzYvlWf8wLQotiApaOF4CvPVkedoGo6WIT8pqDzGnhZLsGXW0I+tcmBgUQ== 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 34ff1b3f729c..e3ec6649f7da 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -6457,7 +6457,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); @@ -6468,17 +6467,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); mtree_unlock(mt); - if (mas_is_err(&mas)) - ret = xa_err(mas.node); - - mas_destroy(&mas); + MT_BUG_ON(mas.tree, mas.store_type == wr_invalid); return ret; } EXPORT_SYMBOL(mtree_store_range); From patchwork Tue Jun 4 17:41:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13685754 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 900F2C25B78 for ; Tue, 4 Jun 2024 18:49:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2B1666B0083; Tue, 4 Jun 2024 14:49:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 261696B0092; Tue, 4 Jun 2024 14:49:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0DAAC6B0095; Tue, 4 Jun 2024 14:49:04 -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 E40986B0083 for ; Tue, 4 Jun 2024 14:49:03 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 9B4281A0917 for ; Tue, 4 Jun 2024 18:49:03 +0000 (UTC) X-FDA: 82194093366.19.920D1A8 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf09.hostedemail.com (Postfix) with ESMTP id 1DDF014000D for ; Tue, 4 Jun 2024 18:48:59 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=IyNif54f; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=kG2vutiO; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf09.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=1717526940; 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=7+x3u2+/bHbWB8/QSGmRsO0iD0mdBl8MbJVOtKnMvyA=; b=etDv/vxS3h9LCkwoZCzq/gBo5IclKWIDeREKM0fyilAyJbueCCvGfDF8cZswLaVgozPJoR PTPfaiBBJt710VAuA2j8ds/NYbrfNMPdDvoi+UCoEw7dqHxWoeNxpckjAS8ieky9nmcmKi GCmBru6clHgLYFCDO3myyn9MKFRJL84= ARC-Authentication-Results: i=2; imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=IyNif54f; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=kG2vutiO; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf09.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=1717526940; a=rsa-sha256; cv=pass; b=8CCPqnvYMyQSSqrgX2vcRsu1ullAD1AavDOB7J4WJgL95wcxuTDyxxPYLPst3dA0VMwrRP Sk51XOdRCab4bFo0MAyiTemrLK4oe8rvuQGvcz/f6Cfs+nkQypKu1u3Wt/gP0YB0lTniHN 511qavqO1wreSyWRqoIf9u8E3EHBNKo= 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 454BnRx4026501; Tue, 4 Jun 2024 17:42:18 GMT DKIM-Signature: =?utf-8?q?v=3D1=3B_a=3Drsa-sha256=3B_c=3Drelaxed/relaxed=3B_?= =?utf-8?q?d=3Doracle=2Ecom=3B_h=3Dcc=3Acontent-transfer-encoding=3Acontent-?= =?utf-8?q?type=3Adate=3Afrom=3Ain-reply-to=3Amessage-id=3Amime-version=3Are?= =?utf-8?q?ferences=3Asubject=3Ato=3B_s=3Dcorp-2023-11-20=3B_bh=3D7+x3u2+/bH?= =?utf-8?q?bWB8/QSGmRsO0iD0mdBl8MbJVOtKnMvyA=3D=3B_b=3DIyNif54fyiEwHSTIc90GO?= =?utf-8?q?SCgw8IIkLiYMNjUfv/Dnd01lyOMbBstC37tXDQ3xqntT65c_xvdU7lcMD8n9ilwar?= =?utf-8?q?Q1rRKCmQx2xEsPYrMvEeSqqB92/Z1KH5REwSm+ijT83NycngfJu_/SSRSW/bqG2Qk?= =?utf-8?q?Lfb0jiZ1GjFoeZHpkZwVd9j1K7sgBzp/nKznJSIt2yBY5VrNs2F5c/Z_ZvjY0QZEl?= =?utf-8?q?kIkxbK7LrRJK4ZUZPS9takZW/5RUqH7gF8idbmGC7sJR2LEs5GTeNmkbHxn_vYJaO?= =?utf-8?q?63RmiNJquJwwzBIJqJvQSSP02ShcZiENZ7JHNOi1lbUDUhTfTGT2M1q1zJnTIe1_+?= =?utf-8?q?A=3D=3D_?= Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfv07wjy6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:18 +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 454HbJvF024002; Tue, 4 Jun 2024 17:42:17 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2045.outbound.protection.outlook.com [104.47.55.45]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrqx69q2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=joVKZxE8R4GowqHZCQZ5z9ym5VnlqPzRWKVvFuF7AIMGEA2KoYxEbWx9PbT5bTDU0fEG1iMBqJJDUbPJSA7R9Cxcvl9Y9Mt2YJWktISgRJ/eWmy19tKkD2qyEReKomhVTC0MNZmtFmmJvHsHRAFhKCQKTcb6la9YhuMczSgTGvP6TQkj9P15JZlhcCew3iejc6tydy4SKgdD/MH+rRM3esYQnYyUyt+g+VCpw2FCVp6NfiVjNk/eW4GnVSXKBiLNZvWFRM6wSo4JpTU2LXTEHBtoccqunZgaApEjdVnTqI/x7GMhSUbZ/dUuUvt9RHPN5nA3y0U8SNw8KPeW+Vh3Ww== 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=7+x3u2+/bHbWB8/QSGmRsO0iD0mdBl8MbJVOtKnMvyA=; b=XJb/tSLSftW3D8bH9SQlfaeamiPo8kvyHoywhZOJcQKRZEOOtOyVw4C/0SGdCU9aAwW9BNDTTlr0hvgAtuI0b6oLCapm+xiHFLOhrZ9FxGAoDEShIpZwa2PYF3jUNEgdLafdhhS4bjVVVRpEh6mXP9u7GEaBOKvMh2bITGvZDDposl8O1xJztBt7MRc1XwdK3XcH+varskk8NgA297+W390CwCDQvCeiz2oFXGLfCEuRkbbm8g22QQoo07IpuNNW+3F68ieMqQQTRLPW4/GrxjUQrkXsXM3iUOWnjFs05BuTN8ivQcdVK0rXVwr8hZvxmFVu1bpcUZvLHlu46F7gzQ== 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=7+x3u2+/bHbWB8/QSGmRsO0iD0mdBl8MbJVOtKnMvyA=; b=kG2vutiOhRzOQGPB7N9Xv809UBi3EH1pnwSl8y7jeVCdCgpjLgR0jILtlZbEtCwgYRYQEcdynG9VgeYWNeFsiKcAP9efCcnQGtyRjroIhhzgijgLXeVXOHL5i8BvMiIDpRhI8Afcrf4UFBaaoNrWkLVF27t37hfhVLJh9Psrq14= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by PH0PR10MB5893.namprd10.prod.outlook.com (2603:10b6:510:149::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17; Tue, 4 Jun 2024 17:42:13 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7633.021; Tue, 4 Jun 2024 17:42:13 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, zhangpeng.00@bytedance.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 10/18] maple_tree: print store type in mas_dump() Date: Tue, 4 Jun 2024 10:41:37 -0700 Message-ID: <20240604174145.563900-11-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604174145.563900-1-sidhartha.kumar@oracle.com> References: <20240604174145.563900-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR05CA0191.namprd05.prod.outlook.com (2603:10b6:a03:330::16) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|PH0PR10MB5893:EE_ X-MS-Office365-Filtering-Correlation-Id: 405d5cee-37d2-4432-7490-08dc84bdab2a 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: B5C6gJRc3G9mEcWGvyjccogHpND2SQeeNX5R1swj2dGv3c3I8XScWPJwBdFuYd9sYNibzziz4wYD1Idmp3r2XyxtQaYXolkweL8BQXWBewHX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m0pdxgdsPQSGik+Mipo58eypI8U+MBhkgt0DoQs2RWVGX+k537cDFGb4EUDhKWcgx59pTwed30X4m4CEnPNyi1ppCVXk4Xpay9Ia0fG8inE537wgrMKK0rIji1jrosizVVqAabrk4ni0cSRYM08sv22 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: 7F/y5xskdkhdGZRMJNUIo7hDeHEz4bFd+iu85SHXxl00EdBo8s5PFHwf6zqKoSDZ0xAwNIxc0N1bGgtcDWnjEcey1RupMljsIQs+88g88Yg/IKvmo8qEjGzgGDWaH965CKcz8NfLNJ6hfoYjjS1WSgAlqLnu0SeY2LaHZ0CowRWl10I7PwmWbmhhescYlsbdJraK9YpKUhXPeDI1UaSsbljGcqbqxbCf+KGIwXt16Pr/qb9AAnsxpxingVUWlw0bcvABkv4HIRXZc9LTKLV2GJ6Je5EdIkx8om9AlEnddE9/WcNN6Go0uso0qaLN1fUpquLgMSYsXIAHzfViVu8WWCgK48iXW2/bJWQ8MhHavDsXKcqT5wHrOyHtLu/tkK02s1tnaXx0ho8KHFIQ9DML6l0bHIv/xthZjyMqxn+OH2iq/T4xHRspNtpvwOQJMSG+YrXyZ18Gr1uokhPbZKxHm5zHAx06HB8EYseHHKbq4KzWgDTcBC896yyZ+h0cJQAYWJuARi1xHBmX9qEx+e1BtyTZ171b87FjFNW5hyTu5z1SwA9ZA4SQISpCgr7UO3ishHaafDOuZTxgIG6ZwpI9gsz32W6DRuOwQl8XfK4hjrZHU1UkY+yI0tQXeARItXqdRt/0w4zndhFb7hMZfbpbxY1aRNlHbrsrMNhZRT0l1BSvwfTJtWaG3gjUs1jDhWDBf/5+F1sN0HFLztWT0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4sKNzNZzSpMbRppz3U+qBfAnbxDkMymhhCtn1DcM6n569gzo4MvF5+lrAbqT56yps/QAqxe5yHqlMGwRFiNDxAR86czPrObPdSkFwELgaNq/AHwvQYkf92ippFJqOIeK3LZdkziZVIJv37giTY8iHmnjRmeDwuGxD45E9d6sza6jM991S8aL0/7dzNUE0xSqGEjqwzaIzE5ozmwR55fqhtJRnYs08vPeoJuF2u9f9FA7ejREea9JNebrjJaVwhGvDz+Mmu2p89nCvtRoVTjXfk21LdDzqHVPIM90HaMhrfwYpZ7vOv0tEEbi1S4ifNYssxlHfvkTjZW44N9SdKX9UXXSgtYlwQu//UEx8RMX41YR6VGfiqoGBL0B9wEJhxSE0XJonY1nb7Nyyz7JgvRFivAlIA0mT0PkTnfjmNPGW+NQ3QS3maPZllc8jMn9bwQoXajhBAxgFjElulilrWiSqiRz4R7SVXvvZ4mm3rzAJH04Y3bD2lwCL9HNK+YTpR1kuD9gvJcdbvTmbkJhYdSO1q2I= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 405d5cee-37d2-4432-7490-08dc84bdab2a X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:42:13.6768 (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: txgWmva+J+Fbj5Ol6cTvyuguffRclpQ4qFeHFcM/lPREVppb8FDJsJx8KTgrghZuuyi/ybW87jwiJZRQldYys1Jv/PddwGS/JMFoSnFtcr4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5893 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 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-2406040142 X-Proofpoint-GUID: 2Pa2Yr5cXPSwAKD5iVotpNt70RXKAHXJ X-Proofpoint-ORIG-GUID: 2Pa2Yr5cXPSwAKD5iVotpNt70RXKAHXJ X-Stat-Signature: dca58xxgmuixe9renc5uoxiyb1yoaezc X-Rspamd-Queue-Id: 1DDF014000D X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1717526939-198105 X-HE-Meta: U2FsdGVkX1/1bZZd8IuWBgnMdAYjdsxe+lYeM2bFG7uX4RqAgvR/VxCKHLmPU/B3bo20FjdObFOjmbUu/NAX+jUyIulxJbNsrNddF9Z8SjAssz0uui+fQMksqTT0NFKtF+TruLtt90TeBnqZaAQ4O2jrAX/7+SGc6SBpTgznDK/UIXdCf/7fUiwkjRC052ToIrIBoDupsYLR2Nn6j88j3z4pvb/AXyfsUsEt+4v/z1BJTLGh2qiJX+WG6q/NFpVGTikrNCStEdEJUeXh6RbCAya3Gxumvll7bXumiC0TgO6uz0fW1nUU8DpJtGsw4cJfy3uLPsdvdOfIlCbsCp0fdSld+9D4BXqjhIJKnko/zUAX5lXgIgZGFuFH9zTjqNXHWYzs1Ny3ibOqRhBBIPkd6k75FXYdGLY/XFKLma5MYVgVPni03NheS0e7w5EdFm7d9xk4hTvMIxUo7kGnCwCPqyxi8HvSZ3E0h+9sL38dSLxxk2i1YAY4zVhw/SWGRCD0Hai2VNLhdtEk4Zzd+oC+2Hdlze454/hHbNmhS89yer4ylvQP7yhuhUYYQ6IoJo/oFjWJWEdf0gdeUPslBqQ+Wr07S35wWlFZ1EMA+pMpsBxyUvGYfpy3NocMxFE09+6m8B2dd+kkUO9xftU0g61I85veZ0WNA8P3XvdmyV5Vb6e90IAam+h0dWBADCLGULoX6AZ04Xo0mtLltqMXBorQCKuCTdl/c50vo32Qnr5Llpz5ornDR1TzsNhAmPcb4Ubxkw0xMV4WZz3mQRgfHCcjibwQWhAxDTKrkPDc89wwT9PQjotYFadpS2fTl9FU5AjPEP/lMfZoxJcyFkU1Db/y0rMJMijfMCBWWHBmfHiz/gzr8N+h8wuTttz9gTTosrhxvnJl6YqJmrv5Mo8QPvUOHLiagzIsD659/4IU++4rH5vns4rEDKN8A8rTHcGkBySze5nPC8oPX2y98E4tbQp qpfp/li3 B42Biln/DN1RjaQD11XGKQH086c2vVyuOI8goo2Ha8M6byB+V77PHbqduZrSVChyqeeIvMBIYV7BpIwRHdqrmUuNwGWn814I9pTxvSpJYZVP1YDRiZbdLEXtBMtaK+EHm+OHcwT14xjfPWUl0xyfT5/LzsknI+zrqjZe8DmWws9g2Kxn1Xl9uFfIxikcKfDDPb2zZyfmUpx3Gh3d5GOSkqwHLk/Dx0jt+ujAYafW1Fn0Vk5RPRXmJymmFOxvxqijUAJkGTzjykfpY7u5i5grNC4LV7mp/jNePRXdscJh0Px+Ec4Gls4AbEzQT1kjh1oORo5brzxMhmzbZRIXOl4EFg0JNVdD3uy7sIALcbJLf86c9TBnYzlftMhz1RJ+Qarz0Esq1XSLaUoJqQR+jxdGpDwNqfhnhEiJLi3BVeICPVVSFtM1w6LqSxtCY6o8nmOW4s6TOsWyj8NltDeSMeR2TIotOUQ== 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 e3ec6649f7da..abd2f396bb1e 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -7729,6 +7729,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 Tue Jun 4 17:41:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13685734 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 17363C27C52 for ; Tue, 4 Jun 2024 17:42:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 34A436B0092; Tue, 4 Jun 2024 13:42:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2597F6B00A6; Tue, 4 Jun 2024 13:42:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 036D06B00A7; Tue, 4 Jun 2024 13:42:33 -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 D3DDB6B0092 for ; Tue, 4 Jun 2024 13:42:33 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 855F7A039F for ; Tue, 4 Jun 2024 17:42:33 +0000 (UTC) X-FDA: 82193925786.11.4C6E537 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf09.hostedemail.com (Postfix) with ESMTP id 203EB140005 for ; Tue, 4 Jun 2024 17:42:29 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="jFAvl/L+"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=dySYejhE; dmarc=pass (policy=quarantine) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf09.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=1717522950; 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=BPtTPhTSFq5Lkbe5Z3QKORs76kLwd90+PV094KlROIg=; b=vKuh4gsLNpAS92nnKAuL0X5B82VpeXRJR0uxP7kBo7kgpdBJHAp0gRTitlLejxstk7M1hr eRVCZ0XTdLthrat254mEuJmVVeQGl9aVqIW5fQ3JfxE+tKlkt9mgm+jHLS20Mcb1lXuIHZ uNbpTlvvKmg9UVJiP8UwKSnDVkqiL7E= ARC-Authentication-Results: i=2; imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="jFAvl/L+"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=dySYejhE; dmarc=pass (policy=quarantine) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf09.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=1717522950; a=rsa-sha256; cv=pass; b=oy9KyiT7urNo1e32FGOixzPQbyQDIrNO2zYf1uGRFjTgVlZ/S8IFCJuQhvJn5VMdu/uQoi TG38JzEyUb7jEmwE8fxGqoF9VLJ0Flrsv1vWy+jZP/D5U0yKIks4WuLoZQC6faTjBbpbhV 24q9VDEK8tmeQpGv5p+UMpcybgUnB0A= 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 454BnQgJ026488; Tue, 4 Jun 2024 17:42:19 GMT DKIM-Signature: =?utf-8?q?v=3D1=3B_a=3Drsa-sha256=3B_c=3Drelaxed/relaxed=3B_?= =?utf-8?q?d=3Doracle=2Ecom=3B_h=3Dcc=3Acontent-transfer-encoding=3Acontent-?= =?utf-8?q?type=3Adate=3Afrom=3Ain-reply-to=3Amessage-id=3Amime-version=3Are?= =?utf-8?q?ferences=3Asubject=3Ato=3B_s=3Dcorp-2023-11-20=3B_bh=3DBPtTPhTSFq?= =?utf-8?q?5Lkbe5Z3QKORs76kLwd90+PV094KlROIg=3D=3B_b=3DjFAvl/L+BFGX9WqCcq2ir?= =?utf-8?q?TTNP8oHSeWONISFlwqPB5zq5KsocF5glVTJJ4I+tVZTslEQ_Z7N/uM+XffOB8WxIg?= =?utf-8?q?aXHb4YGNbaYDXnWrt+ENiBoa3n0kkcTg0Z8yo+sRO5XnH6s+bzj_yoHsFrtYcyJfC?= =?utf-8?q?Oh+8q0qAaEldjUdGY7W02bM9fqVZtGJ1G19p6HSbCNe5M3+QzKO/XBi_Ci6PILK/d?= =?utf-8?q?TuqDFaukYBDZe5nvfCIZAp6hK4eGNg8kolPC1e0ZWqhQPusWQZdNztPj9S0_8hp6H?= =?utf-8?q?SIKVOaSlzSx/nch3J2RnVA6p12G0hOi1XEIB3N0ouG7lhGkbxUyxsii4u6vNdim_X?= =?utf-8?q?g=3D=3D_?= Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfv07wjy7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:19 +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 454HbJvI024002; Tue, 4 Jun 2024 17:42:17 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2045.outbound.protection.outlook.com [104.47.55.45]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrqx69q2-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nL9znb3RP820P0FOFmZTiqIT7lXIQ14qHoFDfd3VDi6+Mb5PA3T2O6PHOBRsXW/hze45LXSuGS4wWOtd4U/JkxnkM6w4Hz3/xI7psBMU5A93jSI5tnxj5PG+qR7cBRfFpvdl3ftndvMt0rTxFoigdpFCx2HDd9zFibS1nmqWJ3L+hhTOdn9gZ/hV0+4BTRJmHI1LRB+ZGLuISmLsBUEULBw0PtP28V71TX7CU3I7XBHnMmIdPAgteqXKKdd8HWiDR6/MGL20b5ePeFq+KdFNyeCsZnhcCz9DDM7fruyiyuN/e7NSySN0qwyJiXJnMGhYUJLCtDfR3KVVDMm8xee2wg== 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=BPtTPhTSFq5Lkbe5Z3QKORs76kLwd90+PV094KlROIg=; b=OYeikNjNgvd+uXyYHhXqX73hiXQCLQGiFVbQ3x2YLT/eHnKxKMY/G79/bf2vLMdWjY6gu1oTBFl0SFmFNgXDLWGMVumwQlhguGlE9Swfz8CFBUikJ68j95mreya3v23ZMFHaxWzgytfrhoadIpYsHqhD0Bsms+y7Aopj2GnG8AdylssdEgR7TypcqCdA3xD9CQIW0fFra9s0UQrkE5y3sCtFDBR6XiwM+hWLCTsQxrLUJRBNWQFs7TFNVD647tJn78WMk/rHWQgS8ka4GgIlqTJYHJXg6EOebaeUishD1DNI6IACXn/rvcU1nOfK8VsXtQ0R1nRIHI6qze9Hcl9C7A== 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=BPtTPhTSFq5Lkbe5Z3QKORs76kLwd90+PV094KlROIg=; b=dySYejhEU3JNsgAuw7nXbTfF0FxyTO9oNqrSWHHA2uWXfBzNO1yJylB8d4NbQnEq7253joOmWq2RA9nXBsbFLQnZFSfLlZZDWSiBsBXWyhi6eCMjLFn5ox9qZ5pjH4zLvZ2hwoh8NHwaJVD2kN/gvlFTDjhkwHI1heS9IAdso8U= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by PH0PR10MB5893.namprd10.prod.outlook.com (2603:10b6:510:149::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17; Tue, 4 Jun 2024 17:42:15 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7633.021; Tue, 4 Jun 2024 17:42:15 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, zhangpeng.00@bytedance.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 11/18] maple_tree: use store type in mas_wr_store_entry() Date: Tue, 4 Jun 2024 10:41:38 -0700 Message-ID: <20240604174145.563900-12-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604174145.563900-1-sidhartha.kumar@oracle.com> References: <20240604174145.563900-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR13CA0184.namprd13.prod.outlook.com (2603:10b6:a03:2c3::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_|PH0PR10MB5893:EE_ X-MS-Office365-Filtering-Correlation-Id: 0e16849e-7ca6-4ec5-7775-08dc84bdac38 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: HRlGNCVrKsgh34T2EFsu6c18mFI4/z/ihT1zCogoSYehSlDALID7bdcjvfhbj4jHYwVCGxSWKnxsT5GOdK/IBA7uCNv/eXjmiX0J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TaWdAZgyaSF773i2u8SEffvQcIfdAQsRvNxp5iHDD/rRuqysRANGukfWzBgCvFfPgu6hDTvheDsndpPYogx4z473tKCOackTaaO22zdlRPtRzBnypP0Aor2Q1lllUv75Be+D0SS/aBMxQ= 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: fciB/gNATGR8qHrIL62bOlHfsPtkZjjJVmDyuGju7M9fi1BaroZ1Ozi6OeoyraCkXsW4VPFsa2zupm4S916+1/Kv05wHslXeRmZvJmutAOnsTNvUKT0rd8kH7g0OigRiGKLfUveCywdX7lNr3ha0gXQHCfP+m5Thnyo2orALHpdSbYES34FMV4jeTVptTVXEXmOj7gjdlCtVbcJJP11TCYkWkYCdivHqjDJe+m0m6NGVM80115l6nDlXDc8Us7RIhTqTdqA8Gmt21mOy5P7nWKkYvYbs4KVUE9UHlNHizh6HkAwnDLbEDMwMvkocQWaFhU2Ga2FeijFfUXfP2NAh6hqY2Gvdgrkrwk/t1wMa3AARvoD6HhC9Okcud7z68wtBriSzMhJzMf64GD1qlX0yGitWCo+7/iPvdywTzkDV+a/NUjB1C01M0g98DcB12zxjF/p05T7wCa07oYF7kXUcDrhKoYjXbhUUMQ0aMPeqMhNMe4p3zrf7HfcPBYbGAjmTwfSKWMGsQmQmrnE4wQDwRZZENtxjm5itSYBro1rax1Mzr6yIuXmOJv56V0BbL7E+zfMTHmAFyTMokR2Sjji920yZKYnDsDKggwZzYLvJoYzKmcIgVcTttXnZHZbEHSLZJbwec0EbiYe189m9xbBITRdoACvc8fGQJagr1Dmq1cEJiV1ahngpfeQ8seSGud0p0prpESTn7z/pJYF8RNIIYCtsxKFRaRWS1wc5pjfSr95tb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GRHfAzd9f5F0n4ShZjiKJwJ9YD1eMk4TM49A85XnM+S2qPITUWoeMJCP0aG5LiY0oNlwHpDKuE7eKTXUpTDFe2O8aNDJ3iSbbtc//LvzaciJSr1KqUr72McoEM9Yk+v++L24c0qLi/9a4Dg05LQk7M5dcpcmkpy+hG1V2Wl51ftYRbjc2aGdLVsz4iPaLc37FmXfU32A8tn47GIkAeV7rpB9wj3uJQpn+0Dw2NSYa/dvBm8hmRapHule6eS6PJLpSJtWrefAUESaBbdX8fefHoRwz8GvoDx/W/VnBzPjEWgl/d96LhFx9jOMrhVURFh7zuOErNx0wsHZtI3kJtjCaoQhqQV4OV5AHv8fMCh4mYVng1zzoTVnbo9Vt30p8oG++EdBKTBUjcSggirttXymeAQf9UZZK1fSQgi76B0fZb35dkpDylfmZpYa8E+7eOBylknj0l0yJeZKqTHN8M+noT5WsVAvSbNr6facFLMApa6paOkJkvFYk0UCts= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0e16849e-7ca6-4ec5-7775-08dc84bdac38 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:42:15.3905 (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: 3j1JllUW84s9B0dS+xfwsLSw6oxuW0HJvR8mCpd+Ib0vwRIMKKdqNnRdqpVI2bSfr7lKKu8A5vUqsdf5O5+T/1Y8dcI513uU7P0IK4xD4eA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5893 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 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-2406040142 X-Proofpoint-GUID: sPgAtGPgjca7tCyYUEaocuu-5rsppJpx X-Proofpoint-ORIG-GUID: sPgAtGPgjca7tCyYUEaocuu-5rsppJpx X-Rspamd-Queue-Id: 203EB140005 X-Stat-Signature: mztwzaxdf9gyye9ege5epbmuca7bc9o7 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1717522949-496355 X-HE-Meta: U2FsdGVkX1/JtiPnc2FQMKSv/ISfqgl7E2kobQNV/B5kNjl3xrZsoXpBLC432/EznX/1i1a+pSOUvAGj+UBLQaCvWLVrRIumqx5ej6ZWu4rn0P61ISsyOm7SDt5u72EFtut3hloZkrwM6Ee7o4OxMXb4AEG79OOvNDzGg1QQQj5JE9+4Qgm7aT/DOwTlGm6Ldp3Yx04x+lnLnFIsgi5oF3z0y9bnf+Sz0jryBOfDyrG3wQl4U7AwnHfxMGwFvDfdxPejN8UFvMF9IZk6mpst8G/zUg5tpcAU+hYhHSkPjOf4bM9+LBRiCLknq2/Tw9UYxzVIjZpRnGj/no0SVuZNFAt6Siyh0pkHt6L59zrzfTa4L+I0iN6k3LgKm1jRinLz3XgbYgfGmXeuEilhpPfwgfK9mV9VmTZ6grEh64XyHqfLCCGl8Lx4rYawaOl+kh2wnDCS2RNzthweav3N5dOOM9JkT9CgANJwzKz4ecymlM8Fnjvlz3YTY0DInAWMBe8g6YE5lQWM35EMFJt2cNkJjuA+B1xX/hRvgeJ7oyGMjsRO2+S/dDKq1uyy6Ubb3TfYa1QSSqnGD0iaohmYGp0gQ2BCaiCG0GJwYHB//OrxxJcHQ2+9C9wQrVwZvIDPJgD2LDC2FNHUWnd9WnD9BrMUoKYnd/p+5Kbdh+41rpjU1E+Xb8ISP6J+Hygps9+7N8sm3wMkXBeWvudhDsfCkA8QcxD6lQjcfhbTPjQgCp/ZAMYpliXutGwpdSviExZe+mzGjN7s/O97kAh8+BSTNpcm/J+dU66EbwikRqKpFnP75gE60c09qexnJEDr5M7tA8PkFD9dp5/mOmpDX0bNxj4VNKTdNB53aYBwjDg/quUqYNwqh4MwnSak+JMfD3uJ1ertxEHZ5+P35h6RNUwkih7Lfn8XEZYyt0Ibm6R2bR6K+1yTJnfCzy+ZM6KVl9wzRQIGOz2fAxEW9uDzolTlSeE RZh6nX3f jGfAcZvYCON3SyBLMZC8x8H6paJWeBpOTV3jalDBi4kDjo2B2W0dpyGAFnzWQn0KwD9bp8SztcfzkMzHJ7MMgJwVmggJ1QwX+FsFEj0tmbJqB7q5Syfe4Rkn2mM3RU0SM/ltyRVXBfEGug7qrFUIX5qWLITbqcAscgbtjipqZQFj4rXWElLVrnjzOrfFTFFft0XUiVspYClpNFWFQ8+1bsaAGQKCRWymopZfo0wH7MEN7oq5Gkma+IfjVoMVzXXwvFdYhe6JuLkzi1k7oCpoByYLyOPDcE8stputKbad3BktJZ3Ll3lOL6Weunv/AxbN7rq3Zkkyx6m+zdNdgkxZnmcwNFMKZw57/tKxfV+t71BQ0t/oayG/ZxgZSAQFiWb2MygkZtEQVYuScOL/oO6CLr8AT1neOWZ1X+jIMAnlXuynIJ/CnYDrIKqbBETDIRinLM5qo44fxATOd9er/NEO4l6hNCA== 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. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index abd2f396bb1e..20e9d13c2980 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -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; } From patchwork Tue Jun 4 17:41:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13685751 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 4468BC25B78 for ; Tue, 4 Jun 2024 18:39:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 914026B007B; Tue, 4 Jun 2024 14:39:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8C3536B0098; Tue, 4 Jun 2024 14:39:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 715C06B0099; Tue, 4 Jun 2024 14:39:29 -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 525BF6B0098 for ; Tue, 4 Jun 2024 14:39:29 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id DB6B51604E9 for ; Tue, 4 Jun 2024 18:39:28 +0000 (UTC) X-FDA: 82194069216.05.F4B2CFD Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf22.hostedemail.com (Postfix) with ESMTP id 62EAAC0002 for ; Tue, 4 Jun 2024 18:39:25 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=MxRPowNG; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=HrGS3b+P; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf22.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=1717526365; 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=EFfMVjj0307ATe57Wpr6UCL8Rk+6A4Ycxlj6HCesF/A=; b=yMWkK5SaWAB2cei5bh1H36X8/JDB1ksIFCnDJz6Som1T9kpQ9T559yJGI7kVqsHcm8Zkfl X9SlZJ58q1uybuVmjr5cORmPUaTG+LdvUIqNWuPmZGyDHhyvAS0LXew2odvm+s+qLk1YOb KOd7Ququf71uIRpT8vWIvWWzazM+2R4= ARC-Authentication-Results: i=2; imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=MxRPowNG; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=HrGS3b+P; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf22.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=1717526365; a=rsa-sha256; cv=pass; b=STgvOu80F5t5Zu+0T/37gmy+SWTa4L6TcmqhFXhJ7D5TCI04CYi3fHmmdS1NMcStFdgufb reYhmHEaNZw9UQZmdnp3/dkT5kojBdEIIlrzAGV1cKcIaTG9fP1KwgBWn4HAqCe9lT0oGp cryQKy/ES+kuMFnwrkMSJt9hhSH/fdc= 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 454BnIf2028071; Tue, 4 Jun 2024 17:42:21 GMT DKIM-Signature: =?utf-8?q?v=3D1=3B_a=3Drsa-sha256=3B_c=3Drelaxed/relaxed=3B_?= =?utf-8?q?d=3Doracle=2Ecom=3B_h=3Dcc=3Acontent-transfer-encoding=3Acontent-?= =?utf-8?q?type=3Adate=3Afrom=3Ain-reply-to=3Amessage-id=3Amime-version=3Are?= =?utf-8?q?ferences=3Asubject=3Ato=3B_s=3Dcorp-2023-11-20=3B_bh=3DEFfMVjj030?= =?utf-8?q?7ATe57Wpr6UCL8Rk+6A4Ycxlj6HCesF/A=3D=3B_b=3DMxRPowNGd2saAS3eiLyrn?= =?utf-8?q?f3094PXk/wZ2viGL1WvVVMa3+ZvQSu5mX150sH2BPfuEB4T_nDufJJu9J5Aa/3ksq?= =?utf-8?q?NGXgtqfrE6EQzHNhcX+J41n7p2Ei06+R4Dwik7AfgYmE+8uyp04_kN6hwgeZwqlYp?= =?utf-8?q?CEcLtPTQYrkNlfTaA2C+wOmn/PtTKNSBsbStUdawznoVKqGSsQYjrwC_pU0bC0Yhh?= =?utf-8?q?Ts1fjbSO2Bss31ovyS2r/ppLwtfCL9qbAye1W8pLZgPdkt9d38/vkUxhDpI_HZOSk?= =?utf-8?q?/DMXqLu130nxNCgya9WxbyLWyphwOrSfmVbzxiq+XQsSc1SlOoZbRTWWv6zWY8b_T?= =?utf-8?q?Q=3D=3D_?= Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfv58dj9y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:20 +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 454GNr3H015565; Tue, 4 Jun 2024 17:42:19 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2047.outbound.protection.outlook.com [104.47.55.47]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrjcnn8h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XpCeQkY7ZBmEoTHs2vdXK8WB2CjJg4JWC+VH7L4sEkPcdy9G0qFPJdjWYl94CWKtLkRNSMEiFtW1WRxi32b1spAB7/du48S/jhILz55ccFYYurjnWlWeL2XiaYFK+RHADuJ4TXKa5Is9+NzPk5NSNolUOHqbBarh2oKeALZPOcnds0i7nGdSpEp8Z/takWl8ge+YueHvCa/C2azn7gp0h1dw6S8ccCAJyH6LLWzVVq6TRgsSkUdAHGS6lQPTp3lY73ln7vN567wzu5VWV0GA3Xl8V1W1DhALcsYvGCSso53bqu/IvZZmqlalQcRN1WM9yTAlLrzAHKqam2A7QsZxpw== 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=EFfMVjj0307ATe57Wpr6UCL8Rk+6A4Ycxlj6HCesF/A=; b=mJVu2Gg7AgF6BKePpOvI2Av5LN1oihP76yRoy0Nj1LG3SkdtUEwnY0bYGWgwIW9TNxZrSzVK9IjcBCM5ozcVCVEMIEvKJTgRTKbfhmoUguhLZxkg/+RbKnJU2U+d0W859r2aJDrEyP+KiDUrtaiaHieKBAQKToQwR2deLibYqj07NiEhxo87JQpLmyaM7dx+gTVmBEejGtObSoUz72naQMjFpND3InkS/jwBX7Tncn6WyYH6OrH5OeyOa1Sl9frX43vDKxMzJrvGfQ71GEA77D6yKAhb6Pc/1Jm1MNpq5urDuDHIX1JAvDYRj4TYYtVLlRCvMD+ixBjD4UKivBmUcg== 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=EFfMVjj0307ATe57Wpr6UCL8Rk+6A4Ycxlj6HCesF/A=; b=HrGS3b+P4DbRWhOPIMzuODGyTXiiKIMIpVicHlMkiE1lrAtVSN6Nerp3cEZB9EtC8cXuxMcfZFr6dQTlShCeQ/28NIkmGOKmrt3iFpMTEpg/IfcUGBodDp1YEUpo5ZVxAWwSjwiATO//K/eZBlO1qKOdDwz6//aPruSeLcU7qpE= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by PH0PR10MB5893.namprd10.prod.outlook.com (2603:10b6:510:149::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17; Tue, 4 Jun 2024 17:42: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.021; Tue, 4 Jun 2024 17:42: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, zhangpeng.00@bytedance.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 12/18] maple_tree: convert mas_insert() to preallocate nodes Date: Tue, 4 Jun 2024 10:41:39 -0700 Message-ID: <20240604174145.563900-13-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604174145.563900-1-sidhartha.kumar@oracle.com> References: <20240604174145.563900-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BY5PR04CA0021.namprd04.prod.outlook.com (2603:10b6:a03:1d0::31) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|PH0PR10MB5893:EE_ X-MS-Office365-Filtering-Correlation-Id: 04ec3810-4fbb-4c8d-5448-08dc84bdad56 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: fx8YT6T8OoI7g9f+ur+pbGPrHdctdYfCvEZNDjXQK6r/F6AlgjgD4FvRq527/Y4YC/uPfjYyh7wckC9JPjSrOcj9jNHzGbrTuJTnsvE85gLIhT9yngY4Bi4eqIOiaFlWZblieMABwAul01IgTiMLaq4THSpjn2sOm1RzYwQajz+oW2rxm+UI8ydHlUqk1XfypibJPWMjzyb/MCsOqvCeCh8PS8dD4beKZeYnFiPY7Jtq22h2ya4M4Lk3veYxW9bemKLP36/cVvvTx01HTi30erYqumHmr1Uqyt3/5fPXxeZ4+V00chbdgqjHI8cxl8PGQex0cAW46rs0KVfLsNcX4iJmepnqpYK9bG6H2xGhXue8FxjAwgVRA7cytigapSFj27C26oCKtyP6Q5BA/FR1gfhTEH3aFZglflKZHiemgEug2oTKo444L8WKxU89gT35KGsbiyGQuCrTyBblcduFNUcvzrD9HEiQOk74RA3UM0JWHQcDnmqYph1IqPox5fTuUi7VDfj1hugZOQdEb5gR4HUyHUby02gw3mvK0mMo1Plgx5JXQ0ZnHkoOOOKWCNmM4/GSDGHazHf7sxuITUrZkI9QlwTyTkrnh4Yn6ERiqwthGvzwvGwLxtnUSgxYhBWov4U2RYvKnNvncBTvHU/xSMqYDOYI0M65PF2FQ8daxWvNWKCcJr9QuFH3Tu1cgkJQM+cpdtRsUToxeE5cxx559E6PuY0YyjcQ+jUlpNK/4QpG4xkShnbvWMmMXn+VIVZvqce5ufoyDtevsIazoctbpNUHBDIdRSD8QSz9bzw6gyYLx4gDpcjaNcQAEF9iILCcLnBD/+0z4frFAHg81ndSIgzh5FGslQBaXSN6Jogz/ImfxAHez2rbkKXCh55VfHVVhbq3QJYnoNs0sz0yB4rwCwI2kaH96Us+9+P+P62i74KMo7GoKeGPY3/K5sU0gj7qLocxsf0fcMZZ4mkDaRNL/UqlTpdC9sexvfa8t9J/IztH/mne9z9byqjbJTmwiNAGgMdMA6+sJ9TjnFNI9Ms21XsAcT+s8fUtATfC+bh+1nJfdxWXAE/4XxXfDStBDXF3sI/tCNEppuFgLUlgQFKIVkoIf6e0CA8i7GZWb/g6+gaZIJJVr1/+018Ma3ieopGqzKYpnDLMT6UmfTDpMgQ/YpuW3wDnNoQIT2Lai6zE6ljG4PZOe77cfEZ1JXwQwMtIkMIDkAO8QElWdcXLQfu7/h5qJUfiCDhwRdwxveFmTEE3/anaX84AlYAZOV4nAJacwm+Wc2g4B2sT7m9LIBySwjCIkNOgywfcspgbq9bn4uDHzRi9NchJ/PngEeAA8xcm 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: ZinUU1qFYwWIC9W1nKI1//VZPfNSM1dL4ZyXfc/Hr0++9jxCblnT7Z4N4/lSWPNBgJ5CpVACT9YchnMvVDemWbitCKnq2xSeFq5wSe8xS4l+egxSfcHr5SOgvAThyU21Eq2wLNEQEC84xLwGbrvdIyOc+Xl1hk65zvzJHkeQLi+4qS7ZrGtPfkflwQA4m1TMPQLLnEDeVS8OohpA/+Q6tf1epWF3zfnCSxTTkutYVB0/yBV41+RkcrJDY/dX7DdmIvqrzBPnzJbK/2yYEgmsGmViiuD4ESDf6u+1L7MHCWANAhBPTz98Fsxxlo6p9Spl6Wgbas+ntK41uzZ7Zp3GNhUuDK7fM8f4Nwu4CJCnfN+c39oFhSvyPTvgA7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OsxQ6+sS+VICbqOFjj0FLc/nv8stoQqq5KTyFWlRpR4hXHxfFnNNfRryNDpcFbZeWVzxWv6Yv8mZJGWLcFxRFT2qhHHm+AwjeFtOOmeAcZHu2KwPKJ9iSGk8okAd9GA5/4iJiUr+JgCQXLpIKd9DRiFJid/Q8dJgtNvm8Mq+Pqd+HoWE= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: SvA4u3yM5wfYFDGDk9XPpIwjfm/1jTYbdV0vXNGfwog2N5j1ACKkWThQO45vzEeboYue6e42ExgwLDuvOEJbrzydGdCqr6zFOKKK/C11yot+Qb4j/68u0JPiA6RXINCgTFZhFMm5KeDfTdHA7/svCkuBrf3Cp1/uEjZVIVaf9mx6p0ovdDoMjqpPKQO/Jht7yh36v4MPqVjMBZUr58mbDF44CBrFUnEZ2SuBKswbIlLNZWI6wffwsz6r0w9FxTfNchy2SEMs8avTObzRK0eSxBJ7Sco2AReVgx9w5AAyRZngCnaurBF34KGfKK7//QK7dl1KrkDMb9VUdntspqbmsqRays/gu/iBf+9qRQN37OXfgHhQ8CHNyZlwWD0RKCC/YkBCmRqBBV+2DqT0CoXfL47gAOH5EZYb5N3TOMd3LW9Lbck3tXn2ghvjRHij5YHa/tRAtixIeWCV8nOuHz+GGmthlblV0LxiTYZy4Wj/fUdB2uRGH1WuYJ3iOXwERIuv/9k0eUbz/BAn9QGg4Fn8Gqg558KEWde6uU472khyuKegCGAHhjpx1HcktbzjsSPolCOF9EB+JGTleJ+tobgoyi8D/SPI8vcUZduUoOKIdIw= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 04ec3810-4fbb-4c8d-5448-08dc84bdad56 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:42:17.3339 (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: hJb2WTfQgHcTzFpbNcate9PY7xndkOcCA+OlEgNmKK26YiBT2FJmgcxUo6din0quAH/jg9ZQi7tk07ZMuzNmtqZ6/AVk9BrzmMLChgsYYGU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5893 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 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-2406040142 X-Proofpoint-ORIG-GUID: ZMVqSr4Kl0NzC6Lyq8I0ug1sQjfAqvXt X-Proofpoint-GUID: ZMVqSr4Kl0NzC6Lyq8I0ug1sQjfAqvXt X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 62EAAC0002 X-Stat-Signature: r1sfkuwxtxzya7h67sg16ftquiyw8i5s X-Rspam-User: X-HE-Tag: 1717526365-576706 X-HE-Meta: U2FsdGVkX1+vVLiZNWxUqAOzhSCB/UiLrT3Ruq1Sr0pG4RjQOfm9pwCXyRsD7MrdwmiwEjpL4Co43iaMyRBK4c31ZyQp/2rfNk3BgzhVcYOMAKjxkKfSXGPVQLtK87ZzobcGlf3Tcg33Th2t2vtcuG1akq7GtSDoZvJ+8C9fGLd1DEnozRDn4LGR4JXqrvvTZV1okS5z4HJRwpRN8lTTvXdEs7whS8HVL28ybRyxzNzlJU3HK1PVj5VleidMbhqSzwh/GwNF33FAt7LO3vcwswEBklafAsZbRU7XScbm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aa13/hT9TTELfzr8EWEU2FuaY1ZxDDlQYIzEQsmBSWTwz9iFWOvCGpYyhxE0bp6mp6sw3NqxTdWTRyHw== 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 | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 20e9d13c2980..314691fd1c67 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4445,7 +4445,7 @@ static inline void mas_wr_preallocate(struct ma_wr_state *wr_mas, void *entry, g * 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); @@ -4467,26 +4467,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: @@ -4531,7 +4529,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); @@ -6532,7 +6530,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; @@ -6581,7 +6579,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. @@ -6663,7 +6661,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 Tue Jun 4 17:41:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13685735 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 4C019C25B78 for ; Tue, 4 Jun 2024 17:42:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E912F6B00A9; Tue, 4 Jun 2024 13:42:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E40D96B00AA; Tue, 4 Jun 2024 13:42:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C1E246B00AB; Tue, 4 Jun 2024 13:42:38 -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 9AF856B00A9 for ; Tue, 4 Jun 2024 13:42:38 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 5ED71140A90 for ; Tue, 4 Jun 2024 17:42:38 +0000 (UTC) X-FDA: 82193925996.28.3A6F92C Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf08.hostedemail.com (Postfix) with ESMTP id D684F160018 for ; Tue, 4 Jun 2024 17:42:34 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=STvYyx7S; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=hUrSkAFO; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf08.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=1717522955; 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=ubIaSEckWfJUp+wkuVmhNaKmXVwwu71VQEcFJ3DDB9Q=; b=D2vH/tVt4AulqN1RTighjE79uhCic2MZDS3SYlxlPgwz0v2MpbTgd5jzAHagqjkrqerfMx IkesKa1An/22+HLmyFal5j2b5oOn2QGJYgORL6P22zQb9q5cZ4hLQrgccpUWQmYCbWAgZl yTK7FDdjlD6GkgOoYSUeDZ59+y5Q6+o= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717522955; a=rsa-sha256; cv=pass; b=Sp3XUk4VjVWhkujT8+USDAWC5v729iLiy7C+iEfW5GkoXDOcmw5pGFYcYEg/uzuiEFfFyk XDyBm1ORWrqev/7XKnKTdY1Z+3EckscQHEM/jc8rpslZ79ryFLuF539kdQjP+TxZz82evx QcsHozDLC+0s9cxl/cphCCklUHrn47I= ARC-Authentication-Results: i=2; imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=STvYyx7S; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=hUrSkAFO; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf08.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 (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 454BnW2b032115; Tue, 4 Jun 2024 17:42:24 GMT DKIM-Signature: =?utf-8?q?v=3D1=3B_a=3Drsa-sha256=3B_c=3Drelaxed/relaxed=3B_?= =?utf-8?q?d=3Doracle=2Ecom=3B_h=3Dcc=3Acontent-transfer-encoding=3Acontent-?= =?utf-8?q?type=3Adate=3Afrom=3Ain-reply-to=3Amessage-id=3Amime-version=3Are?= =?utf-8?q?ferences=3Asubject=3Ato=3B_s=3Dcorp-2023-11-20=3B_bh=3DubIaSEckWf?= =?utf-8?q?JUp+wkuVmhNaKmXVwwu71VQEcFJ3DDB9Q=3D=3B_b=3DSTvYyx7S19v+AcJ+wSAd6?= =?utf-8?q?/eC6r+b6AqJbjblr/wQJPxJ6qnEMmdz0iZiNYFpNbezjral_GxriVPs83VO6Xb2uv?= =?utf-8?q?hEQtICg1SqBwKm6jW4Fu2f4y+ibKaeAM/jfSbDB9LFc9vYyUPMq_/vnLvs7kmptcD?= =?utf-8?q?OfkfHVV5XuZPoLBdsDoEw3QaHLL9rzND3oel7K8Os5Ci3M56Tef6Lsw_OWoLx05rl?= =?utf-8?q?WuvYRCawWpnGzD+gPAjlp57JDs3jvKCLebNK0vu/+8GbHSx28/JiLPT4Z2A_3VUuc?= =?utf-8?q?qivzkBeJjOVUUPbyyi2GfhnTdH4VFWGB6HI0vwmvOyX0dZn4AxuWrZ6SlXUuGye_l?= =?utf-8?q?g=3D=3D_?= Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfv6u5jgy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:23 +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 454HN68q016121; Tue, 4 Jun 2024 17:42:22 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2042.outbound.protection.outlook.com [104.47.55.42]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrsaf37v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hzw/truBpbgZ6g0jbfuY9frHFcXHeQfrJGC9zm5lE37TEtOjWClU7K03wL0yV+BalLeeNR1K4q4pXNcAWK5z2xc+/ds1qXhVW5jDLHbznKTQriZAMl4a456BDtkwMp9UAS+nsqhPY3s31mjoYpBAGienkwINI97a299rNrPXX3IKqpUQEV2V3E+2E3gZxgtO3ftAF/5wqOYTVkBjetVVxi4tCkbFpFU9UcenLFW68zLx5osVfiEYEtyRAh0Vqb0iIDQBpT1Rq6RmpF4RHURwhshMoTCuDsufJn/Rbsmu0BlcKqzmeRDbdA5Oibroy7sH6IvTl+ZKUiRBU4X3AEvYoQ== 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=ubIaSEckWfJUp+wkuVmhNaKmXVwwu71VQEcFJ3DDB9Q=; b=Zv4QX9HeLm5+b7oIORRXaIzyEq/QGXbA5x6SjRhfJcdaQYljJ6HPhNkJSWDZ2Cr/0nf8LynQZbF2iXV5zYmUa1ontorlabH3rOF2McY1VAs9yunTwGTpmrsSS/FCtfF58Fb1eimCmFUAVItGtnkDvPNLu63HtjLTEnpcElQQyi4BMcmIQeltXTH+tIsd/IdM0LzTFB0CqFa0mEEwZsbee8gX2+SoTmJc99OGv3xEVWcr0DDwUjsNqzj9rn6lawDSTquQok8/HaPwg7OQ55sUbN5eVFtSrQa27OYMRHpckPX9ObizCA+QnGPbLfpGaZ7nZiWhRRxvbvjI8V4J02UnEQ== 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=ubIaSEckWfJUp+wkuVmhNaKmXVwwu71VQEcFJ3DDB9Q=; b=hUrSkAFOedraG8um4FDdjpo09CTufqcioahyK3YOTxvGDhJaroU1tTU4gG1Wo8LUpJfW6RqhfqBCf5AjGQ5u6ouICa4HgLZlq5zLSQG1R+AmrEXD8QUnioWhcHjhl4PJYqN01QT/cF8CxSkeyOTtTsWgZWW1JRufKxzrezTckQs= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by PH0PR10MB5893.namprd10.prod.outlook.com (2603:10b6:510:149::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17; Tue, 4 Jun 2024 17:42:19 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7633.021; Tue, 4 Jun 2024 17:42: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, zhangpeng.00@bytedance.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 13/18] maple_tree: simplify mas_commit_b_node() Date: Tue, 4 Jun 2024 10:41:40 -0700 Message-ID: <20240604174145.563900-14-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604174145.563900-1-sidhartha.kumar@oracle.com> References: <20240604174145.563900-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR11CA0077.namprd11.prod.outlook.com (2603:10b6:a03:f4::18) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|PH0PR10MB5893:EE_ X-MS-Office365-Filtering-Correlation-Id: 6fe7c6a7-65c6-40bf-e3c5-08dc84bdaea1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antisp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q5HLqQFutT9VlETuR3jYxRSAuoEW8suIzZ2shyEAIq2CdJRe4/juwaF8moe/bxf009Yf9prX85MKFG5n5jLiFfND3BG+i6POJy783oUuSbOVlGz6WIkbd9+ilAF1dddVJY71cWItZLlqiG12Ja6BTR211nQTU12eUB/2lbTDFD50Mb8rIkGoEZI2ZJYGi3BDVHFIEwBo8fcrdxCbXUYbx1Jb1uSizuICZK7QKT/rhGFdHqevk5J1wxIds1jwCtxeOJk= 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: 3OttyyjxZ5HHPCYFYASpfXl22+oZA7jFjJx1SK5C4ogKvW6Q2bDKyF2ga6ZsrGXrFdZPxa/XtQUxsJ+PDo4Va5gwefyKYgfnpzlw7CXEL055lyKCrTBnowjiJCo2wCQnchMSR2fC1xaA5NTN1zzB/52vr9sCaJGH30lUwhJ+ODsSaU665JNevhI7XXeIXp74l3elKeG61HUR/wD63hCoI+RtAW7n+Nmqm9mvy3NapVchQ2R5TWAFAA8VQvKw5eRQRwBLE6PQLcj/MuAaqfVfcp5JG4Dcgf0hNGVYGGoHCb4duUL3nkhshfCWqzg5g6mQzVi7ZaLqRC95XKeGwbiIfh8JvC58Ox8n0OEkp2PCC/b9uKiHC11F37PMLj+qWQjR/4tekVr01XPfB87KRN676XIQR/Dimj3yLnZiGqq/ENVewySZ6gZSKnANdBnnDTyDWj3ickdy//ctuGt6pchzAxMjqWHBISIUbPIHECT3wcnR5Fb1+SqiAc+SanzsJAxbLHMo+Ck7Yx3mLnbgVc9/jIFq1/P78AjmxKGOF++IqsxpsuLMxs8E2vxUdI0aLnvHqNsN4CVl+c7uDyaod0Co6o5TMWh01Je0hMY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ount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: DIZtzwqlC6x3HJjjpAGjxI1faSAIjls1EHwzuaAH0c8aPwmaXnE32fTbiomUF/8d/3dDEZ8iYgxrsPtrnMvsHOF9Aj9HEOYlY8SWWDwF1GBe9w6ZHkoJxCG45UIkht3HpoGO1bgCXRRWyfMGBTBxbXCpPSyvNNLpAjz5RuaFK8TWJTUY01VkQ3X8BFKPYg8xnXUnaJ2PFKxPqd8o01f1nIXGikFlhil5pafPkXKPEA6e5zNMXqtJsO+nL7O7nfFOimSMvD1ejLUoTJWyAqKUMarLbnHzuWJRy831OAtUYcVpl16IXNQ47gOx4hL68Nv1W/CiYVPHNCQ7XYB7cSYbB5XPnXnzyzqbOSAriK89k+MjGBhUAL+4iERxQGkuxxWPd8C1z85z8KOqVA+FiktMcvKlaFSS4903QN8fD3xfzHX+hrL8T+2Zy3lohRCzi0a11iD2XOdN+oSjGbv+WU/kZu3mDa0DJlZfg/Y4/uCx7xjOLGQNQETlKQjsbDvTcYwaiP0Nha27895qpI9zOojKX+RDjjF6OyZsHEyJwCMFYbZTCtNmJxeSBY0T1XDGwU/syZNDleb/ti/2mt9lq2VioDEK3EAZuSpy8QX+tKkKtbU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6fe7c6a7-65c6-40bf-e3c5-08dc84bdaea1 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:42:19.4660 (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: N9yW4mv9qAxhUDproKoOHz8CFRqa0K0As926vzCUlWj5EZuuyCBOXxIs/t7RF3lcvqF9JV457bmabGLfJzzsivVs75jrEZCGdWESxsK01EU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5893 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 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-2406040142 X-Proofpoint-ORIG-GUID: cB5MMEMfwgSWjE-ewRZnY6Cz5dzYmA7v X-Proofpoint-GUID: cB5MMEMfwgSWjE-ewRZnY6Cz5dzYmA7v X-Rspam-User: X-Stat-Signature: h84uc1jqnak7rtqrx691664wm16fe3dt X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: D684F160018 X-HE-Tag: 1717522954-504404 X-HE-Meta: U2FsdGVkX1+Bsw3aH3TP6AppWDY9BJoPXCCthK6wo2v5Imawp5KBepkVDBtIGcKWAJDkqY+2RWkz+25GWqPnlB6hdyWTURrTcaeOboRRx0IfF+/mXojhPTfkfAFjDk1dWh7ivdKyp0xECLhUOrgsLmFHVq79xq18RyAICYMTCs2lDSOnIdoMw2xBJFHaMmJXNZpa65k/iBjPKfpofJwsLIuZt8BeXcFHC43XlDX8QkKSALTPgJOJ0OId7dvmB4cQ0ClncUGJ3YMJPFBZpzzqzje176QFbRRqRAFBScJqgFji3JnOS64PDYXejqCenPNDG9Z/TyfCwdNa1M2DSFEaoqeDLsGfxyqUjYvDSIg1QK4CuZnTSKxlkblbXcH+NymCsPjQwnQ12OZujRzE7y9zNXuA57Y2fDPmbdgehN1spw0EYyt2YXX7G6Yh68X8FfhfuXjfQZxTz3/AQ2vqSbm9KzeGbF2ctvrEj4DesNsg841CozKsIdsJEA3iqtbYt/VNmjcqbeReBS8eOa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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. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 314691fd1c67..faadddbe2086 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3437,12 +3437,10 @@ static noinline_for_kasan int mas_commit_b_node(struct ma_wr_state *wr_mas, enum maple_type b_type = b_node->type; 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)) From patchwork Tue Jun 4 17:41:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13685736 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 280FFC27C52 for ; Tue, 4 Jun 2024 17:42:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 14EE76B00AA; Tue, 4 Jun 2024 13:42:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0FA186B00AB; Tue, 4 Jun 2024 13:42:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E400A6B00AC; Tue, 4 Jun 2024 13:42:40 -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 C38BA6B00AA for ; Tue, 4 Jun 2024 13:42:40 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7F044140D6B for ; Tue, 4 Jun 2024 17:42:40 +0000 (UTC) X-FDA: 82193926080.16.DDBAA4A Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf11.hostedemail.com (Postfix) with ESMTP id 178A040025 for ; Tue, 4 Jun 2024 17:42:36 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=UgwBhLyX; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=rpv4Aga6; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=quarantine) header.from=oracle.com; spf=pass (imf11.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=1717522957; 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=PmOkY5uADHU69ozTyLP7cB1Ob5n4YcKEW7gbl4Eh+y4=; b=Y/OCzAUQWmSR40kH503VKXErwsRzSf2QEMOHE6mREnlIgwW7SElkx+8GWKALHl19zijCnm ZQETjLtDYoSwS5tbKZNaaZMDx/aJrlK9MONeHQpptv/i6NaxvkARP2vwTM2IXtAA0jNM7M 6j7TWSuEHJArICX7+RsNIKbJFsNm/SY= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717522957; a=rsa-sha256; cv=pass; b=19eTEs1YHdiJfvtQzR3GBlCUZsi5t8e+0sslOexEYQcesU9fh14j047P4+Hli9yphwC3NU oooY5aMVr5Vja2bPhNpQ2EXzri7oQP2iGMIwLcmT+COIZJOq/auUT11Wuw8jSdR28baNmy b9Q6aqmCXqNdGQTvIs9SPkJm+kGLmxk= ARC-Authentication-Results: i=2; imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=UgwBhLyX; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=rpv4Aga6; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=quarantine) header.from=oracle.com; spf=pass (imf11.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com 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 454BneW7026963; Tue, 4 Jun 2024 17:42:25 GMT DKIM-Signature: =?utf-8?q?v=3D1=3B_a=3Drsa-sha256=3B_c=3Drelaxed/relaxed=3B_?= =?utf-8?q?d=3Doracle=2Ecom=3B_h=3Dcc=3Acontent-transfer-encoding=3Acontent-?= =?utf-8?q?type=3Adate=3Afrom=3Ain-reply-to=3Amessage-id=3Amime-version=3Are?= =?utf-8?q?ferences=3Asubject=3Ato=3B_s=3Dcorp-2023-11-20=3B_bh=3DPmOkY5uADH?= =?utf-8?q?U69ozTyLP7cB1Ob5n4YcKEW7gbl4Eh+y4=3D=3B_b=3DUgwBhLyXcxXZCTDkHc5e4?= =?utf-8?q?lh8htUFNwNUGJIKhHWaPEmdLx1KidtME//HZhl3X9W6DBS4_iV41prM+mD+KrolPY?= =?utf-8?q?FYw/2Qvu94CNr2q99KJP3pjGIFqAEFCi0d3yfNvAkBTOWFtcwQc_t/G6+f2HPlhqe?= =?utf-8?q?YIyJv6T6xY6qqEeH91KjkJwm7ctdhxbgSuNPcWaBu1jtQkeHjvtrTh9_eAwE0fa/G?= =?utf-8?q?hN5CCzb+9lK+Zl0hZ4/zbg38V+wc45V1Z1ALSmTpDwEQjIUfbvBMI/RZQNt_UkJNO?= =?utf-8?q?iJXEubNwO//IxOmFfYguLjeP33f/BMf+IEVjH4SNJy+oQz+2etk+qfrIgUJYArS_g?= =?utf-8?q?w=3D=3D_?= Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfv07wjyg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:24 +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 454HCsqT020553; Tue, 4 Jun 2024 17:42:24 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2048.outbound.protection.outlook.com [104.47.55.48]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrj2bmjb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mtqasz5RuwN4Abju39lAXe5HRYFnvAQciEQWjejT0cU3Qc7qzEHoMX6/YL97gYj2ORYNIKvnupNrV+WlBSbKoXvzUmf4AIILiGULpLZTCO4wazVsvzSsUVpyZkgsTlyWT07NpM0tCP7UNvfF5/rkAq3RjPK6+MDJF0XMqbOUFo1O52sFpaMdySuOl2oUwJfeJx3w/it9wJ5URUrJt7K6gHICuS9M7697Dv/dRkWN9NG8YI/XMycVtkWMyTGB3GQWupPsq929Zv622qthKzKRr08bm1MCgc5jl378E0OkHPtws5tilx5rL37jck3vVUW9VjqzfmFQQOkeyTgnxbobwA== 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=PmOkY5uADHU69ozTyLP7cB1Ob5n4YcKEW7gbl4Eh+y4=; b=eakLP0NoaAblN6z1znqY73s44l0JP3E0O4sHmK4E5kdw4b55rJjVFNX2TYAPRVlo+UljQGdWaV0K39OzPSixNEygqoOOLOyQ8Z3H3ZQw+myYubXL6hBlW4eWDuXWOjOmuV5oMUuQ+lztb+yygojhBwdVj0tLvqBUTNECUtj/s9b+dVt7QIV4VhCPMbUyTK1L1JJfshxeCtlsypL42fLgz2snkOBNbVX8gMbjUQ566TD55tVH9JBkDCS3imTl7tW9ov/d/TxzCWMqcZZ9FJzZb533GmeONEaA2IAw6coINu07mmFwXu2LFy4sfWgeEqsOmkZTbyr50bmtk3SIFy2SoQ== 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=PmOkY5uADHU69ozTyLP7cB1Ob5n4YcKEW7gbl4Eh+y4=; b=rpv4Aga6sfD+G0Ng8X/+W/WoLckFI0C74e8/rwQ3LqgmIlSGcNbx1a5Fz1YKSIOfDaakplm35Wz4YFLcauz5MdxYYNDFpBzcaU9FePgLc+J8zF0w9nKSkmNZPhMyiIGbu86LNYnOc/LDC+qdZm34O11M0buuzr935600tj9rMEk= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by PH0PR10MB5893.namprd10.prod.outlook.com (2603:10b6:510:149::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17; Tue, 4 Jun 2024 17:42:21 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7633.021; Tue, 4 Jun 2024 17:42:21 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, zhangpeng.00@bytedance.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 14/18] maple_tree: remove mas_wr_modify() Date: Tue, 4 Jun 2024 10:41:41 -0700 Message-ID: <20240604174145.563900-15-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604174145.563900-1-sidhartha.kumar@oracle.com> References: <20240604174145.563900-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BY3PR03CA0002.namprd03.prod.outlook.com (2603:10b6:a03:39a::7) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|PH0PR10MB5893:EE_ X-MS-Office365-Filtering-Correlation-Id: 90ee5abf-e6a7-4e06-dff6-08dc84bdafbf 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: ckn6NwjpeA2wr8c2K6e3ayuHD+v3OB3CS3/zsLWDjWDL61n6g5vTHDKrPL5MObsivVTAkc2WsNL0Wzy2mQ1Wy+y2UZ6eqK73VK7KdtkcpQBFZg0uujD71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wA6h+PuLt+f7HFHVd7UdxFgUUJY3XvqzMpEZKqj/IE1RMgn59n+vZ8joDXRH2GHm/0jysFrxy7uPYldDEq/JdRQ9FCue/DHq4L/Jka2Z0DBDFnaKmq9ZOtBtMU= 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: r0pWn5+nKiqB1zurAQZFl3/3fINdf823dORO2h/V2jCBWXZ67ln1Pw9EXHF7WUbIqGXKvXgnay3iiUNS/7Clw/vcCaY4pP7Fb7b+bFDA+JsDTKzK7o8he09Fc/a0mTqUkhsyzkA4hxV+tThpEQOdyxm0Oni7g8CIcbq45uBMtKdxrQHVXgmQOrpBOlMJrepxD0gq5b/MJ5Q70uMQNtHP+aWJ/WAPmyCfQldKFBrdpCbMz3kYjsF4nY5oJ/TjEkQC+x1w4TrXxtw1SenA/MLphYAStWGMn31hVkBItgRw3xGuH2x6tVWZ5nP9VCX+YFv/yu9mtma4LW13vEiRRj3G08Bnn5kW0OUxHx1eGbgpkL3b6DClJiXBiSyet4DShy8bAYelUnZEzBcy4oGsAmtC6rHNDQ3etQp5I1ATu32EUXt7XDKQSGGle0klyr3gIeRajP1VYLdQzDgkatPy3jz1vatLDs0W6NT2oycoX5fAn1XzOdKN2AvjXXpvg5lVj75yN71cgeW/7I7yRfI5f+tcWqgQIUEY380aIx6i8kVqHHFH3CaEx5Z3WSpoEMPUFdpPh8Rc9FSUzl4ulP/98KVZwHi20H24DNW/9PI8s1CWBL3OaooJqVTEAt02pWopx0wTkzd9d0V6PpO1Bb4yYFQ+63y8EeRjfsf79a8E48w58Vv09Hf/DycAlns1iBmVwF5IIfxZ5/UGEK4hWQB7zuy1IMLAJRLdQ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2WivkluXvMyuTqVdGftOVPnAmY0QgdRwlTfwplFhbvJ7OCSXIFDtkbtSyBVmxyz3OlWcnio7nXnzKf1C7DreqLEnE/bLFM43aSWpzJXAoCZQRxADJ597Wxo0f4J68L/I65VkPmBBhW5O8QQCbSMZt40VEwUd22GC3B1Ew4PJJFhht1qxGYjy98I4JgEgOBe5Fez/oZ+2UIzjLDpfuCG3pA+rlNAVSlo8SF37fwS94XkuDdLVRwlorwAMFplPypgMXkVk4NlAbwTIZ1mL1VoEkgoCBuSDAr3QiCkf7CLNWMUhcSDlP0RFayGtYcs4NIx2jP3v3RO9AFB0S48WglCY8qRNyhd8rkhwnDQxhboaycMLL3NUF+H5Z+CVJf23tjRwSjkZV0F5j/Ekr/H/Tgm0u7JtrqeiQlAgAqv+4SBsXC33560WD9MZTDoxnKTunJ6f8AQYowhyT//r20gYi9mxh90Ii3Xg3++AdegrWU05dxD+8SLMYYs69kSzTkO1Ws7iR+MbqNVmIEEQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 90ee5abf-e6a7-4e06-dff6-08dc84bdafbf X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:42:21.6149 (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: ox6citQADmsN/7xFaUUz01HdyZy0ppGJzdOhZ4mp1iftmLAlaZQrBBiEJAxbUTEXDHBGNQg7FuZ/YwfPCTmbqxwi84eWGojoTNoy8zIJuc4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5893 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 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-2406040142 X-Proofpoint-GUID: YfQEzQo8Ys4uGqUOXfb-ed01T_5hyxdl X-Proofpoint-ORIG-GUID: YfQEzQo8Ys4uGqUOXfb-ed01T_5hyxdl X-Stat-Signature: ctm4q1pmn8qh53bzjiio3bux5k58m4qp X-Rspamd-Queue-Id: 178A040025 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1717522956-307004 X-HE-Meta: U2FsdGVkX1+k8biLZ+Qdp+a8+qxV77SUAf5uE/waI+F2J3CWeciDBbPZLNca5+PtM/Qgo57AvbPkgkQxp/CyzYia0z8hrbCXmbHa4srXss5mEXnT6vrbA8CMPE3g1ta0cKrAa1xz/7LmQLL7glmoiCo9RoGo3r8PGcbRDFz8latNwNo9wlvKm6krd1U6qoO6p9O2FQAtNERdl4J6amBETqhpJLu9NSdx+EVU7VP3zzphkSFo8rnXudGXPeRspOlxlp+LGpKAbXTCv7CehvSQ1H+o+L3wziW8QCehUi/cDqSqogeVohIvxRjxLSvQnzkad30uv+ePAqioDJi+z7rB8JBWdKaENBXS4afWySdHn9T0u6jfff5FrWarmfggijVX+SCFwxXve4g/ZymG8/bi+va/hB0KdriZjK/5PWuo0Z2BS5cWYvBO3C6WuE6VgXDjW39lMR6Dpk1RIji2gTRdlvz4nuOdvrtGuUFcumTzLBIaclJ2focRwwUd72Gqm6FNh9+cPvXyckUzE317jnaWUfAvLcD39vQjvjrbcMt4N5MT0XNCZUaLVUGvSsDUbYTZSXTj5COHxVSWpPqcrlqCCNrkw/FBFsuGANHgclKlfV2GyjYoY/SBpIlA7AqcuPv6sh5Y10+qFwf2CxW2t9gVHtiEEMphGv978FFtR3R1ENAAkAl/mVrq8DWqSQFZRlk3MhJrsmtYvNGR39jwPTrpQY3QPwjCer4LgcEFOoL1HriaAleQEWxuSN9Lel5tERly3hjOhUjUkk6rkXwr4DZ6j3WgWRaRgH+ECZTYSIkUp+sal4AdPND5aLHmVGu+RPVTA4j5w6L5udinmc2WI+3+/87Rqn42+ny8udOUJVbY6r89/i+0NJRr9pzgBLG5RWytFgMxFAVwvRlys3y5NO5t0Eokk4T6NJ29pgAQANYwUp/ZUpbwFcaDpjms8DhKPyPpA2ixS2zB8sBfzNHnl96 1LrjLOsE QoiNIgoVQPiqP4Zf27w9H5mnLD0cm5xLn7eUj9hYZ8ueJPiK1BSWQBs8vBV5X8PDQhWHabSzZBBuE3WnEdXRjE6IKK526WHmZyVCB4GAyC6nPqmcPzHTcCPShyQafLY3uWUZfkU7ZJHwbUZ86W4xqGNlvZl5BPfjJCgwu4x9AqzPuW6pMPjWhrbQjH8PUHf2KH8r9e6odKn/b/IOvGscQ9tRIllix7ZYtVxx0X+6R1L7bVtNxP9nWTryNR03ZCA6BTlMAfQBOaR32lL7pEUCexzz0tma6XZD/5Za4qAE9JT8aLibZkc5Y2Epzd7+2p1en0Q1OoNJAa83fnXpoU0+3x6zIRjEw223/RrnPDi6wOB28RE+5wauGYJoGr9AeKiXwiyPi2p0vRdtwGRi0TMPtGgrpjTGTpnJ447KrK2erl55mDCSSpzxfdPOjpd+w/B4ZvKzZuuDbEYTntUp49c07SSOxQw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, 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 faadddbe2086..74c89aad8bca 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4156,44 +4156,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 Tue Jun 4 17:41:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13685737 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 5A797C25B78 for ; Tue, 4 Jun 2024 17:42:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C475C6B00AC; Tue, 4 Jun 2024 13:42:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BF7FE6B00AD; Tue, 4 Jun 2024 13:42:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9FC4E6B00AE; Tue, 4 Jun 2024 13:42:42 -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 802A26B00AC for ; Tue, 4 Jun 2024 13:42:42 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 3B7BEC0FF3 for ; Tue, 4 Jun 2024 17:42:42 +0000 (UTC) X-FDA: 82193926164.05.30CF13B Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf26.hostedemail.com (Postfix) with ESMTP id D378414001D for ; Tue, 4 Jun 2024 17:42:38 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=QRrkR52d; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ndMT0opI; dmarc=pass (policy=quarantine) header.from=oracle.com; 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; 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=1717522959; 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=WeX6GL25hnGC9aDaBruf9RjJKsgQfe5nXvPBB1WbfRE=; b=gAdWV+S8IB3zn2DpSBH0bqcdGaj+IPUkldBppq8y2hfZSOnG4aTWFD9y6lTs1dwIThsoDF J/7dYvOemBrVssXMEWw0Kle0YVVNylV5vFiMw9dyVp7/hAqM3o+htEIFqdG3wKlzx9uaXV szL+khRCy+ydZSaRzDRzCTrh4aUWcEs= ARC-Authentication-Results: i=2; imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=QRrkR52d; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ndMT0opI; dmarc=pass (policy=quarantine) header.from=oracle.com; 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; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717522959; a=rsa-sha256; cv=pass; b=H5TNDoaGkyMFOwQVSXYHXTfOOs4+QqhaPPXL5YmwBCtS3+iWzUi68JmQ0qHEWd5y2vKvdp aRVMZtvm3e5uIJA8B+dtmaCCmLolMOs417QYX8jGlH3GpCzp4iCYQLi4OMHsjx1Ras/IIY aHTv20iZ46DCCD1gTXBsl6kd7WCPT6Q= 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 454BnRkg026498; Tue, 4 Jun 2024 17:42:27 GMT DKIM-Signature: =?utf-8?q?v=3D1=3B_a=3Drsa-sha256=3B_c=3Drelaxed/relaxed=3B_?= =?utf-8?q?d=3Doracle=2Ecom=3B_h=3Dcc=3Acontent-transfer-encoding=3Acontent-?= =?utf-8?q?type=3Adate=3Afrom=3Ain-reply-to=3Amessage-id=3Amime-version=3Are?= =?utf-8?q?ferences=3Asubject=3Ato=3B_s=3Dcorp-2023-11-20=3B_bh=3DWeX6GL25hn?= =?utf-8?q?GC9aDaBruf9RjJKsgQfe5nXvPBB1WbfRE=3D=3B_b=3DQRrkR52dgdB8E69+PjPNG?= =?utf-8?q?WyEEZGkYiIdHhMn2Tro5Ma3d/co0Zd1e4GDR7GI0k7furWw_Of9rQLLdeyDfRg9GV?= =?utf-8?q?BQhyrWzRar/EMpbgb7y/dli1PgOqD2s16DpOZCNppwJiR/cPw9g_vbIlBojRNoclY?= =?utf-8?q?ka/x29Gqi8IEuhbykapAwEtngqZIL7i3s5CtLnU1oJ4Wu7P5Q+mhh9I_hqdnpYSLj?= =?utf-8?q?dj9hReVw0znSKwIhtN/A6pD3no1Ajbx/a90EfHKT4NmWYA5t/2psUxcYBwG_awHZ1?= =?utf-8?q?lyGKOhkWNmMx5/4AFA++OWAtBaWXcDkwx1AN745lc9MCBNs2c2c6e3dSplqEZ43_d?= =?utf-8?q?w=3D=3D_?= Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfv07wjyn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:27 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 454HaZ5b005523; Tue, 4 Jun 2024 17:42:26 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2048.outbound.protection.outlook.com [104.47.55.48]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrmdwneg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NM6v0rhj+1nwdIn3+vXXhvhVY5r/j0jkr/iQiZHHxlNeDHwtihXdBO9MuHHZidSTEnQNBo+rSDqIoEMS7DLMAXFVZclZMFvIk2ccGKLOcjMQakKRcSBcMY7U+tbjOVfVVaYpinFvWbH1IFmFbM7zrpdffKHI9U1fX0i8xVja08RzbHBkWKiNXRuvcQjnrX0mYU90eR2gfjw5vWovVAdQVONmO12vE25SVUL2fgGnuuttK+10phZiVHLeaq23GiIpAkCKjBGvgOFhYInmYeGqYMCfsCALXmF61gnNyr/wqCo2o9Y2YQ8wu2D617kSy52hzVvky4lzXtA2+biotIqxMA== 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=WeX6GL25hnGC9aDaBruf9RjJKsgQfe5nXvPBB1WbfRE=; b=AMZOf/piO3d1rYFP5JBg7BSXFoUf5MPWgEax/GPDQF2tsV+BRCFAjlBUF+6PRD5lxvg6SBna9eM7S6+vGUkLFM2D0mEWMneug7kSfJdgPmChuVQE5qItJ1ors1QIzbQPN8/PRQ7lnBU0BM56l6UQ3uX3+k7b2MK7G+Rrma0Cr72R8yZrqhlR/AfbkWu2++Gh0yGPCO9M1a8F2JusXXOfEjcsDaxW/APP90OnUWM0O7ayStf2gfVHeqX09SN7/w8CRVfwK1uAkSsmnEFhW+LGbeTx5JAs1rHjV2jjM0Y5ZrAm91mwMHMLLYYEggR1Ub0u9+dFBi/o5DxO77lN0OxpaA== 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=WeX6GL25hnGC9aDaBruf9RjJKsgQfe5nXvPBB1WbfRE=; b=ndMT0opIC9U3z7y7JtW2tnRaUQynlyL9O1lDPoLsm7MP3UVD6Mw1NVKks5NB4pxYxGVhZIxX3eQj7g6g6DjKcxirmr7jOfr/2WgCOBYW2K4+1iYO41sws+kQCZnFKCfYAo/QFWKSB1RrgHEa5+IRfabJZIEHKc4Np32Ut1HPHHw= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by PH0PR10MB5893.namprd10.prod.outlook.com (2603:10b6:510:149::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17; Tue, 4 Jun 2024 17:42:24 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7633.021; Tue, 4 Jun 2024 17:42:24 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, zhangpeng.00@bytedance.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 15/18] maple_tree: have mas_store() allocate nodes if needed Date: Tue, 4 Jun 2024 10:41:42 -0700 Message-ID: <20240604174145.563900-16-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604174145.563900-1-sidhartha.kumar@oracle.com> References: <20240604174145.563900-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR05CA0047.namprd05.prod.outlook.com (2603:10b6:a03:33f::22) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|PH0PR10MB5893:EE_ X-MS-Office365-Filtering-Correlation-Id: 3ac6587b-87c1-42be-d999-08dc84bdb15c 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: r00WyTM7Y1RnVW/wjBUuT+CLcybtSUe1cLn+KavO7kwl+K+0h2c4l91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ffRRYWYdVyINiB/hsYtHqEDPhldIAV9fQK54PHPdIOjSrPUzUU/U5DbR8MWDa/tSnm8g0upbfaPw8fWo73fJFxdcTfnwQjG6sANImRWxNIGCOshofavRmHh4WHO/rRtFdSgv6S7NQmSouLzSTrzuhMWVjOAw5zt2IxUZ6o+Qqi8S17AODBsRRpZ2BcmukvOud8b3Niq8pnv 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: FUNxPaOKGGIpBDcrulIZDC/9QiyIv+tb4656ixOsth2MzU/mtufgXilcliVLqFvejcR7LhX/hq9LCfk/+sa9j/itQSGUgT3jEpp8smhYB4lC/3ztoHbU4vXP0FYTjln7CYCBdnC07ORnIZWEz610wCOn4u69Ac3DmrujqSsjuu5S2SJh5JZRrnfAqxTPG0oS3sS/GotlfEdRoPLUhgzr6HlvmUcrwXNf2z8RKmJGnhqZPAJ0ZHzbqHwxG1mcYHw3wpWAL6GJbHhHLVwEu6gPxkYCu7/eBRUvIoiy0nNqIy5A1o89GEIG6xk5VDNO8G5GnceHh66SRCatzmu/sOF4PxflT+tXS6nuvSmredzv2qfNKz3tpQwZCntuWslsN845O1wqICEX8dUmbMdqvqjuQza+Y2+eWry0M70RHHOEHNOft0opdIavUhEpTGpNuZfw8Y7pPnQ8AJEcKU2N581nko68IMwtftuafLFJqfFfF/v10D5RVdWwTOsuSUZV/Osc9SzplCpkXVIzT3w5naj5RhuaS6uUmEEonHSmExZU7ofhimR1qo5F+GuZh34JKuMoMpRkBZIg7EfKkhM283oHXFPTWgCgo+zBft1wqf4DzZsbOHgJUEr4q1C+Yq3RFouAopyR8flWd/o0WAdA/2gS8VcBEEaXbLvO54822Rf0B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6/zwFfbO4rOkhG2u7cGtYpWT1ln+4KYFcr8Qm7ReTVb3wFMbErot1BVFJIGVAcNukSyBvxS2FYHm/HdtU/MnHel7Ty1WeWEocBrxTPGUelPTQ9ijf/Jy6scSQe6hNu14cFGUzFuYz531aVr45PF3iKsfZEdaO6tA9lmil1MWWsYz+aIQZLpo88TTPFNsgR5VX7HW3/7QCfu4sDRBOz1EJ50t/ibbVsE0NcVw3HZLw0fZgbYmPHu8tCWoJV6ZZYLPF/V6fMTC8YWllgHjw02lZnqB1LbSfs0lQEt0AlVPnMTzQo6qUxmRELaj5/C19OirYk66d4tYkiSZ9wrP6KbqjL7KTmGJO5dh6XoonK1GJe8NL0XcS1FGgO4ErNqlZnOfK+t2lK3NnmxTcLL3ry9tD0pHjL0OaB5OUaNu1BgJSNZEqmzqUg88SwOXNykLzOEjVKx7qXdZD9JL4rK+DwKBeStWsVhO7/Ek9g7yQEuG6vmsfUEHCgewpXiw/KNKSNZScBk/oy0+zD6YVG27ehROcsq+ae7/nD4BeMfRC6QFIlZFQJpUL2hP3ff0JRaw3YFc2M= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ac6587b-87c1-42be-d999-08dc84bdb15c X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:42:24.0725 (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: wOBtlI6fABzyiKXYfONatcmFi0A4OoYPogci3Cnri53ViV6XFBpFVvuua2z0OZIjBedNPGBOtGFvLA7GxnNQoeChtQ+aD63RaB+q9OI4F+o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5893 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 malwarescore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406040142 X-Proofpoint-GUID: -P_sf5WsdP8KvgGPyKUYg2Zhc89639JI X-Proofpoint-ORIG-GUID: -P_sf5WsdP8KvgGPyKUYg2Zhc89639JI X-Rspamd-Queue-Id: D378414001D X-Stat-Signature: qyd5i1ahxxjhoh6q4msfk365y8ronsst X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1717522958-665497 X-HE-Meta: U2FsdGVkX1/8oNJ3Abzhlk5VgDSoSy8sjXjcoVfSt0lZ5Vuux0MKN3M4xq8Ep1N/c8Qv41SK8BCYjqRdoxoq4aXSSSF5SJ4TRmLKaC91hIVe7xkRJpEd2yEjwTgk14BlVZUgXRvsUUYaH6RYigkwwCC8sveGaeKgoXrmwQqgRNUZ2VNq9CwEvBH927F7jb9FsgwvpN9ogw0uoAm3sIGlzfjV0rPz+6jLoVZ+xdH7ncWxIFhrNDhB6sFoUyHYDUxZjaTtihUgjqjyXj78jyUBVR+5Q1qzmSsmfeZLYQqLojzLVbJM4/w2je9QYfXXakY2REoEJWi9oanRtrofKHfeazlAao/Fq9r1hiX8jeX2RjiMsf9v/4LalAdsi0KMQh0PwGXBlgeHrhuYNTZPW8vPxK4CpMgfwSI+ylt/QHKTb39H7AdmddQcJQ+PdYcbS6X24ww8gUmVwacVw6rcZgBMb+9/ojG4ClQSIvpinNhDOCjIqylod+JYPZVHABR74dS8UZkzVOzurTxtNWSywtOApcBo5jLd3wAkZBxZj8t9oYezGi/m0/YrSrQUkkWiKln2wxGcBhRnP93YYljcD+1lZ0qq5x6QS6WRqDUcVcnmqaqIPBhkTAyOM9W86KGBcWQDdD3oAA4dU/P7nkfNvbmx+02gZqE4RRzyq97/BNEnADtWYbHrQfZqDr3pphaC5JRtTsc3cJ94aVRHttny38E2WF+tGKd/rgFWRp6xczcAa/HhcJ9NqR5DVSnCm+lROPtrWU87UUi8F9gG8Q1Q2s4mCSKP5F1755MANHoJz6LV9nL7FozEY/Cm9jVwqXhDMwpxrpifKUmWohqDHxOWpMhp7y1t4kZe2JHfFbz/27DHzmpwQOW3hYWMAr6hjIJ1XJ3oVOKyis34v8Q49LDDXkhM4JGzp+qdFYBRIHjbD4kj94EgI305s9ensp9PmsN+VLV7Ovnr/0ImpMtM9CNWiMx TycMmnji u/eAsVziV/bIpRBpJuz1daMO5jr5lqhXrGFRh1//dKw0WlF9NMAlhih0x16TQzPWzme99Djz5H/i3f3jWRsd44JVh6hWBDiKTlWFil4yyf6NAPBDs47AjT557/4gQo8caOx+SNvM88cejWVNzSyCo+Hm0HCj9snFQks8ZGYmf073yQmAvCCxrpGKnXFL4vTV7AXCqdtbjxRm2X1+4f33nwmB8kuX8/BzKpAA0+n6CuxJUGPU5xtxkU1GHTmmj/DuxDmhRAV7WBjifM8Ter/2e+56j00Xk4M3TGDcnVBCwGJDJGTv0m1CKJQGWSznTUGhViMFHK0tbIH95LXrkk6GwO4FNFZNp/dgb4jLxKleJmETU21jeBmZmRtByBoBfTO3fnDYQ1K3VhEnfMyEkloWQXlfz2ubgvDff5jYzPPkkNhy4jw5NPepfn7feiK9jkykWJaizn22tfxTZ7l6gyzW97XX5QoNAkMa1NkmbgAv4XlwdBgU= 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 74c89aad8bca..42853afc3885 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5527,6 +5527,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 */ /** @@ -5535,8 +5549,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. */ @@ -5562,9 +5574,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 Tue Jun 4 17:41:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13685738 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 C3D31C27C52 for ; Tue, 4 Jun 2024 17:42:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A98DF6B00AD; Tue, 4 Jun 2024 13:42:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A21966B00AE; Tue, 4 Jun 2024 13:42:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 78B4C6B00AF; Tue, 4 Jun 2024 13:42:43 -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 511DD6B00AD for ; Tue, 4 Jun 2024 13:42:43 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 1420DA2258 for ; Tue, 4 Jun 2024 17:42:43 +0000 (UTC) X-FDA: 82193926206.25.20C8396 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf13.hostedemail.com (Postfix) with ESMTP id CFF5020011 for ; Tue, 4 Jun 2024 17:42:39 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=SuSDeCT6; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=RBMDmi1K; 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=1717522959; 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=0uxtuNjYvHMIW8wAN+0vAK8V7rBgN5K87NjJME5JiWY=; b=bKiUCmY3U4MDJjbTl2qKhqbkKcfUiU7m6Q99rRZsRlLeH2MmogNwBDoLxnVWx/JgvO4Hmw 9NrmMHLF8AEDjvEI7JFJzm5WWwiSCrCOihGKVb7sWHdjBWT3h8fSZOFemYXAXDNoacxWCa Kw++90wwWMnp1q/Omjog5aDvhdz5xtM= ARC-Authentication-Results: i=2; imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=SuSDeCT6; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=RBMDmi1K; 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=1717522959; a=rsa-sha256; cv=pass; b=rnAP+Z7pydQA7xymRRRZZ7dWm0KTHwQ+kcp0rW1YKuOFrNWxkVyVm7kKESjydoPtuLGe81 EAPMNqilBf6Of4rVWilFJUMGjPY2K83F8W3ON8KqRpq4oMafn0niC3VRLGTiN137VFH5Pw pr4iyJQpS+e0PPeeJP2T3siXP+9sKpY= 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 454Bn0BI032321; Tue, 4 Jun 2024 17:42:29 GMT DKIM-Signature: =?utf-8?q?v=3D1=3B_a=3Drsa-sha256=3B_c=3Drelaxed/relaxed=3B_?= =?utf-8?q?d=3Doracle=2Ecom=3B_h=3Dcc=3Acontent-transfer-encoding=3Acontent-?= =?utf-8?q?type=3Adate=3Afrom=3Ain-reply-to=3Amessage-id=3Amime-version=3Are?= =?utf-8?q?ferences=3Asubject=3Ato=3B_s=3Dcorp-2023-11-20=3B_bh=3D0uxtuNjYvH?= =?utf-8?q?MIW8wAN+0vAK8V7rBgN5K87NjJME5JiWY=3D=3B_b=3DSuSDeCT6k4JxTRnAh7YZG?= =?utf-8?q?19ZY5u98xhIPhe392kcyRogcz8oNHCgGZTO783MzGzNPPc3_x7UsMe42V5rgvdOxk?= =?utf-8?q?ZLrRFtJxFr5LNEmKIJtS9fPjYz0yqsoNqyS8nbpwg2au6Yyw5Be_gfkD7uavK52wc?= =?utf-8?q?ip5wzZi6gf0SSUANVNGeeC547lKTHE67tghoqy0BRmiRPalkAO3X8LY_LB2zyPnaM?= =?utf-8?q?7jsxz+2YOohXAAVzrVUSkRJa7l9Ws8ZKzAUhDW0vdXP/KfPQFo1JDYw//Eq_LDs8M?= =?utf-8?q?3225KMU35pTwJFSlDJQchP8QdnXvLtYQ1Xfqxpu10BN7U0sDJ/hleF2FIUb5P2n_9?= =?utf-8?q?Q=3D=3D_?= Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfuyu5j6x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:29 +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 454HVuMC016217; Tue, 4 Jun 2024 17:42:29 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2040.outbound.protection.outlook.com [104.47.55.40]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrsaf3bu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ejQ1k1KIl0LvQ+vGg/OA3JREpbN2oLRHEOoG/BnPnOypYA7XUd8dpoyFAPi1nwSkOqU6wiAET27LP8SNAW/Z7By5vNqxn8sH9T5Xc8lMikCD7kD5lyEs89122qVwC/tcLdfZoDscx+TYUxlF6I5ryA6K9VTBhAOBjgMJDzQuy0PY9S9qaCStYs4mKS0JEZ6GShRJjMy1jPOCzWtFtjXfwyFchcFjeX2dBi1iFMIq9WueFDK0oXsvyu0TqdznA+rDJFnusH1cRAHr8pqjgD70XusuY/jpAPu7cmIfiqhGS2ZJvbSwM5hJZJEe5nhW7WciyjB4QhWJ1cM/cX+NxbcWIw== 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=0uxtuNjYvHMIW8wAN+0vAK8V7rBgN5K87NjJME5JiWY=; b=UyPFarxfD+BvOcB4iJNjRYJY3CPDjq3nGgXzhC3GoBeYN2CheeKSWHnWEsfNuqN26z2NEzlcZD4mpLIwzRpby926xkF8BpiavEPCM/SAwRj96vTF1yl4njytn247vH8un027suvv+IQ1FFmOhmi+LQYx803ewGFRZG7FM8YgOJubMouYva0bYHrsMf2Szbm1PLeVGaADkVPZyslTYqfRVL0MHNnZV7ZvxyDs3qmedIMneoLzl36ud0YYgPGqbK1fQSpNbbbZynvvii8MjPSzJS5kqb41PMC3/qgDfC6ia8Ru8UjeHTktPFWW+L+IMDpkyAhQ0xQ2DZB6QIEJqsXtKg== 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=0uxtuNjYvHMIW8wAN+0vAK8V7rBgN5K87NjJME5JiWY=; b=RBMDmi1KrKtLwLolYilKgkciEsUNgQ9D2lwqGJDkbfCtN0se22yha9+nm05qx2kxmx2g7bcWk6mMmnbOEiC3hoj8X3CeCC/8gUIY2rH3i6qIQM1sWs4P+Xdn/ADycbz1hjCRbIQMvvZEElkh9K+JzNOQ5JmoirZ/v3kYayCoSiU= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by PH0PR10MB5893.namprd10.prod.outlook.com (2603:10b6:510:149::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17; Tue, 4 Jun 2024 17:42:26 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7633.021; Tue, 4 Jun 2024 17:42:26 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, zhangpeng.00@bytedance.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 16/18] maple_tree: remove node allocations from various write helper functions Date: Tue, 4 Jun 2024 10:41:43 -0700 Message-ID: <20240604174145.563900-17-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604174145.563900-1-sidhartha.kumar@oracle.com> References: <20240604174145.563900-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR13CA0144.namprd13.prod.outlook.com (2603:10b6:a03: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_|PH0PR10MB5893:EE_ X-MS-Office365-Filtering-Correlation-Id: 8488f0fc-f35a-4911-06f9-08dc84bdb2aa 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: oK/OcY0NJ6d5ujnBIVNTzNIo22tuS5FIWAIZLJZwMqj7lIuuINspIl4nDzV8MLQlL6ueBpb1okEa3sUSuXy19uCJJQtJprXjv0QuErIshbGq6mMbwQiEeVJL8S+nXZ7XPMWWj1K8UkMjvDlgzNnzO4rME2cHffEjaPw1cM6zfKkTaIbQc0gTRfn9i2hry4DCaH3yeGKyLtsxdu4wu8ClRxEk11mXHYNjufUEQzNPrFGdTRR6RlDq36I4IzGCDd8vNzPtIq/s6aE4uxBrIRYmN3pmNaNY3mDJbeaQzqxuXIe7BJpND6quU+b5Rvnbvp6jaPK+6lKuCusxIPMQiEo8kl3wPyWxhI1CJPRQy/EZBHZLaOun7SCbCV3xxBgiJlPdNiuYwtfOWFdiZauksH4ApLswgyu79IFiD54TgPdFcW0f+qedbCqwu8LUKQG2rqbN24v/MXG1EgPetc5hB+a4N3b/6mpYbQdeRLPGTAjFMyMEoZQqRps8+hMOkIWAk+L0GSZGwUZ+YfCksjy8tJ4Eup2wHwz4sWq6m+jLcbQCq+hYIP4i79WQ8mf+xxz/bVicjA0nj0KGDyoP5KueYFI27ms8lBFnCGEbakgrG5Rbfn4x31ax2Zgney5QN+6oayc6n1Bnoa2kSWpTli/FT6jfSSEG4FV/f1W+rE5LYuIXh3TjqgfMoTAo6uQTSWFFFzAW1xWbdGEhZz2OaGDPit1RIUCLrBCqfjXWIpqmhErzKwJgWAtC1bVyydP4BxrcpR4mOHUVZCjACMfJHESKkn++iodtAv7Bu55G9attLD0yy/rjLitdabQlFzDjNhKfxMJAIC8Gik/camV9DcBuoIMPA1R5EpV5slKfa/AoqkToOMqJSIHEzN4ex6ao0nPjrPSCsPHrzWvwDgqB0Z9LKDQAPVO0x9OB9IyP5XYV6deHetd284yLk/WPW87OSPUIkLEo7UMqfPX1hE3J+QEKv9K7PwbuBiK4nznfeAH+hAbDmleKTAXQPZqgbwR1sN677eEjnfRIxv2fEuYMMAyXTq4tYiOkAmD7HAEM/bI8bKETOkai8FAuyD2oNJO+IHAyae+rmi2dGvqHYepkXNheoEf0Oz20fFAiVr6Fe5EyxLlcILvVX/fMwSsfBL0aiOaSQtSkZnb/1bKmpXREBD6+OR6j3BtuzUKuTbd8wRC98nNaJlxHBCZycJHmiHEk0erbEmzogm+Oxl5z35Tr2CI/mvYAYfg6n+yoF7n7JxCxKrkFtNq1WL+Thqm8gMmz4AtO5GwpVA5xhpGGc7/zDv+j50lyF5NBJ2OmE4l4cJUakAm98ncEEfzjPBJ/A/5OjQEYFJgG 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: BXcOFhxRzYF5/v1cbW0Kp9kHw9VvjKp4zwSPLwnAZdXMB8YCivdIFluCKX63aTGEDWSPjctkWm3HB9rurfmRRQ4OY91zkRIUa8WuALX/4ajkWEIimz2OAfxTgJJ2e32cSe3S/KYEuGsaxfnz77EiaaClpBdyDakhNQCInMlIzcd6MG0j4fOfNBP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oKr2l9XEmzgyeJWTjwbgdYGofpuyiVDNzWJSTdOrA7At/ri0KsuYCQiFhsb52sdU25UvXZqC/RMdTdBZ/EeQGY/0qPdJH665/gjDIztKZGh9Drgp7TBbwG1j8kpSJbopZViWqUYs0M4tdBQWA76ciASssR1O6LsFHqCOj2/IkkClhga4w5MAIzt+AKmrt7Nv7eJOjG+6WvXsyFMqpnxJDkDPqIibK4Bw8yo5jj3/2reIUSgx0y5Khja4y4aE297XKoUQ/b74IEH+cSX5tlHLqc4Y3wnjG03MSQTxlmZe7OUzXEsd+/MP5vZxJ7PK600vCu0Vb2ol+IGjgI1V9vTcBkLhAH1v2smbeC5EozJUw5HVGm5qpJdy//E= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: SvjC0emdopi8UgS/Izqw9Jy1k9GcC+7sZV6U+12VGRUBORNsXNLSPHmjiLAaMg9q4cYlgiBQxj+sLCP2yO8gSLgBmBhhrPTCPJEzUSnz2wbQy77yWJnxYYMZjrNAtac6zheueJLYSRlHBtaZX7sUcvJAg4p+i7PhOjcuOyntMd4bIvWILg9KRM/p2XvMZbHz0Gqj19G/F9Ds4rMVlit0RJs3BTAGdKvUclggsoD18r2W3lFNvtF0xIGTDvPn6FwKQPqhnrMK35mNd2eIxYlTXv2spO/2/jnCme0F9tMI0LPcuJPvpw0L7FPYhetwBtnNCrjOM+BP7KGdp3ua26EoF4aL3w4NkvKvHinZxh94ww9aPkftVkeZ0v5idM5lEL+pReHWCOEo6zce8aAL4iZwBLLMIkcCwLlXSHgAcWdVr2oruJbSlidhfdfjjpN+VegU+R1MFPiQ3eZNMMPNhhljrGQgU16gtzNlbymciJgqzhVT6gVY0xn0n565QIOtmAjZT3blQBwStvKwQ7KkbXVAP8UsmfNqP1cVndDWZj1h4MuyMj9AFpEL5jGVY2rAJGXcau6YQENOgyGZGE3iunyC6mvBSFlocRePMKjN3o45DWQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8488f0fc-f35a-4911-06f9-08dc84bdb2aa X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:42:26.2483 (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: VEoo2PFgHYUssV8ayh73BYLJ0CA60xpLE1OGAtK1AV2WjyAD/YBbE8iiKBfoGcHX+s/Vkau1pBLxdGxO71Z36c6JXol/dyqLz/o5TSUkSyU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5893 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 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-2406040142 X-Proofpoint-GUID: mfb-EawXCMblJdKVNmvf0rl_1vmYtDiL X-Proofpoint-ORIG-GUID: mfb-EawXCMblJdKVNmvf0rl_1vmYtDiL X-Rspamd-Queue-Id: CFF5020011 X-Stat-Signature: dibntko4xj8wxnd1q7in1e83otao8agj X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1717522959-101747 X-HE-Meta: U2FsdGVkX1+hQPctpQl6FhAYmJe5ALav9dWN2SwCoqO9fGUK7n+D/rN7gKyys0SO4PSIRuCLd+tBdp4PO7VhqesT57u/+3hF8Fd8XEcNvVAZskIuJiX/B/R20lOEg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o1mQf/XTTuMAA9oCY1KaqRmEbV4Bxv1nlNFUL/wGW6DjJRXxch4+6jD2tKhByUbVKKsliVfnLfW4QdMXubVhRamFQLAbqca2ddeii3HK9gBkO0Otb0eX1QRM+TyhlPrbn1LUxEzLb/HVI5Aic2SWtp837hOZ6eAJiIaYwpJlbrgieAs/GDfmnavO68118lw8oeT/0vH39HGBjVkc0qdP/Ioz/+Rbz8l7jn2xdtmpQIdjigDpq111un4BZNwRzDHaCNCrrpl0oE0q/4Cxvp7OkA== 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 42853afc3885..3d2d8c2c24df 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; @@ -3446,10 +3434,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; - 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); @@ -3475,10 +3459,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); @@ -3747,10 +3727,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); @@ -3813,9 +3789,6 @@ static inline 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 @@ -3899,10 +3872,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 Tue Jun 4 17:41:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13685739 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 12382C27C53 for ; Tue, 4 Jun 2024 17:43:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4A6866B00AF; Tue, 4 Jun 2024 13:42:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3DF026B00B0; Tue, 4 Jun 2024 13:42:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 20F446B00B1; Tue, 4 Jun 2024 13:42:46 -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 F2D726B00AF for ; Tue, 4 Jun 2024 13:42:45 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id B650F40EC9 for ; Tue, 4 Jun 2024 17:42:45 +0000 (UTC) X-FDA: 82193926290.26.20A4638 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf30.hostedemail.com (Postfix) with ESMTP id 0F71C80012 for ; Tue, 4 Jun 2024 17:42:41 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=NeAlU3Kg; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=nDu2E6Dw; spf=pass (imf30.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=1717522962; 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=5zvCRKl+U2ByYXCU/OBlf+JIMmoEO64HTB1VnCJPdP4=; b=ERfS2XlWDsKRkG2xTxGAGn21qLl+iWAl7b/U4q9h+6p5DfIC1K6+zUrdulrdv7MX11BYF5 3sWj1Y9c3HP2XNJDUuvlDtfOB0GBCueTly6WgXSnbaH8bnp58WvDT7LInzPvnEipCInQQu Z+E3i9YO8RZo6w/pCv/5K/DCGDyb+as= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717522962; a=rsa-sha256; cv=pass; b=wppEoTLw9aypb3s/DMkuzRPEWMey4yM9wLlo1K/6yIznALnI8dWsXygPO71Q4HHU2taM/Y i3khvtUyVtfkek9k9GJo7V0yHqaeZUk0fgkHVD/t2BKe796E8Yhfgc/i0PbZ+tXVPQLbND DdUGdW/8mucfa8kdQEhn0ftflG433Qk= ARC-Authentication-Results: i=2; imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=NeAlU3Kg; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=nDu2E6Dw; spf=pass (imf30.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") 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 454Bn1i7032558; Tue, 4 Jun 2024 17:42:31 GMT DKIM-Signature: =?utf-8?q?v=3D1=3B_a=3Drsa-sha256=3B_c=3Drelaxed/relaxed=3B_?= =?utf-8?q?d=3Doracle=2Ecom=3B_h=3Dcc=3Acontent-transfer-encoding=3Acontent-?= =?utf-8?q?type=3Adate=3Afrom=3Ain-reply-to=3Amessage-id=3Amime-version=3Are?= =?utf-8?q?ferences=3Asubject=3Ato=3B_s=3Dcorp-2023-11-20=3B_bh=3D5zvCRKl+U2?= =?utf-8?q?ByYXCU/OBlf+JIMmoEO64HTB1VnCJPdP4=3D=3B_b=3DNeAlU3KggAcL7oCzb245s?= =?utf-8?q?3ruw61z046ZZMuyQ/lQDOJXFKaTI91aeu9e/uF5/31jUcvZ_fas4l+XakfEzWdnxC?= =?utf-8?q?+m9KUtIWalDTllZASHb3MKzFXEwhonHCZe97AHM5FA3iXZlpsjx_hM4CEcgNs2Cae?= =?utf-8?q?MbqJoTMVTgvMBig322enjM7QXtGEo5wqFiiQmmhNbX67Ypvictb2G6P_PComKxGm7?= =?utf-8?q?KJvo0IZYPd8aFVeQgXNczB8cz5C0ozXB4veh8ByRm0OeLcoww+yazKGok7o_qyUy7?= =?utf-8?q?nXFLEePRS9n6qYIN2D1MSBU5b1mQD7k9DSqdmn0HtKgsy8DTyn9Lz8mAx0xL+/p_3?= =?utf-8?q?A=3D=3D_?= Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfuyu5j6y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:31 +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 454HRBZL015719; Tue, 4 Jun 2024 17:42:30 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2175.outbound.protection.outlook.com [104.47.58.175]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrjcnnes-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hFl7b9SvHKR6MsTQoZ9q/cL5/rR9J/MJGBBszGkYX86Q9f84uIRK8NS8+RjDq9NRvrDtVE/6dzIPwqdlspH2qpiW/AvH7W4Mnktb2F62CEns/QW8tuAkw9wzDzanPzuHVzq7OGxPSVWD6HtMcog36KDw2KuvxPqLse6olhY4c3q7h3CCKGilgd4CE+MD7Zu0NKVThwgseqkej1Xi6Mz1Wuo3EftLI/dgAOx92bo3wi6c5FUPH6/dR3fWJOfZRzq2mD1Z/4UeEAKhVnkkxfKbrJg976RGNiwLfdZCmIjMgaDSNThMxansEF0/8T5WOsOjGoUE6yFEXt123axvrm7XXQ== 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=5zvCRKl+U2ByYXCU/OBlf+JIMmoEO64HTB1VnCJPdP4=; b=iSEC/rkeea8k0sQVO/B+hEIy79HLYDwjC97NBEV9xK0oMHt9XmLxDGbEuEKVJ7n5rEc+xlM5gc0d5YvTiXVGgdwqP7IM7d/zyrrVbKYUJorbMtIML8NgbAnxMSMT+L7XAggWdD84ctbQQwchlsHunC3Z6l33Kg0LWgDI3tFxvw2cl5ffborzehEYDTJQi5eTMVt+DA8d6m7sW/DodoOT1b93+rdPebtZ6uDLyEnNK5YUR4Eap5tScvW0/FCOolj+POz2s5NlIWhhDGnM573846bjmVJx0O8p2fUNYwGWKtF3ky0J+c7viSK9r/iWSahfp0ugzinJ8Xjbt8Ksp/s0Tw== 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=5zvCRKl+U2ByYXCU/OBlf+JIMmoEO64HTB1VnCJPdP4=; b=nDu2E6DwPqt8xqBGnJUuIiQV415gGQ1T+w9Bp023O8Qca5Z9P6Gf429y/57vA1lsKrShaVHd/rGry6YPbYqFmhftU0LdIxDgMQ7FKecg76IwDpZ87gHkRS9/89WT+t086YOFt5iSBf7A5mgudgTvhfN/bo8VkIJSejyzF7hluZo= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SA1PR10MB7593.namprd10.prod.outlook.com (2603:10b6:806:385::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Tue, 4 Jun 2024 17:42: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.021; Tue, 4 Jun 2024 17:42: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, zhangpeng.00@bytedance.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 17/18] maple_tree: remove repeated sanity checks from mas_wr_append() Date: Tue, 4 Jun 2024 10:41:44 -0700 Message-ID: <20240604174145.563900-18-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604174145.563900-1-sidhartha.kumar@oracle.com> References: <20240604174145.563900-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR07CA0029.namprd07.prod.outlook.com (2603:10b6:a02:bc::42) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SA1PR10MB7593:EE_ X-MS-Office365-Filtering-Correlation-Id: 92b8bb8e-f776-4443-cc63-08dc84bdb3c6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|376005|1800799015; X-Microsoft-Antispam-Message-Info: nUTGd/dcNXJlnlFN2G5bnxHf7IY7R2ArEtXhl1Ww9WK3cLgjE6zxgMpt/+7Y0+bwpfUuxJ6UwPAkQjjuDkqwoJKhZRYN6QRHQ8LspUnr7omgEbCyEaH4NS5BIi/mNkl1HHV4e4+XqztLLkBTWzaQQDMpffVZCrwtEIazuRvnUS900jQtgqv1HZsRFRlI/wBw/K5lBl9TvCSxkmR/DBYpf/r30rRcocVKXkz6IXBBbyN1cXTDRie/wfiiknLIkXkyKsuOQecZaPAXTlg40i2fxoVF6tIk84s5ywXvUA1KYKUR2Rkjbc8hQO1f6x5LTW9HKSHqCiIijS0Oivg+xAF+IFKoNixioZ1ZaifCQQTfQFoVjAsp2DEuf7OEoA08xWlMNPc7ECMaWhM2P9I58/JkuECKTWxIh9QkbFm/P0rLVUCDtzw03fUCRceO4+/WcttjA/NlqGnIRezpY/zX5yVZ7Mcm+e1OpjrYzFJXRgt57LqgBv94z2GOl4UYGl0GrMO82D/zg4ZLXXVbsewnhlCpbc9EfdhQ+2zAeszq4GN8JIgpVBvjOBtiWSmmEREhOOm8lgFO3XiuK2fLraJHXjhxqmIU4fLRH+vEDhKT+ZCtaOgQj0U3DggldbcYT23Qgga3ooyCK6Y4NNshT/EScBU1uJMY2S0Pvn4hsl7USolrigz26aDcmIHlhhB6tLug4a25uqx0tMSP/bVvCiAC2APqL3jprRSJpSLdnaBzGMhOBVYbIkMKXPH0CE/moS3+VXf/LvoNj+C37BNGbwBmLqnqXVbiw0HUdaErxztRufwhZ7noKFP24lsUFOi4UT7alEbiGuD8xYYY+/mb28yEbSYImrVgpGXslWX0yrIUfDzA+x92FG6mT51E4vLtw4E5mbmgUYMTNMxCqkJqq3YuZsjbf7zwIEjdLt8lYcmyYEAs6+ztB5ug3++APM2XMfRRF82jVTHw/GT/3bLeXZF7BvhYy+r1BnFMcu0FRwoeqIhpoBhaCRzN/Ct3I6/NETwRjffte2SGv9cjVpcgVY3YLVN3FFu08Pn+f1oefD8FUYUtnmUaeVex36dqK1abkYwBUOE6e8vhN7Xj7RLZ2qH/E65JQoVG24lRs+cB7GUgvr9+YSTPdCw8dgi+Ulgi4lxexPCN1ZyIGebkg50HM5K1oHPuULW1cS3IEkh5W/mst9z2Nikp0IqhTQ5hbpZtkyEOkhqT4LDkE2L8pSjKwmafR5S+UToXMhbSOeYE8lSswDACCKh9+kzept1FpTkdo4uUUQ3wWDjLBzGUmQgtfNBorYj5yw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: e1kGhgBKCXxSAav1yd37nRSGR7XM1hngRzfAUrEMvTm/BDKGlRv+y1TC3mDok8Un1lvuS7A0aKzQZChqDsbUtnTDiRCdji7CQh+lB5cfovoyOAAjAaca9RijFBk/IM3Grcr0vYvtf2kdhIdpJ1LNXDGHr+19vvGgn4/BBs5ShagMUq0V0gVpg28lKAOkwUo3pAmU3E5BhRR8Lrb2yezZY6kwwNde3/FyDySUxKIgJsHQYxPSJWwysiABSBbne1DchjxD9lw9CPmL3wIcfmbpdPJYuhmwgbrG4sjB3w0GuzCq49LUdPkjhQnowLz4KSyc8jnA65oCEEYdCiZbnoKvLELZH9thy9C/be2m12Ag+cnzUUbCfYd5ii1Bs0+cO7fcA2QuyOcbG7S6IdHdUhlmv7y+Mfppd6gn5biD5rzNR3kYAkYHcFrAWmOtNscG7MO01m6TlCJQry8E+oiYDhNGTutQaMgFOiO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3ScugtCd/1fV7uG2WZlgDy+uhmzEjm+YSvF6oBaCTiRtLPSXgplcEI2ICm4sptlo4155wELBdNSpIB4= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: SIWrxWfRw262gcaH0L0iavJqfugcDUXH8XlH2GeY9N5tYfwWTzZaKTgwS6YZQpc4eV2T/GDYXyLF4uFOsTydJQ1psjbvttYpoYOW3jJSgmXpJ2iq5nPdZ0ytb1XonwvpgYhxt1gryYMJsJunmjpWYq718XVLa6b4i6OibfHhBXi4VENIu12rx0NehXUQjyejCBbYsLok7i2noTWsAAfzUQYTAmubsk2yvM/RYLM2wF49OEcp7L/VRqkPh3HshF3OyOO/RB6Wbr0jqwt8x9O+S+3xELL7dMrqTVjNn40xbqgYXVJhoKHqAiO0WZpepDjzk6i59z4EvqBopUdVYqihbcNZDPB0//DpOJHcfWTp2DdOR85Da1ZCPhxO/67Q6Of5l3+kaslYKgo84tvEc2fnYq5uOoWb0GrZ835LfBLAzeJ5jR3Ae3a3OT+CzfzVhfTv4fIk1d6JPVFMPfPL6Vk0p9OKOP4Oj/X7uPOCh5esp+w3mnrlmJgLsh+VM6S3udwkdoOfLqhAumgdV2fISBHXZEYEbuODK3PlqooX53hzk951BLrsuKuU1J63VIxHcJyePMAQAh72QStGaSiwRaND+iGodYYtlHHItZlkdY0yR1s= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 92b8bb8e-f776-4443-cc63-08dc84bdb3c6 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:42:28.0714 (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: dqalQIRAKT9dG/CWhIooAQmAIDeEngSHw4BlcB93OklvZKJ7RIvlugOnYS/bfgrCedx8tAnnRv7Jd+tetZdVEnOTgphB9//1oKvAiNU76Cs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB7593 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 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-2406040142 X-Proofpoint-GUID: zERGJ5ykFZStswL5NZ8BtfpYz35ybi5m X-Proofpoint-ORIG-GUID: zERGJ5ykFZStswL5NZ8BtfpYz35ybi5m X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 0F71C80012 X-Rspam-User: X-Stat-Signature: cdqmi84hswuaky6zfjczewdoe9z9o71b X-HE-Tag: 1717522961-783233 X-HE-Meta: U2FsdGVkX19rMm41872CHaaJDRy4ClTcVu6DFRP1VGrXY0HwGdbXY6r2Eg/4Fo4NpJsU1Abji5T4gCxaYuRP11YU69UAZPxNe1VWqdXEdADULpecLmrroTGZRXpFpDYGBVUPj2bSZcZXa7s0FEoJ/Vj0Rb4U7uFgs+e2HlBoHhM17oI1wkbFlC6jgbg/5Nl6yC9+VV5SU1dAWvI3l3MHK1Co0tGUvyHo7yDWEWKYYsaEs027Eu7yDsWNnOaP1G6jX+eB9BdyB9DOWQsKgfGrrlI6RTHp6P1+EjLDU3hfVaQQ+zHl0oU29UYXSakvnOii0IRdrMYYePb7tG4gFZhyJmyj9aLZSiq6oFGr/5ttnmFF5UBr7RdCQR4zp4j7ZGJ0YPQVb0NPENbwJslUVyJXOWb5AEXpE+B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0VkDK5ov/XSkDOL03aCXEVVD4xzCXuelHW2i4G6/zpJMnrQ6cA7G1O1tSPR22xcCdr3ezT7w== 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 3d2d8c2c24df..a90512d15549 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4062,17 +4062,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 Tue Jun 4 17:41:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13685740 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 1512CC27C52 for ; Tue, 4 Jun 2024 17:43:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 43AF66B0095; Tue, 4 Jun 2024 13:42:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E1E36B00B0; Tue, 4 Jun 2024 13:42:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 149566B00B1; Tue, 4 Jun 2024 13:42:47 -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 E281F6B00B0 for ; Tue, 4 Jun 2024 13:42:46 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 8B72FC0F47 for ; Tue, 4 Jun 2024 17:42:46 +0000 (UTC) X-FDA: 82193926332.16.1929849 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf04.hostedemail.com (Postfix) with ESMTP id 4F70B40005 for ; Tue, 4 Jun 2024 17:42:43 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=FqeNTKLD; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=H0d9RaWI; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf04.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-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717522963; 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=/axvbuW8khhoVEyMPhrQgsnIMUV1XCKocXZ29JyAv1E=; b=fXJJ1kUhax1hzfUQi8ZiKDGEpx3rhXVeUkfrjP8/gRI2yYVnfqsNFGWJSYKkDytTbR97/C qGnU+yilXolVhKnC2tFXD+6pPbet1UJw8dhhkPAREGJw1gHtJ/l1EcJ/NqYH0EAfX9rbZE frUs3Nm017a+nvX5+HA/KZIZe4lOMWM= ARC-Authentication-Results: i=2; imf04.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=FqeNTKLD; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=H0d9RaWI; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf04.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-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717522963; a=rsa-sha256; cv=pass; b=McPPPg9nPVHfAs9sGIxqnjBx/Qe9vvIrF89jV9g1Km1bsRq4G1k9CaRu2OWfE7KtN+RK8B O6gQQi+O9qq7upRjxvp8HIDRBNyepzNfqm3X9Bww/DTP5r1r1btiq0z1LAObzGylQzOKF+ HRsM2NEJ4ZmCulJ8g3I6+1MSn+/Q7b0= 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 454BmoPB013712; Tue, 4 Jun 2024 17:42:33 GMT DKIM-Signature: =?utf-8?q?v=3D1=3B_a=3Drsa-sha256=3B_c=3Drelaxed/relaxed=3B_?= =?utf-8?q?d=3Doracle=2Ecom=3B_h=3Dcc=3Acontent-transfer-encoding=3Acontent-?= =?utf-8?q?type=3Adate=3Afrom=3Ain-reply-to=3Amessage-id=3Amime-version=3Are?= =?utf-8?q?ferences=3Asubject=3Ato=3B_s=3Dcorp-2023-11-20=3B_bh=3D/axvbuW8kh?= =?utf-8?q?hoVEyMPhrQgsnIMUV1XCKocXZ29JyAv1E=3D=3B_b=3DFqeNTKLDyd3Qz9ctX6mzB?= =?utf-8?q?fYdl/yjrF15aSUWmAGSeEmdUGj7O9wJH3gDqwkoKVGWl5Ht_l5WOFBhunHkze6Vyc?= =?utf-8?q?cJ6uIj+wk4EsEk65AWlfsJh8x96AEjKR/7df1cI4Jf1N75AMbBw_HrZAHPd38oPoA?= =?utf-8?q?jb0HEs73/BnpP7lVAfHZOLt4abOqJJyShtSRcQzda6Xx7q8HUMt9YcW_zot2mghC9?= =?utf-8?q?O/BbiyNfXpCLqwvnozyeKLhpqtTFJakNaF4BlrqZU43AgbiKHUlbYJP3+SP_0f9yB?= =?utf-8?q?i0vUKhGyTc/QFRpQ8VsxrVjR1ZfIVixBJ2HS2V+TwSK9YXfiGgzJG46cimb8esp_b?= =?utf-8?q?A=3D=3D_?= Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfuwm5jrc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:33 +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 454HW4DG016141; Tue, 4 Jun 2024 17:42:32 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrsaf3dn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:42:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PFmhjP+pH2PLlpTAIjwP8sBusL9t0gVpWc6Y/dVTsbYP+jB3XwxM36oK/O8FQUjbGgihHe534Ou4EOh8EjqoOex0jD1Y3qM8BhfoASpsQHZAusLVdpLLaNwl9orLNCUyirazIxGCSouIfz3Sj6xTCCnn3Sk9nqlv4VvqhaL6T/r9lOrAfgqTYP73aeXwG7t7vdCDuW3Ykvb8mEXjwc2Mp1EpOuNeDSh7CvpUHKd8HKC4cE1MyywfReJHESyQLNWsq2ouW3U8b08Rc23eO3ydSZMP0jR8udChJA/1eN5yjZnSMWLyB9NcFDfhJo8KARSUp8MAbd5jHJW42Ru9+Wq4FQ== 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=/axvbuW8khhoVEyMPhrQgsnIMUV1XCKocXZ29JyAv1E=; b=KfnTjjQ2Gk7796y4X3fN0VB9z7n7eal1cuAQCLamVwWTHsk2OAtmhS0LXYenO6X6ROOUzemLOjMEO0Yt+4HGhsjTM76bqDOYpjycJEA7ok/dvA1bFkhT4uA+SHw/rSkS8rLcXNeMWmsePi83CvawOENBm/EtqnWJqMX2mNFafKhTm4gpp2ZVNlOAeVXs3R0AV9EgXx+hbk4hK7wcseXwmAVLiYPd9zONpZu/beiK/611EhD+OUiMTrnRSHHDCqIIXrgjB9X0b+wLEdggsGadyRLv0En8XqJQHMogcmkckCY7uTRBRqupP2+CCzdlaKJNOpakHVJUxEHoTw7IpcLU5w== 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=/axvbuW8khhoVEyMPhrQgsnIMUV1XCKocXZ29JyAv1E=; b=H0d9RaWIb0Mrw+7vx0h1rwT72pQtdnuFMAQJSZeKl10TfzZzwIxgQLS1TfmJDg6aCvWL/oe64K+VBAxgiHqm/wXdI4XiZwSzSpYoDlGGS/nyVD2gP4d8wP8l+Ep3neegxVuTAllCtL78joqwSqCU+kECm402vvUm3myXvo1stY8= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SA1PR10MB7593.namprd10.prod.outlook.com (2603:10b6:806:385::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Tue, 4 Jun 2024 17:42:30 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7633.021; Tue, 4 Jun 2024 17:42: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, zhangpeng.00@bytedance.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 18/18] maple_tree: remove unneeded mas_wr_walk() in mas_store_prealloc() Date: Tue, 4 Jun 2024 10:41:45 -0700 Message-ID: <20240604174145.563900-19-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604174145.563900-1-sidhartha.kumar@oracle.com> References: <20240604174145.563900-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR13CA0035.namprd13.prod.outlook.com (2603:10b6:a03:2c2::10) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SA1PR10MB7593:EE_ X-MS-Office365-Filtering-Correlation-Id: 6c1b2a79-7cbc-4d59-d95c-08dc84bdb511 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|376005|1800799015; X-Microsoft-Antispam-Message-Info: 4JvesdLVzHDvKx/UsmwaAyB9tozbNNdyDOvqpt17AFVnalB83nu2gH3Jd9zs5+Sl+9YfZb03YNuWWlR0MoBadJG4n3qVNymch65Kd9q/K29t1rOwqJvXdIB7dllit98fvMEULjLMDgv1lh22bubZwtjEUiVDBiqDUBDbAtFMcgSm/3Pd8ekcuSm+S9tSk2GEHeRElgPo8HDyjvY30uWbPgwblfgT8EAIfNZC47Y+xGhocby/RfS1mDckIskrfILQ5+z/7zCjQDFDyUPCRCGM57/a8vQqufi9SSzqoDo51CF0aR4J5v6N3ybPW7vhEjZBbPQlrc+rHG/RjLI0HHjqOQYTJOHtnLfhpQsn2VASJ/3RzFu2MReKwgBJ//rBghwhyZRnRQquOge3BTEaDbIqoppeXT3si7DHBRgoTNa8o8RCg3jyNxpdMnQZyOGhF2U9/sPUyWxdlWvYSFp9GPyYjhtGVnHv/MuvG8hd+3wamSLXLQhZ9nff9EtupKI7hKantLi2V7bTjpANkOjounHxf8SoX0KlKjFcAewDs9hRy+GgFG+jZYu/4r7OwiCNGLiPBRFDtPJ5tYVofyY/O6UnwGicxZhkliDOZZKmZc/Jr+6v2qDNq1e/gA29pTbtxQ383ikB305EvyG/Ia6M4IweEfVC3Igqa5KAAtTuspAUM0sK+v6nxdO3BZcA2yECJuJ5c3Hy/lUcq7Eo/Qu41bhEOtwinTfL18FLaaM+0u06iT2aezfkqoR45xLsXHsS3LidcfHV89VmEjpREZxPaQSB1Med2S279F49qHbvAKhump4Tww9FcHzlXdfgLMqDeW98mxn9lwXJApIzg9k2EFuBXLwltdFQhmLxKC2DLfYrsxCrgNyEXKnEoWEjvDW4LFibjN/ZPaD8lnWMCdQlPK2i0TOrmUn/3MQPdNzZNQQAHaX61P4dCp62VCYPr4ScaURY4Slo4HgcD94LI+VmA3+93AjVA/xOPa6xSGRZnP6ck5kmOYAkqZf67kFgaUeTtYegJ/vFNdKe4SWnQjPmy0wX2SiS8aXQXii0zDV5MuzLMt23NblEZle/A5ifE3OAVbHOJMGUe3LeEsbNYwNI46/DSBxUaAzNHh/ox5lwceYCuemYMWJejrD6SlzWDJEPkka7zZBqEh+/Qlih9Og8ocoA6Dyd61L9A006ksZsyH+PmmdGohEnXSlV5tZAPlfPM0llwKNwexZZICMcHtAWUQzp4nYnUM8PuT1SM626pNNxZu4PbOlEhcCOPGtPXRiSpRX9QuVTIcGno7/URgBkn3eG9w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ycagm2bgr6iZ/tQh0OMuZdS8BNzS3JiTBIjdFISc+jq7SI/6YPOOyCHjSKoqvetVaEAJM9aNGJeyFUcSkvMcoqsytWgbKzxddhE0eBnpigl54S5aYvAiT6pSrEl2qPQgl7kE98jxgy7hpAP6rR+9KCG8fcJ6qUOCNw5QUNVO8O0EJ+KcqDI3KDwbCpgsRB+eAMM1tpJWVOZdxpeQOUktQOv7XofnlrVj2M/a4Lz53FUD0cl9ApYYfqRTz6TgX+K/BHSovmDHOx8lMRviT1MZURlK4zIYonDsvRh1qb0/Me63M84UmC0hQDBcVhEWLulGQQNKNFAyO9KR617LyNLZmAjwtB23BjGEg7mhUx0xWge+No1fWRiOw0sQYG/hY4AKPUDrSxu8aOyFlTITxsnHwLBN6QbbArpbW5ku2aQ5PbetoGrldwxThKJpgzDTOud4iFB2a4yeaIC1z3qkx5qUOmCfX9HKU3d/Zpumue97O1/vfBVt8RTEIXKOI5ZB/SpOmLJEWensJ4AFaqCnvpRCMD/ITYQmK3+dQ579/+X5TaYjKKNmDg0PY8E/89RMKFKLFs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Spam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: YKbrFAaLGIG/HTeukfjRLIc49EaiepX5IBcYjVGxFMDa9ICbAJSwmHlRQ9s+MllqkSyU637F49Ct9lLCa5Z37afNS/gQyoucHnZRSac1dc9u1bP7zVQpneWvmYUrNF9pRKejaL5RF4KbH/gYBxRT0XWmsQyupl49vEk69M+2MgsUAyHWrMFj3yq/qk3kuopXgRLY5BaNl0CNIyoYtP963/waq/MVRr/7nutPOhj+Mpu4zs4UzgaBSYYYhoHfbdglRVoUQTWfiyYpbCxwRhIvsRuHgAKtL3NkWtC4fKD6baD1pdnnqgdexP81wez7iDneoxAB3YkfcZZ0byhpG23z86hAUspVEBIXb/6f4pS3TKpohmty2cIQOkztayP++26e7zUyIQhrF1RikTyeWHWHriuxHln9xO0f25meTMVnvZ3e7ncP/6rQfVkr2N+A1uC5MEk3UYrwhmYZI7miwpz4vP8Nym3daLIkVu01Ad2Pc15E60B86fb343LOZcq0BY7T4u9jiPnvL7p6PgzBdwv7F1FkceCc7Xv0xQa3Rli9SFUCHNysiO/gASHRRWQoJX+DfwwPf2CUK/luQG1A2CRxMVdY147ngj7UFuLdubV/TKc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6c1b2a79-7cbc-4d59-d95c-08dc84bdb511 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:42:30.3087 (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: 28sTVdoYgGp2d/vQuPtCKDld9SvwYHE8tdslpLKVSP97AUI0DHhm0ynaD4WbXWfd+21Pm4tPlVSy4yJZYguJRz6/rxQoDnXnWqh2Qg/yg8o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB7593 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 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-2406040142 X-Proofpoint-GUID: auNnVvWluD28L6jy7NFku5XcrXrWOj0I X-Proofpoint-ORIG-GUID: auNnVvWluD28L6jy7NFku5XcrXrWOj0I X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 4F70B40005 X-Stat-Signature: bktbtttej3kemg6jgc1yt3bkjaupscqt X-Rspam-User: X-HE-Tag: 1717522963-923374 X-HE-Meta: U2FsdGVkX19Ew3hPX3Xm9EzJoAh7rJ4DyAZhKtDn2HO6nlObbSwaVAwvLaZQ/1cBPNKw8lgvZWuoFKpm/u+eJW6crz2Q8Pn3Ip/Gfohoag16tdbVKqenMLLHkVSqzoFsmKCf7bMkXB1IkFHkdxcK8PP+mRqU05hDRngpQPdssilM4vQi16rj2AAp/VS03z3fQTup1nQTYEo0a4KxH37e7R86UDkS0IIgWTkq8+ZeUz8giZa+J9m0hVw9a/9Sj8PkasbwQDfPWWUJDsYEA620RzeY/eIuduPvPHzOeVd0AKS81C9krUnfISXL/cMkk/jLuLPWQ74wM6OgbLzgFdGmjk2p3tSDwByJ8YkhvfUS+EaDAhvD1W7ZFYiZrMv0ZouOySvMdiAGkrfn2Uh/OS+EdnDa+PU1ypTsw8+JBC5hiMFxm4n7AG5MJkXKoVVGaLRT2QnDYTX8GLRNIDmdXYOT5FAwkUZ5S8L4pKUNzujj3HXjar2rxFBZjVd61erqNZrc6ghbOPKu/1aOxNDNhSFJCSG+kiUidHGOiVq1kxAh57rQM5ylE+PiCAk2ikqLaFQTJRmuPUc2GdQq18lLZ0F3mqRml5ei3eafwgSGZvdRcit0WVTdhp23ilHFesiNWblsJAWoOoMXWFZOPsGDOtk+V45nJ0W8gng2yUY3WcUJiIqUfpIMquLCEio42RGXd/C+B3fX49nPoFGfjYsOKwYrEuDOwyPlrIRb/vmNWMdtpwshlNH0j3G+o2KkQ+fsqP5wyLVcOeV30HiscCbDZ/Euhttw+ubkCqBvMbonG/dQ6wTFmKY+tEQAy5WTkIGosrqFtClL3LyWctb5eh/0biuefVXSPh57mlspKpBtnXz3LKydfy1EbepgnWLKBFKNAtnLZJbU3v3uG6CK+QAcBUXwC9aVpSvdGlKL/oj/SjLvDY0wZU5YfXY9O3Jy/RXJc1CdcqzOJ9rmJyuw9QEYLok 1m6aQwRm RJOtiL4PEOhCiVdzZmzx2h0bRHC8ZhnLt41k/MnVzaf38oQ0Q3jmQtIAZG6szz7Kv48eCiqo4ZpCLfZgM03crD0XyegBpxc8jGyehp9TB7XLv6ud4NztWP1+CNJ1CXVvJj6/PERx/Bgp8HYMXhr8moIvYW2db53vpjfQ2UG5FVlv8UeKHDYHxz+heE13j6Fpouw91IfErn27JAbZ7VSvoUAcrmL34bqthBGq9IWZ4ysBmkP7APZHhReIBnpIVyjvQKzIAUUmeB8kATh8mryL7ogfe3YVlclUQ78u93BzZ70/dkPDU7ZzZwVwHY26J9SIT+J5nOuzQMxR/G2pKqy2/L59tK4YHJ5MtvtDkvSCjCl4LE/9tP6t9X+CsFNWZT+jchSgW7uImJkmoHxOYUh++v6aFrKUROooy1Pm5EnN+AaAZb0/mNQFAK/+B8uAmTwlknsFSEVYGXFgFY4gAfZmeIFP48g== 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 a90512d15549..eeb8def13f63 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4028,9 +4028,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) @@ -5595,12 +5592,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);