From patchwork Mon Oct 9 20:16:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13414398 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 40D9ACD612F for ; Mon, 9 Oct 2023 20:17:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9D6F58D0088; Mon, 9 Oct 2023 16:17:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9621B8D0003; Mon, 9 Oct 2023 16:17:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 73EFE8D0088; Mon, 9 Oct 2023 16:17:16 -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 650C78D0003 for ; Mon, 9 Oct 2023 16:17:16 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 3879B1403BE for ; Mon, 9 Oct 2023 20:17:16 +0000 (UTC) X-FDA: 81327032472.26.758F92F Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf30.hostedemail.com (Postfix) with ESMTP id D39E78001A for ; Mon, 9 Oct 2023 20:17:12 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=ujT23XKE; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=TdLjyEH2; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf30.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1696882633; 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=4H5BtvqSc+0mOYg98doViY1SX0bCxITXGEXdoB6sLAM=; b=RkxWrINodLb3TmU4wg7DpLnclervzWJz1iz3dPvwjHINXl9JStsd0Ue4OlQ1hLEtQFkzrs jiXu/zuq5t+tx36txD98vRl7I+m0S+J+jueTDu0RMV4bi8txggScs9pXjU1BK63Bbo5AaG Vn6DFGnko3EwejcwWfZ7YpLIYuvZdfQ= ARC-Authentication-Results: i=2; imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=ujT23XKE; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=TdLjyEH2; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf30.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1696882633; a=rsa-sha256; cv=pass; b=kZlyxQmN5/KVC7+X0QUhl1PjsxptFfGf6wGu5d3aHIbkDYkqh5UaRARcMIsnqfYq4zTgxY 3jvHNx0Ux/rsRCyKwpdT1GUOQcQ6ydxeMrMHbt/lhmD9QbiVtexScDqnv+Cx5Q5zwUyCfV to+MbZJIj5hpS+9Nl5q+L40fl4HdGk4= Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 399EXxfB014979; Mon, 9 Oct 2023 20:16:55 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-03-30; bh=4H5BtvqSc+0mOYg98doViY1SX0bCxITXGEXdoB6sLAM=; b=ujT23XKEa4nsStIg2waYnxP8CJbixv4PuMHqKhSQjZ2SsHsNWevgZVFPsaLtXMvaMBrO 0DCoKZNKOGhdXMPXtsP+9G9+wCsyL7DEoYozcKx6AyiEqnnRYEdkgnegy/bQ/WvLfiP5 78KvcIm19SbtD1/oieSlenAg2q0j8+FWK2Q68DRMuuE0iC9WdD5cwKUMOMMc+2hY5xi3 Tt4KvUNsqBRLkHRYHjqC0bEgTEMdmGW0+zBWL8En+NzY1kqV3FXC3sxoCoiKxfmcZar9 1FTrlvOLC+t8b+zy61np8EklQOYxKXnpOLNxYJ0bqNf0MYftriAYoMxd+eQZwbMwV7UI lQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3tjx43kmbg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 09 Oct 2023 20:16:54 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 399JV8q5032145; Mon, 9 Oct 2023 20:16:54 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3tmfhntnbp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 09 Oct 2023 20:16:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iH00Lwo+wX++A266L4wV3K3CXPgllYZ7hWgP6UswUMJJHt/4sQ9zDlrK2G+o5tynaYRWH+UyElx17rUS1iU7slC3+kh4qdUifcuhsfbgkV5OIb6E7KeGKCqzi4owaTo2J9FnSAqnclo2U0T3aeQOBLFlxyHWGGFIhAKeDgLvRqtfKDZvQO/0yjSt/jCIAh73pQVhdVHT0TXApFU1ZwFofUNZvmjrG/I9RP6NI1jKldgDA3VdiMBGE+j6HFjjmPZ8CohaZZ/Z6ZHiZQwGOyEFDNhxbL8UgirM+0zw/MFF6koiDPzD1MvmPuhPvctT0nrT3pxtjXvbvgNizDh1tuLNcA== 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=4H5BtvqSc+0mOYg98doViY1SX0bCxITXGEXdoB6sLAM=; b=fMD707e2ZFbunYtQmMVJVw6l5F+IuQAgOCBuDrgIpc4nD6Q0PaFu/VKWd3H5d51JhSOvopFiC+sQRqnbjmBuxdfStZz9HEu1ddt9IXmE8qtzVnlHvkEIwgPorAuJFW7pZG3NdZwfL8XcKGSumX2RcnjjI/t0xMgTVCNBFceznLUEHCThbsl0hGZPQQ88SWZ5Lum9Q5d/aO0GuHpxIXZnyZ/oeXgdvFmMWjC6BHn0qWv2m4owAZ0CruNuCOB/ZDisyXfirriy7acBpC+n/8HysgF2luJr2tVnYSnoHv63db1e8r7JRuk74Wg3QechjCcR16zU++9t2YMX7/IoMmuIpw== 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=4H5BtvqSc+0mOYg98doViY1SX0bCxITXGEXdoB6sLAM=; b=TdLjyEH2KpbTeQX+VNaECaT5c16v8t/fcjb5HqUnKpZ25qFWFliTpf/L0JsSD+9zkxNSOSdFo+sCkgHicBKNQs8LbKlc2ECL5UDg8hdKo7+57dLo88ItsjrLUqu9n7gquEnv8NTeGVifG8fComXkD7lr0uMYBz932DF7b52v5Mw= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SA3PR10MB6998.namprd10.prod.outlook.com (2603:10b6:806:31c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.35; Mon, 9 Oct 2023 20:16:52 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::e391:f2a1:a9d:967d]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::e391:f2a1:a9d:967d%6]) with mapi id 15.20.6863.032; Mon, 9 Oct 2023 20:16:52 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org Cc: akpm@linux-foundation.org, willy@infradead.org, liam.howlett@oracle.com, zhangpeng.00@bytedance.com, Sidhartha Kumar Subject: [PATCH 2/3] maple_tree: use preallocations in mas_store_gfp() Date: Mon, 9 Oct 2023 13:16:38 -0700 Message-ID: <20231009201639.920512-3-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009201639.920512-1-sidhartha.kumar@oracle.com> References: <20231009201639.920512-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BY5PR04CA0021.namprd04.prod.outlook.com (2603:10b6:a03:1d0::31) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SA3PR10MB6998:EE_ X-MS-Office365-Filtering-Correlation-Id: 2de33596-c95f-406b-19d1-08dbc904accf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M2P9cZnWrh8m/33tYCndTboE7nyH7P8HMx9DM0cVuHPui/3vpkP/a2CXGxUmsPZN/6UeHLbQjc/kRQ10q6ZbmFW1Oc578Rp9doohqUKAyIMAQATwrfkPKu6S9EHLQRYx/TPLTAlSH/YVPLfXITpGxAsffVQ039SKAz5ZvlXBSYAkyl2mYIlKLXgja1EJjRp2na2OCi8KuvdScikmysKo3CH3mcEywek4yNz00hR7f2bt8SrnQzObHjJQImkbVyYs2aQztJ988awdnsRV9nsNvqSR9wTbkL28n3yyZnimvE+fIwZGmhttJ4N4oDhK5v83SbXZy2+7rt1FK6Wv4Ut+SHD2hqwNQ9ViryQ0pioFMwnpblGuJiw/tedrkbRqw3DZMaaknyHB0lAhWNvanw3InLp2kpA8cbyrf35T8Q6Hk59f7MZzo1f402a72NL8QyQ0opLf4bQFE++oyxrTB0IMNfk3bpbtPKSPd0gXw2U1zOsydmNy3v1TElK43dq+YmRmiV5XWijIgOcNgdUYfQh1AnqTjpvHaw9HIWICmpkOsQpZdRaaxUvvwVy9Y5Gtk2CF X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(136003)(39860400002)(376002)(346002)(396003)(230922051799003)(1800799009)(451199024)(64100799003)(186009)(86362001)(38100700002)(36756003)(6486002)(6512007)(2906002)(6666004)(478600001)(8936002)(44832011)(5660300002)(41300700001)(8676002)(6506007)(4326008)(107886003)(83380400001)(2616005)(1076003)(66946007)(66556008)(66476007)(316002);DIR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7LQSBQYTAfnY8eG2WAbGTxnc7AawMLBlhg1PFmTEXYx2rxgTmLrkrvqDYRb95tA3ATH3HOcQovyY733nK3ppDEAXRLVEfqfhO78TdLqGJIoGpJNYPSJSai87rptzYvKUUG/cg38oLqlgjpQ2CDSoIj5ByEzU3fj3a41U99Nu5T8V6qsF+SfT+5dkcxY4/FV+qCjo2ZdpuUgJDMDFMeyT/QUobwJDl4Fw4x1ye2FWIIyr/Vq/JbKpQKa81zrBBpZSVa04JXDNwDp54YsovIPBzX6M3g5l43+Xbauw09F2hiVUnvGXu/PkQDfw+a8pgULvUYmtm3ZjeygrwvVME7PpBjMa+FVP047bHTsezntwKIRliR82TyiMeeoLh3RksQ/I18hbMhwXo8cveC6fimAL4qvCSaaZRzN7NG7ouA0/BZhX7kR9o2fsU/nIUJI3CAMljKeJqDHgjSjieqtJ9roj2CI+4pIvXi95SWFnAiFeMyt6Pok7tMB3GKD6hD/qLRq3Tgibw+Z8lpFhSk5uNHtYHRZ/V14DJaj7I3UDVHd9PcPx8g0+g4QKRe19U2e3FPnoF6CvJuwgNrS7AGkdRg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2de33596-c95f-406b-19d1-08dbc904accf X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 20:16:52.0423 (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: znOV2H6GjDyY0wwOtwwh6BmvzYZdzEYKiATTmdXiw/tfSZ5aS8Vtqpwu6ubu85gb/EC0XqvFLsiyGprtXvpISkf+8vcoIES60Hljveo1Ab0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR10MB6998 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-09_18,2023-10-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 adultscore=0 phishscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310090163 X-Proofpoint-ORIG-GUID: kf9SUGuqoWXaUrzWB7HsuGtKv3iwpWjE X-Proofpoint-GUID: kf9SUGuqoWXaUrzWB7HsuGtKv3iwpWjE X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: D39E78001A X-Stat-Signature: mfxhfuespmsxuetepng7adaxj6q6gayr X-Rspam-User: X-HE-Tag: 1696882632-731828 X-HE-Meta: U2FsdGVkX1+ungjUK1VWiCwJvVsQ6j2cKbtqwUssR7on1Hg9T2DyvX+y/ChnuNI8C68IoTIB2oXUznjmifkP9+ZhgYUlmHPdGGOvsJuz7VrmBnl5JOKjaExCUHyoQsHwr5jL27Emd/ezdYvdtL7sZXammac2sUryXDRuCt0tzUhD8TM3wiBno45wv5M3GdDgO16HxVST/gwekKfsyPvZg6ogALxxRh/seNw5QcOqKIZVEjU3aluackUML59tCCI6rhPs8QrmxlIu7lLMkfJ7PMYvosA3nObZPoDgMLGm2ZyZsd70z79u3Mzo0wC+Bn28dT3Mi/Bb5ysQnn3nbuGwvqKpwF7AwYhpmIv4v9lGh6lATxzuOQyC2LVahUfKSCSjd5CQrKQ3PS2gU2hGRgGOA/maUYn5l/1cDCC9zezPe64ekZXOoWhCoC5Oxa/ofFDog+C8CnceejFynmvnk5IlOXoWKLpTH5BEhDIlGcSlzTcH6DW69JE40YPbVnSga04pICJTTOhox9dLKK0n3X/dO2Gnw2Njh76vqGW5ccTZkkVSxQdrAAqBzaKCsaJza/+VCWKadroOiZmSVt1hyv6oVvxADi2bigVhpGinqGHcf4obxvR6ktSdt7qDW65HZmj9fU8i8uq62zJLHp3eb0qA3CGQMCtHX+90XbKvLtvAP7cmSdypDYvwg0phqhpDIiiv12LEK8DNseSbBntBdQ+5mr1r4FOJx44tS+E+cEB6ymBvVxhHJ8L9WUSL6Ml74EjZ+gRUms2MwkcE4dwdSlOqzbPYnVo3vPZn5qqS0caW0tTFj5+f1XhH8yFMod7zhLOCEhXRUx132qW7T8Wl9rvA0CJmNtvTJiVHG5PMXUe8GBCurmbrrEwq7IgVkwHojdTM3feYSUXJri0WEfM2Oz34ouaySNgl6Zm1fexuidaqbwdBUgYf9rNv3WpwxJ2SHzogBjbXUf2bezyA33zB8c8 k+xHd7kV wvZLi1uaqs/IHgZ+uRAHWTcwFpBdmxPvYR2TpFKcPCf+KgmrVHDx/eAiCgv3qMr1C8gplqTeDSOifXX12L6Z45+7ywznYO/phRsaK4gosW12ksKfyy1z2wGVttdY5Vc5eTnWjMx/6/77wAWtaXNMAfIe2uVmNXhSGR+lmxnyQLbKhZ96lUjHraj4o8DGrVVR53BV4c0paMUTew99Q0fjG75wxJxWFGjV+3VLlhRnlPoZOEAz9eMAnNQnmohgkaPVqTNnwXjpb2QhAnnJ0/zdjwBloJGdDiJ8jEP5MapQpNTSUPezDNv6mRUrggqENyzj4jLYXq72q1tA4zVlsFY/7E0As6Xvmu/yR63ioMfjQxSAqznsqsSfjxRnrg/3awbo6CGkn89Rcqbbv8K5tCB41vEVrl9eLgclWB3LkATMKsXPHoi4bYMFRaR0H9JHjw7OIheDQikL2q5rxoBmhwrKnD5MTQA== 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: Preallocate maple nodes before call to mas_wr_store_entry(). If a new node is not needed, go directly to mas_wr_store_entry(), otherwise allocate the needed nodes and set the MA_STATE_PREALLOC flag. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index e239197a57fc..25ae66e585f4 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5478,17 +5478,33 @@ int mas_prealloc_calc(struct ma_wr_state *wr_mas) int mas_store_gfp(struct ma_state *mas, void *entry, gfp_t gfp) { MA_WR_STATE(wr_mas, mas, entry); + int request; mas_wr_store_setup(&wr_mas); - trace_ma_write(__func__, mas, 0, entry); -retry: + wr_mas.content = mas_start(mas); + + request = mas_prealloc_calc(&wr_mas); + if (!request) + goto store_entry; + + mas_node_count_gfp(mas, request, gfp); + if (unlikely(mas_is_err(mas))) { + mas_set_alloc_req(mas, 0); + mas_destroy(mas); + mas_reset(mas); + return xa_err(mas->node); + } + mas->mas_flags |= MA_STATE_PREALLOC; + +store_entry: mas_wr_store_entry(&wr_mas); if (unlikely(mas_nomem(mas, gfp))) - goto retry; + goto store_entry; if (unlikely(mas_is_err(mas))) return xa_err(mas->node); + trace_ma_write(__func__, mas, 0, entry); return 0; } EXPORT_SYMBOL_GPL(mas_store_gfp);