From patchwork Tue Jun 18 20:47: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: 13703028 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 445E9C27C4F for ; Tue, 18 Jun 2024 20:49:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0CF588D0055; Tue, 18 Jun 2024 16:48:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ECBCB8D005B; Tue, 18 Jun 2024 16:48:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D22648D0055; Tue, 18 Jun 2024 16:48:44 -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 8FC718D0059 for ; Tue, 18 Jun 2024 16:48:44 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 38BF0A2134 for ; Tue, 18 Jun 2024 20:48:44 +0000 (UTC) X-FDA: 82245198168.06.6029AF2 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf26.hostedemail.com (Postfix) with ESMTP id E70C714001E for ; Tue, 18 Jun 2024 20:48:40 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=LG28IOwN; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="evrLFT/Q"; dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf26.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=1718743713; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=LbRUqzQTGgReNrj5x/34j4uZL7gNsaS8wJAQGdq1eJ8=; b=4xM53bLeLlpxfJdXrOSgXNG0jTZHHMd3wsRbes+oAtiIvVFntn/gmiUai1tOOImK7GtczH vdazmx3HAIvCej41DJscg3Z5N+Au0mZkNqifM6SVa4hkLz0fqrnux94kUH0W63PmjrNrlT 4+JJZaI5LWeagcHImVbPjSSC3xmzOaQ= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718743713; a=rsa-sha256; cv=pass; b=GSaZFmF/ooa7/NWxtrXIDTKNf7NbfwQpehrewhlDLfzB0hQm0RNvCM0bIxC9l6UlD5naOF nmt/vXrq1s+mNaluLk858hlj3L4q5hotSn08+ALt1NthhN5ylcdCFkOufTUifhi9N8V4np Q2h2mUYMfHahT4UAtr8qvQBfV+uymR4= ARC-Authentication-Results: i=2; imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=LG28IOwN; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="evrLFT/Q"; dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf26.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") Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45IIUvXo031029; Tue, 18 Jun 2024 20:48:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=LbRUqzQTGgReNrj5x/34j4uZL7gNsaS8wJAQGdq1eJ8=; b= LG28IOwNvtanZ1cDEcuoYeIe8O6j0ck0/OQ+0htS31vV5zXUO/jaK54/RG5veioB TAjhlNiYE6Q4xW5viRPCUarOYSqHifuqaxomdlQdBZsJSsUkWupmkvEs7rZ5N3t0 AbJFWgDYBViix+u8idLu5B74STWO/0HnXgnprRZmqTqNi4Sg0Kydp0V7ECertFsH i3o/VI8O3pA/voe6H8okZf0oEPdM++ZrHZh0Vac3ZJTMGMoa9MGbz4T36OiPmLd/ 6aEN3VgY0vg86lCONOFEIfLBDWvq4Wj1gyvXZFNL1EPttfbXxQ4fSLQP54LoPrB3 sDq8xIE+PU7b6t5L/Usv7Q== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ys1r1wv5t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:33 +0000 (GMT) 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 45IJeuRa034707; Tue, 18 Jun 2024 20:48:32 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2040.outbound.protection.outlook.com [104.47.73.40]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ys1d8p6p6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XitMcOMmsicDpt3zuKl+5cGFKyo9i2kbFB5H5xF/zIVabUinvqpPmuMj/Frnvw4bAcWJWc/apKn6pZDZrAxXDLGweP6ja+xFgkYW4XG5+7UE2kR5G8gHNzWIBEzSlL30tYWsXmVL9Pl4ZvfPhbIp49VFqYgatjj68L0HgFxE4gVTn3LSq0TEcIpyH93MylaVA5ltJrni0VV5jq8tcXnpgnklme/DJiQbK+UKsFdGiQJ4G6pgHK+ZWAaTo0B42am0tbBcQ5sDGxq16KaqHBzOHUpIKdo31/cclC7mhPSmzDYx+OBZ7g7Avj9tELXCSAfEZjmk9znnrIEalMtu0n9vmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LbRUqzQTGgReNrj5x/34j4uZL7gNsaS8wJAQGdq1eJ8=; b=HUjfKRTjHwdHnMhcRtmYc5wlVXVRe8kmS2EDXASOcHC/JDiNaV/qRsz/v5hvQRiogkF9ihCgz7X5TovhygHS2vaDudwvd820ETn0vbJg1RUeA3dGesLmy57RW2i6bK6NEcoIeTcwT/v9goxZapb4uhw8aZrcN9wrzuTogVBegi47u6Vls85tVFVfj6t+53+CbhGqi5z6BiJZt1+BUHA5mz8ZQNzIio8+q6eAwbqC84iYMtvc6prqRAJDHnNpbPH+y4+W6tPyK3v2q/iEHE65ajDiWj27Bl2nik7AuXmho04vBXsH0IFJLFXz4D/P0enatAQXF5sCzn4AcEMXy4Z4Mg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LbRUqzQTGgReNrj5x/34j4uZL7gNsaS8wJAQGdq1eJ8=; b=evrLFT/QQ4wgA8Xe298f0KDEb6CtM/Qjp6qFzzSOa49QxcErL3iBjAYBF1QuzRM3jGgna3jxcusmadSQQgm4IaGe60TZLZmSxJIo749Fi2rgJ/14Igy6Dzi/0p6/jWmMPvq8Ij50qqNueRR/LnLVdDCC24JqG8Mq08fhAVRx9Aw= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SJ0PR10MB5785.namprd10.prod.outlook.com (2603:10b6:a03:3d1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.31; Tue, 18 Jun 2024 20:48: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.7677.030; Tue, 18 Jun 2024 20:48: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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v3 01/16] maple_tree: introduce store_type enum Date: Tue, 18 Jun 2024 13:47:35 -0700 Message-ID: <20240618204750.79512-2-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618204750.79512-1-sidhartha.kumar@oracle.com> References: <20240618204750.79512-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ2PR07CA0022.namprd07.prod.outlook.com (2603:10b6:a03:505::24) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SJ0PR10MB5785:EE_ X-MS-Office365-Filtering-Correlation-Id: ce288bba-b268-492c-7ccd-08dc8fd7f1af X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|1800799021|366013|376011; X-Microsoft-Antispam-Message-Info: 9eFr2xSLjSLDKDbZtjApfosPHxZnqIdGvmBhkiz4+By5q0JgHpyLSv2RNw8a4RMgGFII0tEO0HFm3Ah5uUxHYrAm/p5ngqsKFNJY6OjfXp0JkEo5g4Z3vHOQOBbbh6W8iT04HSjKI0bRbFfKH9MKyh6mv6vCnC4JHe5H4c+AyLYXjD7RoOYp+XkAnnQadmekeog+BNgkJ02rNU+1tGp0f+w/Qpevo/cQLzFvHHosK4iEGwU7NoyccD8OMeScE+AxDXXDfqQV4LCx+8py/938YygmVZZFw+4aCWRLASgtjIJ7wCrXcTScYKpNfgkB46cHZ9ZnNRw+hiHjx7iJpTRJ7e2o81XHKgmauE3Z5RqxFBnPQzvOjN+CdSeTn0Cg5TMb4iZW0GKN3MGYYqjnuLn5r73CeDxuUcJsKEVR9iirAm/u/vw3xjfvzefLD4sTEU4MMxrapG6AI3WIjeTUBgtJRGvBkh2EDb9wgTH0w3xUuAx6jUlblOAeO9qzdmLiY9jCz6Gnz4JwtrErpS/uOQk4QlOricXiubWEULIDWoSnaNRndbxw5SPvHYsrfZslRXjQ99EgXt0IyHuEL3paQFBXjqVcs5lt98XBhRlTCzCuw5E/o9alQstu7Tt2GkDnVxM7CIuu9cD1o/4rBP4DXId37zd5yP547IdkaAL406PLlpQBppzqslWxFRRiCDyeXU6v2iMH1FVmSxu1xBAd4a0I8d+yKplmJ2KdlGJwJFksRASQP1AGGmBKRJDfxlPC9XkpgxvGqHc8gwScIpLnfNdfTP/aeklu5Gw5kYGHaELMpRjgt+ZYiw+E01UwsiSNchF2fz256hoAi0WsQWEMt5rYs6buRFIYiGX6y1PdfFChj2+dBXwX7mX29wKCHszZjjYKjCv49DKBWMP2sOC6nnltbrcb4dwZla5W3xanbrTLhBVwnYaEcfLSG7ApIy23YrxuIjCAi8HqQ30EQXvIypmoR35X9MADVw3qEvo6err+M+qFRLux1323804VEcPJaQrR25AnTb0NWXSjkShew2we1aE1uyAOLHuuA+NCZMMQwfNrSsndafpnEtXiFw5MG14QmIrpBI5YRckVcO6iVouFpqNAAmTDQC7bYmBai++5PPf41csIT0JAdR29Yl4iJdPwuyxdpDUK53G0ss0p+qNfyaay6k9hrRMo2AacsF/CS8U0YxU/WfjvollzMHiq0G2zkRIxn291mZR5TbofyyAXGISHY39b5mxoiOBaGyvLWT/VVvImmQmPerQhTiPRn3QIZ1srOBqjTRA6Lk2+GXuwUacNn5EiRcxVv3PTll73dsQpUToxALlIcCyJkXmciHdN 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:(13230037)(1800799021)(366013)(376011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fpYGvxNs/IRJMovVuUQWxHM6zasBIhvIamID47qyNlkdUyyaNKyXvvMGZfqYc3gSQRZWo3oUOGEEH/d5zPczcHCcGg+NFbTVerIJCTQwfAT1+97KUI4TsmYcnqB31xsNB261EvjXRCOgm8HNwojWkYSZFhxa4RJIknQxaPBiJEDEq8KyRidVUlgEE/U9wsiTZXPEL4lRduQ+oKSWS/Xv+c9KL04EfOKMMVm1fSV2KQfp+f8FOy4AAk+MMYyDoX6FquAFeukmYI2kFPcrggsgRtwWr6Wq2Jx/C5wVXJHi5q/B9qCfWEBxG5jngwGm11CNJn1q4OEXPBeXyCxmOpaWLNBzWZ4Vpm9dOeLbPSeR6jV4RsLbXMI4OzUWbqZmk1Ig4i+vpnA2RwMEevcUe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ZFqkiUH6DGgfdV2+/MeWvUWXrBT12uM6Po+hPjzhCyQiCxDh0x6fFbbxhYpg98+h+TUu6+f5RI/xBbbeASzzhRkskMMIPkf8+cJ5FVNs6vK/yr/3SVdgrxguHjkuSEEtVknac/RBYGYcap+9wyA/+RkHzBsalajZk= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: KpzrI9q11L1RKolXZbmGHvdUrB9FDKFqw5xkQo+34Irv9gbCI8BMW796ax5ktTe39hNrpe15bwtLHa7FCWBnM9yU8/tiA9jjBQGEQKZvzmhVVinAEwKje655/uitfSHke0mw3kxH8kXmT5i0/nzDFKtW9pD8Zhi+KTu/lC51JzMvSa2sAzbmcrQAQw4iuJRH25HaZhv3aTPpIoX+idI8dFaTjM1bJ7OOsei0ch/gc5Pdi3AoEnU72cijmt60ZzMaDKMgYXHUFsOeS21c8pmiN7FpZewEByVagHn3+o/ak0+RTjAtmZ6Lw7j/8zVxiqE/rO1kiUYGVqSw4GdTT034umpgw93pVWT0VgE2MUSLFDUEro2bPXUDnQrIccjtG9vbKjB1iOO3JqPS06vdlNmFZ7dJ36HmRA08I74Z/llAyzwwDdTWWhghWgAqRtsW5/HKIxdA8WVf7Z9oMLq0qPgNyrwM2jeLTtvDKEKL4BzUE/q8y+bgSPdtYlq91OMlaishlASyjRovdcF6Hf6ofgzv6EGTbIB3tyCmyKPNMDDa6wUO3W5yrrTn/xdLcs/59LdK+XtVCtebXh1C7E1J5xIRP3NXf1z2MZGNdVe+shNVsaE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce288bba-b268-492c-7ccd-08dc8fd7f1af X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 20:48:01.7399 (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: ohGhTwhHMiyBe1GRDOLHNeHhdDMEB3UabD+J+DCkrDNMsrzMtYpvr4YMPDYKzbHst6rhbQWr2eMAZ4DVGQaDVEEEPi2Wrhw3J2oQGl6+UMI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5785 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-18_04,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 malwarescore=0 phishscore=0 spamscore=0 mlxscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406180153 X-Proofpoint-ORIG-GUID: 3yFq5Vu16nJxACEtrwUJTe3hk2Cv30ek X-Proofpoint-GUID: 3yFq5Vu16nJxACEtrwUJTe3hk2Cv30ek X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: E70C714001E X-Stat-Signature: jiw433wir5miiyb78a18e3xgc5kdniqb X-Rspam-User: X-HE-Tag: 1718743720-38074 X-HE-Meta: U2FsdGVkX18Nkqd41ckayUxzg2BZ39Tl+4Gu/zzoqb8sPY/TvmHpDFJxpnmy/8nj33hOR4EesC9nH9WA2cNUKfx+X2SnCdGwCUJTeSr/aXVezNM6BugTHmrhqNuulktbiYSJoCUdgu+D3D8Hr8JipyQvd4MmXrXXUv09Q6883TSrBXS2LCbxJmu3p1i/hjXTOhIOCYUNdR9WjEyiZRAk9l5i8iVNNxo7Br4whm37waEtEg1lpNOjNt/fXoci0WmoMC0XGt58fuqLpeIUFXz87W5/4klwSe7q4xwegPfpoF9AV2JeEdZI5AMLDCtU95gKNPdUSPuUA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Y6gZBPNfcvzumNlKdG3xziXCY2FIVqqyoJNcm5KHRHkmv7YCVQ== 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 18 20:47: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: 13703031 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 91E6FC27C4F for ; Tue, 18 Jun 2024 20:49:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9EC778D005A; Tue, 18 Jun 2024 16:48:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 99AD48D0059; Tue, 18 Jun 2024 16:48:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B4E88D005B; Tue, 18 Jun 2024 16:48:45 -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 DD3A68D0059 for ; Tue, 18 Jun 2024 16:48:44 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 99147A2472 for ; Tue, 18 Jun 2024 20:48:44 +0000 (UTC) X-FDA: 82245198168.19.3959440 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf03.hostedemail.com (Postfix) with ESMTP id 4CCD220011 for ; Tue, 18 Jun 2024 20:48:41 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=NZpAl+8c; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=QvPaDkxx; spf=pass (imf03.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=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718743717; a=rsa-sha256; cv=pass; b=BijZptuGr6dh9LsZjxV6dkELtVwYeO1mmBLv7O9DG58rVbVwIBWDqhUHTke6or3pJfErMQ eCT9dVNJUApa01il3Ag8PoDCycDEvUOydj2D554aOzgiNO5NXPis+DUbYrCPOpEK3y4GsG OcQCbuqNldCSQwuUmDHrdzz2q16fM9A= ARC-Authentication-Results: i=2; imf03.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=NZpAl+8c; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=QvPaDkxx; spf=pass (imf03.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=reject) 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=1718743717; 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=MJYJjPUqW3BO7LGUv4dPuPylke1u23RTvz/wCjTjJCM=; b=ifWVyjdXWpoN6HsI0M6D29US2Un9gTTu2rG8uBL7WAGavK8nTZ0NxL1vaj9UHcngz4ljK3 5XZSaMJSqhbK5AFi5el4GidKrL0TrGFNGdfKF1BevDsmnCXKkGV/HE4GCHUOPHzhgRA13B DQLV27LBfebgoWr61lSyjfQ4EUhUM7A= Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45IIUrdR027367; Tue, 18 Jun 2024 20:48:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=MJYJjPUqW3BO7LGUv4dPuPylke1u23RTvz/wCjTjJCM=; b= NZpAl+8cWoYNRR64T5f49itWdrq9paewg1tm4guIvf/iKP8S0MO2+BZ8oq7YwYHn diPDzRiIZpsRStc/lKzMORZfkt1b1hW9Lck9m3DPcGKm501VuJcwO3iLDtuAsHlu 83CA6+u/++Ju6wmGFGcnSMIXlyVLmruJmFZ2kQrXAUlehBJawKQ292FIXvVQU+FJ 1Jxl9d4haacBiJjlEts2KWmNiai51EjtXpKaclre94l/reLARcbN9AbQJT8mg7d9 bD0TJbD/4SOfRrcUqjGhy4ZKlQQrUTUo0xv4osrHstO1Uepma1SQNo5Ni7xfU5Eh wDMp+oTRzBlYlOO/AOx66g== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ys30bnvn1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:35 +0000 (GMT) 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 45IJeuRe034707; Tue, 18 Jun 2024 20:48:34 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2040.outbound.protection.outlook.com [104.47.73.40]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ys1d8p6p6-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m9sE6HluxPNHuP92Tj2AwC+MYw2idhpE1IHGEWJyioGgg2/UYvYzF8t09D9E6udCzkuJOYpQI0WEJp2CP4DSb6Aq0hyn6TpR2+nGcuQ3h0Elk6gi1OJxUXvoGfA2+4TgHGpnP6Sy6eJIEn3oQzkvBgW5qyEt/aXSGHNaRrU3v2Da828Ub4ki8naQAoGTkUT11o0chiK5wly+HfgBBW3I/nmGCP955hMwILj65ElxfH6+N+8XoyqCz2lkfbogLL82ih/fzr1XzjmbfV3JvgVbZ2dp9BWPjZe2PlFnxflE79Ux8mnjrFsaJLvtDR7tYm2BJLonndd5OV+BmBrRsX5QNg== 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=MJYJjPUqW3BO7LGUv4dPuPylke1u23RTvz/wCjTjJCM=; b=DDRtO5v6oQLSu07iLBEb/DE3voAHHfhPo6gZdp2ny2lqh4rkMm4YjHsHHjTuwh9EnLOUQmcbhmpgo8IOUaar1jOiYIMQLCexI6huw/F1KHouRcQhkz9FF1WlQk56Kq0gLjnxe6zKR4qm2kE+2RMex3TK4b5jEJ667AbPAaBW8Aft89wemJXNHOVgivD6fAyIBfyLfwG2G+DPafx383pOfzyBoYyHenm8l96gDpHsuTFs1PKdjhVa2mLr7iOU6jQ82y0N4N2bPypSWogeumNmgC3H0tRlDkxZoJRFhMQeybH/ntCvHbfIpNFd3gpH1/5/E8bS3NaJTVPzPfzgK8mHzw== 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=MJYJjPUqW3BO7LGUv4dPuPylke1u23RTvz/wCjTjJCM=; b=QvPaDkxx2tBdLoeMby3Tu3gLyhVDIFRMDc/xyygDMrOVyjYWahD7NvKYqgNps3aYRE8HHFj6DEMuRWwRuMnLrXpxbjvNe2YEnTkgU/MZiwaWVazDFrLTzK5A862ooy7YexIBobaDmiSD73PojF+MzWbLcoy1scRSm2CLuollStQ= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SJ0PR10MB5785.namprd10.prod.outlook.com (2603:10b6:a03:3d1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.31; Tue, 18 Jun 2024 20:48: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.7677.030; Tue, 18 Jun 2024 20:48: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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v3 02/16] maple_tree: introduce mas_wr_prealloc_setup() Date: Tue, 18 Jun 2024 13:47:36 -0700 Message-ID: <20240618204750.79512-3-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618204750.79512-1-sidhartha.kumar@oracle.com> References: <20240618204750.79512-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ2PR07CA0020.namprd07.prod.outlook.com (2603:10b6:a03:505::19) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SJ0PR10MB5785:EE_ X-MS-Office365-Filtering-Correlation-Id: 8b24240b-0a86-48bc-100a-08dc8fd7f2c7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|1800799021|366013|376011; X-Microsoft-Antispam-Message-Info: VsrHLlJzrsx/vWSM6uBLap/C4V7vfxCZP88lS+gMIF/GGXGjD1GF3vifd1dQo4jGuH7J6DhTmznMKT5NLcIWavDvpcgzgWKcmhN1y+3JknD29jCLGG3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R7jDy2+F8tSBOoq0ietIBwjHL2jqg8FP9dSHD+9e1MeDerNNGlJlVu1wS8BN9tacilQYLPkuCBtLW+qrNFJ88vGYFRPVwOKB6un+S9qcaHCpKleiKWyYSKup1DRb/qTevO3nQVdQH 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:(13230037)(1800799021)(366013)(376011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: j/5S+0YiPzYcGmW9ZGvhUnBgEvBgcrmDOy3K9p4+elmoiGLjR4HLFXt6bHk3ozUZtM199iyuCfaq0hiiyTS3i5CePTtHdAsVerKktg1NjycP2qVrzgvip3vSnvLE10/Yqfe/61jHVt/e3GQ7XFtGIq/9UkC8tD+5QYOpV7ZRRAN9vPXFuiVhbybRv51HAnhCrnViFIJRshM2DyEi9mFCRyiv98A7nzr1bnm2la8cp4FtHgJMWpAsxrxSH+0Is5FzQ3iZByGZVhLlOAM8OtO+6OtdDLGsrD6/722J7Jk4sCSSIMuHqcf2Qorp6ocWeLk4rQ4EcOkVdfh9VAy4WL6St7Fg4y+cnsByISoqHaH1BBbPAYVzamhBZUzobCzIgg+R3UdjCfwywpkVMHBPAm3hcpS2XWvhxWPcxF5upDlZWecfEgGh0j58db8DeS2iWbdWVh/Tc7bryOCHbvRk4kXpLY9s/g/PCbWeMn5Axss9VVCH7sUGClvuk7BJRI1I5n4RfDuTjAnkpoRWUEomTECNwh3yXRir/iH2oVoWluEmSR3IfX+VBQ6e7ssZPHYDGNBhNGVl0HvgyGUoyFlWuqMpa8wDdpFwQvpCa+gA3I5wu2bsr/KISZt4WD8HhwF1i+KVAQjj+YThADHDz0n4jtkeO4pRR8BU84Ia5q4Q4GwNO4Tix1+W+6QhTXwa4C38tujYupLXy+uqzfFUNgeDg4L28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p03V2o38uAamgHo4he+9s1bpxwLga/wHjK7Mei4bL6F4YnitwsTIBKs8o5wJuaPAjYBHRJk6kMUnZGTRP4OsdIeVVg419Y8BJFF1+JmIU/sBmViIHo/AZYUuXZiCx/gg681crejKjWliWB5rioc5/AtfAF2KKaV5tyKgt/ePv8dzyJk9dGBX86fMePF7J3fFG2JTRDajl+IiUO0KmJVBJMmzSonUArsqsYrpSWcf9EAOScuoHfEL4/vzw6pqQjN/iCMNSLTFsc/EqucW5BQZhTPtfzLne6TJYW9VWd3KPW/pQOVY7+CAj5EigaIFwG7m0R0xntToneG0UET4bzfz+H15nvMN/NpK8y8gIjY2jGq8f+kELDZlyfrDBPHD2BFGkWULytHDBNcyYFg1mgw5pCz8nlRXoWvnQrByivdEO4T2/w7Par7+wFV3Dgo0tFi/JbBPgqmtrcJrZnDXz8OrUdB3dNiM5mgRiHP557BkYWJtY7YpR31r5NpjgGoLCtouxx4DbU2c70DZYHwr3xYTxrU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8b24240b-0a86-48bc-100a-08dc8fd7f2c7 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 20:48:03.5281 (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: WFpO+ff+yh4OeW5OAgdCvQG4e4p0Xs42Y5MnAPaGc1xjTQA0aFa+fYZPmv91BEOaOJL+KeMsLGvDvMG9szZ07n/8YHerLMevPB+Bj5/bneI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5785 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-18_04,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 malwarescore=0 phishscore=0 spamscore=0 mlxscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406180153 X-Proofpoint-GUID: _0QO2pSvox6TbE45FSyPfYKYbQUZpuPf X-Proofpoint-ORIG-GUID: _0QO2pSvox6TbE45FSyPfYKYbQUZpuPf X-Stat-Signature: d31oqciigupq4nkqtty5bwykyzjx4hpa X-Rspamd-Queue-Id: 4CCD220011 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1718743721-292195 X-HE-Meta: U2FsdGVkX19lh3Nircz8tr3Z8DXe/XFief2c5rmK321QVTwMbNqDF9JQU2veQX1Bfac1mVUih7Ywmix4cailAcIXqWiZGBvJcXQDg8RFz2Or36DUBioK9tflpcTtlEJ06YYbEbj6vJ5jL3o2uHTameAqJ8nuzjj6M8am60UydcDS9BtY4wzg4/ifazlPgn4JJUiW9Fxjqg+7ssX1P30Q4Hl9BWOwF82BxY0KOtMOnQzsAA10FmEFkrEaTuGkIGMN4dFF3GLU3QU74C+GNS+xVgWqr9zyK3GeYu1E9X+Ly966yI+gL9+C4eTl/5GcP20n/3Bq2vEfmI3WoAiy3JMXpAfcKeAfCUucp/yxrwGhtuZW/39JUnWUyXtkWjeyZ4XLAeNAyPRJWfg5ctJWMv4vEeBZbw/7kBWOnUK8634w0Z2rV74pZh8DJMvfSYd8Pot3HDWLfljJLgvqTMeeOd6rh5+BE60uz58ED4oNuWSKDUZ6WElp9l7pKCdKzuu8hv1mdNeqnwVdHdV48KCFFMikObyycH/Y7DEwOWu0UfsFsFHJ07ywBpCvFc59Jq3Jjl+dx0NZ6S++gFbxrQGJsHzyo5uAGNJPs/30h4L83j4ODThIR9RAWxKWFctJyL2jYBkHbmSNH0IzLhn5Oct4CBWkMPNGgJ2+PVligahpA4U5gi9SG6qT1ZrTA3jqAUp4m9U8xhI6Be+ZiHlKLkxRpMV9VMsP1a9BdUXfFMFU5sJrvfiZVOpZi5ebH03YhspbxVWjdXlEtuwohCJ/NFfnmuyYrj7PYKhQ8o4/3MKcuVeoETLXAnPp8QXkqSAyuvgNSvybcnAe8ll5vt4XHSQKItWfDcNSKR22HSulciJsy6G7ydoc5PulLTSrI6JikzY7nDBT+wrbn1tCOamxkA5+5qMIM8gXDyHnANV88Lo/txKC5eics9SbUSXiKs1W4P9SGiqPcygERlcAlIvJRMFthIM 9ynnmZp1 on0jNoSJwg6/cDfxub45N2LkwU+XJnmIqBm2ii3RxoZ1tF+QZ3vtjP0ZpfJ9DzEwRVOWRF9sit3z5KtrnLOzOyRemD8Q+3DQWGhvl0wRPk3chL2DurQOIGIFWaPeW3h9tZBFaZF0rK0xKdAkepdV8G9tmvCQwstzzK3sz1bz/QJPkzDJhXZD7TaSDgtmT3/97PUW3KguIEO3hmwBKoVwbJj9J91pK9okMW2ieIz5PHXSye2Fwf0kAZAOBp0Ycx/GQ9eD4tKOzLR8iqLzBf/NiAxvZLupgOc/NH3skl4cg/V4U3Ndx6HBDSRuyf/5T6EROAp6u7GTAzlgp6G3RcmutlHmM/PsQgGoEbiqXwtyYucc0ucXY9wjIFyTBqkJbpXoyox/Li+c33P2Ul0Nw3SqZ4xO5OKhiFpQMcTy737NdsVi4EFNCovUxviVXEB25UB11LLhg+w/rjz2HCZj359lcaB2HPw== 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 aa3a5df15b8e..fe490ec9067e 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5399,6 +5399,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 */ /** @@ -5504,8 +5511,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 18 20:47: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: 13703032 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 60651C27C4F for ; Tue, 18 Jun 2024 20:49:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4F0C08D005B; Tue, 18 Jun 2024 16:48:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 313058D005F; Tue, 18 Jun 2024 16:48:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 138FD8D005E; Tue, 18 Jun 2024 16:48: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 DDC798D0059 for ; Tue, 18 Jun 2024 16:48:45 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9A58C140AE4 for ; Tue, 18 Jun 2024 20:48:45 +0000 (UTC) X-FDA: 82245198210.20.92C46E1 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf01.hostedemail.com (Postfix) with ESMTP id 61D2840018 for ; Tue, 18 Jun 2024 20:48:42 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=IIRl+aEG; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="l/rGJPax"; spf=pass (imf01.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718743718; a=rsa-sha256; cv=pass; b=Gtlu+KeKa6qoTLiCfbwvHUDOnDHy8ADCtlA0UPfzm2Cyj2EJQpfSWIK08N9MxfHyC2lyyg ItX5a/5G1eIdX/h70jmJ3sIHDemIrkN2FKdjxlRJxrSf9ufvWn8rw56Pfu38lqxAG5fuln 8nkdQzX/pO2g2QNKmj6JQRVVon5MHVw= ARC-Authentication-Results: i=2; imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=IIRl+aEG; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="l/rGJPax"; spf=pass (imf01.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=reject) 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=1718743718; 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=Mr7ZCZdBNUuLIytxDOxFub9NGBSHRTcM1seHAm11Q1w=; b=mysOLJH6KrDnHAmcVDwo6h4hMk9J0SKSwQ+d5S9TRHaoshRejd0kE50f4+qjdYhCN8oipg tYBNqkPdYQdtu9xAgGYP5RzLa2Sr6bwuGoubV+5TS9V+YeUirv4XL22kqvHapL2ZVjDSAx WyCeTxqwj5efUiLCbE2cHLo6W5tfiTU= Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45IIV0JD021561; Tue, 18 Jun 2024 20:48:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=Mr7ZCZdBNUuLIytxDOxFub9NGBSHRTcM1seHAm11Q1w=; b= IIRl+aEGRyolBpHTkebEz9fR8G26yaPruGdXMXA42lqJdGOcOL7ZAA5p9NDFy4QA n1GV9J6pAhVbb0ED2eQqJNQwGwU05JvrZagI0JuMiLICSn3TRY4b/PXhW9DCvIKq 3ljc0qu+e4qBKWAKb7MUnufjIFhBfTMX+ELbYTPFk7E4I6Bi2f+llmSAiirwTXy/ eWyoWo5MhZznYxMlRVI8+fmM5/e1M7aEVj2dvgZ7WLQF6GRNBdX1lAH39721D4CN 6evPLsUZC3d3zA5crGy4vPo9+Jzt+pxDbQ3VXQkhs8INL+qeTDtUTfuTgftCCqLe 2UBBxV/oRQS0AxQ+IRpfKw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ys1cc5u8k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:35 +0000 (GMT) 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 45IJeuRf034707; Tue, 18 Jun 2024 20:48:34 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2040.outbound.protection.outlook.com [104.47.73.40]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ys1d8p6p6-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mFaQs7Q8kQPRVV+O3q7DbXJulr29DuqcH/WSfYqJpcaafAmhGCgT3dWwcGPPP0jGfmWjC6i9VkBRc7lBl5L0qhPs4dBBvaca8LxJPIQrr6wmGqPZ4xauYnWxBnuRp1jfC88n51RiF0kiuaRSjPBdF2aXN4pEvKZtsQ+Zcoi1/i0NURDGQjEzuqLN3rVYv3cb1vr4feLVRRyBXYOBf4G5hQuSrS1w1Z11mIq+YU4NwfCbJ0LY8WMO+MTuKlBpEhbBzjg+6yWZau+w1aP8Wp8ca3XTHNoTA0VWp8wfd73K+CNl4W66tRV1TnBVPyJXvh6AEvOxmYG4TmYF5d5fczn2/w== 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=Mr7ZCZdBNUuLIytxDOxFub9NGBSHRTcM1seHAm11Q1w=; b=ereV4egk95cQzQ4BZaQJAhInEWyy9wt0q7RMvpRtT7oIbqWoEAuXDzfvw/w/sJ7rXRdMhrCffgHaMXsjJ5h/jdkqvXTLyb7eYpBaESYRbOY+4c+Yla570Ot71ZEiFoepBW29x25b7kyoaJotmPT+DKBSD/bFw1YOLI4Ty8M6V52Uc3X3eJjUTSEB9dARbt6OZ+LAWM0A1Kdux9275unEuKUhlO+ZI+/85A0Xp7+cg1+VMZ4pOdcVorQXYdFvFPRanu7Kr6mRbGIPk47TV+2nJtpqOPPfnWjrH/RiCh43TChxlfI3kO0d+Vl+bXvbJg+vNbJflUY3D0PGFRmEyCjqaA== 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=Mr7ZCZdBNUuLIytxDOxFub9NGBSHRTcM1seHAm11Q1w=; b=l/rGJPaxN1L4W6UCT53WboC8Chgy/rZI8UZPGPqe9Q+J5AEcHfLwCETE/pYMrZjQlWybQnbQfUn9nBID8wOKOF5eRa6chBlFKC8/lhQb6QRluMiC0Q8CGM0QJp0kt0W1fpdlYytWVS8ZxfEilbBdEg7/PSDOsI1rhjufLnTBB7M= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SJ0PR10MB5785.namprd10.prod.outlook.com (2603:10b6:a03:3d1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.31; Tue, 18 Jun 2024 20:48: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.7677.030; Tue, 18 Jun 2024 20:48:06 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v3 03/16] maple_tree: move up mas_wr_store_setup() and mas_wr_prealloc_setup() Date: Tue, 18 Jun 2024 13:47:37 -0700 Message-ID: <20240618204750.79512-4-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618204750.79512-1-sidhartha.kumar@oracle.com> References: <20240618204750.79512-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR08CA0055.namprd08.prod.outlook.com (2603:10b6:a03:117::32) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SJ0PR10MB5785:EE_ X-MS-Office365-Filtering-Correlation-Id: 8611efc6-64af-4cdc-954f-08dc8fd7f454 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|1800799021|366013|376011; X-Microsoft-Antispam-Message-Info: hrFV/yvpCJOJSYFS+Hhnk0Yv1gl/Y9ErTW0VrJIdT+kQ+e3zqRAZydZjsyR6/MHS4Y34aUVt3dxc/KjcQ1PyC1zJjIDPHIWH90u8eBCsTmvazsiPbYm3PCbIyPqG6X9yk/t6yLI/gOHwQJdfoEgXQExH5cyefSL9zOHdvdRdFxCRgYJHQJ93WkUXCFtgCOG5FglLix5Y3mL31vTXHkss0XCz+XRsaRGe5Vj5oxq+XCa+P2z4HfuQZc3/7t25MnqwzyHIb+PYI2Cc6CSm/mHZ8zRmkq4TUjt6MjFbdfRbSB3oOn1jnE/G6ol5cPGk8smF8sIN/F3cEA1R0+x2EDIXunM3mSKAT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MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230037)(1800799021)(366013)(376011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CVhrtDOz8iEiY7PixQJkerV4+e3VoqLsCipubbXQ7BGLxExwZmnJE452bXFIVH5AFj/w/w7iRqmbFnZ9rvco6egi0VZqYRE+OgYxiTpSkcXNRQHQX/4B90cBPCTKP0E9FjC4qcUJgHmKXiyUUY5AvyvMTuq7MEwXfR41BrR3uN/yqV/bzg/9yfi7bMMwsIOoizpQS2hSVSVQSk8vGEsUcuk1AWdT/fRMhNBRyd0gCasD4KyomsERRapDrAkaLef6i+Bf2HpcuQ/GltG3VDltRuZYnUW81ElhFl2nkOMEq8wuFUH0zsIryqrEFFV6aDXWamhmIztjy/VKXnurc67FfXnx+NXByrhWMHDmlu4DwjAxfn1jjdvHfV7eFPsTsfM1ZVXaqpdH/jv8tWEQR5R742Ho9og9Q+5xwX48hBvTBm7NZ4SfirSWqbWyiAzNehkLT+Z3LJu+rQN7VYNx4/03KLoY6eL9bGKZ7neDESTYsW5X6kNF8yhQsJHpvPoidA6VMqMTfjGQNInEpLGKweEgj2KipoyEwTDbkBeyelDWzdcvv0oX0YelTEZVOxW4WNG0J3VM1QS02glwAyKdZ02JY6U57bGqgHViaSbjkRtkLX03cY+v4XO9KyPcFcUat1FHL2S8qWDtVhgGJ/dy/Hc3BbBhegqV07uuJpKeLbdb+NCTX5V1rZCahBRMfAhVJuwgPMDf6Ef1SVvt812OClZMQhaAogR6ZfyGiGB3GIySrlfWImufIDQXRDvSxXRF22BwmnofzM6h4ZrCuUkO0CXhfxX22C1RrcGSrNoos6xPqjh0xh8DQPWAjzEHfacnLiD5nh42hfqNysG9hxj8jQ/4c+LBWQBL97YUhWyadz/0wShdHrCdlgr26MYeFHWiLZuKbGLBKEmhFdkNqNx3QAhc8sOGAXyjZq38snJY4xE4b0GxpMvXw30puX5+vro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nxQ9XfrrqEiUtpeInkfryJcOB7+qZGz8VSjITMcvI5ZzlkDrF+leRGU+7IVOIczaOBysQBlApLjTeXsGInvLQX4GJYyecTnQhG3DZ01+3ZVbON2ga1vK9eNLtwqFOUWLbwp7mG8CGvjwXILjMsYpcJe48vIBR9YsaWnpKSPIymMJRJIQsGTDkRBeZy/9S+5s/cYPJXySXbNHGMD30DOTXp3EIQnc5xrjWalouQbzK2VkTMJBKow6Ha0iBruiIod/GqW6SwdBR2+lT+ideBhQiYphSF0rd7dnXR4Al9kWilQL2lZBjwvg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8611efc6-64af-4cdc-954f-08dc8fd7f454 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 20:48:06.1121 (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: ehuVBZVWw5Jfz0sVddriFYgj3FqGe5DQ8GzG4rgNmdcn30T0bjiKRmUJ5Ab6SST51bIMQidNhuz+FFfNN8b4ZQ+ZRy5NtFT35qx0S+94RJM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5785 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-18_04,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 malwarescore=0 phishscore=0 spamscore=0 mlxscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406180153 X-Proofpoint-OR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dwsTaUJrs1fCyweEBZLAl0I2YMjNCultOMbCqV8v+D/naXPr/F9gDJ1LvQONaxDkjgcMs37RZHV74KzsVDqjw1xy9H8ytf8wxgt9z/9M5k7NUyEN7ozWWo nkUCyHJq 46agPfX/Ap/HeoYMf92sXi+ICYo9y8MOvghpGB1BE7CZlsSGxd00Nk8fTkp1IABBXzQDvQ+TLVSW2d2QOLJ7tPB6pB0+2B92v7LsAyuKanjcE3mx2m6FtJrTiloYjtuKOq9AvDxULKhDGps25FeW4IgK3x2/J/FAP4LT7bufqKvhkXattEwf+8xrzS+LVGNINfncaxsspVDt8FqIvla12yZVuPLgyUaRdAj23o3xesXNAot0EJYA78xiKTSrS0kjTg2DFart93iTX/0fahhNRnHXuYhzzM0NNsURk0gTL2gdsy2sCOMINqiMu/eJBfjiqKvVb4jXlO7AfFV0OjVTUBksE80zceeVvDC1jO6jRx2oyixlpR3wzzK9Kfn77BQIco/SagZP7T+IXFIJP30o63yE2Aa1RzJ2ieH/V+gcj07VU92zKhSLlXZbSUVrOZfr9j3wRMVwjfHSsMGdb77ADhC+Jkg== 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 fe490ec9067e..62b465f0d97d 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4227,6 +4227,54 @@ static inline void mas_wr_store_entry(struct ma_wr_state *wr_mas) mas_wr_modify(wr_mas); } +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 @@ -5358,54 +5406,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 18 20:47: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: 13703079 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 C65C9C27C4F for ; Tue, 18 Jun 2024 21:49:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0A38D8D006A; Tue, 18 Jun 2024 17:49:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EAB4C8D0066; Tue, 18 Jun 2024 17:48:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C38A48D006A; Tue, 18 Jun 2024 17:48:59 -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 8D4FE8D0066 for ; Tue, 18 Jun 2024 17:48:59 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3794FA1F59 for ; Tue, 18 Jun 2024 21:48:59 +0000 (UTC) X-FDA: 82245349998.15.9DCE25E Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf19.hostedemail.com (Postfix) with ESMTP id EB5841A0008 for ; Tue, 18 Jun 2024 21:48:55 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=F2sbfQE2; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=NkIiNNJB; spf=pass (imf19.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=reject) 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=1718747330; 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=aXmVafrvMKS4PjtIoLGPmCZF41DcIZM3Vethint/D/Q=; b=HXPl0jLbHE3WqxywtRyMPntw820k99WeLze59csKPgZKsjw5u1LrxSO4tbUVZeoHVpSuXU GbQnH7ZCmPv2tqRYEEa1hhBggsVmHQve/ZfTt7WN9F0ZqNrd7SqONlFWDbR6tO8gD6pHt7 WIGsGxQsO9tEu7BaC4HST69rRh05rzU= ARC-Authentication-Results: i=2; imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=F2sbfQE2; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=NkIiNNJB; spf=pass (imf19.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=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718747330; a=rsa-sha256; cv=pass; b=iJB5zTjMzWEDDgHp+x5UouSzKZAE2WCdjruYsuxZipxrt7DjjaozwAUvos7iV0Q2v1vLOR ogf4vhXbEjfkiNOzcOIMJDvngbUkfPgHR5wpeu01GoxU0I/CTecGcSXiSH87n2coFFEc3k O0imh9q82IdWiFT6aeSJ0nThTocaqdk= Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45IIUxvX029821; Tue, 18 Jun 2024 20:48:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=aXmVafrvMKS4PjtIoLGPmCZF41DcIZM3Vethint/D/Q=; b= F2sbfQE23/Djbel1sXOVF0pMOzc/UtfrP47/oZyw8RMWc7p2r4hSV5hwCDXh8pt3 Y24Ux5O+KEelLyuoZXbL9itv7kulkTrZNlVUO3W0VIr9RWrvnqk0daPhe9x6Nc0o x6WkIsyuDgR8XxQjovaloam0qCPj45eSrU+zAA0+nZfla42V97HG4za/hRLMh3+B HBo/a6pBzhuIakrsM9ZyR0RKMcwtFzDxphQxfGFVeYbEauylhySKdkXMzwktnJk1 2SpH9gGH5iDH7s5r2yA2hd6Tzdr+kkc/3elwa/d3JJsX+/Hny+W1zOFc3tED3zkh cggCynK9HwRYg6707VKI7g== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ys2js5tp8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:36 +0000 (GMT) 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 45IJeuRg034707; Tue, 18 Jun 2024 20:48:35 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2040.outbound.protection.outlook.com [104.47.73.40]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ys1d8p6p6-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZRUIkU2m8CBGAlC+hQcuAe1O3v4WB9gD9WJHkrfb63v6tuMEDcqvpBwWoBx037MywY2UID1qlQhRcR7Xpb2HeoDokHCuy7/FS2u6Z4xKH/5bQ5uWQWnn/r+9ZC3/16lHO5dNaW3juv3H6thpXRVOQYNCYwP2uF3s3DDX2ivDgvOqaccKNHmVDb+Gc/K5Hushlf2R57A2swxks7/wBDyjmo1YLG7V5oIn7LgCb0PvmCC8cQ9nvGIdhqR7F3FOFpjaZmtx7ZWKRwQlubU5ywIVZasDhn1wO23r/lTSV1e6of4yvQsA5i303HrTJ+WDuYVI0g6M2tFZHRMopq18qnC/Zw== 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=aXmVafrvMKS4PjtIoLGPmCZF41DcIZM3Vethint/D/Q=; b=E7dxgr6W3U+pmk8vD04w2Io+y+gxA6sV5vrD+8xiMuWxpOufM6RmV6eQizD0RboiWawOnwPGUGWh4tDgFsHFzwgz2JX3rCfwnRxO+rLudHO67sW/J+22xTDNyhIXBQ80eP/cXdtAy59V3oMBwWapRijVWWu7Vs/Bzw4K+YyFjxBY6hSwi75V022ZjesZuuPspUNJMn122e5LrS32vs5bN3PSkc8FKqPv1LD1DMCE0Qj2H59Ba28kvt4aDYyB45FC+a/cwxeaRAdSdioalyL4cRymqLHxLbQTIclQx2vspuVviuHqYJVm/9kmlLsBY8AXC+Sh/T4u8C2akPjsophVpg== 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=aXmVafrvMKS4PjtIoLGPmCZF41DcIZM3Vethint/D/Q=; b=NkIiNNJBq9pqbyt/oACdRG/B6bDXlPJjUavDsssroD+5K64uwwD398Py4hN/gSJpFEzpfRSujVVE6R9Ej2ltNpsUViBAqMBJILl73yEFSIB6cwjZtAA8HO723VKZLfe8yxj/5aX0ZqdjkIb4Hf5gHRF+6tiso9XH3px9idYrkPU= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SJ0PR10MB5785.namprd10.prod.outlook.com (2603:10b6:a03:3d1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.31; Tue, 18 Jun 2024 20:48:07 +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.7677.030; Tue, 18 Jun 2024 20:48:07 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v3 04/16] maple_tree: introduce mas_wr_store_type() Date: Tue, 18 Jun 2024 13:47:38 -0700 Message-ID: <20240618204750.79512-5-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618204750.79512-1-sidhartha.kumar@oracle.com> References: <20240618204750.79512-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR03CA0154.namprd03.prod.outlook.com (2603:10b6:a03:338::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_|SJ0PR10MB5785:EE_ X-MS-Office365-Filtering-Correlation-Id: b2d3583b-9d08-4097-33cc-08dc8fd7f556 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|1800799021|366013|376011; X-Microsoft-Antispam-Message-Info: cvJJKWxWcqk37KfFFIGef4CRs/cQJeRDqoEV86b8i07Uj773sYfa4JheMVXgh2LFGx7gAa8V4IqVQat7o6RpmKHnQuW5mzf6SNRqlRJhS3E+nJv7rw8P1NWb5f5ttHKKdoILkKM4tRl9LLR/6enuINz6gIMwO4phqVAf0yJm1KEqUS34cXPQrVjSNpNo50NM6FcmakQrx/Op6ZUEP/C6lQKh26pmrFB++i2+detOdTgNb7MSc1LWbtdOdsAKoDSXpcUiMTXEXNeMw+ImKnAq8g+vBRGG7h2T6YL1wQdmF6dLAVyKp7j9BBR6OgFvt7J/H4ImtfDWkdB23Q+5yFOtwnr2hps6TdovykKV/t7w7VZQn+3VQKZweKuxo5B11jhx5ZT5yqmcqLM6sZoAK+epRn3V+y7viUb2IWY1a1CH40wMWGaFkAVD3ehrMFLvta7cSeUbIZKtLOxTfdwA4AylkcJwYrjpulksH7pv/XQwYmzDiXsEIghqLjOTTaIEyDhDYSLA5u2ycsGHbaZEooqrjDaR6NzcEPZ3PeElOA5AXsnz9+7Av4ur9Ivzk+YntTbzZRrmRXks1VCvbelayf84WfJnlG+h20cUC79GnD4kf2SGH7imXhElU3/TLn85jz1oW63iFrppTmZzOgd6yCLi98foZ6EEWRpg4DjWONpFlsv55rkRqhSySBiopraNpMLjPKr2LxY8H3fcMwNHwihZA/8OOqPiiSqOt3km/hJW8AJ9XwdW50ZVh2iq1vgi948Jqw45pWZbFtwjQoGMlYAUKu2ZaD+44DVYLJdMOwOAgrbkX4Du4TBgwXFVqtSX8VxSP9XAG2ftREaSHMeTTf3VIw8e9USBUEVbaBR9VQ2jZtS+eXvRk14UaJTnAwN+o6bmQWfHq431D8AxGDUCY0zU6zyJgiY7do9mflWUkn4vsy/dzH/PI4Y51VS0bMQkKmAV3THbCXgSyKM5F28BFQxecTQFpZd4W/UWEdfZXIKBSvU7yDcu/A83vM1hc0Un+Ab2bC+9d3XkaChdtv2VkqcsAIqwFXglE6+jtdoHWQG/a9s9/yRNzfvxWmFErslwnqp/QfhaZA/26olMfY5xGorQFG2+RkfnGcgEd1o6vDu/mi/45NG3edjOQ7Hkluduln38Aqe5YwhrVR4ix7K5TSwRMbgBIIK+wt8yu/mYXiIjW8Ww4Uzw0jkpA6n8XRpnbw1zRWJZOlL7pABSEDZ+G3IXdUZQO+zE4KQLpfeXraz3+MEpV1EW9J+0mCYARzVnp0WN6tRUr+ro/4noCFMA/f2dIkvRYNVP9d3Vehhl3Wofi1hxjvxRgvHj75lPRe6DLRZh 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:(13230037)(1800799021)(366013)(376011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: En6L1ZgQHHFA1fPnQtLn6uDOIzpK/+kQmRcCO9kSeSS71O68/AzKMbupmCYLKU2hbJBnE8vbTsRu1WsivWHmdGM/9JotiqSiRgrlV42Smg0Vt/HsGTOJ0lbsXf8AXV5i2zDiGZ9NSuI8Nt3vQb6JvEz/5N2Cm2tlfFeqsAReWL/0L/SU/ddFkxiWHHCcg9YGrz31Tl65mAIwsVrPQ0dl/BM1lI8zhc/4ZSFDVKfZIPOaDwpMt55mncbNLTJpxBo+zFPNpECR9QtPWexjmOL6707RNAwrQqMQHt86G4iS6QvPZSLozVMdze/DtdBQjZp8I8kXuPFCYsbvFjCer5iIFNKXjAYS86vIGpM0RpTTm3rbfnbXWhFQv7wYpVtS3zeiK+rHQTfc0DXP+kX/Yz+8DxkM9AZf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vFRN/2fWctjB6WIz1NorQrJr/i9s4ozszJt70L91Inz0wjqGAb4jNe8T15oZ4iNhxAQN6XvY+OuMKLSCEbpMfwZVKr9fMDiWofUAnIcCKEQRBOHoMRENiZnks704iMNxUo+jZt6mwjleE= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: SiAQF3kLcY4CmdHHXwPRlmqVgs4Wu0aKEwEX3PEkQexK5TeNhwLfOQ4rS6Kk4RXY2e6JWKSrUaRqua04NhSqdUylc1hSQ0/TmzdKHEWVaTleGBpbPAOlf8BOvU8SjWhvS1eiymsJQ9SD5FzEoZkCgyex07hu5TBcYqg+o0pOT5l8Lbj1EaFvw8E7BpakcSEbsRRac6NYUcHsqohoP2bGW35w66u/TOmBlqiT6k8Bzmd2J9kpjINAqIwzVF7s1yMohwkUCXA4rYkk7ynojhtocr+z2vXhkuIefW3LLc74f2HUiaJZx456aPfEB54j4o+0u96nL0SWh2yjRyxqIXalEQpHcfLxuftzbQgh1yHeX+tB0NpemwTlSHvMwgKVm8SV6Iez+8gZ0VHrMJPFpMhf7HuUatu7u5mlctte4R62BV32p1vp9K491/lnRLL5G86J5SS0x/ujP/KVYrKvPUYIOdNbxLYr8ZMWexWZzVka4RZdSGx2GqsKZq4lHNvo1OUFIj0QH1jRmc6WX2gvCiBF5dOnSii2N0eea3vymWjks955QSeYyemG/NrNyqkNJDCW6yGsvsUod+8eszc/wIw8sJOfjkkEYDREzNghBmSspPE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b2d3583b-9d08-4097-33cc-08dc8fd7f556 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 20:48:07.8410 (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: 8lwbZLRZ9gyMaI6tC9Hf+PElH9eQXt6jc1/4qaBIPYTILyVtgOtEG5kccIuofCFguIaQPo7vgithLqzH6lO2ze/gSvlfpqNiwJyc1ccReog= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5785 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-18_04,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 malwarescore=0 phishscore=0 spamscore=0 mlxscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406180153 X-Proofpoint-ORIG-GUID: lSLopz7xQU6NG444sDHcpoAQNzAKjmka X-Proofpoint-GUID: lSLopz7xQU6NG444sDHcpoAQNzAKjmka X-Stat-Signature: jrmop4dq83pd836q4ipuu6nc1hrgbqt9 X-Rspam-User: X-Rspamd-Queue-Id: EB5841A0008 X-Rspamd-Server: rspam02 X-HE-Tag: 1718747335-707945 X-HE-Meta: U2FsdGVkX19MlJ15lFbtGL42d9u5/Mlv/U0WI9hytbJtaMVT9et9Y8RIcC3WvGd0LTFfMLd4MNVJ34zg3Y99VYoX5185FYhsYJPA7fNzdj1Gy3E+4KpNBc1LkH3tLqikHBmbsARPMTtg30nzQvCPgaG1bdqA0Se58Bsw7fy0mTnAAdzIFlKZDQpNdqRaz9ZccEi6UvrZph+8K2Kr2wiv8pRfAsVfqF2CW2qLVIHQRv/EZiDMVCpWQdBKiK26yTeFDmlmnRGdIDJ3H636kOGIBdy2Fd2ZL4zKkHXA3GZGGgqVzCAyG6zlWkzfvGEAhu2DD04f+1a9OTwclMms/HbSbOKFYNBEC28zAaoCZ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S3uq7qEwRWFdf3hMDkCInJtFEPNWAyjUzc4swPp87jvFyD7STWFZwdxgZl/O3NhA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Introduce mas_wr_store_type() which will set the correct store type based on a walk of the tree. mas_prealloc_calc() is also introduced to abstract the calculation used to determine the number of nodes needed for a store operation. In this change a call to mas_reset() is removed in the error case of mas_prealloc(). This is only needed in the MA_STATE_REBALANCE case of mas_destroy(). We can move the call to mas_reset() directly to mas_destroy(). Also, add a test case to validate the order that we check the store type in is correct. This test models a vma expanding and then shrinking which is part of the boot process. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 214 ++++++++++++++++++++++--------- tools/testing/radix-tree/maple.c | 36 ++++++ 2 files changed, 190 insertions(+), 60 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 62b465f0d97d..5187f0b19742 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4275,6 +4275,151 @@ static inline void mas_wr_prealloc_setup(struct ma_wr_state *wr_mas) wr_mas->content = mas_start(mas); } +/** + * mas_prealloc_calc() - Calculate number of nodes needed for a + * given store oepration + * @mas: The maple state + * @entry: The entry to store into the tree + * + * Return: Number of nodes required for preallocation. + */ +static inline int mas_prealloc_calc(struct ma_state *mas, void *entry) +{ + int ret = mas_mt_height(mas) * 3 + 1; + + switch (mas->store_type) { + case wr_invalid: + WARN_ON_ONCE(1); + break; + case wr_new_root: + ret = 1; + break; + case wr_store_root: + if (likely((mas->last != 0) || (mas->index != 0))) + ret = 1; + else if (((unsigned long) (entry) & 3) == 2) + ret = 1; + else + ret = 0; + break; + case wr_spanning_store: + ret = mas_mt_height(mas) * 3 + 1; + break; + case wr_split_store: + ret = mas_mt_height(mas) * 2 + 1; + break; + case wr_rebalance: + ret = mas_mt_height(mas) * 2 - 1; + break; + case wr_node_store: + case wr_bnode: + ret = mt_in_rcu(mas->tree) ? 1 : 0; + break; + case wr_append: + case wr_exact_fit: + case wr_slot_store: + ret = 0; + } + + return ret; +} + +/* + * mas_wr_store_type() - Set the store type for a given + * store operation. + * @wr_mas: The maple write state + */ +static inline void mas_wr_store_type(struct ma_wr_state *wr_mas) +{ + struct ma_state *mas = wr_mas->mas; + unsigned char new_end; + + if (unlikely(mas_is_none(mas) || mas_is_ptr(mas))) { + mas->store_type = wr_store_root; + return; + } + + if (unlikely(!mas_wr_walk(wr_mas))) { + mas->store_type = wr_spanning_store; + return; + } + + /* At this point, we are at the leaf node that needs to be altered. */ + mas_wr_end_piv(wr_mas); + if (!wr_mas->entry) + mas_wr_extend_null(wr_mas); + + new_end = mas_wr_new_end(wr_mas); + if ((wr_mas->r_min == mas->index) && (wr_mas->r_max == mas->last)) { + mas->store_type = wr_exact_fit; + return; + } + + if (unlikely(!mas->index && mas->last == ULONG_MAX)) { + mas->store_type = wr_new_root; + return; + } + + /* Potential spanning rebalance collapsing a node */ + if (new_end < mt_min_slots[wr_mas->type]) { + if (!mte_is_root(mas->node)) { + mas->store_type = wr_rebalance; + return; + } + mas->store_type = wr_node_store; + return; + } + + if (new_end >= mt_slots[wr_mas->type]) { + mas->store_type = wr_split_store; + return; + } + + if (!mt_in_rcu(mas->tree) && (mas->offset == mas->end)) { + mas->store_type = wr_append; + return; + } + + if ((new_end == mas->end) && (!mt_in_rcu(mas->tree) || + (wr_mas->offset_end - mas->offset == 1))) { + mas->store_type = wr_slot_store; + return; + } + + if (mte_is_root(mas->node) || !(new_end <= mt_min_slots[wr_mas->type]) || + (mas->mas_flags & MA_STATE_BULK)) { + mas->store_type = wr_node_store; + return; + } + + mas->store_type = wr_bnode; +} + +/** + * mas_wr_preallocate() - Preallocate enough nodes for a store operation + * @wr_mas: The maple write state + * @entry: The entry that will be stored + * @gfp: The GFP_FLAGS to use for allocations. + * + */ +static inline void mas_wr_preallocate(struct ma_wr_state *wr_mas, void *entry, gfp_t gfp) +{ + struct ma_state *mas = wr_mas->mas; + int request; + + mas_wr_prealloc_setup(wr_mas); + mas_wr_store_type(wr_mas); + request = mas_prealloc_calc(mas, entry); + if (!request) + return; + + mas_node_count_gfp(mas, request, gfp); + if (likely(!mas_is_err(mas))) + return; + + mas_set_alloc_req(mas, 0); +} + /** * mas_insert() - Internal call to insert a value * @mas: The maple state @@ -5503,69 +5648,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); @@ -5591,7 +5684,8 @@ void mas_destroy(struct ma_state *mas) */ if (mas->mas_flags & MA_STATE_REBALANCE) { unsigned char end; - + if (mas_is_err(mas)) + mas_reset(mas); mas_start(mas); mtree_range_walk(mas); end = mas->end + 1; diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index f1caf4bcf937..2c4e69591235 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -36223,6 +36223,38 @@ static noinline void __init check_mtree_dup(struct maple_tree *mt) extern void test_kmem_cache_bulk(void); + /* test to simulate expanding a vma from [0x7fffffffe000, 0x7ffffffff000) + * to [0x7ffde4ca1000, 0x7ffffffff000) and then shrinking the vma to + * [0x7ffde4ca1000, 0x7ffde4ca2000) + */ +static inline int check_vma_modification(struct maple_tree *mt) +{ + MA_STATE(mas, mt, 0, 0); + + mtree_lock(mt); + /* vma with old start and old end */ + __mas_set_range(&mas, 0x7fffffffe000, 0x7ffffffff000 - 1); + mas_preallocate(&mas, xa_mk_value(1), GFP_KERNEL); + mas_store_prealloc(&mas, xa_mk_value(1)); + + /* next write occurs partly in previous range [0, 0x7fffffffe000)*/ + mas_prev_range(&mas, 0); + /* expand vma to {0x7ffde4ca1000, 0x7ffffffff000) */ + __mas_set_range(&mas, 0x7ffde4ca1000, 0x7ffffffff000 - 1); + mas_preallocate(&mas, xa_mk_value(1), GFP_KERNEL); + mas_store_prealloc(&mas, xa_mk_value(1)); + + /* shrink vma to [0x7ffde4ca1000, 7ffde4ca2000) */ + __mas_set_range(&mas, 0x7ffde4ca2000, 0x7ffffffff000 - 1); + mas_preallocate(&mas, NULL, GFP_KERNEL); + mas_store_prealloc(&mas, NULL); + mt_dump(mt, mt_dump_hex); + + mas_destroy(&mas); + mtree_unlock(mt); + return 0; +} + void farmer_tests(void) { struct maple_node *node; @@ -36230,6 +36262,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 18 20:47: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: 13703025 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 EC3FAC27C4F for ; Tue, 18 Jun 2024 20:48:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2BFB98D0057; Tue, 18 Jun 2024 16:48:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 248D68D0053; Tue, 18 Jun 2024 16:48:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD0828D0058; Tue, 18 Jun 2024 16:48:43 -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 91F298D0053 for ; Tue, 18 Jun 2024 16:48:43 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 08F0280A97 for ; Tue, 18 Jun 2024 20:48:42 +0000 (UTC) X-FDA: 82245198126.16.69D4E67 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf12.hostedemail.com (Postfix) with ESMTP id B469B4000E for ; Tue, 18 Jun 2024 20:48:39 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="CJJa/eHQ"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=MEvmtRHW; spf=pass (imf12.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"); dmarc=pass (policy=reject) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718743715; 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=TnRBn16rZSvz7QjvRsI5wvDleitKq8HR28QzelIjebo=; b=0aujrODtaJW5uqsaMYyS0zAgXcyDSbCPBUfjsJ+59ZRibzlgTpmOA0gbsf5XBXIrzoNBu8 6R6f1HBXsXs2oj55qKXfS4UTrLDkocgA4A5OCoAUTZpypM7plQ3TriCLp1BxNOPZ5eUJLx znlkAGQWClQZvl3dprcNvwojTQCbbpk= ARC-Authentication-Results: i=2; imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="CJJa/eHQ"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=MEvmtRHW; spf=pass (imf12.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"); dmarc=pass (policy=reject) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718743715; a=rsa-sha256; cv=pass; b=ZS1FjodA3P0CtvETpaWG1GhZxldeSDF5FGju+ggyrRRcFsuLMHcAbeFv9qFSBju9mOHf+l EuMTlNjA1fCy8KJbfUwjnXb7XMjjcc3jw/9vOCvPL5N2L1mANJtRA7dPnGlS8P/glydE54 QIm80wvTePzareP1AkfiJyNsDNV2zP0= Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45IIUuo5029804; Tue, 18 Jun 2024 20:48:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=TnRBn16rZSvz7QjvRsI5wvDleitKq8HR28QzelIjebo=; b= CJJa/eHQwwQwku0JK0aSCHrggI36NAFmTw+tXINRpbGWai4ZnKgjMr1+dAgfzwGB mcbnkMoI2OuZtO7YKPH4IXL+n0pHk85JefLwx+zFTDkJoH69R4Y/B0D7oO7y3BDQ hdInQmkP4r+aII8qNVztXmyVsZB0ob3oQby52bxDnVTSAm9v2kviu3TdApijyxlq smbbPMgMxTPPjfUo6LrSx/V25s1CwB1hPwk/SFjiY2qvEH+NUspGU0JjsPkr0QMe z4Qnjydq735tdwzsf+zwO69zysCkmhplfS/ewnIUsUAc99Y1gMgF8aJEl+Si0OxW j66/RGyaKeaEKjEsDVRF0Q== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ys2js5tnm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:31 +0000 (GMT) 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 45IJlTIN034656; Tue, 18 Jun 2024 20:48:30 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ys1dey4ud-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DiU2J5YwcEmv0CUVsZ/fIrquNMYhpCQ8bDuaRmbdltZ6klnUlu3X+Jl+h/ftPwUpGkgpHaGciH0YTHVgYkPadG0qmA7Qg4fCZeFKkCqp4+wvYlGixfZr23ibrWZnI9mSIuDR4//lbZyMkmLpLnwKRjSkLLQiyD7tYr5Yc+xVTW8Qf+kpVvep+3axEqH0N5bUDt2DKdzoW5gtUgbIuIJrTHXjysawPvMGfsnuazOu4rhq5ef+HcvZqcnC6yImfALLH2ssctYSltF5h1N9rWxnErPCd+ykzBFVrjAV7rp4PhFdrCj/WZl9Q8SLmRE5Iu2eVJPB3PC/vhaMTbtQBAFWHQ== 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=TnRBn16rZSvz7QjvRsI5wvDleitKq8HR28QzelIjebo=; b=c85o++LlvWz/an8C9RFZZqIYPTPFQwJY1YYrUWRnyFOp7bJtk7lZuOYGpegztZ3/ViZSm/w39cxFF9kDKjgQW+0H5YTEa2xizdI5d4v5nlmhAH3fbOiNp9Syet6doMwEZTLu8BbcdV9LbxT1ROXAXccWSU4RTO14YKtadanWaPglwIYHtLArBiOMvijyvbA3bpMPkEube3cZ/DZkLnN6IxXSEKXvz1HYE27jmB+/Kfp4Vd2Mh1YXL8gxw+Pb0tbTryN1/toPupJGWDp0tDsrrc2/YZi6sBNhTqYe3x55mjmZ8lv6CUUWco1XtTyIeYBf+O4RaPw4gIq4kocrL4+WlA== 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=TnRBn16rZSvz7QjvRsI5wvDleitKq8HR28QzelIjebo=; b=MEvmtRHWxY9njVZdwVHK7sddU6jIGwm3IVMi1+eTG9JzFB65qWg/oWeW6EaRadxLVYIepxKm1Q8fWq+BERgkiHL2AbiTRwdcEHzOy9VSTQ5F9LT9m+TFs8rkwrEEHQ+NNshGAos61AUR0bMqR1EJw2dKU2+Bs5uKlRq9Rgqgi50= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CY8PR10MB6465.namprd10.prod.outlook.com (2603:10b6:930:63::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Tue, 18 Jun 2024 20:48: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.7677.030; Tue, 18 Jun 2024 20:48: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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v3 05/16] maple_tree: remove mas_destroy() from mas_nomem() Date: Tue, 18 Jun 2024 13:47:39 -0700 Message-ID: <20240618204750.79512-6-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618204750.79512-1-sidhartha.kumar@oracle.com> References: <20240618204750.79512-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR03CA0370.namprd03.prod.outlook.com (2603:10b6:a03:3a1::15) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|CY8PR10MB6465:EE_ X-MS-Office365-Filtering-Correlation-Id: c3bf3124-c4fb-4078-3b8f-08dc8fd7f662 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|366013|376011|1800799021; X-Microsoft-Antispam-Message-Info: 6BEowefu4qlpmm0tipmjL9ySGeduyPI5VkOvDkCso3z+pqxatnA3r6Mfms5vDSCftAdsaYXBJSj2kB7M6ltV2CV+nt0rbViQf9B1N74FYgKT1sd5YfaX+IXZc2W/OL5Yy+rpvC0kpk5pKbRdLVurEs40ONpwVRQpEpnJJK9Xf9XQRTcSBw18IVwIndd/PjJGm0Zvo2TzLEJEaVNPCwzYaNBgVY5lWGv9vPCaDr9hMq1NMcxEVBX88pkTlg32gMk/pIUi0Z702MSS1ibexz8OqjhjJ45nL872lW4ZmwD4AZHi0GRImSSDnpUncT4y22tCdV8kGSGBIvVyXRqAuEm3JXy2PIps9NYZ6bQxGvSntY+CGjf18l74STN2NevXiDynZHLA18hVuGi3oC2beeIYQmcrclV1VmPi4uawGaJEcAHKIijK047UQJWcoNyRT712zTUAY9CLLh1zkJjNQ1OF63LIG4Y0jKGaZwmcjGIDhDTO2PObDbCKFt1nPo0DheOQGi57LUA0zvqX/JTIPoea/HKQlIOXfWiEBZKa0xt9/YtaHTfeUYbR7qp3+dM2jonC2fCHPGCH+NAZtBiUcun8cJEEDvOh14utVtotbIay9NYS5E+izVDCVYtBcTr5LFrIaJvkxC2g0MA5qgUW+RXHkfSK+M3qac1jEdLyRRKitP2uqHVHB9K3LjOszlcUCRlNar7ttY6slKbYYTmVo0kaLtfo/UjkQoMG2rAZmy1uY207CxRUAGV0KQFRS9XwhFF8t6yjHqYS0kkMP/cR+ugfeJVRD7kI0aWnAlF0v7UoRLx+VqmbUnF0Pe75qSxD9ElJCmiH0QojiLgP8I1sWG9VW/pCvE1PkoTGUsfdjR/5ij9+pQnS6nE8SOU3hyeneiIX7qq+CsRGoeV2SlFjtIL3xI/w5FmN6jHQRp7pOPm5QdPNbYPFEiKtxStnIdIyVE+YmaaBFU53WJQRNs87TdSYy+nlEWewvc0L8tTpjqqQsaWpURZiNdGTEjiaTLJbAky17Ov3tazR4BM+C9xSXybdJcXLZIkmEp4PF6/t+NGq0QUwi+bq4n0xKzx6isIRfdyt8QQHZkCyztipnWKOg4ucK9VLSwQF0MTRkjD47O1nBSrbag9S/auoscXjhbdEQe7fa+WKrCxa7klmuV3/RW6UBy9OVhzRGARzuoLnjydjuCNO1CGiZq1ulMiOFI0xBCT5eJXCF6DB9Qny4iU6SkFeRgLU4AdEJeus7wXZUDYUG5u7rwtulsitGTbOf+ZRuL4FsxTSzUuMSX/3t4JyMttJBbGbBj/px3DMKHjfoWxYAI3zpJ6AIdrthbLx92iVQiLT 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:(13230037)(366013)(376011)(1800799021);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ONhv/mTECoxuIkkcKJGEc9k9Bl/7Tow07KeSNUrBM2gJiMnafbE5gShmey+3AF6nwhznKnvCawftgxLjbF6VQ+DKlgWtbA8tTmzdMMY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WCuqxRRQpT5f4eEpqKaGUkVqCo5YhE3Ncibddmo5ewK5AZufC2WLPWyDatLTt3P/2uUoBm9mHYTXE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c3bf3124-c4fb-4078-3b8f-08dc8fd7f662 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 20:48:09.5533 (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: Uk4QwZbOKv86JBfudNHhWo/sYN7bFT6A9OTZvPhvC3AIm7LIdpJD8WqRWdHf99g/xYgZGXrM8o4fuTCgCEOoGALAsrL5WsYXN+qwtrvEwgY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6465 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-18_04,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406180153 X-Proofpoint-ORIG-GUID: mQFZjeVucwtriD1_srfgYEISTO2A0VzB X-Proofpoint-GUID: mQFZjeVucwtriD1_srfgYEISTO2A0VzB X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: B469B4000E X-Stat-Signature: 994p9i1k58r8qcci3y9bjmu8j3em4fho X-Rspam-User: X-HE-Tag: 1718743719-773355 X-HE-Meta: U2FsdGVkX19QKOvUAFaUnnWY2CBjPlZ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QM0PoghsbC+pbHMyTl6L5+4lhL17Ni7VpDT2NFScQSmlqnXA0r0fLGSttRbFuqqOASt0lpZBlR/R5jnjFmVaUvmGOs+VHCx7R1bOvBbVSNNjEZypXY+azoth1RxQqxLx9U1bmVrlRWqijQfTpne7TPeTUcm6RUysUA+wz/4anlnHH/bMuht/Bhdxq/H6/y0Pphge/3ypqaJx6GYJI1qKLtiOQE2vYhJ1u7u4EOHqZs1HfMAJDJHoLM0bacJo+B0qMjQTCUofKbhpz+nplHxIsixeFhg5g38j5L2inrvhmSnHteTmZJ6DJZr71jXTZzE4IfMVWD1kawuhDVMMqFE3Hrkb X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Separate call to mas_destroy() from mas_nomem() so we can check for no memory errors without destroying the current maple state in mas_store_gfp(). We then add calls to mas_destroy() to callers of mas_nomem(). Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 39 +++++++++++++++++++++----------- tools/testing/radix-tree/maple.c | 10 ++++---- 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 5187f0b19742..648cd003b99a 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4524,6 +4524,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); @@ -5604,18 +5605,24 @@ EXPORT_SYMBOL_GPL(mas_store); int mas_store_gfp(struct ma_state *mas, void *entry, gfp_t gfp) { MA_WR_STATE(wr_mas, mas, entry); + int ret = 0; - mas_wr_store_setup(&wr_mas); - trace_ma_write(__func__, mas, 0, entry); retry: - mas_wr_store_entry(&wr_mas); + mas_wr_preallocate(&wr_mas, entry, gfp); + WARN_ON_ONCE(mas->store_type == wr_invalid); + if (unlikely(mas_nomem(mas, gfp))) goto retry; - if (unlikely(mas_is_err(mas))) - return xa_err(mas->node); + if (mas_is_err(mas)) { + ret = xa_err(mas->node); + goto out; + } - return 0; + mas_wr_store_entry(&wr_mas); +out: + mas_destroy(mas); + return ret; } EXPORT_SYMBOL_GPL(mas_store_gfp); @@ -6363,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); @@ -6377,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); @@ -6458,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))) @@ -6473,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); @@ -6512,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; @@ -6527,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); @@ -6584,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); @@ -6665,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 2c4e69591235..175bb3346181 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -119,7 +119,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) MT_BUG_ON(mt, mas.alloc->slot[0] == NULL); mas_push_node(&mas, mn); mas_reset(&mas); - mas_nomem(&mas, GFP_KERNEL); /* free */ + mas_destroy(&mas); mtree_unlock(mt); @@ -143,7 +143,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) mn->parent = ma_parent_ptr(mn); ma_free_rcu(mn); mas.status = ma_start; - mas_nomem(&mas, GFP_KERNEL); + mas_destroy(&mas); /* Allocate 3 nodes, will fail. */ mas_node_count(&mas, 3); /* Drop the lock and allocate 3 nodes. */ @@ -160,7 +160,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) MT_BUG_ON(mt, mas_allocated(&mas) != 3); /* Free. */ mas_reset(&mas); - mas_nomem(&mas, GFP_KERNEL); + mas_destroy(&mas); /* Set allocation request to 1. */ mas_set_alloc_req(&mas, 1); @@ -276,6 +276,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) } mas_reset(&mas); MT_BUG_ON(mt, mas_nomem(&mas, GFP_KERNEL)); + mas_destroy(&mas); } @@ -298,7 +299,7 @@ static noinline void __init check_new_node(struct maple_tree *mt) } MT_BUG_ON(mt, mas_allocated(&mas) != total); mas_reset(&mas); - mas_nomem(&mas, GFP_KERNEL); /* Free. */ + mas_destroy(&mas); /* Free. */ MT_BUG_ON(mt, mas_allocated(&mas) != 0); for (i = 1; i < 128; i++) { @@ -35846,6 +35847,7 @@ static noinline void __init check_nomem(struct maple_tree *mt) mas_store(&ms, &ms); /* insert 1 -> &ms */ mas_nomem(&ms, GFP_KERNEL); /* Node allocated in here. */ mtree_unlock(mt); + mas_destroy(&ms); mtree_destroy(mt); } From patchwork Tue Jun 18 20:47: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: 13703023 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 447ADC2BA15 for ; Tue, 18 Jun 2024 20:48:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9E8FD8D0054; Tue, 18 Jun 2024 16:48:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9507F8D0055; Tue, 18 Jun 2024 16:48:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6EAF68D0054; Tue, 18 Jun 2024 16:48:43 -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 4E8BE8D002C for ; Tue, 18 Jun 2024 16:48:43 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 07FEFA2237 for ; Tue, 18 Jun 2024 20:48:43 +0000 (UTC) X-FDA: 82245198126.09.840BF3D Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf09.hostedemail.com (Postfix) with ESMTP id B1BE5140020 for ; Tue, 18 Jun 2024 20:48:39 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=QIprdqC3; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=bCqKYgR6; spf=pass (imf09.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=reject) 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=1718743716; 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=zz6qNIKltTmXoHlX1g+R7AWUOp4OUnndefvednj8JZw=; b=uJXlODDYTkyO/CA+Vm5ST8gZ0DCfD+rYlqmEPolS3adX7Q99HWWkidHXELXYaBONkvAu7B bTevyx2BHpHKNhPLqkg15aw6WCF2lPfZWFvNa/IufgmUXzpOmGqGBOJIZ/FsC7nCBej0cN kAOPP6TgpWZWrO58L4CnLyfivlkuM3M= ARC-Authentication-Results: i=2; imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=QIprdqC3; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=bCqKYgR6; spf=pass (imf09.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=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718743716; a=rsa-sha256; cv=pass; b=FbpbvSdCnkRbuyLFBNv8zcDoPmYLOYlPqv3vEeAk60uR3RyGl5QVOBZ+D5UAVI12ED0x+S lpYmEmQlgn+utz4fH4VRG/ODlI9m21OVoxHgvCSWV3SH757VAbeUHGawgp+EJWrGllpwL+ DyYnRCgSTMrJKUwdi4zDLCXTEck4OWU= Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45IIUxvU029821; Tue, 18 Jun 2024 20:48:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=zz6qNIKltTmXoHlX1g+R7AWUOp4OUnndefvednj8JZw=; b= QIprdqC3ja7oPgvSHDnTQJqt4sN4HVZPf77noJMVjv16C0J6pvDCCsQ+imyTS/XU bXBw2Le8I6//bepOgTkoElCBa5s8bQkegvfbQG+O80OF6VOwS1Sx0pnCn4cTQMES jclzu4RQs/scPGgAgQrHBGiyS7bmt4PjP6rsWTti3zXSwsrgXSJhQ6t3bdKTaaGF jQdnKKMXelOXbBMB2VuSs59ChjDa+AbkY261T9WWieB7Foowz8CZlJg5Hcsv6Xma 9tqFwEP1poLahyeyCGYVhYZbX1Wm5pc0mHZiDxKScI39NGr0qT3AVPjrLZaucNv0 3pWBZQqpEKBBKIoW//Xt/g== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ys2js5tnn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:31 +0000 (GMT) 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 45IK8ThE015724; Tue, 18 Jun 2024 20:48:31 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ys1deqw7y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Cdy4NUtHl+KKtlGxY5jnf+E62xpkjwA3s6M9MW14FieOs9jugK4QrVqB3UM2HuIqCbTC5AICU9Keotp65kpXTdZwaYBtQvBIheAGLJJiqPeWGfLskDL4Z3wVlUwEdxRWHiMoQ/csE5HJJE0xch9N9be0R84o10Y/v1a6CHKQrJNUECha2QYCCg/GqEhC8hkLT7s4MQSPhkw32P+E71HI696yc9D6GMfTyNaS0aJ/tefp00oL4D0BqROFerGzXB58ErCxPYrPwFg/HP7WUmKsJTI5mHucbw40fa75imAY6LJZFKVVIDFYf9h8Xhob9FdCloazlVTTssde1tOvCfDR+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zz6qNIKltTmXoHlX1g+R7AWUOp4OUnndefvednj8JZw=; b=Q9Io7N7s1K3F4v6IgvimS9h5PjU1pvQ9FlAjydvYuNFj1sU21+RzcvvhIC/r+3+q22NRZ6dc3AaoyMlGz4+uQZu6kE7+CrEPU13+O+2WnWbjZGejG97REVUDJFNUhK4hcd+P9xiomTBbW2YE3tUQrypuHY+Iew2W74joQ3EynSXI5zfgVhoCvS46SqmbTvcQh8UaY70/3ybjin5xwfmM/yY/+ntEYf3scuWl5+kcdOFr+DggM8yU7EeajZC5TFK/JYIP6SwU37j0EYT6kxmZGjthlVP/mZLJNQYEyOxI+QdUJ5A4oJrpKC4q0WdekpF/lSMGHTqgqsmFsklPt6szPA== 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=zz6qNIKltTmXoHlX1g+R7AWUOp4OUnndefvednj8JZw=; b=bCqKYgR6fXEHRoS0NJ1WbVJTgNTj+qOoO/33bukAgcdT9m8N+2Qm4c9L4TSEhZqEl6G6Pzs7KQ70zDn5p20mtPh8HXrSkvuoefFN2giuQjYILIU0/IIUEJKI1UP8b/UNo4bViONJO+0BC4qS5qRQ5yCYKiFMrKSx4bFwc+Cv+2s= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CY8PR10MB6465.namprd10.prod.outlook.com (2603:10b6:930:63::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Tue, 18 Jun 2024 20:48: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.7677.030; Tue, 18 Jun 2024 20:48: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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v3 06/16] maple_tree: use mas_store_gfp() in mas_erase() Date: Tue, 18 Jun 2024 13:47:40 -0700 Message-ID: <20240618204750.79512-7-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618204750.79512-1-sidhartha.kumar@oracle.com> References: <20240618204750.79512-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR03CA0152.namprd03.prod.outlook.com (2603:10b6:a03:338::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_|CY8PR10MB6465:EE_ X-MS-Office365-Filtering-Correlation-Id: 8b636b10-6182-4595-490b-08dc8fd7f788 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|366013|376011|1800799021; X-Microsoft-Antispam-Message-Info: 1T9mGsxxKx0ljwTtLyNeniKZsg4pbbIkMSAu3ew+K1bColtmxtkLUr6eYsY+wqPf5kB1RcRkMjN8SgKqkedq4PyVBBHRTg+0qFiK5OWNDHGDYL936Xjy6Z0jfnF418CouJAncWq3+t/yMoUjefP9A/lOMwyeijkLFzsT3dpoTb1VEL+/sA9cUy8+LeBjGmnQ7dOk6ZWRwQGirDeur8/Nw7oyILt2Wwehslaw76qaYV3O3Wxef0qBftZ5NktwqJX9cHZzZr0WSMVUS0ldzYCQADcSZwya3RPhLUN5XHk1Yjf5jGSTxjQdI2RLzP3Fd3z7eMEKlAcW7teN7RKVHBvDphplF9Lu6RToQoajJuTDv6v6XTFU++FshgjvFPksExY7zdM4j/pPmtQntRQrlMI1wn8BU8Dt37XCvUHwA138cmT4U5A6iCqJvXnt2N2w1amPcAD2T/SiVJjgx/iPJha6J4oYZmyG9KEOdaWLKlzjxIqFe+k6YL32VzHxbMBke30NrPA2LA1ND5/K6CVCpMwMsjE+284PFXZlFxfc2qjloEfxZgY1TntymBoEzaOy0FqT3mUCqA7N4KB1yY868hxhnn5i6HKI+7i8VEaJK8XPZXHAoL2QdcOk+D3ndDdysSgKCXJplB3rg66jXbXIdfGwcGZ9cmINASqZKHOy+wKVf+zvW5vqMjl8/VJgaA7uSORnrdeuPYb5b8yvqa0BHCwF4kEvawKgVFzb6yF7r0cXkjIQesKJ60YfaE4K9XZARfL2rg5nxJKPW4ZIY+X8686ZA2TRTImcYJi+EcMR9EVVxmrcb+MCzvRCamYz7VmyVbqNfOeRG3gj2TmmrzhoqqlCwTcN/hCanfR+3GOjLN3pmDi6bPw1Pz38brQo0nXNWH/yRwdcpTN8L59hD3oKB+iXAeOvcIh12+dHdCgBXWa9vD+ptJysRSk5uvpXs5r/OyapOb+8RTNrAyiWDg/1i5W72/dyDfaIHEkfR99F4uwkXjLFfft8dbITm8DdfRQ5li7MqaNDGLJULUzfWrO5Cju1ZnRDlG/jmGiM05LLlp5he+pK+cDvFcAJwq2n+F15MWKXpLV9tYTxICXJqC/zxo0wNed9BP5Vk6dt0+nSMBW+Agfar4Hetv9hD1R8mMrMB9KneBo8FylTgFFCaV6RGMZpKzG1NurCc9/QjwU/wakzWaXwZu6u7KuKZiUaSAIYEAkpWCcj8FOgQTJoHN9t/agJd4mF6/bSMWKSFbYgcsh7O12zdNJ+i720QCnSQoBjxCjqW24PrjrYkmYxt9eJwr0Odr770rR+E5m6LQfyt9Fo/ZuA1hzuqfi8HghBVn09Bkci 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:(13230037)(366013)(376011)(1800799021);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: b/8AI9x6f8bFmdw7sfyR3D4StMx/NiwrgceDGhFmG5fcwLEtkg5VCq9q2dHWzKInXsEoq0yQXFhTMnRyrCV7qm8WogSWQZ8l6617TsQr2NKEU+vGiLEWGbJKE0MnhewPA8CPzAv3LNFLH2LHgLprpaA7ce0FQ3/LEov/FKLDNFDMHlaxGNLwSJcJSWaufTta7g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aHV1vjZVunu8trMNBS1Jzhy24AuJK7yU7Lfzf8Rqn4swOdDDJURZLIzwb3h/sBQRNQOEbv72qCh6zSjC1pU+pQD/J5wu1Dn4+OZC2wCNQlHpuM8gStbFINF7jBP3Ffmk7VFEhef0PvB1XGvOxF7Eyl67AlloaL9ZWHD81Z5OCiG37OdJMjfTT7ZxhlM9g5DJwcvSH5fgQXptfto0pIP3PGYSC7eb2cIROmfuIpbT6HUH2CshVnGjSE0QG2odndgQtTcZIqP1+Ze8BO9W4V7hujB2eyvsgEOlrDUrf2ZNKdR7ZroBAQI7fa563w5YHgn2Mu5KjiOWarV4DKBel3pexDhJ9c+T+dXZsLtzZtiJnMIeCaAo= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Yuv87YVzbQ9mVwC+QzN3b8S9rJqLpv+K4szIRNj8EFYfI3gd8Do6S4mUHk7HjF68OyOdfqO9DiHQ5yiUhZ+bUcYntzk1kImboXCPCIvpwszao3230TDJAsb/u3GEYKp21+7tPiBysGMnUJff0JJ/vu1pKc3q66RK54sUJAsyk7aut4u5U2Qkem0cSyp5uagy5Zyx+Rc41x615QyLs8C1DzrLxXwyC8yHNCF8g2JKNQnR/zGK1wrbXnsZu2KW5Abkk2OdVgYLB+rPzu7PJXK7lN6tWL8s4pNgb/UZLxzbXcEOnqKfShnzIklpwePkS28SeZJA7X5u8q7UPDORd2odAy/TOElq/g6uknmZKTveGxCwCUaY8irDjFCt58z705CwRPPNL3HOzQABHYgRRHTESS0vgerWs0lW+6y8biVrlMwlp4PkNW8yMf+Ez/VKCxDecRezPxocULY8kSUiFbz50H1VxzViPjUSq0M4qx3A/OVDhoJ27IB7ZaX9hjNktqHmLp4oa1prV2RNdd2PUNI6jLSeFjOSRli2gaeSjN0v4w7npLclagm+xTLgnN+DBsQFvpQEEPtHjCp19fBYIvhpNKaFtI8emjh4MPuwrIOehiY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8b636b10-6182-4595-490b-08dc8fd7f788 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 20:48:11.4772 (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: /FE2Fm7oq+9SLTvy3zke/lHiOwjR1E8DmUb80rtwFm8k9+1fy+W4F09QbOR/lrx82oPToezA/VdFev4erzHH8DccFfQyNACNRQeTczust5A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6465 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-18_04,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 spamscore=0 adultscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406180153 X-Proofpoint-ORIG-GUID: RSST5i-5mF5kriKklRVucoqOxjPGZMa4 X-Proofpoint-GUID: RSST5i-5mF5kriKklRVucoqOxjPGZMa4 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: B1BE5140020 X-Stat-Signature: ufwk79c9kqqdn3u73194p8s4uyr1z4tu X-HE-Tag: 1718743719-221155 X-HE-Meta: U2FsdGVkX1+4QL14DGfD167BAiBpBik7iSvKS5BeA79RdnjdC9b+ZE6JohZk9wDNux7nSD2xn+uplk2hOVHQSEnn6NG5OxE+nFVx5iiPu5NZZUNHSYumNxpL5cEAQkE178kEhYxQjdpKxDG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79m4zPeyPjjo8tslR1ITulgXgtraxrAx82AK7YQ/GDg2sWmSjAEbg5ATgR9+AA6qQbwPVb0j5rnjh7MLDeZKOZEE6Fb2t7z8kqSIAYtZhm5hlhHeL36X1lL+RlJ+GjIBLmnvMYv1HbJkLKgHI2+jVgJisWdKh4WYW+fHHhmSpaLHvGwYMUmHCSD1Z+voRQrR9vSbdUYFUjVVwVRKMp6oFcD3gc5vH+99SzR0+QvFtiMnQ== 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 648cd003b99a..892e864d4c9f 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 18 20:47: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: 13703027 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 2AF17C27C4F for ; Tue, 18 Jun 2024 20:49:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9B34D8D0058; Tue, 18 Jun 2024 16:48:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 84BB78D0055; Tue, 18 Jun 2024 16:48:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 110E08D0056; Tue, 18 Jun 2024 16:48:44 -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 D99EB8D0053 for ; Tue, 18 Jun 2024 16:48:43 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 883C5C0B5C for ; Tue, 18 Jun 2024 20:48:43 +0000 (UTC) X-FDA: 82245198126.24.2EF1076 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf18.hostedemail.com (Postfix) with ESMTP id DE8831C0008 for ; Tue, 18 Jun 2024 20:48:39 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=FG6k9Uwa; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=XbG9BM5B; spf=pass (imf18.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=reject) 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=1718743710; 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=el5ueonE5eHDyr6MvVbtDd9ySKkILxBK0XuP/xFLbgs=; b=t1moCS+26dCV9pGlD329NShOLbIqsSjmldDY3bUkccb1ifidhQ+kVcxeEgGM91VNOPmPtp J6N6Ikpx9EWeXCwnH/6IVsu9P1KMAFGV5gXU2oYuG6H4AAF7CVmzZMVgvtIL5GPXwBdlnv MyAhx2yiXiOmIQ4jb2Xovc/K1cdNafw= ARC-Authentication-Results: i=2; imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=FG6k9Uwa; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=XbG9BM5B; spf=pass (imf18.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=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718743710; a=rsa-sha256; cv=pass; b=XRohJR38dYGGTZtaGMfbhohnSfIYw4atXyZoXLVmic2kj6tMgDy9+jnsngd0M+xP2YJaD0 WGeLjyLzOr3pQnySgaxuiIUd9F8lmbXDS8wOG1A50LOEoUbs1w+uMpCi3zkSShwNjSuw8N QsuxGr6udNjSB+WggAqTgMGXShzVvAI= Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45IIUo8t005340; Tue, 18 Jun 2024 20:48:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=el5ueonE5eHDyr6MvVbtDd9ySKkILxBK0XuP/xFLbgs=; b= FG6k9Uwaf9kB7QlVt+n/jSuMSh5mG9AWKE3KCk2N+wNXzoElNCuLvn9TBaHEe/v3 JLkNMuT5hY31qPKnePxoGhsb1zgA24uZids+AHfVdqSrmpPS6W8x1zSg+C4TG/zR 4350a89XaYncLWT5pxjey6Fj5pDmtblD5OT8nK/qJPBlsVnzlI98JBwmJBeMoy8w fpBQe6Pu25KRcpSWbKrmvW7RyAOfP5t6MBVvNG0NHC2OJzCvEODOBRj9Hvzdsnjx 9z26XxEVckYP6xY/uflF9fH9FaQ33y4zZx0UzC/KOXp468a2W+xa79K9cnI7/t63 qj0GsRA6uG6BUYZRmsFq0g== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ys1j05xak-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:33 +0000 (GMT) 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 45IJlTIP034656; Tue, 18 Jun 2024 20:48:31 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ys1dey4ud-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TTJ8c347CSxsDONkfWIAoCRhVS5VzDMmbuszDzI4B32JDff3gYJQQUR8dzyHgt5wkT/vfeNFMdLJctCuzjO6VJp4HTlQW5TgPLaH72CInZRe440/plug/x2TP2BiTSKfqo6LxAYZaJiYQXH1ZLlraKSgm4x3OpqDxPeeMrzyCUpZNVCqhb4yLYSTCDXa5YL28YhWOpwx0c5AHvEb1aJTitto7Ln+RrMsGchuarnugYDkvccWw1QPd0k/jnerOBeVrmDzQpQ1/o4j/lnA7hNntIgR+V1Nd+w++wgyHrXyAfcSq1hYZDAQiKoJ2YylXlm2qe1RpotWZShUSpRNN89X0w== 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=el5ueonE5eHDyr6MvVbtDd9ySKkILxBK0XuP/xFLbgs=; b=hECkrkAujLcth/arq35Q2asOlQf3BXTNdJARRWvkbtsaW01vlQnuEhxn7u561nPyy/la9FN9BtaY25tMfT+udmF7QDc0lkKkkAXRU0vYzAGL1RhXz+EU+ZkklNnWEoqGM+fA/Am8iE/ou2lIQ4x4E1TZZ5ofpgZ0agwlvsVTH/IWFMHO0n69/V5MU4ZHMPHBgNIMoHhgrjPYHwaKUnLMOMA+J4NZY9aTHteO9kwF8Oy2OvsgVS10gAoiLUgH1jTiQEQrPSA0ZOzW71qT9AM1FSaXPGZJafXsl/geZAdxRJJtz+97dnO1B7NkCn6XYsVYy0HQjQJeIyCEgwSsATBmrQ== 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=el5ueonE5eHDyr6MvVbtDd9ySKkILxBK0XuP/xFLbgs=; b=XbG9BM5BoeUph/j98JcN44xVx7RhEZIXzPRPHl1NQzwhPtYVx4YtnMFVa1d2uqTu9mykqZtPYvlADR+UhXwvXz8fsqsSmOSyRdlJrGwPE2U6pZb/QJrGP6x2h0Zkk/9M2M0n2yXEYqFTkvJSclhH8+rSYOV2/jRM0vUkIgXCAYM= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CY8PR10MB6465.namprd10.prod.outlook.com (2603:10b6:930:63::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Tue, 18 Jun 2024 20:48:14 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7677.030; Tue, 18 Jun 2024 20:48: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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v3 07/16] maple_tree: use mas_store_gfp() in mtree_store_range() Date: Tue, 18 Jun 2024 13:47:41 -0700 Message-ID: <20240618204750.79512-8-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618204750.79512-1-sidhartha.kumar@oracle.com> References: <20240618204750.79512-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR05CA0132.namprd05.prod.outlook.com (2603:10b6:a03:33d::17) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|CY8PR10MB6465:EE_ X-MS-Office365-Filtering-Correlation-Id: 21b66b9c-744b-42b0-a391-08dc8fd7f8f3 X-MS-Exchange-SenderADCheck: 1 X-M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Jj/M/7tBqFPJERbT6hg4P/efUvwxYFlkPIAifOAGb3rsuWsGgVv3kY9b+O/yVzy+ArVVWfDSpnXrYEa+8AMbX2whZVhzz94Tbrc7FWMEyPJiKSFDmV0mi3LEYDV5aHvUxRlYwybgDIB7alnNepFs2/V/DNkNEIjk2PVnQuzDV96vljkFPNOitFk4WMIGx4JPGedrJWv7eve7Qh4G0kmxrB6FLyBU7jEtXfGAsqO2W3BhL/L2oNoKN84Ii0CAwfbMG0ET6pSKL4pU6sX+fdyvYrVUQjlk34fJAR5PAKNsl3LOH18xN2ssIJMmznY3TjNqpfz4mwzOiU71iziI0JvX3PGtpf7tn 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:(13230037)(366013)(376011)(1800799021);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Vn78TyD7l7VM6d2p2TYJPsLLv2STDYw3XNs/KggDeFLBJra1L2K4Y4fs2f2c+hF/bCNhXUyvU4brn8PgavEq0jRnof+BulhM9q1HTqZFbqg24kAgC3B9SOgeYPy+pW5J8ItnBqAMO4dyTmAeJXFoRk1SolNOBkDE3D3P6pf6esMLACOqWHmQ3tb+lxRbWAmNZbWK6X8NW9IGlC7vlNeABZ1KzoYhdqbfFJ6P4IUHLWC3vvMduQS7Xz9qTzwuhdZOi+hRZXlgNQ98rSALk85GDHGFoy56mSu7coZ/gELoJ51u54VSVrygtZvMlBR6nI3rkoS25PYz1xzmST/HKN8ihMwLjCI3baIus+AsW2UEpUMAqOytglk8/Icg8Y8pi2O4w7ZiCg/KULkBA+rz82XpDoY+VYRsGU5uuoiCwDgaEBw3YBZhXZDYAJJ6TNv5vUXmMfZecdc835UCmAhFemaNnM8kQ7HkUN02r2f9gK6EzuhLe2Zf3yxhfsKBWxpUe286C5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ETMdq1EUHvsnHZTi3NLPB6z727iKpXDEvqv1pXiNru3FXY4lKSeLFmnE= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: nLRystwl25DznRMfp1bsG1oR9JoILRXXTCeVsoN4poOxf/TT1bPoTk2izDV4Emh2W7xxMHpNdb4EStfEoCYQHf+zOJV/E79OuMHhEEw/iQyO7km1E7mnJ9zs8FVJrIWZfWeBUIPw/HVep4F3BYxs3B/3W+pVh6BtAj01n3iMYsHg3iBUmo+I1EY8bZQZmsyEfA4Ao0z4mQMaom5iWDeFI66dkieBgoBdcFPNLaOnrkK2RbnYLwsT8NLkgIswBoOMZBI1VGafFxN7czqVbsFSDFcFa+tnx34CGslS7xwh6SRlZw/yP91rFGMcIjcD989r+vPPYbaGMK5Kit3MBSNzjKtjKbBESWCHIL89DbmIbwwbB5l8Ni7Aj5c5AkV6fLysFnkZIA6s9EGQzyvaAYtSaSN+qMn9MGWe2GwadUgAagd5UkRcM4LiCLYxhG2vFQxdcaDBXRIw4hJ5HPAbkOMnXN6hv6JTaK5zIvOFP3THh2Cy0aCMYAXqrc75uMWU69mEzon7/U1YueX2Hsm+q3mN0ou879pnAEJLD0XrGYpMRAeKNNup/07xaYrcXf1S1TCnJoZwzHRAd/q/zatGKq6FCXuJgDf9ix1huBRreYDpfSw= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 21b66b9c-744b-42b0-a391-08dc8fd7f8f3 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 20:48:13.8648 (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: d6OUUu+P2lbqrgyJ3+FN9HorGK4daOPD1Q/eG4SfdGn+c/ImG7P6jf7htI8LGnH95YnMfhM2yPgnHmNgXLHG/giJd44nZqkRJ4mWj2nzvjk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6465 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-18_04,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406180153 X-Proofpoint-GUID: A_wM7bQ-vCXsnCjLCHn3GjLEpQx3arRe X-Proofpoint-ORIG-GUID: A_wM7bQ-vCXsnCjLCHn3GjLEpQx3arRe X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: DE8831C0008 X-Stat-Signature: 665upobwbm7rc9ztygwkjft36bnnz3ha X-Rspam-User: X-HE-Tag: 1718743719-94683 X-HE-Meta: U2FsdGVkX1+PT6Hu0Qg9BFmev1Nvy700ws05AcC8Fz13mZa4wY42zpMov6owdYb9P92Ya3VPDOjoXVAm3/Z3P0bW2zsnMISyYXDNRVzqZg3ULlsW9bAJJZvgde1mgLTJJZTUVIjyrVSv74QXvpmeYJXNB14BuQ0V6Ovco81xWLYdMnglZ4k9fcEfbwqmOIsFKwot9TScNLSBoui8vHQtDI1S3iCLs7B3Xdxie9zmcgcWkMztpsIezmadw7bNfRCIJwsKmSBT2tIISBjJShOchYsRDUOScv6mZFaYsa2gxKgrMXeexSBwVPTZiviWsgjRL2sUwStSBrUz9bcjvzbvGpc6sjpEjMr75LMhh/aiRix1Hg9iUnOqj1AmDeOd0fR/8QfxBJ064uR15o7Pau4dbnq9x23F0h690e7wsP8YzNDXzmcTVYSN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ter, 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 892e864d4c9f..ffff36e8b140 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -6456,7 +6456,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); @@ -6467,17 +6466,10 @@ int mtree_store_range(struct maple_tree *mt, unsigned long index, return -EINVAL; mtree_lock(mt); -retry: - mas_wr_store_entry(&wr_mas); - if (mas_nomem(&mas, gfp)) - goto retry; - + ret = mas_store_gfp(&mas, entry, gfp); + MT_BUG_ON(mas.tree, mas.store_type == wr_invalid); mtree_unlock(mt); - if (mas_is_err(&mas)) - ret = xa_err(mas.node); - - mas_destroy(&mas); return ret; } EXPORT_SYMBOL(mtree_store_range); From patchwork Tue Jun 18 20:47: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: 13703022 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 7B285C2BA1A for ; Tue, 18 Jun 2024 20:48:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E82428D0052; Tue, 18 Jun 2024 16:48:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E2E9E8D002C; Tue, 18 Jun 2024 16:48:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BE4EA8D0052; Tue, 18 Jun 2024 16:48:42 -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 9F6708D002C for ; Tue, 18 Jun 2024 16:48:42 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 28135C0B58 for ; Tue, 18 Jun 2024 20:48:42 +0000 (UTC) X-FDA: 82245198084.19.1F9D4F0 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf18.hostedemail.com (Postfix) with ESMTP id E75D01C0010 for ; Tue, 18 Jun 2024 20:48:37 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=Bnm8q0X0; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=S0mM+uHb; spf=pass (imf18.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"); dmarc=pass (policy=reject) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718743713; 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=iie5vgvEzYdWwZ4muw/pY8/hfxW9ERQYh1d9Fr7j7Lw=; b=ywQkJVNRsncvGBdKH7wNihs6JF+ce00TeFTksk2YX0VbK/thRJ4DcnJJxOod1ypojVFaQM zKDv352iaw2Znd2tCaEUhN/e1ns0th7HQ5NYq/aVs5AHO2vMXne8dUozM0JHRaRKYP0UvW E0ePlNI4dJhuUL7yxee0KdtybIgJ6YA= ARC-Authentication-Results: i=2; imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=Bnm8q0X0; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=S0mM+uHb; spf=pass (imf18.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"); dmarc=pass (policy=reject) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718743713; a=rsa-sha256; cv=pass; b=JLuERpmo0Aj0FlRQPm8j1vxQa50lNEtesGsMVjCfv5nmgphOYvFludGcmGMEqENaqSfxd3 vHGNl0tGBt/qNRdSJ5n2XeUZpnOvB5dtFW3NHtTW38IWHiehA7fj6H1PzM0z3oO4+ds+kv hn6G1KEb/qKQR2DbgxpGpGzT97JpjNY= Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45IIUt5A027379; Tue, 18 Jun 2024 20:48:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=iie5vgvEzYdWwZ4muw/pY8/hfxW9ERQYh1d9Fr7j7Lw=; b= Bnm8q0X0eONPqIDL7Ga4yyFJR3iN1X+0AHDZVZryw6Xuo7KOFGyzR4r8GeZ3BT5g VUd/LCjfiPLPLuH4dBiIJ3wbXje6TpsVeIws3ZzOSdQRTIdl/8mJHPRBUEyxHIbK ok6TwgrpOskChAGMe24h0kxfnBwEgjpTSwf1cu2gS5G/GZVESEQQXtG1oHA1IEJt Pr9rMiFGOyouka4t98fFY+YmMjAdc/sdXyIZyUgr6AajBuuoLbXpT7paO/8bV8p0 RWy+kuEJwPX0eunLVo3XD3aNsfkQm1i3NKfKOVxGmTZJd3Y8mDar4QuDXbQ5ivOo xisnm3t26PWi0UZ4jcFKdg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ys30bnvmx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:33 +0000 (GMT) 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 45IK8ThN015724; Tue, 18 Jun 2024 20:48:32 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ys1deqw7y-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bTmogLNOD/ABtih+AIYe5yJeroXdWRLxMjINW55oprsjsBWuVmz3LriLL7y2nB2264xFNVWEuKRMbRpTfQvVFy1JG7OoDe4FNbB7VSLVivl6ykSmlcrUqHFvmXUzkN6s0I4Q7+FlTg80fIUG6WuemgYq1KiavMhonO5lE5gTMcT2Yvaek05ZAgLOqhzqXGYIF+BxoJbozjNFbZgMuQpsRXeOIH/bDvjYvcrp2eOUvUcPw+Gnh3XOJFII2VGXTv+euJ67sKHYtfNQguB5etAe4kHorNOyyffKohWDPWeMZEziGE2JjsunWs1czTSsxQtQiIOa9yBRBdgLtuEVAIqhWw== 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=iie5vgvEzYdWwZ4muw/pY8/hfxW9ERQYh1d9Fr7j7Lw=; b=XKvFb5rEMR6wM+4AT7mpI1hewvSojT4WHVBkdfhSGvjlFj8xmV24WwBAXNn5rL9bNWIzzie0eLujGTJCZ81A+d5lLnhTKnx07t9WSedFZnln36/NfVzrMek7Hsag9E6n/fLAU+jg6EG2CMq2SIu/ifXrHfm4548S05MvPbQGXOAixs2GszZ+Ruow9/E7V92QB2LTMllzuJWvYjLtY2fS2zH4RrkZp9cppmoJfnWtUA+EksY7Sla0x2k2nRY93g/+7WvqsAfx+PN5mqCn++IutalPaJDiENEcHSTSWrfc1It4NBuRXykaVaZTzm6eZORJxbNwcay3UeVrCo1qT0HQwg== 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=iie5vgvEzYdWwZ4muw/pY8/hfxW9ERQYh1d9Fr7j7Lw=; b=S0mM+uHb6tL1HvPSWHApkNcF6OE33vVKcIC5gO5no16g/EmMN5nyIr9jZN1N5fzta5uGMkisRnEamVViAyOU/AmrbnjAhqzYFQKx6zHapKB2IO8U16BnrhHGHfYsk/GKj5QheUAW67IcUxkb/OXcUWMeh/OEPQ1ME2PqKHF9hmM= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CY8PR10MB6465.namprd10.prod.outlook.com (2603:10b6:930:63::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Tue, 18 Jun 2024 20:48: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.7677.030; Tue, 18 Jun 2024 20:48: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, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v3 08/16] maple_tree: print store type in mas_dump() Date: Tue, 18 Jun 2024 13:47:42 -0700 Message-ID: <20240618204750.79512-9-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618204750.79512-1-sidhartha.kumar@oracle.com> References: <20240618204750.79512-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR05CA0097.namprd05.prod.outlook.com (2603:10b6:a03:334::12) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|CY8PR10MB6465:EE_ X-MS-Office365-Filtering-Correlation-Id: cdcc4a82-056b-4e30-0b51-08dc8fd7fa1d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|366013|376011|1800799021; X-Microsoft-Antispam-Message-Info: 08yZg3pefp0GVkFy6u1NEZ/oQuS8AY9kWOSMQiG6WZmvAAzNSayzgaCvlmqBRY8HM4A3LX0VzrTCYmMTFT8HW7M0rVfoV8pk4HRZbYT/BXeDsNme3qHkK+IqzJXsEMTJmBRdR1cU03R5Hc3qVRjCcCi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qehMHUyJ5JQC1mlhbik1Hq2V7VfxDb7ItDBX3A2Nvex32vU3NX9wOH13bukKCmA4p3EbvlemE8H6ClbnfKKN4JCyW7piv7EP7m5H2lx3S32e8fxI3MsE= 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:(13230037)(366013)(376011)(1800799021);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aR/6INO93TB8v9JfTQm4OkN+H2e0XKS8CE10Z3ZDLagyZbkfBf2I6otrXhq1vOp+c0zWas/z/JEcoys3mKqkoWOg3m0LpNaD7fzPAUmkzJFw8nzBkDoKl1HICx6DnewKUJcFgQpTshjCtnlIkodn8l7RJTeGUpK8l9aSig6BCeHKJFOdLj0V6Nvl4MD6h+WHQHkPmI9PNu82VMsBl/ZXLNR8WyNJzBrISyDocIgRoyGPpb1Fe9TzvMOD7toGsdEF5beHZrdwXhroGYB2xkZLj+ow1e/5qtywFA+P56sqjRWxvB9AHociMdqL51zx5xeq4zgZh8ApQNkO0R/7awbDxfz2bcq3r+vHQiJwFbSS8MIRde+czoPhzCtfrh/9FXbK3vPtUI/VuHk5FpQw4iNVCWyCKxUjOsokDyDM5PaevqWtFQTFWalIVRju6j/U89QquRnP8CWSlc7o2tWWLqv1enBgtBZYMbOZkSp6QJQ70/8UDIUNCW6mqHkiWfoshAeRwJBmo0cWsgKJqpFHfsntfkn0scog0072alQAcAR8yTkw9TFKNWz3udhdiFK01zDzMHvrgSm88635ct9zfOR+EZEqvX1sVB8pqV61Y6dr1yZMYpS/suZ5jT6E5DhFGyk3MbZdlR9j0Hyi/zl350643BPMj/pgFolt10RovXyFXqQTpgAD2QAWKQwGHyXSuaqigJTFrzW2iDacsTYE2UcDBnNMxgD4mpqysL85wAlqzbdrZcHQez76tE9FQT0d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5nwNiKWboNglCnGb6NMsd6s5eIg+1OwSgcbbtI51mL6BhtVZY2xcNBWO8KVV3OTuceYn7BAGxhR6Z4HdoUzVT2vrQfOjZHOWhzbqP6RVFW7W/4u0VvgUofAc204ek8awXasVwrDznysbBhCuDFfvdm+W3IjTbTeiJeyglAAQLP5ZgS0LyluaLmqhkweZyAJySeRGVWN2Gal0nVAYTjj1KsIxtGUf2DVDbUQg5cIbxhSHvA6WmtyoyVPVxamVSvlcTFPy7CDj1RN8mF2m2x6bl05p08JGO9QF7sxCvCoVrybzgq+vbKfZohnPLpaHlZZfEubF1LVitBrXF8hijAY/U94IgAzXwVUNhMeJtG7fYQYYSf4gpqqONnU+A67/Vkh/fQB/5hZsfIsvd6hkVsyciuwhIiSwobB7dQzNfovI8U+avX3o6+PBWpHUMdw7Js79dzPuOa9qpcZFu792BOIomPC+xh/WENBuniBVOEXw= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdcc4a82-056b-4e30-0b51-08dc8fd7fa1d X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 20:48:15.8316 (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: GwYFlWF2nlYAq+fTSr0vF4DmJEMKspt3yP/j/XZ/pdHriM4B22Xewbbmj7Ef/ZMXVjcCFs533OjKqKxvJLeBlorvdUq+YIXIZFkYz+9H4oQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6465 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-18_04,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 spamscore=0 adultscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406180153 X-Proofpoint-GUID: M0XDY0VtsjQX9fq_AnzrqbCkbY5RAa47 X-Proofpoint-ORIG-GUID: M0XDY0VtsjQX9fq_AnzrqbCkbY5RAa47 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: E75D01C0010 X-Stat-Signature: n18zcdhpouw6hfozf3n45e8ug34wegir X-Rspam-User: X-HE-Tag: 1718743717-232328 X-HE-Meta: U2FsdGVkX19w1I40Mykgy2Gl9SGtGIMyk3PsRo9wBPOlgNEAObvpUQ1qpdBRQp603sF9ZT9yb/tfEDCUIlZcR+0kc5+WU5zv7X8jSV1koBKqaOk5t7I/RRHbgAVRmCv5DLJmKga3LfHnYSYt4DJ97y+v/pXUnkcX56j4eHdlPe6PdG2YvIsBd6cH+fowlxOHvRPuRpmJeXPwJJVAN0G5q8DvpOM9r79h2+6vpve57G4cVyfltyXLWgNIj12qNDYjX9jFm+kewbrtgRfIl+X+61UsealWTshffS0tE+6smU3UeK+ZWfppHHh2HEYNXnE5J7uetreL2x2pZBAdkQDrsULQApIPwQuSn6Lc2GzEY/UARSC8V6/+IkpA8Xi8fCYy3xVQnO3mW7vmPv6j2eu0/d/SSoWhyBvwdsT3KE/Z9vUpSHZeQf2S1bIFb13UJLFYullnRFNvjvyboeit6OUR5lHiKsLBZ+ms8mtaV/VXBHqqho4gEbqj/cqQl7a4P0p9/ljJ55nfW9A8gbcTu0cRrKkSFA/IeEYqd1TXA+DA2o1UZCKNoNiM6VUjgUlzf/E/593y7/CKksn3F5L9KDHyybt3N2XO1Rv331NPm142IRj3Er/8vMNosxhMwN0rmzmSYVSIkXiKnD7eDakX92kZh2b54LkidBeBvQA300vhE3zixIowjMi39QzcmiI1NaVOvM1QDCblpsa71Pqm0yqGaOUqzRxcJ6uaOUk5kQXi0sks0sbWaAccY+q+BjxpFJ6tlvf1JOlj/bF5NdFl8toBnwIsaPPpiJ1+5ab/sbsDfszyPM57Tg1FlcV4ci16nrXAcO4BrvOTrEqYUOPOboIE/5fDtTd6UwkJHJ6G8lboE2X8k4wNV8mKD5g603fA1VtKQTzSHC9WLadjIy3KRynfb6kx8abGvukYWoB3aXsz2nm8yUJ2vc52Jr92gyXDn/iLWoV+VhiAbF7PPXG6jvH NtxnwiHb r2x7ftl8Iur4CXUWC3kopH1y0Nw5NFQg4YyKMybGDedSUH2SkF6xQlHnkdokZtrK+uWI7tCJMu+O5DxjIV5qHpwu13VqTFhalC2vi2tLTYtTSC1R8XRu8AIqFRz7RzPChXEHG8PpmvUxpclMC+GeKt6Ui2k5pO4yAjF4rIU6lWqEeUD5Wo9E1feRfFp2TffxWFithIGbuI5rjXGs4FgEmRFkllMts2Lu3cbm6qvHVzunB+A4dylMYjrpi2PMkcIhceHj2lwNhbzcpIUmUAoaUKlFW1QO4BdUi79t1+8Hmpw0gtxezg4KdRZwLTMhOTNVJLxOV6Guu2EHO9ZLnlJ0IP5sJb5vMBf2ZJZFshtpKMPh16JMu6skSax9JhXfPSo2QhujFsdoiq52v/N5zH/ERuRdse2MfuQvkMbCYEyuq9lh+LeVRybe7gwHn6qWWym6bSin+i8ijk34D4lsx1fC9CPDWPA== 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 | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index ffff36e8b140..f40732229c9a 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -7728,6 +7728,43 @@ 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 18 20:47: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: 13703026 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 205A8C27C4F for ; Tue, 18 Jun 2024 20:48:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 645E78D0053; Tue, 18 Jun 2024 16:48:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 551508D0058; Tue, 18 Jun 2024 16:48:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 009578D0055; Tue, 18 Jun 2024 16:48:43 -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 AEE0A8D0056 for ; Tue, 18 Jun 2024 16:48:43 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 366851A0B4D for ; Tue, 18 Jun 2024 20:48:43 +0000 (UTC) X-FDA: 82245198126.24.02C3C71 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf14.hostedemail.com (Postfix) with ESMTP id E2243100023 for ; Tue, 18 Jun 2024 20:48:39 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="mJM+sdI/"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=cdNp+xx0; spf=pass (imf14.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=reject) 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=1718743714; 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=eSYIOHTKRzu7IUz6tv4eIyVN7yGr4LGzTFAAcrhpaf4=; b=Yma0EkkumRtHe0mLwbINFI3dxhJ3K/fb1BTxcMdoikx1CDUprLs4KJmamYwsiSpQNTxcjl oksGkG2V3aryOrWpY9Ob8H2mUW/jEQGSKWbCD0G5O6ht3OXTtN0NsOqBV49SKThX93V/tz L52p7nKaGKzBs8SAE2KyKt2W5r+Hkrs= ARC-Authentication-Results: i=2; imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="mJM+sdI/"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=cdNp+xx0; spf=pass (imf14.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718743714; a=rsa-sha256; cv=pass; b=VLQMdM16gfYHpkgF2WJJzDubg1o3++D8vszwp6jVNvIMLSQ68gAcUXFBRSiEFU0aqlRHLO hoRBrfgjUlP6+RHNRnyi7/LhjnpVkDcEk0pVoWNc4nVFd6BysQtF61UN5DEce4PJWLjY+r 0DbS3TrkrcSQbHTHMINfxsUhGOOWGsM= Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45IIUqvm005347; Tue, 18 Jun 2024 20:48:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=eSYIOHTKRzu7IUz6tv4eIyVN7yGr4LGzTFAAcrhpaf4=; b= mJM+sdI/QHeNqSbSSlhOcxN+FtwLkK2OAvhh1h9mIQa1GJKTLYQePY8uS7+fZE+9 gq/BtA3R+TdaUO59teZxWJkP4+d9YvIGDrM2SoGqQQwELJOiYR+zVcYdWV0jAdpt eiFE0GrirNphAR1dNUWt69fRPckb1Yxq5G7vEp1B9Je6uFLJ97GZjMtLz7ZZYiNw gcuFc+JCwQuwPRk9RT/Pj8nBlvgkgCrKbkkoij71JziX6Pu6wSeyJvLhhGQR6LvY VKuZ9AQODAgcQFXEYuIIhe+PeLcv/ppbdL78wkuL+QqsIMEFZtW+gkTBUTlmaNrl gSJBxh86DRz+P0YI2d5H8w== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ys1j05xam-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:33 +0000 (GMT) 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 45IJlTIQ034656; Tue, 18 Jun 2024 20:48:32 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ys1dey4ud-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SOir+CvolmvIj/F9c3zLO9xckFuE0N5eSibwZz5ZOwqy+h44u7w1lf7hBVwIoa46xzhQdpcTu5Y/3LVwLcXxG7dvAb5R0JHsSwrge0uNwhokK7JVABq5X3ujhCVB9K2fRYhYJyRUarTRepDtgaLPiNXVv2r0mVgf6zefpm5LVSm23gKI3HkBZqkZXNbxGF8vOLZnjNVupTIWXEa/dwNfUaUpYDTXUMz7Ze3sqRsc2lYqTh1/E/QYFH7jcS4YqwSC/trLUfZ/1S5l/UTCIbr3V5OizfEM3YBf5ywcI5gtzlsH7/XqH3OoGEGCWZBFLDdaIjtlIdPHozZB+wawNXrT6A== 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=eSYIOHTKRzu7IUz6tv4eIyVN7yGr4LGzTFAAcrhpaf4=; b=lDc+BjBTK21ORjJEZOMGj+VWW191+flXT9SIU518zD6q6oYLc2f+Gf2Cuh663FEQ7vKbLusNzd9jLpRZF6L/R7GCVEbgqkK1xgdbmfzvzMOnQR7GDoPxR4BusVGtbJ5pDOAoEnjZDFgkEk2ZuLcaqsdHk+Pgukdy7wa/eFjrM8vd1wWW+yJwSXW8vq5o8xQE31Yni3lqOL5OQsRABzGKMc56k6eTdKw/DoFIJ9QJTtGDRt6U8ROvZ7LeXzYWlm62fFDGstkGJ/S4OTOnW7gHHxKHpAE4VaUWDyS5uhVQjylKCAn1i+J1r+1I36/DwMJRlUwZhbUuXMxIH50DdTLC/A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eSYIOHTKRzu7IUz6tv4eIyVN7yGr4LGzTFAAcrhpaf4=; b=cdNp+xx0KUwO/8P8vP0ZnNVcn7P6Gc9Thlrwlq8yip4Bkh8brhGcRB9OPaX82VXxHe5Y61Cnq35uohoyP/64QglZqw/1LJpx66NnYJVTFZC59ZyhQEGqefmEjxNDkit/Jeh0ovu7IPRv9c/hYDrmbU5i7618m+Ga4bNTIwuwUhw= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CY8PR10MB6465.namprd10.prod.outlook.com (2603:10b6:930:63::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Tue, 18 Jun 2024 20:48:18 +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.7677.030; Tue, 18 Jun 2024 20:48:18 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v3 09/16] maple_tree: use store type in mas_wr_store_entry() Date: Tue, 18 Jun 2024 13:47:43 -0700 Message-ID: <20240618204750.79512-10-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618204750.79512-1-sidhartha.kumar@oracle.com> References: <20240618204750.79512-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR21CA0029.namprd21.prod.outlook.com (2603:10b6:a03:114::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_|CY8PR10MB6465:EE_ X-MS-Office365-Filtering-Correlation-Id: f674a0f9-2001-488f-6739-08dc8fd7fb98 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|366013|376011|1800799021; X-Microsoft-Antispam-Message-Info: 2zl6mvJ21ioLsaISeb/eOkTBYM9pyAQ+0GPn0SFl11lhssbl17AvCg/BY+LrPQgBIiKz6wHmacP9AarLnzpIrULkxaPF2eFVQ/UkQ5yCuQkJvFq1NGwhGiCF+s9jmHh3UViAtffzA92b9OcehANFNrXzQ1eHfQ3KPUGbDdlxcN8UW0yV6ePhYgIa80cnDPgBBNZk3zh+1MpsaoeJIwKnjUNq0fs6yIgtqNfYpmquOkE7y4SEAqPMEL0Glbe4pm1hFne94fJnzsjiiEx18LLGIgADIb22JMPc/VZx1vf/Zm9sMiNGIMebj77Rce8gbt4OdAmT1Tpx/iyQ12nuftEflUtdiB/d5Kw6aPo2HSeRvqNudNomYln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h9W5cmZLrLxzfchYez0usaqgfbYElkRuZSGEPbjAfNWsZzE3pBGlf8iRypcxDv5FLkSZeORuGC/i2rMxDkFrvYcEDXcuHOtduXPn+xVNyLAVdiZOkfMcJypXF0kcUqFPl75Z3rJZpTzBJWkBaCXtDHraHDNkND1bhhAP4zBqdvoAv+bC8yWlsj2pJ9RvVnsM51q74BO7YYYztsJ3bgq8ez8fXHLiO4GgODHsuScDe5rhiR20c+RD3YEGMLkXwwlWGG3D25cbgmq9ukZYy0Fz/+ICovtZ1qsbSieb6P4M1zqXUldoSMIyBR2LjUek= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f674a0f9-2001-488f-6739-08dc8fd7fb98 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 20:48:18.2859 (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: CArCkYCB8THhFQuY9MzIqKcFq+FDI4ZyRW31mlB1QiKVW9MbCeQJoa0ScUBw0t9dLzRq+NEIITuoMrgoqO4q84YTpxlvIFaLuMHh2R4lK3I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6465 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-18_04,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406180153 X-Proofpoint-GUID: DvFan6nl07_jfjjaEFKhP8QRb8ieQPi1 X-Proofpoint-ORIG-GUID: DvFan6nl07_jfjjaEFKhP8QRb8ieQPi1 X-Stat-Signature: 8bafir51kqaz1qr5kc7wydrxgxrq8ghn X-Rspam-User: X-Rspamd-Queue-Id: E2243100023 X-Rspamd-Server: rspam02 X-HE-Tag: 1718743719-882082 X-HE-Meta: U2FsdGVkX1+3Js20zVU92ei2nwBs25EfrS6PL0BAsCmISNLroqdfLVIOJgH8bAl6QXjnmE/BMRdb576adI0DZfslD17ix2t51BjBNWjxz7B0S1glSnSz7UnDzZnmGAOUasm9ilov1n8oH45e4qUWzuD5Rzm1WBddasSjtY9aGwr2xe1t2SoLRypKzh/P/Mgl/4MRRUHLbh+2Vn5zCGfk+IHQIrFVzJpFZaRVl5O427ZFfpS7XvFMngpTdCi1LfJj45/7ZIE7OYYrSp4OKth0pDv8CUUtpMz7Sw+dtTxYdcdLbn3BGs2v0K1T7JpDxEtIiq4H45gJdIBrEKkZ8ZO9SwW6PkHqqx1MpWUHY4FITHrOzFY3+p3s0gKqa+x2FD2M6ZKfP2R7zdJagFMgUwwilh6uUXzOeeOVpueL1j1CkKRkFW7mPmiI4by0UYvDXj4ATSibQi3a2S4MaqaBIHGO0OsYmHbOPr/xCSSIxRX4kVBE7CLE6jmzeQh4T2TDB5HETam0GW0JdruOkxOHv7tWh7LOS8XneZSfjr9qYD2EK8Gbhlde+eP+s4d4+U0n01zLsybMjRb8aKXLKI1LPkD3v26AowYdU5+0POujQtvM7m5qxVM/uNQ3cAgpXnIyJjbwU1FTTi4tLByuYNjf6E+N56mXXjX/er4Q2jkWObeEI3q3GYrdFSVhpornraYiZNReV3NLixqSpuDTchM72FgFHE/Fc1EdddT/+vqxO5g1qIDyngJyK8i4W0ElrOVSbMZAwDVS7ZT49NB0Jx0FutRMTMyYknMOzKAUqVXiPz74gOviAHCa/0r+ZfiZ1rFvsMb94R2FvJtU+rYkMvEZB9otIem5IA27WhNs0hAU0cdc9HbmLkPHlqrJOLdz+zzPy3QctOJrkudEyj1p4m7XSDllRQYE3UecbgFp9e5MrOZliKUCrLfuCkPjqyCy2gcM3mbCsPRw3/dJQSDa1gMKjKa T7Oyaaq8 LVRJRIwSNcqBpukPuOD/KwuecpaA6hsERQyxIbzLeiqcTgPdymFP36c2f5r3WbgXRfWYKhZMHqF/u20mNYCE4yEjz699o1S6BGBC3C08hzw1q6ZgyjpDVsqTMskdbC6TcB7QdWjoAD6zkrEImZoAt3eQ206o3+2ztfzlCwlRXNdfw9YGTQaSrRMX5ltXYanHnn6HMOrg+OEdXtBSL6JSph/GkE3IPNPzDVkJue2DTXXUpu/s2aXlNw8jt1/1sl5sly1SAUUnDEMXC5HbuBorfwTQGYTHnuRy6qrRM22yfjOgq1AogSg3HeLpuGJSgXahUnH76gqiWnc49bEmow1YGymodvHWqagFKdHhCd92lmeo8WhaCKihhv+UTJc7tYz50olaomSJXyfpFqiSFdN9mAby9np7vlqOuUJ4V3LujQqncvADOYXOckZabAGls/enkW1ALu5r6/VnIpMPOusnrBkbgNg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: When storing an entry, we can read the store type that was set from a previous partial walk of the tree. Now that the type of store is known, select the correct write helper function to use to complete the store. Also noinline mas_wr_spanning_store() to limit stack frame usage in mas_wr_store_entry() as it allocates a maple_big_node on the stack. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 54 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index f40732229c9a..8ae87e512961 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3780,7 +3780,7 @@ static inline int mas_new_root(struct ma_state *mas, void *entry) * * Return: 0 on error, positive on success. */ -static inline int mas_wr_spanning_store(struct ma_wr_state *wr_mas) +static noinline int mas_wr_spanning_store(struct ma_wr_state *wr_mas) { struct maple_subtree_state mast; struct maple_big_node b_node; @@ -4206,25 +4206,43 @@ 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)) { - mas_store_root(mas, wr_mas->entry); + switch (mas->store_type) { + case wr_invalid: + MT_BUG_ON(mas->tree, 1); return; - } - - if (unlikely(!mas_wr_walk(wr_mas))) { + case wr_new_root: + mas_new_root(mas, wr_mas->entry); + break; + case wr_store_root: + mas_store_root(mas, wr_mas->entry); + 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; + break; + case wr_split_store: + case wr_rebalance: + case wr_bnode: + mas_wr_bnode(wr_mas); + break; } - /* 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); - else - mas_wr_modify(wr_mas); + return; } static void mas_wr_store_setup(struct ma_wr_state *wr_mas) @@ -5587,7 +5605,8 @@ void *mas_store(struct ma_state *mas, void *entry) * want to examine what happens if a single store operation was to * overwrite multiple entries within a self-balancing B-Tree. */ - mas_wr_store_setup(&wr_mas); + mas_wr_prealloc_setup(&wr_mas); + mas_wr_store_type(&wr_mas); mas_wr_store_entry(&wr_mas); return wr_mas.content; } @@ -5636,7 +5655,8 @@ void mas_store_prealloc(struct ma_state *mas, void *entry) { MA_WR_STATE(wr_mas, mas, entry); - mas_wr_store_setup(&wr_mas); + mas_wr_prealloc_setup(&wr_mas); + mas_wr_store_type(&wr_mas); trace_ma_write(__func__, mas, 0, entry); mas_wr_store_entry(&wr_mas); MAS_WR_BUG_ON(&wr_mas, mas_is_err(mas)); From patchwork Tue Jun 18 20:47: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: 13703029 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 8C30CC2BA15 for ; Tue, 18 Jun 2024 20:49:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 441B68D0056; Tue, 18 Jun 2024 16:48:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 30C148D005E; Tue, 18 Jun 2024 16:48:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E32268D005A; Tue, 18 Jun 2024 16:48:44 -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 8F99A8D0056 for ; Tue, 18 Jun 2024 16:48:44 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 4A425C0B63 for ; Tue, 18 Jun 2024 20:48:44 +0000 (UTC) X-FDA: 82245198168.24.6B5729A Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf19.hostedemail.com (Postfix) with ESMTP id 046E31A0010 for ; Tue, 18 Jun 2024 20:48:40 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=JIGpGgOT; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=rBFtIlqC; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf19.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=reject) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718743714; 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=XP1A/eOgqZMUlcJAiPY9f3/4Q3XZGbvXKJ9jT8yEgaw=; b=SsuCyXMYkxBEOERF76ob58B4bUxjnCKNEQJD6jxA0QUAqrzuT2hf7TAD3c6U+kilqbeIts WbBQv6ADEtyLxjBA27UdqrpSMENqUkSr7qgRSsz7lnNqQpYX+5bERR8Y9SPPENrvWJkaOq G+IdjVrrDM4Mko8haQWoMUJBnPYoVUc= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718743714; a=rsa-sha256; cv=pass; b=lJUZGcVT8BdflEcI6nrKKNkP6Jop7tvNfc4MkU2IdoXWVpnfkDjEmAcA71A15Zz7RRCHAG y+1Z7Pyl5iyaGrw3SwJMfWerv/V7DZW05mq63Xy/kRLDgMLfCtvr1TKbWYn/az0KJ5aMRZ AP63ouG2QHJiozPTloTyjzbiLvVkcpM= ARC-Authentication-Results: i=2; imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=JIGpGgOT; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=rBFtIlqC; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf19.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=reject) header.from=oracle.com Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45IIUskA029791; Tue, 18 Jun 2024 20:48:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=XP1A/eOgqZMUlcJAiPY9f3/4Q3XZGbvXKJ9jT8yEgaw=; b= JIGpGgOToHk5TqsBKqvuA39BrY812xcbxW0mUOglbpz4Mt+brlJ0JcaiYMGKHfEE Mk+iShgr61A9E3ozq3azP5opMorm9icrwjTNS9Qgp2+tuSMNRlq1smChEMd+MqvL 0dBz4iLxq1/27hxjfdAIK8qoSf6lU1d7Sncczz4y+Jhnn7793aGfa4+jgyi8L+nc ZcmwASlFdKgKyQ8rVMQ93YQefAPWw4KNhJPn5HYQ4Go09RY0F1ZCY6Phs5ySSMM0 I3Wgt8czMO/udVoOpqKBi1mt/UAzqJrJ8GBStXmH1tH6YpsR/KnuNMjfDfeoPXlX FUT+Sa41texVdNhPs3OZ0A== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ys2js5tnr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:33 +0000 (GMT) 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 45IJlTIR034656; Tue, 18 Jun 2024 20:48:32 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ys1dey4ud-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NH7X9j0E3CqffwXX+OTU30Bvv/M0DM2SH/aGy1RJjGzrQmZeA3X28k088KIiMe6oc0DbP5NcCvjsF2MCUYsdSmKeVUYZ+eIwIJan/mChMp3zMOeaRfBZeLxuvy0Z1zEqB/LSC4hIPlW+iH2ek4xtmT1SpC+S4iJdlOcYUJJqsY9meLHMOGgnupsGK7eXjsn7kiF61j2CqZqoE2BhrL44vg3CIJ0eEnG1RVdpqgG5ptzZLM0ywFOo9XbhvDaV8p+P6/2qupkhCXFVTrLjitUQUnlrYD1Giv86iNs3lxLpF7l4immxhH5QCDYYdboJxhUsNJF7R3bl/yt3rgTrGp1CnA== 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=XP1A/eOgqZMUlcJAiPY9f3/4Q3XZGbvXKJ9jT8yEgaw=; b=QLTLcdOOIEnAxgyMR+ulGCudhNUG4jF3YIKHcFTdcoOvo7SAXLf9PwKRUb6ah3gMhuWTEqdne9qLUn2KEtBlHPXagEmZnXs0ITX9ZawDDNORUKAsYcM1QNXAfW3XrfHsWj5JdwyPcptmjVCRgNk7rPhdKwW+oDYrLSpmlJ0Stq7WE9tGDsuFTvjU+LS+y5EwohCGG6GPTcIpwX0PsplYKAjjxgHBsAguYvvxLsQAqL+LEwG9uX4drEX2JOldNI9ei3NVPYlGeMMk3oY7PzyAEjzjYzI6dxdY0bkSHmCBrzMRMp5R6sQ4ML5qtCV9dIoTIxEGLdN9uoYknSaOy7I6Ig== 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=XP1A/eOgqZMUlcJAiPY9f3/4Q3XZGbvXKJ9jT8yEgaw=; b=rBFtIlqC84DmUz++KjIlHY8YKJQ41LuHYmTlkPdweeddFtXtS6iKGlWJvlfCQAzFsckJ7DhlHT0NNobktCBxwpxRnEv9uSB+zUtRKgFT7eIiAVLKcNPL4KYZ5Ih70LUstdy4eXr0WrpxURKy+eQCVVjlR+AhllY2KtxeVGeVsdE= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CY8PR10MB6465.namprd10.prod.outlook.com (2603:10b6:930:63::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Tue, 18 Jun 2024 20:48:20 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7677.030; Tue, 18 Jun 2024 20:48:20 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v3 10/16] maple_tree: convert mas_insert() to preallocate nodes Date: Tue, 18 Jun 2024 13:47:44 -0700 Message-ID: <20240618204750.79512-11-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618204750.79512-1-sidhartha.kumar@oracle.com> References: <20240618204750.79512-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: MN2PR18CA0008.namprd18.prod.outlook.com (2603:10b6:208:23c::13) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|CY8PR10MB6465:EE_ X-MS-Office365-Filtering-Correlation-Id: 75c68de6-2d5b-4b5c-746b-08dc8fd7fd06 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|366013|376011|1800799021; X-Microsoft-Antispam-Message-Info: wqhTsmTk18wjRiulcUEBAqsAPppw3E8eP1U5P+M0qIcKzvaHHdi3mqYgi4aLU4STxl3CTKfNK3D/I7c/bhX35fpZQ6wlQJkoAOOQc55lVAx20u6UQKabeBS4TPJUxCVuQu2w4Ki7IWVDr/z0B3CwUsqZOskY/kBMcR7ARkbSlGQf8iThCJKAs0q0je1dcsZ8z0e7CoPPvn5DergQegQCZv2ahE+j2pVM5YwMPdM0kC8BFriiCn9m9pXH4gSaQ5qlyno6Ivw8b2kIWV6kcAr06uzj8/K1eAF5O0oiPcGM/s21GhkoqUpxanSWb2LUG85WeL7jD/dgVgly2FvconcUkIK69E+XtYW3tPt9bxHWkCVom3VQvD896D14kygBdaqVlm+v/ZVIoiQz0G+2DmvnypF2XrJueXpD/xujUkcbCuczAyqZNtZPXOZO5Wd6Lr9rvSFaTueWgq1cj3hix2ZE1+2Z3Q4bJrB2bTfAy6XG3sCX0hltsmdr3PBeM8h9zf1AfwB+AyBfe6Y6tsPViAWruWzDi0FVZmYKJ9dfpmbvl5tzKNmOoDmwwCGjauspzZfSaAwd9VvG5OxWSrHCoAy8VHCV57aCG6Vnwu/jjYGjXOlz1M6Dm9LpqSnFNkrixnQ17J11OZ29N6/bVDxfis/5HK9I5SY0E/wnoIXEFqzOxKe19jlQa+hYmfBaqcj022DS23TFCZFALJnduBf7pykNqgorWab7IvxksK3XRUch/VdfvvRbQqJtEiV1ozIJS0RJLL2frsN2WVaeerXFT57pqvP3ExEDNRFEaIMmGx8HPGPMhhpAuNSuGQV9nYqhks0h/ACtoLyVtRP+/RGzro7+j8kl/xPZc1ay8SpwRd85r1dqG6RwLuNLleA3nEP+6eOVpQHOVpIIw7YYJLY09yjRArKjlJGLF4TxK0+YWxt3LevVFtdIr79M5Ut9FFM2goWNR59gpFdfE/PPXK+8G6McgEGRSMhzWjKdmuFdCDQVXAcfbajsIodq/Mi/ap26g+ipvuJsxFxclL9F1IUIA1xT9BKcrjsbkwkTok4dA+9u3x/t1XtFejC3/lmqEWag3AK/0A96cH6HG9rmXEaC43EKdhL+rI3QQjMfV6vntipd6ykxx6tRx+MG2C2jSlk6nTi+6VeXybMq9tkIy9vSCFzkp1kB8E6dKiB0GyxfQaAnrYuICLgFzyjnP9y606nTY0L1WGsP5MiFF27lOmE6npB2vkRDdtb3XWemUrXKRconGoZoPouoR1A3CKkSnMo6Ie00zoAjnlLICg48hQcbQsgyLTaDatn2pxDH3tyBPUTe+48laOAGCzKI8JN+64WP+anr 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:(13230037)(366013)(376011)(1800799021);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gdFM4k3f4CR9MZvxoloUjsq/6ie+PjdIWyUB2vpF+wD9zSh7z1RtznP19ZcaxmXyBvHlfbLsIyLIn6O5qFVCccHGDZGZiexEoxZ9IPFLUluY0CDOqWMHQOmliBKnZkbeA1aQAhDzkgYEkdPxK+BWOYeDxvEZ+VPyd0jcYf+4vsUbntfBXtGrX1mPp4hIXEWHf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E= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 75c68de6-2d5b-4b5c-746b-08dc8fd7fd06 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 20:48:20.7041 (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: sqvfdGBMpDr2gbQY+xp6kac7IxrwkVKSdpPTCPp7eGyeN2tnt4f6qfsUG23mBrwx5WaSYXCo/Djc4iD/wZ1ApVzHwUNhsBx+myNV0VlcR7o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6465 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-18_04,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406180153 X-Proofpoint-ORIG-GUID: ZwZ1nuokKgIBl60Brqr4t0OFppMXuFhm X-Proofpoint-GUID: ZwZ1nuokKgIBl60Brqr4t0OFppMXuFhm X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 046E31A0010 X-Stat-Signature: 7t61af3x8j1y896ytri719ukxnomquxb X-HE-Tag: 1718743720-385927 X-HE-Meta: U2FsdGVkX1806hXaerqc69brmsmE+pbGRquZOILSwnap/DkUORAOxxfrJTuAtcGMKkrvZvYHLjBjXofdV/HnU9/Ho4VOj+uuws95tgP9L0D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g6NYkVLFZOhpGImOjCpuYtzUHDkJD46z13Jv5eS4u5ggWyy12L9/5t+lqU3wzB65jTM67yBbtjrWM3sqgPgglzMiD0UbPuxZeuw9d6bW4AAsEBr4dr1yqGnXEZZCCvn6zS079cC29yBjGteRcv5BhIHUuFxofBaueqT+qiPNgyccbQqQUEVVGPpb1ouhd8BSDNvchm5Ht/3Mo+psj0rHwMIv814+5ridV6QG+t8D+pfXggiDzmeENV3HxYlYoAAw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: By setting the store type in mas_insert(), we no longer need to use mas_wr_modify() to determine the correct store function to use. Instead, set the store type and call mas_wr_store_entry(). Also, pass in the requested gfp flags to mas_insert() so they can be passed to the call to mas_wr_preallocate(). Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 8ae87e512961..e53f1f398ece 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4442,11 +4442,12 @@ static inline void mas_wr_preallocate(struct ma_wr_state *wr_mas, void *entry, g * mas_insert() - Internal call to insert a value * @mas: The maple state * @entry: The entry to store + * @gfp: The GFP_FLAGS to use for allocations * * Return: %NULL or the contents that already exists at the requested index * otherwise. The maple state needs to be checked for error conditions. */ -static inline void *mas_insert(struct ma_state *mas, void *entry) +static inline void *mas_insert(struct ma_state *mas, void *entry, gfp_t gfp) { MA_WR_STATE(wr_mas, mas, entry); @@ -4468,26 +4469,24 @@ static inline void *mas_insert(struct ma_state *mas, void *entry) if (wr_mas.content) goto exists; - if (mas_is_none(mas) || mas_is_ptr(mas)) { - mas_store_root(mas, entry); + mas_wr_preallocate(&wr_mas, entry, gfp); + if (mas_is_err(mas)) return NULL; - } /* spanning writes always overwrite something */ - if (!mas_wr_walk(&wr_mas)) + if (mas->store_type == wr_spanning_store) goto exists; /* At this point, we are at the leaf node that needs to be altered. */ - wr_mas.offset_end = mas->offset; - wr_mas.end_piv = wr_mas.r_max; - - if (wr_mas.content || (mas->last > wr_mas.r_max)) - goto exists; + if (mas->store_type != wr_new_root && mas->store_type != wr_store_root) { + wr_mas.offset_end = mas->offset; + wr_mas.end_piv = wr_mas.r_max; - if (!entry) - return NULL; + if (wr_mas.content || (mas->last > wr_mas.r_max)) + goto exists; + } - mas_wr_modify(&wr_mas); + mas_wr_store_entry(&wr_mas); return wr_mas.content; exists: @@ -4532,7 +4531,7 @@ int mas_alloc_cyclic(struct ma_state *mas, unsigned long *startp, return ret; do { - mas_insert(mas, entry); + mas_insert(mas, entry, gfp); } while (mas_nomem(mas, gfp)); if (mas_is_err(mas)) return xa_err(mas->node); @@ -6536,7 +6535,7 @@ int mtree_insert_range(struct maple_tree *mt, unsigned long first, mtree_lock(mt); retry: - mas_insert(&ms, entry); + mas_insert(&ms, entry, gfp); if (mas_nomem(&ms, gfp)) goto retry; @@ -6585,7 +6584,7 @@ int mtree_alloc_range(struct maple_tree *mt, unsigned long *startp, if (ret) goto unlock; - mas_insert(&mas, entry); + mas_insert(&mas, entry, gfp); /* * mas_nomem() may release the lock, causing the allocated area * to be unavailable, so try to allocate a free area again. @@ -6667,7 +6666,7 @@ int mtree_alloc_rrange(struct maple_tree *mt, unsigned long *startp, if (ret) goto unlock; - mas_insert(&mas, entry); + mas_insert(&mas, entry, gfp); /* * mas_nomem() may release the lock, causing the allocated area * to be unavailable, so try to allocate a free area again. From patchwork Tue Jun 18 20:47: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: 13703021 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 6FEBDC27C4F for ; Tue, 18 Jun 2024 20:48:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 72CD28D0051; Tue, 18 Jun 2024 16:48:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6DD008D002C; Tue, 18 Jun 2024 16:48:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5556C8D0051; Tue, 18 Jun 2024 16:48:42 -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 373698D002C for ; Tue, 18 Jun 2024 16:48:42 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id CE81340AE7 for ; Tue, 18 Jun 2024 20:48:41 +0000 (UTC) X-FDA: 82245198042.17.E20B65F Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf12.hostedemail.com (Postfix) with ESMTP id 69FB840009 for ; Tue, 18 Jun 2024 20:48:38 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=UVquG9C1; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=iLsM1fGi; spf=pass (imf12.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=reject) 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=1718743715; 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=32B6ngM4WOWVGCyckbuU6wS0iwX4RANJwBQYctQ4B90=; b=7lhUfD/YlXtFoByKcTlVcWjFmLRo4yIZK/ED6SGeR95fVJZVzhzbkNexwpDXIw0FF0fyRu EO2SyNRQo1fsDjVgGRaEwaeK2ROw8wXxHPOFsuvFTy0rRXG6MGwUt7R2zBWtDdrwo5E3Ao U3lj8I7DYJGC6SoOklJbr+2NVW1AvzU= ARC-Authentication-Results: i=2; imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=UVquG9C1; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=iLsM1fGi; spf=pass (imf12.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=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718743715; a=rsa-sha256; cv=pass; b=s5/n8wVHThVTNgf6zuvfnF4ahN72Cfan1ncbA1Cf+Zb3gtIeg1YoD9lkoWQT2bXVhYREeo wJKg+JGod7Pl0EuMaB49K6a16rPa/p5Jz1NcvXwegGaqdHtsLtos+7D4xzhu1VD3ALEcFQ 4frF35IFVl74tJAOZ9eXAdnqi3ZFHJY= Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45IIUvLA020993; Tue, 18 Jun 2024 20:48:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=32B6ngM4WOWVGCyckbuU6wS0iwX4RANJwBQYctQ4B90=; b= UVquG9C1fNHUZyrkcWzOWktbRcGJrwQFCYMqFzGe0aoPoBjbalhbkPAJyTCcnzeR O/OXUdYQe21BFjwLBnMSEiMeQ0JEZMT+WeuK6ZYXskz4NSOWGGsZfeHCTLcR1Ij1 K8yrHmXm4SPsEUV0I1sMbIZ4DC9yUXPark2Ul+Yocexel8KodpzjU+jmO+KZ+34/ 5WcHkN17t+xvris/H+AMRj+gP/TE+ZcDPtFMagi8mq+GGbZJZ7yrM0xpQ99mxPaD hHkvtW5hlJcREwqelYV8f6t8seTAIclygHmi0eAeGuO3b3jv8HWOR9AqissetzBK 6kQq8/LYp2rxMnkaNy59Zw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ys1vedxn9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:34 +0000 (GMT) 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 45IJlTIS034656; Tue, 18 Jun 2024 20:48:32 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ys1dey4ud-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jlpN9RDIDG2+UUJC0ImC6W6qWqr0KxcTRrShySg8ghbVyi9MD30WeJVCCtKO6Rpu6mfjcwaw/Kq4I9gQ1lWfE2FMKKh07MsXfKBjPf6EzHxYIQdmi09XNYOspiPdgS4rIyY5JBfDZGF1wKwyst5s7eB95ayH9Y0Z+oCMu61NU/DHfbBD+DoYGsJ9IqDFmyUjowVLXA4MBi/hiaVFzqsu2w+evq9/2yWXabaEPzFGVLxR3XOOUE8UHoThtrDGPTvuWpQ+n1tpP8AHNp8l6MjoW0bXW4+FobJyW9pSkrl72MnILxrBNqbBjPNWT5B1dPMX0zN0pq7fWUDzTrowr/A8LA== 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=32B6ngM4WOWVGCyckbuU6wS0iwX4RANJwBQYctQ4B90=; b=FkWZaZ6w6U2EZo15s/48+TE+IKTzw+EQB5+QLBdtp9NVQpscS7wkpNrvW6XboYwMOTwssLr3KKRZHqZAlVZ17+vbb6npCwSViOO0144oJRiKo6tM15tDzIR0czQua5NMOjRMl6+3KJqF3YASLbk8R1Zk1aiOdy8tR8TVl31C2hwx+XmLMR9ZcBEsQcrN4DBj17/lHuiWAn0qS6vJeOO8VMvaVJNkvivUbwbbvb/IZ5Do9vy6f76BVq7QskaMwhSZ7Mtp5Jct/N9ZgQ+w3wUC7MzXdJ/wRtC3DE/7NmFmMO70WenKhQsINn0NmpW4f+U5A/gouTkdvWKovtm8ewRKDg== 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=32B6ngM4WOWVGCyckbuU6wS0iwX4RANJwBQYctQ4B90=; b=iLsM1fGiyeJKgmbJp38WrBR8GzSwFMD1k0KtiLUpF3JE0ALYBESxOyCf/SK5pYL0KGk2UYRtSMMHgsFbJ6lcEDsVCxMFrSAENJwiQvA7xTm/vfUyJgye/YZR7CDhsHWO5JbY+SeoZJAYdbFkb6I/KeljcLThHp4I8O8YBO82lJ0= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CY8PR10MB6465.namprd10.prod.outlook.com (2603:10b6:930:63::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Tue, 18 Jun 2024 20:48:23 +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.7677.030; Tue, 18 Jun 2024 20:48:23 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v3 11/16] maple_tree: simplify mas_commit_b_node() Date: Tue, 18 Jun 2024 13:47:45 -0700 Message-ID: <20240618204750.79512-12-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618204750.79512-1-sidhartha.kumar@oracle.com> References: <20240618204750.79512-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR03CA0333.namprd03.prod.outlook.com (2603:10b6:a03:39c::8) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|CY8PR10MB6465:EE_ X-MS-Office365-Filtering-Correlation-Id: 8d780ca2-e1a5-438f-3767-08dc8fd7fe5a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|366013|376011|1800799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DXQlSYU6Ktg4Nbn6pEL7sDYogiKw2o7IsuCeKDEhtyuVaL0gNW0LsH2fuksFhzX8UeRO3ivfpG8Bn4JgodwS1Lc8MXQ7FFnpVb0TF5TjXnjCOMKKD/Fl1OtRIElCzijm6DHD14yDe4+K2CWNm5zI65oqa2L3P9vmDIcgmEJzD2l0JN3dAhnKNuKLZxa5v683qCY5pr+g2HtIJHp0yRRmSLheWGbJ2nI+alRQoY3aJE37z/4WD4= 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:(13230037)(366013)(376011)(1800799021);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gGnp1ivA/oRCOvmsmgdyuqoKHgQuC0ipBWR35DTgWCDNmjsXGuNRVAjZ+WkeHKYxvmccm8Op9U3HLWuPI9ROwCQTbIsOs2onLoWxOwfflbAVK4xoJPcOtQnqJ8vUFlmJxJVU4midaweQpfOaRvxy1OokihMCJoCXRyO9TTd3DXxIvZ5u9grYMxzyH2OmtgoUWdASxBvVtAJ3PM1JqEJt/4rGViwTXKYYBxsyeL8aLLSmMCUYbEqy7vTNikF0F3tTmNnLdB7Yh/FbiW1jn5OMrmtlAkus3Lqk2nQ7j6IKVOPXnY5kJMwIXP5NXHyf2C9r2jVEImP63O6ypBV0J64zsSoRrALp/QjY0RwSsmXdexacngm2/GW5mJUNv+11Tr57hSfL0RBtDiF3ncGt8lSqwba2zyi7v5DMlisE36JobsXsYKkOphQQC80gz1nXEtMX9ehR8yAUBsezQ0hdF4L9P4NF+Pb+Qb1N8qCsWssFiqB7lx/QtU2vSolRj43i7IdDwV/W8HA37MVmtWCrsY7HD5D5vGzDkZmPiCR2NkNA4F1N1G4tOd0/iTjwwjEUoTsFK1t0GYRCXO2L5eV6+68eN4lUwAuglhgKyu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-ExternalHop-MessageData-0: 1T7D5hH6HkupmR9NRzxJA5xvXizBjGh5+juKn2s3U6rfQzsG1W+422WuDh/51v6/xRKN6bvX/YTEn93QDLv1ZajBtuFiU5d8g7/za72jCYN1MT2hb7jnPQxbPIDiPzUn16+JFU7QscR3R0Xa+pvZsshkMNSEreCOaSdykhF7dsD2wI+Fv1EKE6WcQ4L2AWtP7qY3u7P7+pxm/C4IoyLT1Z6XK4h1koxvhSQj42RN/mimrAHqU3Sr9T4LM7Kz1e9Y5NYDSn8NanV48/oduuAhJYUCFR2nPdlw4tyrdC2ryYrglDuGQ2VduRxdf9jfLk7MBDO9MgWIzcX3UPHmNnuwwTdceqEDaBz4RxwKOkb2rnSUZb4Cmba8qOTManU5suN/sSXrGJuG12lHK9ODEcN1ziw3s6ROwkKglqNLrOqhI3QTkeowCOLiupA56bcOa5xcKqNEhls5sB0SPEaALBwbfoG2q2NNMYzwWQa/2R4pPc8XiWWo3UgNcW2V6K2u8vGluu1wgk3auPre8PA8SzM/30/6V8MuQT64gHcclTK8o/2dDjlxRe6TAsNfHQfh3wwWtr9J1BqBochOBBhBoGWbchVbH79bl0OS0R6Hf6jmIvE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8d780ca2-e1a5-438f-3767-08dc8fd7fe5a X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 20:48:23.0030 (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: Mf1Db37eQQjn8yB1O81H0UJs5DqyRuMiKmiY0qcT2NapYE+5Dcnz5FWrMjXtPDG76RrGAxKPnExJN5iDviSzL5k15qmSK7TBT09jOKbEekw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6465 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-18_04,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406180153 X-Proofpoint-ORIG-GUID: bamwehXJsUT65StQ9w5cyiGGeXUF1A1v X-Proofpoint-GUID: bamwehXJsUT65StQ9w5cyiGGeXUF1A1v X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 69FB840009 X-Stat-Signature: pxews3sw6unyon946hiwjrrq4s1rp19o X-HE-Tag: 1718743718-797395 X-HE-Meta: U2FsdGVkX19KT7KXgu9RWi659QESZs225M84UThLvqmBEnsvXScK51WLerNy+i9DBWhQ3NL+eIiqjhIowoB9+dAek3HlLW7u0+plBDq4YF1CTbd7G7glNWJ3DmGaKPWzY+M+n1iokK+N/Iiv8UirZjq8ctPdDdQpeu8lhui4pURNYwQjF+9SSPMLcQUorA+QmEo1Z+opY45lAIujwSZXG5jhHdhMHjsRV0zFqGXqjPPhZZF9zkL9ebJJqkeBBUhq8xyccVMnFej7g1rBi5C0zowVkDymLxQsZ/EcqlYq7ZpLUoIMmNOwDR86AdjRnJUH4PR9Ah7tnNjhMNKh7qTlOtX9WGqMv0shN64kKxI0rTjHXMSxrwgnAt1Sa1ocll8VnctOl9tV4U9AT+GrX6Q+czyAss+8xDKW3mVuwacRO/gAVwZKvJR7diy0OuyqrLm6OALUKDMjQLi1QnETmlpay48/tG8+2iJOcnXmnyCG/zBm81K5OJ/KF5FpEI6dWxatynUaeA0Ge7LyrnAcV02dfDwXrvFZ2jQ7oYCU4R8AjsxVzRq4Vs5ad2VFxjkbAIlKWpSVsSNpKhzGIwevHN+KPulTLCap18Wg95WQZqb05XHZnWLbp57DMmGl3EJN1mnegnNwHsRyLB8j9CQBmDsUTK902AN71E1XVKx6pmQCi2M6xEqufCeGjSIm9qFhidMBY+qIEKsQUHvf2v0s4tyJgMcKHK9KJwN+ujiUT/EuyByqhh0my0ZJEg5iHO4d44s1otnmbkhIYGAR3tCLO15EfHTUJTR6La5kX+8RumPW2bwqsOoIejrcZu8YIz1le3mLO9eIqMp72kWE35z31XpnjohrYTOiedAs4okD7vwpMphoq+yHUCEikFuEAaFPcLBUhgoTXlMsxPz05zz12RF2ruDNxeZanMtrWDwb3BGJvXXyeeDlDCT2XN/fj6kac9+jpsy82ZqmiNFCf+aqAW3 47rAuOa0 xE3fotlxP1OqbCavwiSTg9reF7E8EqkohXPcPGwamqwlmZ8rsQdfhEgC1kDF6Q4wiuZgSkVNVZxFqlS8/Uio5Ts0haUi9JFKP8FHvyE7WOAxtCOcmEilXUsOQakzsa3y2pzyksMFGkLKFNmBwGOjTsJAsVCOlhpEsUXxrNRMNsDbkzt4al7jamtAdDY9fbTNdB7NGFCJ5yqF3gW9dK6hUUl7seZ2S3eRhQWg8yof1DzAAjeFSTKv0kRUuL3NM1fTMobYpDye+Kz9JbeG9kWUWcFLC5CydlmXouGGm+FqJeUMlrJnXgBB86FQCrDttNWYGJ312fkJYXxr4VfAZhxhX0uvV3+2Gila9o6j+PNPDBxj/syaPO/1YpHlymvdGP8JAI7qMyfggytKBbAeWoGsLfsI88xQpWfevoK9juyvV/avs69BOj1KNaxVYDbyAs9iaYbxcm9zBvVB57oAEENDjSvcbMsuKsr28hq42TA5HolObsPmHERe5A71Q2+sAwDXDAXck X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Use mas->store_type to simplify the logic of identifying the type of write. We can also use mas_new_ma_node() instead of mt_mk_node() to remove b_type and clean up the local variables. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index e53f1f398ece..b2062e034f89 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3431,18 +3431,14 @@ static inline bool mas_reuse_node(struct ma_wr_state *wr_mas, static noinline_for_kasan int mas_commit_b_node(struct ma_wr_state *wr_mas, struct maple_big_node *b_node, unsigned char end) { - struct maple_node *node; - struct maple_enode *old_enode; - unsigned char b_end = b_node->b_end; - enum maple_type b_type = b_node->type; + unsigned char b_end = 0; + struct maple_enode *new_enode; + struct maple_enode *old_enode = wr_mas->mas->node; - old_enode = wr_mas->mas->node; - if ((b_end < mt_min_slots[b_type]) && - (!mte_is_root(old_enode)) && - (mas_mt_height(wr_mas->mas) > 1)) + if (wr_mas->mas->store_type == wr_rebalance) return mas_rebalance(wr_mas->mas, b_node); - if (b_end >= mt_slots[b_type]) + if (wr_mas->mas->store_type == wr_split_store) return mas_split(wr_mas->mas, b_node); if (mas_reuse_node(wr_mas, b_node, end)) @@ -3452,9 +3448,10 @@ static noinline_for_kasan int mas_commit_b_node(struct ma_wr_state *wr_mas, if (mas_is_err(wr_mas->mas)) return 0; - node = mas_pop_node(wr_mas->mas); - node->parent = mas_mn(wr_mas->mas)->parent; - wr_mas->mas->node = mt_mk_node(node, b_type); + b_end = b_node->b_end; + new_enode = mas_new_ma_node(wr_mas->mas, b_node); + mte_to_node(new_enode)->parent = mte_to_node(old_enode)->parent; + wr_mas->mas->node = new_enode; mab_mas_cp(b_node, 0, b_end, wr_mas->mas, false); mas_replace_node(wr_mas->mas, old_enode); reuse_node: From patchwork Tue Jun 18 20:47:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13703024 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 B443DC27C4F for ; Tue, 18 Jun 2024 20:48:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D5C628D002C; Tue, 18 Jun 2024 16:48:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C84C08D0057; Tue, 18 Jun 2024 16:48:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8B2738D002C; Tue, 18 Jun 2024 16:48:43 -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 6995D8D0053 for ; Tue, 18 Jun 2024 16:48:43 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 19D451C17E2 for ; Tue, 18 Jun 2024 20:48:43 +0000 (UTC) X-FDA: 82245198126.02.767377B Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf14.hostedemail.com (Postfix) with ESMTP id CDD23100010 for ; Tue, 18 Jun 2024 20:48:39 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="opwmJ/mN"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=GYwFZZmr; spf=pass (imf14.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=reject) 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=1718743710; 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=+7Q97s4qRY3TtX0Im3NHWdCMkhGqb6Gnlnqsc/XlV58=; b=kFfUDHjX7X+rZ6UoGR/uvMjMAlxiGNPeKJ5AGw+fqTyfvV55ETZ314hkXVUtczdBq3Tbff 92V0955/fnULmYw8T+iZa8FpFJeOac9EMfoMoXTPWomSO4QFH3PAtm2fh6A6TyeqzxbpGR eXYOwHLRZMhyOyw+5j3njcOH1gF9hGc= ARC-Authentication-Results: i=2; imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="opwmJ/mN"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=GYwFZZmr; spf=pass (imf14.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=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718743710; a=rsa-sha256; cv=pass; b=nlqplySrNZkllYJKr4dX6QQaq362QaKUCG8Nz6FO5+sYbEc0E5jB42SdWqYHFd0P62uKiX pwhGiGrsRRp+B5iP9chESMeZ3hJkaUGAHGYU0WcqyV8zwapLuEXC4j6sCGoLjfdVjIC9ZJ TQ7jQUhH9UE0nOQUaMyX0AEiRwce63M= Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45IIUkgb029421; Tue, 18 Jun 2024 20:48:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=+7Q97s4qRY3TtX0Im3NHWdCMkhGqb6Gnlnqsc/XlV58=; b= opwmJ/mNWTXe9s6j3D8XjU9gfHRQmVg+Oj/xf6xlyWTJNwmNuPmMn5Mz/xKZMEB/ DZqZf7lFoMyrVSpVtGmHNtpCMTO8fNUBvTGII6DD5FxInUv/VaXFpIMG6j3oJyXJ qGWoE9XawfO6e2cY2JPp6O3lSriqArpc3QOa863bMixOHj/HWbnnYMkObTLdjBVb 8DyAnB4vcZ6V0ogm8qUB3EituBkYzKyXlTjpRm0sto50TZ9q895gkCIb5Xr1kV5E MF7uQ1+8PlQv7nQYfZVp8ZjoDm6vGObK6JCwl/BjqvqqtLKqIp32PqSVCMfmAong ETpvNZLELifWxoUbCKBgpQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ys2js5tnx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:33 +0000 (GMT) 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 45IJlTIT034656; Tue, 18 Jun 2024 20:48:33 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ys1dey4ud-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NpNH5RdnRp88SV4ZUBvxXeA2b5tFa5byx8qX0GDbDMuxNDqtq5ojRXwe/FV6hLnOiC8h3OLIc4eHsBiIICNm3xmDCOJUKhssVxsaxrZeu6nrOrONCMtpAs5+xu6X2EKPGXeLe5V+KtbAvYtUUlvVKHrUhCEis2IyJqAMNfgyISIRn3Lj4eDMvc0DSt6D5BMAUfxKnRiLUJoiTBrSBZaicePAJN2I0twYcN6uoD3q80NyqBfAlcF5gUpDTTepHNiq9vzU/szC63biSb6d119XKMN+QGqsGe+NPzJWwWUsEoaq83R4L/fSg8xql0ZXXuy1LsI5Bo/74oUdO3k+dDV+BQ== 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=+7Q97s4qRY3TtX0Im3NHWdCMkhGqb6Gnlnqsc/XlV58=; b=GENVcuvL+zhYWOJdsmsVTjQql/LgZ7fc+ZSQD69VY1exblXsSP5QssQlyt6BYhccBPb4qb/9RwTiDen/vK6PUxdz7Ui/CTi7VVK744TubhqGdRItpoihPCdfIRfDAfNk5RR2VBW0VO0TrTVsc7f+oy6FKlhI+WN6x0AhLBg5RWExAX6QQ//gXx6RYgdElBUghAYA1fB7/77Fj9Cmx58F5aS1tFdjhXG/O92GmKPTpCDKOCTD0wTngJ/3vxWSve69b1NH+f/wqSBpR1g/m5X4XBj7byhV4jnVxQ+VesEsOuiMYH1ICo3EULgyXxNQDIs0FPQtE3qnXvALkeFyRSsnvw== 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=+7Q97s4qRY3TtX0Im3NHWdCMkhGqb6Gnlnqsc/XlV58=; b=GYwFZZmrvNnAsGmFtOszJqW2/+Mqr+fh1cWOoCmOLfCs6bb2cjS6ZAPxsBQY/SF23rgSSd5AMvrTjoImYne7IpHWRsI+X9tHOK8KqVnXaXEYd8WNgRp1JDBpoRPmB0/c1r4K6D/sohnj0cAz5XTIkLf6bG123fAfXsfoY4Xs3JU= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CY8PR10MB6465.namprd10.prod.outlook.com (2603:10b6:930:63::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Tue, 18 Jun 2024 20:48:25 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7677.030; Tue, 18 Jun 2024 20:48:25 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v3 12/16] maple_tree: remove mas_wr_modify() Date: Tue, 18 Jun 2024 13:47:46 -0700 Message-ID: <20240618204750.79512-13-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618204750.79512-1-sidhartha.kumar@oracle.com> References: <20240618204750.79512-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR04CA0022.namprd04.prod.outlook.com (2603:10b6:a03:40::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_|CY8PR10MB6465:EE_ X-MS-Office365-Filtering-Correlation-Id: dd3ae489-917c-4026-ffb4-08dc8fd7ffba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|366013|376011|1800799021; X-Microsoft-Antispam-Message-Info: TQTP7I1oyLVCC5JVedKXu4MPKqKRL8NvoRvdcMQ0EpzXzUxGuU9IvDH8Q0qnb2CupDznOnHdDZkak8EShdfYWxaBRv/KgOWG4QXNRYoVEgGJGkL5zQ9P6htT7C7YdzIztG9MJ36uNewUPuIB8Z0/NB+3J0nJTewuHU3VJPKdNgJcTbnCU7rBOfeZr+su7vS3FEvHbnQprCs6mlQSb/rQpZ+W8BEbyu415fO9zcBSk4D7ku9cATIUVxVjP4hxvwqtgALJomrjViZdfiDE/WFxcEa0s10Z9oI7twAVncMPbuiW8iUZ2PaihzvtedJva+gDatOUDwdnfc6xZYCJOVOTJ6whQdBSkT8RMmTAwQWH5l1yzM/uGmwu3kRfMki5UcqEx+2kDaJwA5xS/QUox+Y+egVY6c3BUhk1tevGKFdtN4EI+/HTuWnVe2if8xxIfsYOJwA57kzDEejN2nvDLnGa50Gg4BI5tRQj/KLJWu4FuFiwPgFJf1Dfxxq+fSbMvPPJCzxsWcKXPtyViE79M0iZO0C78mfCO1RuYFa5kgjV8cpUdjSmInXgaRcLkKtuBzTTMKUPkpNPxl1aIXqQPbSniOXP+RmtAB4ZXqAXJhNBWrVzIe9XFjeH0Co4ojr7HCut1Hdj8uefJUhoTpZbeGGxHJtwtmiiIgPPdVqmvBrAF5WwTDx2qEM0MyK0szwF36epFEqbt/yVMvcV8d2w1kXXHM3GZ7VTQ0Ade+2x1nN/dMj8ptsfABYC2TtJBp+pujsIVj+pyfMwtuWFYExhL4YYTQxesUoknKDcZa02R+uyG7LOcIxpUJ6WCnV9v5MgoczJUWoO3N7ONFInzosFlt83r+27xXqJ7X2Rj1P34FcU/+AklN/A+OYKLw0PDeGBX14i6p1jemPPCapRdmIKGPIurSwa3tQOL8DvzUzEs2WUTmPDbsQgp6zFMnCI2v5LcD5U9j0BaLyhmja3R/vzu+Nsea5y8+WzPzhV+eHq+vykShaOWr87CeWnVLyIp/2m4jc4liQA6InoQ4o52jFIOGVtaV7/QfLN5lH9J7LxwBO2WMhrgdLeNLR3ZXsNcaRjjk2cOVt5WCFcnlymuZ5n9HQYciES1H31QZlZhCQRCpNLncG1EC4M7w44P4Vv7HljB1bBbzjtz1NTuyRFn0xE5WIIsYZ29DB6qsGcwZ97aHlGxrwywNoAgHGczzTtY5N1hhUNHbpWPI1uj/Me+ptZW6wi3KYM/NG/VYlqynSOTJMMAVgtveEQ4v3IUOpHNsfS5VZ5vtvIuCZZa9Pfeaz83P6jZXOKMmcKUCzN1RhtwC6hzGg= 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:(13230037)(366013)(376011)(1800799021);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1pAjqSFGFwhtkGxoVT0a43ZRLrW38uDJyR/AJdQiaoQVuPaWD71ILDALpoQLbX7L3iIDhmKEB79XzDDKW2O2HQXsChAo5X1IFB0drFmwZg42gHFMHcQr99634MBBeHjP3OZE8Jyyf+43QVNVHr8ICqPW+JghpLO3Aq2OJVtQutqIHN/uwVy67Z7I46tk1ZJi/AxaPIDl4ERcVdJgtrULKuTZq79bRkAlMTrSgEACRjnPbp1nvPcEstCnf+jya9Km8zFdE6u5itmT4xhSJOfvQmir7QX2p7btJiAX8ZmdVT/zHfyaXzbeoQF2KjAPoq7bz1Pm+ABmM1NQvAQIGBduAjEnYtQHfBmlMantHJR7ptzJSjnYS6zCGlC8vY4dPQvsB/qA3F7aTk1zOUzGMWr6aazqw8Hg28T+ITCqirQe/H5cRrGotrzXL5efcFmS/JV8ti0nmScU6r1tvxlVjyuPIhf81X3eIXNMEuDPCafWoEavfwOPfixTl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EAjlA4ze36UsLuzG2sMsUVhdWCo8SLXKrUCJbBu1TuRryM6tp85hEzBIsfwYgfc3ulZG3lVI= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: xL9KqQPuPiZTTaUC2AAKrjtfTnXWetyI9FO7Rc8z9L4G9VEL4GzgrDG6N96w2lxgO0N7k0JHVtBXYmmRAWlygA8L15dMzPd/nIF6d7eTJ5yP/Cv3DpUk3SeDXaGmalQC42xxvBOh5+atf4/0F7rS+PL721pSzPTgNMqZgIXbffLhmpG+Kjcfvyn8D68EWipS9j9ETEpm0vuEtFempLuXl2EKCteK41264XVBeclWVa6Qv0fJq3ocELkCXuIYt4FoZDAAA3iZDAfpknaQ9PawXZ49bAONIM8YGfxt/Ure2rNxkpsszaJMjVDnVC4M9yZK2zTjZXamsKzb0D9wLMZDgh+7QnqbslDTko6D6sBq1TykAK7M8ygec2evZxli5oxl8LnAeYEMIP9BAPAGxFE2d3Ck6BM3RVaCT4q7P0l/77M74tuYcYXWmFWYyHLiiNk+/AEE8FG/t+IWs/qs8LCsdqgCzUjCzQ4SPz3a3vFQeSl6EqozzeOVH8Uo9Urnbt6M7r3bg6W+AJsdsmrycS6vn0h8UVBrnlgDVZ1PLvQUw/CAa3pg/zvsthNpUg71CKsUQ9PKMfy0HxQuU0X+EZ+SU8k/aRTQNq6MYQMVbvCU2hc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd3ae489-917c-4026-ffb4-08dc8fd7ffba X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 20:48:25.2591 (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: 433mKzRK86Ervj+OT4INQrr2XEvgTZq7/1oUJkug2eV27iltZ3hDyDoE7vfdz9LXZzXsORxDvtHy9Pvysbrg6jvvFO6FyFT1FcgqxOAhCYY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6465 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-18_04,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406180153 X-Proofpoint-ORIG-GUID: sVJTecTe5WnNxmJPMsQ8mhMJWQ2MqGcQ X-Proofpoint-GUID: sVJTecTe5WnNxmJPMsQ8mhMJWQ2MqGcQ X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: CDD23100010 X-Stat-Signature: yqumjcuukejzkznb9awrbt4pt8f6un3u X-Rspam-User: X-HE-Tag: 1718743719-712957 X-HE-Meta: U2FsdGVkX19uImZJCv96Ev9hAyebvMYBu/sZrNE4CMq5AJXO1aisTfcKetBl20pbsgne6EAZqH5Bi6TLRNIpASI71mQsGQ/F9OPCucp8LHLyXl5Ap8mvCLHTCW9KhozcrE6Jy8IUlFtKGVPWMSOBp7OkgEk7p/rPIRGb3UmQIlZmCXjNnI2nHdGRMRQF9+E3ZTrqzrAX8DQgmrwuJ9KTWxX+S5hf5wLsvG2qzdOjbX4pMO3WoW8xskqJEl4unn4nDIVIbAWxSsKRaAuGb9iD17ba4l1jAEal5xD6bsdQNXnrtHDvVN53HDHaL8iLyOM7Q5x0WMqhcAqJLkXAn2JPwFvyRscnYee/yi9qM6kbr/Kt5WC4yoCTTAJ0n5hG7gLZyIyNCgFWuo9S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=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: 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 b2062e034f89..98c64aaedb55 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4155,44 +4155,6 @@ static void mas_wr_bnode(struct ma_wr_state *wr_mas) mas_commit_b_node(wr_mas, &b_node, wr_mas->mas->end); } -static inline void mas_wr_modify(struct ma_wr_state *wr_mas) -{ - struct ma_state *mas = wr_mas->mas; - unsigned char new_end; - - /* Direct replacement */ - if (wr_mas->r_min == mas->index && wr_mas->r_max == mas->last) { - rcu_assign_pointer(wr_mas->slots[mas->offset], wr_mas->entry); - if (!!wr_mas->entry ^ !!wr_mas->content) - mas_update_gap(mas); - return; - } - - /* - * new_end exceeds the size of the maple node and cannot enter the fast - * path. - */ - new_end = mas_wr_new_end(wr_mas); - if (new_end >= mt_slots[wr_mas->type]) - goto slow_path; - - /* Attempt to append */ - if (mas_wr_append(wr_mas, new_end)) - return; - - if (new_end == mas->end && mas_wr_slot_store(wr_mas)) - return; - - if (mas_wr_node_store(wr_mas, new_end)) - return; - - if (mas_is_err(mas)) - return; - -slow_path: - mas_wr_bnode(wr_mas); -} - /* * mas_wr_store_entry() - Internal call to store a value * @mas: The maple state From patchwork Tue Jun 18 20:47:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13703033 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 22C9DC27C4F for ; Tue, 18 Jun 2024 20:49:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 905E78D0059; Tue, 18 Jun 2024 16:48:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7EDA48D005E; Tue, 18 Jun 2024 16:48:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A8748D0060; Tue, 18 Jun 2024 16:48:46 -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 DE8F08D005B for ; Tue, 18 Jun 2024 16:48:45 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 98E321A0B18 for ; Tue, 18 Jun 2024 20:48:45 +0000 (UTC) X-FDA: 82245198210.17.82C0A07 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf27.hostedemail.com (Postfix) with ESMTP id 5301E40017 for ; Tue, 18 Jun 2024 20:48:42 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=o0CPx6Xl; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=pHllqfjW; 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=reject) 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=1718743717; 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=ufcKmhI0a06m227Amm2QLiJQHiBuHSuMUYBepJaIpeI=; b=6it5tFnmrAUbjXLhmaeYXVKDTAYbn1IohGPperXsxgH2Ko5EelzoQmwbxCoL4pX3pPZ5Ok jdf7HGoZLpeGG1XYHeGUI9Q6PYgbpDkk3kbfeaviE4HQznuVnY/zXZtK/V0By52jncIO2D II0HSQzbtnDXR6/rZ1MwwQWLUdOKwKo= ARC-Authentication-Results: i=2; imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=o0CPx6Xl; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=pHllqfjW; 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=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718743717; a=rsa-sha256; cv=pass; b=CymD69ogex/gzEcQ9P+i3YmJJUxd+DJ0rwHWzVPk+ucPv69p3NDHzrpUkrjFP/OeK1DVJh eCC3P89CGyXM6XekpKNK+a52GCJQMMZJKrqQ2391phmFpL6KK9bRviXmrb3fG8gaL9d9mZ GTLc6b1UWofuBzPFE9gcZ5bhmtcWGxo= Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45IIUo5Q001568; Tue, 18 Jun 2024 20:48:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=ufcKmhI0a06m227Amm2QLiJQHiBuHSuMUYBepJaIpeI=; b= o0CPx6XlsYCtt165HO3NV5VBX7kL4yRTALa/lUrg0RDAUznPgUW9E6E2xJ2L2loC YOl6sxsA9wrE8DqNTg+AhbZu6KBKyNhtlvx8aOr2qnRf4Z6jyWhPQYwUN3segl4C az6U35pTRpIGG47Mh6Me2VcrjBwRkFXJlEO+yaqz0kt2ZgkK2pB7B8kUgrm0zjoI GUxirLKfv5b1XI8A0GwprvBx7ZF5GBLIEqeCXCQ6cT4mgMUjVXBu+7ZvoycrrYRl sHxlP4XjpSJIzIg3EXa1bclEOjtgTWpf3y218XQzQsn7eFQI2+HoLHZ6Zm4HGkNV bEyqvBC/F0dryt+YFIUHnw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ys3gsnw8v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:35 +0000 (GMT) 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 45IJlTIW034656; Tue, 18 Jun 2024 20:48:34 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ys1dey4ud-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nSU5upelj8Efh6gkvY4EgGvOIZw059UtCaLLChX4FCgx2Q3PMYRzqpZiLRrAR121uVYAaheKGSLTifJdtR9JQJFjdui5gQBdmxmYENAs99DIcSHLEw43YqHt5pruTRZIBEk0QoLZe37VpgJVYV1Zk+2lGwlR1+ryUYltUL2BPBmVJTwJbJXLy9GdMBC+UOPZByYjpLb0k/Eu1068t1CO3PXbVUotvDyKiVmrlmLRHWWlCmcIG6OClpxvhieA9BPMEjwgG+0jKYixdQ8lLowjEx6DT4oyEcefnLh268U3WUf16Q0WQLmUr1XhX3BNwREHOx2mPoqQG7tJlvti3J24OA== 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=ufcKmhI0a06m227Amm2QLiJQHiBuHSuMUYBepJaIpeI=; b=OYmu4WhWM4OWmEqnXvQoQ0+iSyQr3/Lr5p6eCYVUwjCAaw79mVVUL4goAKnmYutSqVEk5dhixQd6SYg9BIUFu4DXTB2mzXSWGCpA8iINvfhrx/kYdj9PBafISepnZ4oPkRhMRMp2ElZe5C8D0HzNjmu20bFqm6VKjeIfsZCEellPaycy0S6dgOsfgbAfFczXeOsf5t7HT/ZPHk/hP6PKYYYYOLqn8ZK9d1mYBpe0PlQf/UfK4YdJERyYhpOjLNn/hmI/btX59qn7de6zTf6oCX5xPn/G9oxv2xCeLsFxLWh8eyYBGUr6qsfuQ9lTZr4EdtBd2o4AEJPWpDGSsmI/fQ== 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=ufcKmhI0a06m227Amm2QLiJQHiBuHSuMUYBepJaIpeI=; b=pHllqfjWOpEyOhQdvdQGI/TOC+oJqi+gU2eG9gxRnsTM7z4zPYzXSXSkqynsLlspDuTEcOe1sfrAJdoY440CNWKlUd8HmldZQVrIOefANJQmTS9rzUfWk/FGsygxGZY4jWHTemrRWl3SvPSSZXd5oRBCwz76AM7YE2WZMXrg+JE= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CY8PR10MB6465.namprd10.prod.outlook.com (2603:10b6:930:63::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Tue, 18 Jun 2024 20:48:27 +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.7677.030; Tue, 18 Jun 2024 20:48:27 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v3 13/16] maple_tree: have mas_store() allocate nodes if needed Date: Tue, 18 Jun 2024 13:47:47 -0700 Message-ID: <20240618204750.79512-14-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618204750.79512-1-sidhartha.kumar@oracle.com> References: <20240618204750.79512-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR04CA0030.namprd04.prod.outlook.com (2603:10b6:a03:40::43) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|CY8PR10MB6465:EE_ X-MS-Office365-Filtering-Correlation-Id: 7409078f-5286-4708-7270-08dc8fd800f2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|366013|376011|1800799021; X-Microsoft-Antispam-Message-Info: T43cBfcq/9chhrXLe1LWXzj0cvE9GJxWyo+5JBvbuezbUoHa+bC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Cs8mwEuhiSRElBiK3x0slFfM+Sv3N+x9xdXdQL98KjNP0hqXOZiqxtxU8Gjso6fJzqakWazJUMylV3sKpaNlLrcACM7RSaLadQO1+uwy+d0fiKGcllH5eMSpG/u0OANlBPL+eZk1hZJ2XBegIQT3F/BFbR6vogyu4fTDQUVeh5n8= 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:(13230037)(366013)(376011)(1800799021);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5p696o8GXnaf9WuoQrkak7tX6Om1J99d0kahf1DuhttDuBcfFDI7OI+jqAC7SYedihekJOjmg+jfua+ZrOEoYmFbOD8+uHZBbJoizLPEisyhY9tdfLn8dkIlww/9UVTz59saAONDWjzIFgfPkY+YCxc/e0rEW4IPHgKgi8x6sm4/4FN9x7MeKV7yq3OBnLpCEjrVmFSuWfL32ywtzURM6NgMLet2k0MHlpeY2iAAcfJ43RCwq5AOBkTmKd0Paf88qPT+gZK5MoilZoFjjo6CqiBG3C8bjgmmjATktEG+s7Ta7iGGcwP+xYAey2yowOGpET8im07c7NV59HRu5JIhTg8bXhEFJEJlEpqxwby5WkPUuER92NsPb9pQUWZrkFb9Im5BBQehF2wq6dGYTKNKB8ypLCS3+6cK6PVkWynUmvS5PkTLIX+J4LDBIA6Kr0xcuqvYoNTnJAjcv+3MFz7kFZkYhM9FNVBc4HOT6mWAUGmpH0bXsNTy5KIl4wtep3fF+SA9wyW9rvibDUkrGq95jz/QOhdhlpyUfJsh8tSbzxFixqUy9M+7dd2/trydSNhDQck3oK/ECCfUE10kANNda764ionDgzkPrTszpUxUpXfO+y5E22qJ4mhR+xoOtrcDhO5kMgJUmCPJytfzkL7OsxuNnyqJSqxRlMyRlDrkgMQgHY9o8UwmN8zitCGr4bdP0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1m8XvBdNiZo0cVJhP4skK8oM9RFqmKBpwkgdSnMaDK6podiaS5+4rSm/m3NTLFFnyZe1HqKfAz0o4PyCG3hZnj4GWLxTeZiqtOyunxjroGFdWYmfyQ7UisgLRFtUfelfQpqrCb3jdkBY2V/hbWvIyjEU2KtKwYBpTSJteyEq/Zl+bUVgnTyuucyCd/kX2Kg3DM1tlJi1AiGr5K3gqUOlvY8DK4W/2nfvd6kLhTtkDGsCkDzS2I4r6io7RwA7m17HeEGhKxMf+z1j1gFvi4Pu/WxsCjRnKan+jxomrT4GMMpHg7YvZVz9Nn1glG/NPeppGRaZhQiAuZ8Ayzf25K7JiD2Ykqh7SB4CrKzdYBErV2kCbmDC7G0yvQs9ac4r41lcgYmOG3fFRvaLBV8r+YP6TD2+rbsaIcyUfbUccPGOaSbZCrQ0DMNniafVZIkkldILI1beKSruTmEtjJxcaj3u3NjDVZ/2pH1Sd64gOLT8yKhvMevaktjPeLodnMD0zLQ5IzoKNZCP2rGeMSrXrGoPpk/DvcN6fhjCPq5Bn9QSwQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7409078f-5286-4708-7270-08dc8fd800f2 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 20:48:27.3171 (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: 58uE0oZzb83TiW2KbfbwLFySnLq/Xy5D/K902PNLOq0cy2+6ijAagLVMbFzOd9sjLTpESFAwGmFpFsP/K+aORhcbe8olABYKlLzY6TdInjw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6465 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-18_04,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406180153 X-Proofpoint-ORIG-GUID: IKVFcOnYnJ8T9Mn0Wo5s0oRaKcuoK8Kw X-Proofpoint-GUID: IKVFcOnYnJ8T9Mn0Wo5s0oRaKcuoK8Kw X-Stat-Signature: ci3dfgaiz5dcth7myfhunrci8o7enkou X-Rspam-User: X-Rspamd-Queue-Id: 5301E40017 X-Rspamd-Server: rspam02 X-HE-Tag: 1718743722-182884 X-HE-Meta: U2FsdGVkX18FjLxJnytm+l13qVYddsmPT/DY9TENUanJQi5bMMHdn7fkJf2n8XBoWqkk/fxou+cCHpf/5QtfOfnemkZvu7nsqRaTm8xUiwNQYWjXY70MNKLafsnwQp9lFukJGQOJ2+lw+jBxFeLIgB8j8T/SH9+qaElX/QHVmBAeQU/1Jk7n/cKLzT1mL60KOI0TW02XbfLzBi4eIImBhLZjMAKDjjUEtQVdjv+nlqARyA5NEiiMMwymxWwyBJn8LodOCPmo3DYaZKkXvxutWQzRstaWdp3E4GuNt31y0osZB8RSp+BrF0JVecuWP2w4385o6V/DynZObH0ToGDyWEakpAv4Jr2xDkH0UkBbp0v2bzNrwKAffQyMcyp+bleLQpEbij4gBYipes8A10XXW6Bq04fyKIgeKRMn6MH3Swh5QVzPRRl6LjZkUWuUOhl9YgsOBBiuk1E3rxymbWf8+lC5AIim9mOF0RAUh7FUmhVmBSJwdEUCKCVc/vNZ6GVPo0JGD5JbpRfjI6uJM+fgVV1yGXDSk0iYZ571aHRC3uOHvSx0UbiS2lwrg//fQiw4edpguP9HhVQ0XzDkZaoiMgV/YDMLTw8at1H2FNjsvDQjrDAm9h11neEPj2XX1m9tsqEeXg1zWCzlZ6lFIstxwCg1fvhwC9s2AzjJRnugZSIDSxSk8hVCB56rdeaG6LobmM25LnrichYSrsuTW8Us+nihqF1A+azJrZqx51vjhJ1eOyOU2l97fhZXH9GKNt7m1z2f+aX+rEygOUFd8GR3oEmqoxZS8Z0fpTxBWixlP+e49rFmA8CmdlHjK7Zk3zsEgp0uexx/F4r1eg7ggrNUR3ZdyRRyYccsP/A9K1o7bl16KCcdARpaU0mKLoIr5oW4DyvK2EOYqpLxNUmKI63l8HmRKWqhOB8Luj+bNuZn5hDuYZReMZv0g+avYA0eWG98aZf4yD46SsOISeGlVXW aE/SXR3B KKjivg2rIATYWBh/+fABjXsy3BLe5D63gLcHWwwPbWv9Ry1cirWAzVvH3eGCIGKdenDGpFW7XFE7wJipht1d+9hHu47k59Zv87ALgQVFvtg4uegPH1VuCnzoqt+PTK4HHQIn3k4FgiDxGnEzi0bBn1U07zlKAqmas9+q91sEDbRKCiaRQCtOB0UhmEaqOP0cIMKae8zEqTfTHQFB2KxpMkH/voyizRN1CM0V1eKCOjXDGDjc6XjCjwvk3AiluLQtJxNuRV0lEQMHS4EbjXnrjdj42uRaHV+S0gQVOXwTUAec66dZZuyWfAW6aC2F60tDHr8tFnn5wqUzdTs+8DwMe49sUswGb6+Ok7BNhRQd+cg+ygZYHvh8MZAFznWXYRthKNg4lINT+IjcEDA+0O4F3P+X2LkK8QnWw2o0i2lCpyPNvPZQNDnm7Q2KlyuNkDn+YDoBWTDcS5NJV7fu2nABt13hsfFD9oIS4Y6uNMk4x/2UWuEzLaq98SKq4jA== 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 | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 98c64aaedb55..46bdc4ce6662 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5536,13 +5536,12 @@ 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. */ void *mas_store(struct ma_state *mas, void *entry) { + int request; MA_WR_STATE(wr_mas, mas, entry); trace_ma_write(__func__, mas, 0, entry); @@ -5565,7 +5564,24 @@ void *mas_store(struct ma_state *mas, void *entry) */ mas_wr_prealloc_setup(&wr_mas); mas_wr_store_type(&wr_mas); + WARN_ON_ONCE(mas->store_type == wr_invalid); + if (mas->mas_flags & MA_STATE_PREALLOC) { + mas_wr_store_entry(&wr_mas); + MAS_WR_BUG_ON(&wr_mas, mas_is_err(mas)); + return wr_mas.content; + } + + request = mas_prealloc_calc(mas, entry); + if (!request) + goto store; + + mas_node_count(mas, request); + if (mas_is_err(mas)) + return NULL; + +store: mas_wr_store_entry(&wr_mas); + mas_destroy(mas); return wr_mas.content; } EXPORT_SYMBOL_GPL(mas_store); From patchwork Tue Jun 18 20:47:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13703070 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 41FB1C27C4F for ; Tue, 18 Jun 2024 21:34:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5EDF28D0064; Tue, 18 Jun 2024 17:34:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 59DE78D005C; Tue, 18 Jun 2024 17:34:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3C9678D0064; Tue, 18 Jun 2024 17:34:10 -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 1C9478D005C for ; Tue, 18 Jun 2024 17:34:10 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C6F1B160B4B for ; Tue, 18 Jun 2024 21:34:09 +0000 (UTC) X-FDA: 82245312618.19.B3A77E2 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf03.hostedemail.com (Postfix) with ESMTP id 819252000C for ; Tue, 18 Jun 2024 21:34:06 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=Q9dULSPy; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=oaHEhFF+; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf03.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=reject) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718746439; 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=TtkocouQTFTPgXp+1BjOXz5ILXZUoo9Pc8T1JgZ0Wmg=; b=Z3rxD2dK9b45Kb4TMs0szWgHMtzs1pDILx4MxF9vUt2MU4w20VsFKDxWUngF99Uqki7zds LpW3NgrKKMpbEzDXlTahSu/xSCP9FbdsCzXN/fgBiZFfT5sF9ivj9DwE3YlHP2sl4S0x+1 PszOwUqezEMqpQa6kmZhpTy9x5L8CQU= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718746439; a=rsa-sha256; cv=pass; b=xqHHCO48KhLHzR8WZsDSnjiHewX937xgvbKKtczRG0n/7LB8to8oBNjGQZu2vSBAJX0lWH 3C/v1jOccZE4DwAc+NjP9cfjQ0BHwe+m4kzhwVqz1LB9/P1Pr4ckCqJzPnRE/CYFJ9ViWK ADyIgpPD6A+tw/na1nwu82E47Q3OeRc= ARC-Authentication-Results: i=2; imf03.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=Q9dULSPy; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=oaHEhFF+; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf03.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=reject) header.from=oracle.com Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45IIUuo7029804; Tue, 18 Jun 2024 20:48:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=TtkocouQTFTPgXp+1BjOXz5ILXZUoo9Pc8T1JgZ0Wmg=; b= Q9dULSPyjHAbH2EuB2O3txrwJy/Qq+in7gxCpsKfORLDZ1UrTlsrx4hIl/RWnEWg EovbaM8OpxvmBvwEacoMXEcF1Hc9F2DaMfsstkXv/YaxSpFyFGyMgzDOKVccR91x xtJi39PZflVE25l9TMLpOQyksjdxHDHs77FemtcewK3C1/tnQhi6qr0xdmyxTJNK C5U/rlLtApRPqTGoIL5AYGF84qSk5pQB74dBskNVdCq4iMeNgP5Fp3ifeDEuaBps Nki06ucLQ1zQgYnYCfFo7m/uHcWjjF+0fmKAix/kDggMBvWuNxOypsu5n3clxY6J 7BgDpl1QHJq/mPtDIGwXAA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ys2js5tp3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:34 +0000 (GMT) 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 45IJlTIU034656; Tue, 18 Jun 2024 20:48:33 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ys1dey4ud-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SN2mSWXCvnpFjtivEU1sMb1sorJRDsKZj1Z/eA84lvtes9o2sSpzSdVkYZYV07/q13xxvvZpSkbilskLdGXqXTcbmmPym8h8GaCm7XgbQvNIFdsD4ZinXrWTIuXukhDtILDrPf5F7xUWdWQBmmDfGb0GeuyLOwXn89V8va9SKFpr2ev+5R+mRbzrpFv4kW41NtyGBj7lT4FEPnL9/WsmACBw9PsoDSsiOxn4Bg75aAdSqFOyxuXyNiJmiFNCBvKKcX82pAuTIz+k/LoOKnDYLpOy2FttRkHAPnzAmBGsBXCrCiPZUermm5b8vsm2UxAH6cqtqAxmbuZVkoE9c6w+Jw== 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=TtkocouQTFTPgXp+1BjOXz5ILXZUoo9Pc8T1JgZ0Wmg=; b=Qbwrq28+9bifv4Wvao7GtBp1qQLXDjkAbHCLIUDpxQ6yFYDi3aOrmKkQM3CKSOn/HzOBPPFi9CWUfvyWbqkUnYRdtZ8WRlIvP1A6KM1E6K9s6lRORLj3Mac40lYmK3G0vSic9BWmXvqwtPp7uKADP0jw9ntyU6vMYK2Yh2D5e2z2WwhcWixXWj8L4qYAKaFD/xU8yAOXDpOlKAshcvQzpaouYtE1PhZqj8/b8qqJ/XiI7Wa0vPEwlvuccwpa8YNshSAJ45gF7aHUMLuVnAlpIQbftgFaWIigwXu/5EujvIn7kC8nLmOr/RlJYILyUfpCkrAcGBzB5wBp6s6x3GXzdQ== 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=TtkocouQTFTPgXp+1BjOXz5ILXZUoo9Pc8T1JgZ0Wmg=; b=oaHEhFF+wOOJNgdGw38X/2C5xSHUAUHXqHprQ61RhaaFLJaOfnpqtsszg3RLz+RzNOYLe+ONUIsjvQjAdJDYKSDI5sga6quePEoi6nogCiU8PIaNqw4HISvoU+ouLYBdNJBE6ieaFxtKc/p+d6t7CXF30VzdX59uFLOOBJBO7lM= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CY8PR10MB6465.namprd10.prod.outlook.com (2603:10b6:930:63::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Tue, 18 Jun 2024 20:48:29 +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.7677.030; Tue, 18 Jun 2024 20:48:29 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v3 14/16] maple_tree: remove node allocations from various write helper functions Date: Tue, 18 Jun 2024 13:47:48 -0700 Message-ID: <20240618204750.79512-15-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618204750.79512-1-sidhartha.kumar@oracle.com> References: <20240618204750.79512-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR03CA0351.namprd03.prod.outlook.com (2603:10b6:a03:39c::26) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|CY8PR10MB6465:EE_ X-MS-Office365-Filtering-Correlation-Id: 020b6d64-cf06-4bca-0568-08dc8fd80254 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|366013|376011|1800799021; X-Microsoft-Antispam-Message-Info: 2pwymMc4WzK9ZCdcv2hOo2xs7uDQOhhLfboWyFh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Ticx7q9akfM6yUDqnK/pqmvT7Sp2BZ0n81rb1X4c7c0VwdP3YIAtq9E9xVRFn/+kbZFrQM6DJp4VTPh5xIDQYyJvdrK/wOckxM5gTltixLwx6yZbUOap62NCmvP9QS0/g3F3TNeew0IhGZAr0hGYdbj0euE3gEswH0ekiS3SiP5l5Xjox9C5tdVifceqoej8ofvzmf+NjD591ThYsGgRqrIHlX8QGRo7/cv1NiS 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:(13230037)(366013)(376011)(1800799021);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AIEA9x7eHs/OCSJ9M13LEaTsfqil1ugIYHVWOLCdQ7DWGcq7cBPa90YkqrrQFD3Pstm9O9W8rkhUW/Vc3vljx95WXs2dfWKpGWl/ayDhIbwZnZ+f/RaNs0XKQ8y8NOB/cgoxny6DFH9CV0OuopYjJUQyt8itidCRXnetHzwQdk3fMdpDDDG8YRA8y+g6eKXUpu9Roxc4eSv46TO+flJ4zRikGxm5MGKk62PVTTOslxAnZ34Z8KYdfL+FN4ackab1SBFBlcrKdKpiJYWnuBMXp1qZxHZMwc0cbFT5sqhgbVtShfDX4899SnY4sVsUNWRBTUuXekNLZ1fs30E4E+ERkJjM/AeTQX2TQBoFxMrd/U7JExB1Zl0vw+dmBRWw3AjPdCtgNj3FeOWYLPU8ufDDlzsMBUTgeQAU7XyFyW+e44Md6nRRNA53Pm4zzAq/BQchxsBkiVZdQp2QU6vNSy/cKv3VunehzKc58Mz4tWsYA4lOljRIQvGTGVzvifqrKLbhxhD+Ta7qY0eVGgESqcUuOxxKwSQu0GcYrE0Zc5GgZ1Vqe4G3MsXZyLdz4wOodxkRZCUHp/mi4Ev55nz228QId3luUAXlSGjq2naLH17J4Aj9ioe2ETuBmKp2Leb6f4mZJD6sfsp8+sZH73ZaYRVJwPVJqYMpWix37SuYfTXR8U7QQckJKNvymBpxTsvM62+pkySr782B5GRI3og8Wn7MO4temXGFY98doLq8J/IR2FKs+yoxHZqz+q6fBCEdzDpPzkNo5WWTWYgaLZCTDjZue7uVSkIIbjByxBXgSfC+0lA5ZQ4L+vR+THLP3h6Lyy2tWaEMp1mFOWmmgzWTQByzVayFUzWrFvehhnl5ggUPd4/nVZlYJNwP6LL/nzugnd0PgGw3fmbaBahb0KN3+zq3JPcE6Bw1uryV7wuf7tInxSYo6kXe/enjRwnqtvF4PLKeMXhVwJT6Rtmxo0vG43SmnKM/t8DLJTjokaN+JLboYEPcCr3qe1/u24Ep0tIodgr3lVjHjst6t6/xzXcZyqDALXVFTCFZ9F2G1yCuL5yrF19vCixnDnTNbx1zP893udNvMCUfMj4YnbMdKkvg0avJeXOVYIRDyPxVUx1Wes8vApqCnTGvP7aN7pCBulyhSbDNrIqvfip5kifgzgfVhBuwCbqP7GioL5Zoo503PYUy9oj+oJnZWR5xyL36v0CtmclXm63E6R0MC59Ek1J6yDWx/6xenyeevDNeIGO5CApFwRaZMbvt8C0oMLEx8H69N5fcxBEYvnYKmfLy8vrUFoyl5uEewBF0RxAWuuBYA++n4r7kCBqtLuSbJYwY9WOyJT/RkSigROykK5Wa6nfX4u5b3oDuQKxV/ffpuAPCTcy7EWuO5oK8+dqKYq2QUYD46fcbPRS4dsO81DSvzzq26U5CZxX5zpIn4LxLU9b6+lSJ75aYrOdVFNXNw3sbblsYAXrNW/O7AbszJZqU506HGNA9cAMtBApgk1mfy4SEVMkRyv5k/ZCr2pWgYuie01jaD5F3EqW2zyqCkFMaZV6qAm7MuwJUiHiERaOBZPFIONwT6aEkchVTLkvtxDegFa7outoywe5xL7O7h6m1+dsh8iVPWF+qu/FNn/9hoBV7Y1roXwg= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: fNYGez856hRm71gqYtD9pUQ2TatF4TwkqVJ59MNXY46glmgKTnXdbCYFQ583IggXIsysRjZYD5QZ489imaYdBW2UDyY6YBsL/MwD6A9mMYvObabFaM/AX7T/3sn5Qyg2JubYmfLQpP/uQT0ZJidN1PaPrkIYt363ybKqpA6YVO/c7OaV9PsIB6lE7jvD2HSiTg0gMATfN35ft8CSm6bDm8449hMv1foWKO/3KGupNFFMhQjmfvaQAXo/Ok43lMUpBU9xy8d8RtRtfW96VfVJLgP8z8IDVP1c1HL1BkvJHXqUFODoHABaRp9U9t53nsxgVfWDpdajT66ECQ6xmcz3vB0J1ctvUnGVby7Ht5AOxesxzyZR1iGB35K8X42faZ0hvMj7Em2o+DIFVF7RPV1t5M/93o+KtYieU8yXDIz5C5P5OENJJs6NH38429flDkEqC7IHw/4a5zdqRgwgbcLP+YNeh91U7HN4OcQEG8MeEVODUofLtIpvw3x8a2n0AoSYSxXqn2Kcdhx31liy3wZMhJ+fo7G9bwh5crv5DL177v/JBoRBO+5mjRR8UnMRid6xP+3qYy8dqscr19p0EUpcAw8KQEyh8p5h2vEwKZLAs0c= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 020b6d64-cf06-4bca-0568-08dc8fd80254 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 20:48:29.6083 (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: NmpESqylId/Pti9x+Wd0LvJesS/XwDkNSLW3gxo9bYD3A7gMSPN0F6LXcVjol61/D3aousE8b9/zNmqfxqvbrmphG/32wUCSZVTykdwHAPs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6465 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-18_04,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406180153 X-Proofpoint-ORIG-GUID: LG-n3IqnHaeHNZ2HbgU6l5uJ_F73b5Ve X-Proofpoint-GUID: LG-n3IqnHaeHNZ2HbgU6l5uJ_F73b5Ve X-Stat-Signature: hfjt7e8pth9mbot3uzyb373pmib61aio X-Rspamd-Queue-Id: 819252000C X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1718746446-403722 X-HE-Meta: U2FsdGVkX1/zfidi2LvqjJinksYMng3mACqVs3I/XB24qoUMRmMKCuSmeP7eXkX0/XIKktt+fqNB57o/4VTz4tXuWlLafgnt02Xc/cIn/t1arQQVvow7htlGdxsw7wQ/Eind82BljcxT6v2cZa+5LJ1pp9zMwmEpdgleGSvgk3304CBYoJw53SlxxDMCsO+CWSWrwEPyoswwSkbFMHtI/quf5bV51u2EAllP7mzGVq2ZqQ1iDmQAKvw2Bd4wJPXBtpvAXLVN0sBIZcpmpM8Yg2p/nmw0Es3/YkPHLYiTJ6lj+GvP6XY4TcW0YvSZfi7TuxiZjQmptwWNOlnn28jze2npW1ir7lZq5SydEBhqlHc0cv+wo86ogx18UgKh1csyq6XB/eDSbch3YR1as0hXV3RE9uFLtCNVJ/vLkYCJbNGuGKdFeDwMEX/xo8DtB4uqGhpJ5yQRzaIScrmahZJ2ebdlhkXCOvNC6dW9G5RwqzOGgwwYZ3SisXAi6ZCnlnMQT9OAvUp0LucukX1sStepjYyAAl2cUvcmtu2s2MmahYv5Gq0gGNczKyIaBH10LGP5dWjGuxUnjzrIVt7kDyPAA4VwqV+TspsCHuLFtg3MMzQzNruaIet1NEv32GiXV2DtiMfifBpC2xxH6d7SD4F0uST+w12OOHGKyhhQbzpvenFGw5Uex+FqrYeHB0n5/KRS4W2qws7xmP98PnqaFzylxpsQpi3qDb9R+y9BEI4X53OJ6aDwhrVTFN1gpusJpvmj84yrFZn8eMVt/rcBiApUmHoQeUBG8Q4VoejSIMq42qAYn8BMbS+5w1t0B9lfSetvDu+UecIWlHNNg2sB2bR5jR/P3m84UIIZz7l1K1ZJYmQ6OhSuYE95tVeaYuCRWSyB1awpHO/e86JWTL0H28QxHv+87zmqkqq6vlSeVBSIpnWTb+OWJyDH95EMykR6INFV8ttqoMzeJgM1tLB1Gau tF3JTl0C mQ+xDaonsrpZr1itsBLFo/S52gCxBnqn5+OfNUvFCq95QqfsN/t05HufFyoiazauVjGvhVjmQdN3zZbN4rw4X6iBJ26K3nGWWQf1+KQXnl98Dt19C3TJb0SqeahZwO2jn7Kepe0PuCtohu9PrY3EU1jHqc78YRLsfbw0YsRlUeapqX3N6hqgQcRYmckA9m7lVzGwvv14pXB7unS1gJRW45gFdLQ5Fc0gfo2kvxBhHLPVaS7ZgKzLwkndskoEdO32otVmc1Q9QmrlRzu79YN6I3ny/4Q6iDRJQR8Uvok4jq7nme7cbN63oL32e0czIg0nkoKoI7ypJzNn26alBUaEirFtXICACArypYD9mmmWLeUXyYlkZj3TWofwNFL+C6EtEyI6DNcKL+y6yHLIj3lk2Dryee08QiN/nxs2hJixf60+LS8bWU244eX8/lLQYCPKr3tSfQ77heaHGawd44LElG2aa6Q== 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 46bdc4ce6662..9ab8a6b6fb0d 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2976,9 +2976,6 @@ static inline int mas_rebalance(struct ma_state *mas, * tries to combine the data in the same way. If one node contains the * entire range of the tree, then that node is used as a new root node. */ - mas_node_count(mas, empty_count * 2 - 1); - if (mas_is_err(mas)) - return 0; mast.orig_l = &l_mas; mast.orig_r = &r_mas; @@ -3029,11 +3026,6 @@ static inline void mas_destroy_rebalance(struct ma_state *mas, unsigned char end /* set up node. */ if (in_rcu) { - /* Allocate for both left and right as well as parent. */ - mas_node_count(mas, 3); - if (mas_is_err(mas)) - return; - newnode = mas_pop_node(mas); } else { newnode = &reuse; @@ -3341,10 +3333,6 @@ static int mas_split(struct ma_state *mas, struct maple_big_node *b_node) trace_ma_op(__func__, mas); mas->depth = mas_mt_height(mas); - /* Allocation failures will happen early. */ - mas_node_count(mas, 1 + mas->depth * 2); - if (mas_is_err(mas)) - return 0; mast.l = &l_mas; mast.r = &r_mas; @@ -3444,10 +3432,6 @@ static noinline_for_kasan int mas_commit_b_node(struct ma_wr_state *wr_mas, if (mas_reuse_node(wr_mas, b_node, end)) goto reuse_node; - mas_node_count(wr_mas->mas, 1); - if (mas_is_err(wr_mas->mas)) - return 0; - b_end = b_node->b_end; new_enode = mas_new_ma_node(wr_mas->mas, b_node); mte_to_node(new_enode)->parent = mte_to_node(old_enode)->parent; @@ -3474,10 +3458,6 @@ static inline int mas_root_expand(struct ma_state *mas, void *entry) unsigned long *pivots; int slot = 0; - mas_node_count(mas, 1); - if (unlikely(mas_is_err(mas))) - return 0; - node = mas_pop_node(mas); pivots = ma_pivots(node, type); slots = ma_slots(node, type); @@ -3746,10 +3726,6 @@ static inline int mas_new_root(struct ma_state *mas, void *entry) goto done; } - mas_node_count(mas, 1); - if (mas_is_err(mas)) - return 0; - node = mas_pop_node(mas); pivots = ma_pivots(node, type); slots = ma_slots(node, type); @@ -3812,9 +3788,6 @@ static noinline int mas_wr_spanning_store(struct ma_wr_state *wr_mas) * entries per level plus a new root. */ height = mas_mt_height(mas); - mas_node_count(mas, 1 + height * 3); - if (mas_is_err(mas)) - return 0; /* * Set up right side. Need to get to the next offset after the spanning @@ -3898,10 +3871,6 @@ static inline bool mas_wr_node_store(struct ma_wr_state *wr_mas, /* set up node. */ if (in_rcu) { - mas_node_count(mas, 1); - if (mas_is_err(mas)) - return false; - newnode = mas_pop_node(mas); } else { memset(&reuse, 0, sizeof(struct maple_node)); From patchwork Tue Jun 18 20:47:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13703030 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 14A00C27C4F for ; Tue, 18 Jun 2024 20:49:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6DA9A8D005D; Tue, 18 Jun 2024 16:48:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5A7148D005A; Tue, 18 Jun 2024 16:48:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C06D8D005D; Tue, 18 Jun 2024 16:48:45 -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 E93168D0056 for ; Tue, 18 Jun 2024 16:48:44 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 989E11C03EA for ; Tue, 18 Jun 2024 20:48:44 +0000 (UTC) X-FDA: 82245198168.21.C3A8E7A Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf22.hostedemail.com (Postfix) with ESMTP id 4639BC0024 for ; Tue, 18 Jun 2024 20:48:41 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=UHQRfxSM; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=gupwCIVs; dmarc=pass (policy=reject) header.from=oracle.com; 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 ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718743715; a=rsa-sha256; cv=pass; b=rsHTv8QqpFd5jul/Pnvd6rBjibyDKCbdONqPz0pUGavsOMZlYxzjD5ZbT3N6B/Mrucm5L6 eG4X0/19EkxN26/T8NFaezZ/WeHjQePrXDbgeNQlEmVBJHPJi7bE1bbwE20C821TCIPhd8 k05e0nv8uH80FXed14b1zxEXkol7520= ARC-Authentication-Results: i=2; imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=UHQRfxSM; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=gupwCIVs; dmarc=pass (policy=reject) header.from=oracle.com; 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 ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718743715; 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=FlmQ+Ohn1bKajxcZtx4NBjWdyayPRi4zWW6jf8dYlsA=; b=h8iVO0dOYpfotqaeu/rT80WKFW4n+BqR3R45syyF2FoXvs92vvyXZifPY9y9FK+81RsaoT i1as0H8wzIltUChHs5rtumx9coCfYh4hREPKBq+xnsuLSrKbmqfksLpG2RC7utOv7PwFgA 6XCSuck8ijTsKKdZ7i3kNM9DZmUl0ls= Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45IIUmOH005328; Tue, 18 Jun 2024 20:48:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=FlmQ+Ohn1bKajxcZtx4NBjWdyayPRi4zWW6jf8dYlsA=; b= UHQRfxSMHAdcM7xaTsFJ9BOdNRQ+4muUkUzkV5N8MyePyiEgB77/8+0+b4S+ySFB gc4Siw7SipxCqg0WU9YFSiS6I4nlwhMnMDL694esfF2xlp4Zkd6oVC1SpGJRNyEX f9vIT3dyUz1dwGyLejX0zjMZYqT4ThfPO0hNIUD38zlKx77FkyvuG6kbt89Fzs+b uCbeFEyMjH5+y1I7GaW+tnhbMSqShTSYP7fOMF3Jrd0teTe1xlnqEzUf4NFmKy9z hz/n0j4hL6V9p9fH++4G3vtH/6eSViYkFSYM/WJbhpuzrUnSXzU2KFCoBCDiMFi/ DCctyVUZS5ygtGVx1CloTA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ys1j05xar-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:35 +0000 (GMT) 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 45IJlTIV034656; Tue, 18 Jun 2024 20:48:34 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ys1dey4ud-8 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aATCMwwDgHu/OgsrESl32IbQ2jJmn+2PPUrc85/6iiZDByp0hW9fzF85I5d49etQ0KlFWe5hfioFRGjVylcE0WpLfEmfuHauX1rPuBdQrgyKe8itlecc1p6CpiiLbDmuI5btz1sYR+jdiOX59+77y7zPEk2Rav3de+WOInVrRQ9Fr9S2da3RpBuibEYFu7utUrq6jgOUg51WfpHyRbt2sgS4aE+XtpIc2nkemZi5x2TJ5x9hDKcUTpaBv+SUM/IwQH8z29uEVCM/zbaHVK9F8r+RcScG4nbtZfZ1mcW8OAUJNwCtnNDWWEkkYodGEmgnVgPcHcFtIiz0cX4kC9+ZYw== 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=FlmQ+Ohn1bKajxcZtx4NBjWdyayPRi4zWW6jf8dYlsA=; b=Pbw5N0JeX2L4T3WludlX+L3dKBVfOJcrtazCa+tJypx1SklG5v/ntlib4mreLAx/FLPRBs6wvekSsKOLBwvpQjw+i8j5v42BtY/VzrB8CaZ2M22r8olYSc4PfYaBaP8bvaPtj47BSj/6p/8gABYzeQJOYGlLmcKtL6o0JYmsJuazgzHT3lqnmEkPMRxd23MIBn4fm15b9cvqvGQGDDDDKNIhfO+/9bPjrpIEMBQtzJJnjRcpcfhUO6yq/tv5o5D4/c8gc+yHADC+4o86zNDsUwvn2FlCVtUyDjcaU5uUV8vuseocYcfqn6nU/aSHVu1oyCuNYoQlgl5USmfWySRT9g== 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=FlmQ+Ohn1bKajxcZtx4NBjWdyayPRi4zWW6jf8dYlsA=; b=gupwCIVsReAS+ZGS2j/k98FKyD7hCauZHqvYa0jfm8/oIVlabJeYYZ5ZEWXZTF/xy8zvz52F+bYVxudeIHU2kqOk/vOgL3C/XkT5TSzFAMkSf5gnZdxkYzIZ0lEvOwsHzmkDEARhEY0wDx97tEBnFY73sQ2Gjd2JeLcuCkFbaKE= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CY8PR10MB6465.namprd10.prod.outlook.com (2603:10b6:930:63::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Tue, 18 Jun 2024 20:48:31 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7677.030; Tue, 18 Jun 2024 20:48:31 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v3 15/16] maple_tree: remove repeated sanity checks from mas_wr_append() Date: Tue, 18 Jun 2024 13:47:49 -0700 Message-ID: <20240618204750.79512-16-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618204750.79512-1-sidhartha.kumar@oracle.com> References: <20240618204750.79512-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR07CA0036.namprd07.prod.outlook.com (2603:10b6:a02:bc::49) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|CY8PR10MB6465:EE_ X-MS-Office365-Filtering-Correlation-Id: f6508bdf-3449-4d6c-a005-08dc8fd803a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|366013|376011|1800799021; X-Microsoft-Antispam-Message-Info: D8Pf4BLa2wCQWcN3o1QAsk5ZpF6gnKPtWWdm/+qtANVejAtCZKI6qJ9VQ7i6BSZgzjR163geHd9UH2zF4T+Hk9FnJqCfqOjm7nmZ+WduNYbp4gb4xHyZyjmlkmyqTDskJNznYLxxKJ3B01EQBL1G0cCmPIiFEWFUF1PFEg6+E+Ti70HM7oajbvRO1DCxaC+0jK5wzkxxJ+RveksvIJA5uZ8Q0XvTVwLu8O6CwjhGY603nDK/a4Yu/05zbzp3qATszptSCshxqnhjgIHd3ybdop7xr3AyKKGFkTDVo85nxipOFFUYlw7O14XvJ+CkAREBenN+vVc1H9HLFaqX9UtN12+0FOvu77PoicbQadjHnfA9ic7AKWcaByaPOR7FMzE6j/FwRsAqVhOXuVbD+WQZPfw1fAEloRChZkQwRMfvIG9bSdHcKgQHn6euPRl5lVlx1TpbA6MqgUUKekniVhwNYWLMqGUHUHRcF7HBQdq1SJo1ieSnCgsdqdhW/dZnwIwQr1g3rvvf5t1UuDDfpZl0GOpMIvFCQNegRolRGDAevsmvsCF2D8RjvRR/bXujS66R/Lgf4MCwWZHNu7BwnJ76sPtwyf1PTlyJQPmIT9dyM57wMQp+L2zzx2Enzb6gbJvqvh+603dQsO97XrtGWox72RZ0nq6qlvm+2rZKjZH7x39VPT6y6lPx70u7U+Vy20hds303gKTJI/ZLGjNenE3geZXhsQhIVGZvNr0mn5mzFOuGXoaNoVbbFaKk106HsnudZwy06Tpcl4kmseZBi8L3a+webjN11vK9plG/8rfDprw+9BqGggJ2PK9UBMF5gB1eWtiPC/TTburN3H2rF5rsiNMssA0dMuqStXskzm9Kkl4LwWNWymr2YjZRIy/yqFd1kjjnTwFDDsxDXjakp1mPvaqBnoalP/6lAn2w1KPY0YG0sB0SIjneQfci1SYpSOv2IQKU7WUsJg2ZWZHwc38lapZ4gGdAcTR6N4wyVz1mqwQLUGp4AorryP+Bua6lqJK43Cap2UKaH2mm10lkPMXh4Fkzx4SwEmtSaCV2houNxl0SCLF+RZtPOFzMMJZ90wblnKk2R/khQkV7omRtEI/EJB6h4cED5xDmryEr7a40MI0q7IEiVSsWr0K1eHJyWN8VCjchYUDoVJNd9tZezcHJPOZ9V4UgdIkoz1UmYA8ebmuGNttAusNVsaFKmpoFN87W8gqqnqCLu6CHtzlqJxn5p4S2fBQ3GP0kjSQCq1PKEcFXVliUQqlqMguQGrByRXmNG6hpjms/fRalHA8tjUJl2Mx49rIE5X+0KXTp6H2DhKs= 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:(13230037)(366013)(376011)(1800799021);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CEi3vc+7NX23qRfYeeIHeDrK1BwsTyx0sR3+PKLATWaFxCps9HAxP7Qcm0oNesM1o0neAOjA7JTaVuvOIU2B/0b8EGXgzrCILP650ILUP8zTe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iFxwGd2Vh5fLpgnf0/ArzlDYSPqvO57VxTHM+jHQD7+NuoUeowe0w0zvZ1XiGQwgEk8lFHH88blp+hxk7Sk33XrRw+Eh/fU4lZ5ErfOFoEalEgohY06u/HcsidPBYyoF/Y3HWns7twudX3wBPjtkd0qWYYy4gmBAW0bYzzrY9BIwtf6DhXMUGRUR+w8t8i09YOZfMV/uqra6/AdhPmFa71h8QPdgfWUNiZAq11zw+nfdIKx7Y4HR0nEomGr5jEcXdhkHzNc8EV0WIRNRTmaimPvykSZvLJx3oOet3Bm3ckd+gl/xyIV5m7v2KDgcvfrBmq8915yQP0U9Na0Rn41lOUevUrQc2grQJGg50mCmH68eorLDmHYb7gVZpfGrO5jL4/vABC+g160WNBp50pfqPc4ftmtD9n4AktQrKVksAJObjS9us= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: WMuL2jyibCM+WiKK5QojurPYR+y6nLLiHcHVA0uQLH0tyVecByHMe5jBRryqzCNw3UxmfVyV10F/+iGlYCks+0mY+Pa1MSg4HryJ4HqgeCpvRTIrre1usbHFyJhmdokpxKv7XyMfcNdzizWEAZH/QUHa14Is7WWB/svXLC9eS3ijLWJ0l4MdOmtC2DxdNrT57LyuUNBUuPXP9MRCm6yqraDMz1C+hmhmhgzu7muLNVIVl5PalxU65tHdP55/D1IYqGpZp8+Lk4h79Pw18mkE/pPogT1c2DFH6tgUL8v+xy5vVeUwCQxrz3A8N97iyvTRiVe4ZDkQhXj0xMIV+TPKXW7YLy52qwODAv7BPDGqgse8cVOqZB4OKSBe56EEwvZvP9htsd611vEFWbjLJsNaEqluNuawo99uHN3DfEiCIdXFz8aqSAvccx3EeQ5GTUYvCGBelxlVVDiTFU2c3iqfu0GWqlhqEKRo6+dZOXus3PpkxRp1+EbQNP3FkooXsy4p5ai5PDTMLqBBpRJThcIj8jp2j80Jhhj9136eyMz9fICpuU+6S8jFvZdcVDlbKHqBdvP9ZLQrMypoS5AqqXF9+M5mjXZMy6410TAIPqnusGY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f6508bdf-3449-4d6c-a005-08dc8fd803a4 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 20:48:31.7656 (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: ugBV+KlxWDAjLpY24zg25xHMZ6DAN1t9FlCmfypCYv1ev+5QtNQ03AYiS1sV83RHb+Yq9KupHphhYH7BJ9uaFFJy6PgDHwB4w9GHU98sY18= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6465 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-18_04,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406180153 X-Proofpoint-GUID: x6O2Iweo3iN4rOlHPQbIbnF_NbsrsNZz X-Proofpoint-ORIG-GUID: x6O2Iweo3iN4rOlHPQbIbnF_NbsrsNZz X-Rspamd-Queue-Id: 4639BC0024 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 7n6h8ru3rtih7ebhze7tn6go67mzsmfq X-HE-Tag: 1718743721-44722 X-HE-Meta: U2FsdGVkX19/gFSJgpuy39T0swec1/krd+GkHhizb/kXYNOORYpoIjfxGkNMlhzMJfKcIu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ZvRoyrqGLsQCEw04463Ioo5WUpgNCQ7XyyimxGUA5bUQhJmPHUtkVeW9hlyymYtJdMLXaeN8d0kRE8Qj7eqkpEtFBgZmj0qjLyIgSyKucy5tIUysh2KTs8tF0AC/wrpFlF3v21AtEuV/unouuzyRge88EumfGgtbeawoWG3IL3By2tXoiie1q6UTOaqPiSydNzTF3dOMl+/Ksg+CDQkFpQFd+kx7/G5qjdcq82t0m7BiGMwo8zErm3vCIzAv6bX4s06iKo0JpnZeQTsBLXxN0C6G6Ct5m4m7hvstyLrPoAQw== 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 9ab8a6b6fb0d..f6a09bb7b291 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4061,17 +4061,9 @@ static inline unsigned char mas_wr_new_end(struct ma_wr_state *wr_mas) static inline bool mas_wr_append(struct ma_wr_state *wr_mas, unsigned char new_end) { - struct ma_state *mas; + struct ma_state *mas = wr_mas->mas; void __rcu **slots; - unsigned char end; - - mas = wr_mas->mas; - if (mt_in_rcu(mas->tree)) - return false; - - end = mas->end; - if (mas->offset != end) - return false; + unsigned char end = mas->end; if (new_end < mt_pivots[wr_mas->type]) { wr_mas->pivots[new_end] = wr_mas->pivots[end]; From patchwork Tue Jun 18 20:47:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13703067 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 AB1A3C2BA15 for ; Tue, 18 Jun 2024 21:29:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B69F28D0061; Tue, 18 Jun 2024 17:29:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AF1AA8D005C; Tue, 18 Jun 2024 17:29:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 91DA88D0061; Tue, 18 Jun 2024 17:29:27 -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 7008C8D005C for ; Tue, 18 Jun 2024 17:29:27 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id E01D5160AC8 for ; Tue, 18 Jun 2024 21:29:26 +0000 (UTC) X-FDA: 82245300732.20.5F19DB1 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf29.hostedemail.com (Postfix) with ESMTP id 92E0D12000F for ; Tue, 18 Jun 2024 21:29:23 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=boYNq4MN; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=uLQ8f45j; dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf29.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; arc=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=1718746155; 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=E0GVOIGhfEZhyYYlOLkhmH0oDChns675y8AWzaIQW3U=; b=Oz1NETNVOBXV94AYNfAIvTV+rwNeJz34PULwHtdOT9wEURbqpTu9Lgalv2uiVc7om/kBOo mYFspxFspyelJAUh7yb+hAgQwGenrzmPAdW7FkbMLe12tnzIYu4rG2CJTfzhk663JoQubr AumyrAdC58QyiSzIb09gDa9YFCbQxFA= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718746155; a=rsa-sha256; cv=pass; b=O8STGzYe5gZf4rXJxrfjXUeC4bqP7u5eloUhUvevY+NjAW2XvkCiDff5aYaI3J3SBL5BCo Cr9cj5PpbdU3rd0W7heYS3VQQdag7aOOjAErAWO98Svaw7pdY77R3w106qDLiXcijte20O mx5f12/PxirdjU3NteaZfjSjeLaYI6E= ARC-Authentication-Results: i=2; imf29.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=boYNq4MN; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=uLQ8f45j; dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf29.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45IIUsVr021513; Tue, 18 Jun 2024 20:48:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=E0GVOIGhfEZhyYYlOLkhmH0oDChns675y8AWzaIQW3U=; b= boYNq4MN2uhY4Wxv5p477CBT375X1xmCCQzh7xnlytMAJOrm87iDI7TKk1grIWWn DDdeqdhgnW/2a6aggswz38uc8wVcYGqX9rg8+m+OJ2BcsqwlfQVcCu/k6VvBSaMn nWXk+5OvcVf1M3c3a+RdLM6oouu1NtzqrgobIhjwUy2/9sMaiBK/yWwumfSfu6PT lhyS1GnIIIl6W9G9rVvrOdvBdziskfZoSMEPDLKlR6QoVtg9tgBnXmMpetvwDSqE SLezYy/AOazsTlcrqQm3gIi+4+Cf+086i+ZWoPDhmqJDpJg6CdI1jX1FC8Ajt7aX 6e53hNYNTPrL/OqiJ7MYYQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ys1cc5u8s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:37 +0000 (GMT) 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 45IJFhpU034903; Tue, 18 Jun 2024 20:48:36 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ys1d8p72s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IPtSW00aNCiIo2uu+SgBzlPNw9tkGGkKV6zTRH6eBUXVQ9kCDRJnR5hJ0GYtxad07ondN8xAtoT1R9Xlw6eDgTlx2ZlJ2JnPSifdA032FNSddwr0ux1dbiRH7e0PiTnou0hhvIjGgN2s3THCNYsVJlJcCBEnmwihRbxTtPb+bu0jbIUyWsVJMrNgaGJYp/YhbX/uf/cq7csK0yFvFnfp0V7bp/L5z0Jvv4LB8W1kWfQJP8OL3FuDuu0JvBEWxwUEoH+wP1PkIueNgY4zmfBAPRxa/bFYrPMdcubhlBgLF+5O949hgnnq2VJ6NQhD+s0UMZk38E5dER725nUDteO4XQ== 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=E0GVOIGhfEZhyYYlOLkhmH0oDChns675y8AWzaIQW3U=; b=JeBpFQrrFhGCAq0wuk6Pmea7nQ6Y0Pbtvq6nJU01fgIfBM76+qIFrtXyDY9PJHTto7qJuTXYF3v1ac671glb/73/hJ5Vd1Jgm6Lrt33aQ8EMyM+5XqFQLSyiYsXwY8kEro37O3E9aqzzqIMk+iX2XHkUMBWQ2e06EMyc5QE1yZOejDwMb6pZWirctedwkfX+tKb6XXSgfx1Bh3dZ4zCv/qt7cRm7D15R1/66UlJA6IeYdVEISs/futnvVP8x5O7qMgzPYZollWqWFN/BjQ3ZoPBTh9gVaOrFPV7LLcdZG1mSNcr+ZQK91B6RK+VzfrSU+02h8c/0ACMCj4Q2oBeaRA== 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=E0GVOIGhfEZhyYYlOLkhmH0oDChns675y8AWzaIQW3U=; b=uLQ8f45jRhTRm3WtxwPCgkQWvNAo4Prc6Wu0GMOpgBuoelt/004RQnK4vO2p6sDfp4668u6kJF8yb91FtJeU73n3fGkF2LIGmI8ziHcnDJVhfD9en3WNnqe+Hbg3mgjlUHKc7QCkUIqrNiLH+44cgMCUqFTjOfpWJOSlJJcSQhw= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CY8PR10MB6465.namprd10.prod.outlook.com (2603:10b6:930:63::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Tue, 18 Jun 2024 20:48:34 +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.7677.030; Tue, 18 Jun 2024 20:48:34 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v3 16/16] maple_tree: remove unneeded mas_wr_walk() in mas_store_prealloc() Date: Tue, 18 Jun 2024 13:47:50 -0700 Message-ID: <20240618204750.79512-17-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618204750.79512-1-sidhartha.kumar@oracle.com> References: <20240618204750.79512-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR02CA0002.namprd02.prod.outlook.com (2603:10b6:a02:ee::15) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|CY8PR10MB6465:EE_ X-MS-Office365-Filtering-Correlation-Id: 3a1111f5-c4ab-4685-7901-08dc8fd80512 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antisp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8Tj0uJhzvophm4QWcpDfL+laKaDDYEXxgb0U3dlOeIGP6FraOTqj8je+AEq5bewu70KCa6cpHJeOmn0tuAQYBBTMaSKHvqHxMfUF75MP9+veqwvsZjrNf2sQCbzTwfzn0/h5eqVImjFtqoaTF11G/JBTmkKPh11WveGMKNUVkXGvL5SUUHIjHoTkYFXxI9na9awpSN376t/fQjGs/i3FwnajMOc27kFq8tQoJTjQo9bT2JNkTQsBam+EVWlkQtH49m5vs4FGv2mfyClkB5Shzjd5k= 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:(13230037)(366013)(376011)(1800799021);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: m7L/IlrfDVgCBKbslpvjaBtV5KvHlN2tQGRL4yXFJIxEdRaj/GRii6kwwU5wT2XtLoR8kpcMAl5puum5sThPX1aFA3rxcqVoqmGYyDtRBkU9POhzsBh9SG4WRbVxSyLC99E+QlGm0QTs4bL7Ukxgc4qdcfMFEplVwzh4IwPjKueKb5wrx7xUZwYH7sy+v5Mgb3/9547IjS4ueOVAocHbmTgNrfWD9EqsqnKnENi8bxfnrIYF6eR4SP71m/ZNQCxhm6j37Lj4pVnKcNJpErQ6n/aSPM7vEazX6adRdBpszahnjdNQOSu7FoKMYlpifUBL25nv1TR5mp89Q+A3RrIqjOK20nM+UWZwZZ+8NBVTtgyigoth4hoznv7KDCtFHELrPwM2rHEbzjz2Z1JVxQsm8LNabRd/mvLLwBfcIqSNQ5+lnuCcPsxSJT+0TXbyiP48i07FzMxi6WtMKdXNgA6mpCQVimiAr0IZNQ+iZL5W6m5AY06W/WjZ59KbcmXvacH9K79+onuI9GFfxu5Zx/71NVYww3+hWmL6+eUOC4kRXUgPBhs1qguNFrYL+9aDblupWPola8KRug3zqZAi41wO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exchange-AntiSpam-ExternalHop-MessageData-0: idJF2EESqEVegcyUv5ELQJ8fl7mLAa6q+Afl21R57Pf4zOUw3qVDeFyHFqPP1PgME3nGa7n5oo0E/gw3RwVXb7pT1JUO5mXO0JoyRcaA+ntLz9tQr+z4Bvaz4rRON4GskZkAtVFqSI4pzOFjv6w7yKiL5ELmG8Cyxh7GB4lnco5Tn7yt1ulnz//e3Ec1OINgekXMaV6ZRd7yNmV6nI13BKkDElXBtH9LszFmjZBcBZDajk/+4a8/mx5RsX5BveTpVieCJxD6y3tSb3l2DESxMNnnBR3mWrVtTiCtZEA59ot/5z6q4bIpxjrXaEXxY/F+g13/1UNbuGCHNVdlUgmDFHujmiPJzulFbi0bSNh2idANzKiDo5bSTZdwKSgoHuDnaJxpAEXqZ1P5RMVwOSmedguoPBhBAC70ryQBRc2NvuLj7WDnzwchDoMS+wvr0lfaOIX7YS44LB0lDe22V5EuGhMWLfKgS6Fb66RX7Xs/ZM8/OjfQ1hDGaIBA3B/1ihBIBIqUkPGr7gUzdSYuB5hgTpO0rgqAgt3uKE3p8oprIhOeB/4fq+lBM6ww4Dd0Hb0NNIjdLFLhG9QAH5+9rHemCOoMs90tTcxBYswX1XmCAZo= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a1111f5-c4ab-4685-7901-08dc8fd80512 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 20:48:34.2050 (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: OPuKw2g3Wcrn/v5DV3A+BeRNOONaNRgLR4d2uH6daNe5qYwSpUlmcK/cBayKQtvgd8HgcPoG/8aSZF/TxbVVE/ATqmBQKZUzU/3i6T9Fb94= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6465 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-18_04,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 malwarescore=0 phishscore=0 spamscore=0 mlxscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406180153 X-Proofpoint-ORIG-GUID: 4K9HPRc4i9ptI9TLJBr2lDursMnWy7Mc X-Proofpoint-GUID: 4K9HPRc4i9ptI9TLJBr2lDursMnWy7Mc X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 92E0D12000F X-Stat-Signature: 8yajzqejxsh9q9ycuwcrnjhsk3w7n3wm X-Rspam-User: X-HE-Tag: 1718746163-955551 X-HE-Meta: U2FsdGVkX1/6SxTxhTQxrEwDbf3Z8Wmm85/8YMLfWXFCoNQUh1YZT7RgwNq3kMlZyr4S/bngL5Svft11FLjKRTd0u7NwhTiBTCMSUGFELaWgQqogqkgwCS7iRHuRk8PN0hAoNNqjHakX8GGVpD06IGvMaLiG9In/Hy79PuHW+ZHcIoKgoZoAuWA9FaOo/ok250VqE45bGWi1SrAoW1WIdXbQPR0H2QAntVkTFJHS+zEf19H5j7iy0VVkJw+BMMgjZs2PuhWjIUgKrDOMTuXuHXeO2Go/L5Xbm1fMnZip/u4v6QHxBwVj2iKw/0yCYKMaMwDxQ4uKo84sITBgkS9Pv7tVjrmmA3Tyxzj/o82NgNI0RFWzdSwOCC208WSJ7ZMNtmGSZUXempUi8KHubAdf5GQAG9KYqETiWt62RyqJpIw7mhIiHsiOohnP7w2bqZ0Hu5VlR/zr5SLcKQa2LBye7BqB7eYRLTKhfrqzEwR0jKn5M/orSr0DIP4t3TqqEFSOVNKtT4LTDIImt+Yz+CLaM9IcdbaMJkUseFVBRaiwrOtpB7xuwL1RLBYzaedbDJPIbuj3RJxAsm6E39qcumY4pOP2/O9HkFJ9JmKUY2byG7yhf2SStoXT/amLoQebZIcan9zDbgvJeSvu+awBHNkPO8zM2YmAQHlKPM0eYl5OkalfVVxPMhJpZ+RLTAURdFbanRVZ1xL0MHQHE97zhJrKi4+WKIcOm4hyKzzKq6A00UreadYhygbbY+fy1FOa2KXSObtFiMGke5r4x0yjVq5Rkj5KF+o6/MnG1FsSnyJ6Utr+/br1LcMmuKCoHE23xMqO2dtSztWFOAMFD1ImV6Yw4trd+UJPFcv5XpppAPxxB6mLog6DXrJaY+wJ8+g1iwxvpAKoxfXpCpz/pyjMOMxD2qKvIMmpDjdfJfjtpJum+kpgX9eYcOE5SLH5fnIGOEIuP60Gc//jxLDcxUrCkYq APeqYn6K MDrfUy/wxzERg0FPCMTfvTQBruYex2lZJ0OZkj6DMqtV/b7S0RgXFFuNBqfnYoOwriYvJP9l4PNBEiDeNhsedMAiGWmDuYAEcQm9G2gwW76nNBMOYgRs3H+xiAZuybkg/HCK06VPxOyynVKTi5KT2jMqmS4F7dRx3j5g2C9cES7CQ18o2ls/Onh7yGkM4bBDyerhjZl2hH0SDq0aoiYKjWoXMCwkJJpZfNIvAbzeZK4+Pkl8e10yq3HJE5mT8hWjzT2I70G7vaaIGY/Wz4aN/0q1ZY+zmGgfTofMIHlFoz4NoooxO6ohQmrya+i7dkX2u/eLv1xURYa5N6QEa49neMV9XxXksPHMrLZmfVQaM6Zl8a9Kd0zy6jRwCw7mgXhzTySszIzOBpIgU/QU+Z+V0xkpuN0aJ9FwP/2s2I43kLrPZB8Q3K8DqRRVrHSmBmZhU7EUt8QTK962+omodr+SGsYYnbw== 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 f6a09bb7b291..634d49e39a02 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4027,9 +4027,6 @@ static inline void mas_wr_end_piv(struct ma_wr_state *wr_mas) wr_mas->end_piv = wr_mas->pivots[wr_mas->offset_end]; else wr_mas->end_piv = wr_mas->mas->max; - - if (!wr_mas->entry) - mas_wr_extend_null(wr_mas); } static inline unsigned char mas_wr_new_end(struct ma_wr_state *wr_mas) @@ -5590,8 +5587,19 @@ 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));