Message ID | 20240814161944.55347-3-sidhartha.kumar@oracle.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 EB7D2C52D7B for <linux-mm@archiver.kernel.org>; Wed, 14 Aug 2024 16:20:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 15D4B6B0088; Wed, 14 Aug 2024 12:20:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E60C6B0098; Wed, 14 Aug 2024 12:20:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D93AD6B009C; Wed, 14 Aug 2024 12:20:06 -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 AA6E06B0088 for <linux-mm@kvack.org>; Wed, 14 Aug 2024 12:20:06 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B374DA7D24 for <linux-mm@kvack.org>; Wed, 14 Aug 2024 16:20:05 +0000 (UTC) X-FDA: 82451362770.13.04F9709 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf11.hostedemail.com (Postfix) with ESMTP id 5C27540020 for <linux-mm@kvack.org>; Wed, 14 Aug 2024 16:20:02 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=UQ8J287A; spf=pass (imf11.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723652332; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=NhGg+QKJ9Cb1suH4rctcJIF6xt0s6tIqw024945p4eA=; b=GxVdyPOmeFE2g4Ql1K7aq0JMsG63lx8bs2rhyLJVcz7QDMXW6jeceP25hSfKd2aPQYUi1F u8cpDaBuGbugFsyRIdHsZq+GWp7nnYC7uyBafkVCfEcyKqm6nO7EJ0fpn5OiFN1uap988Y 3PcSlUsX6PEoSzpKaA/+WEGinwBcFJA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723652332; a=rsa-sha256; cv=none; b=mfZMwdJY21fBbhyorYbp00yORcsqnpxv335QQbXzdboct4QbiLjNFMpkm1ZAKtDVUVvkG8 /eUiwoUFCIcjKpCpoe3QfrzOi/mJTR9Cm34bLomDLHo867WwetySltigbmtRbIKV3F7Pnm 09M4wb53Xomg9ybTlSBeSVrJ4NWcdLk= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=UQ8J287A; spf=pass (imf11.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com 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 47EBtalC006074; Wed, 14 Aug 2024 16:19:51 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 :mime-version:content-transfer-encoding; s=corp-2023-11-20; bh=N hGg+QKJ9Cb1suH4rctcJIF6xt0s6tIqw024945p4eA=; b=UQ8J287A/AK9Npdca Ov+rZCRM4dgCcSXUfpGm84RWxkYYxYYssKGns1NKr0ItzsbSHF9lmwirr5VKyniI /M9TmqrVfy0o2Ob6Dt5iJWyqJeNG4E2ZDP9llT7HdyCQW4PLQa6e98BGt9dGeNXd TwXAydt/g2mH8i83e3bAWTk6kJ9wdkly+O1de+NUhgO/HqLHDFDznLwgP6F2MnZU xDeq/iBA722OU93t7r0P4LL755kLaIzODQv6CXdPfZkn1AD3hywkAhC9gwqoP66n KjdnC2YpA5Z1eACJvqvyvaDpgBWSvFncIGOOTS4tb6mYbZXHErW98wNaOmgdPFfj r5OXg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40wy4bguaq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Aug 2024 16:19:51 +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 47EFoG8V021115; Wed, 14 Aug 2024 16:19:50 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 40wxngn7k0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Aug 2024 16:19:49 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 47EGIvC0035951; Wed, 14 Aug 2024 16:19:49 GMT Received: from sidkumar-mac.us.oracle.com (dhcp-10-65-174-212.vpn.oracle.com [10.65.174.212]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 40wxngn7gt-3; Wed, 14 Aug 2024 16:19:49 +0000 From: Sidhartha Kumar <sidhartha.kumar@oracle.com> 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, surenb@google.com, Sidhartha Kumar <sidhartha.kumar@oracle.com> Subject: [PATCH v4 02/17] maple_tree: introduce mas_wr_prealloc_setup() Date: Wed, 14 Aug 2024 12:19:29 -0400 Message-ID: <20240814161944.55347-3-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240814161944.55347-1-sidhartha.kumar@oracle.com> References: <20240814161944.55347-1-sidhartha.kumar@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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-08-14_12,2024-08-13_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 bulkscore=0 phishscore=0 malwarescore=0 suspectscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408140111 X-Proofpoint-GUID: XJ_CCdNwqMeWJj7i_OdRelDsnSBxqvoX X-Proofpoint-ORIG-GUID: XJ_CCdNwqMeWJj7i_OdRelDsnSBxqvoX X-Rspamd-Queue-Id: 5C27540020 X-Stat-Signature: coq935xeodnzcbc1yb3d9nmwtepw967m X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1723652402-711101 X-HE-Meta: U2FsdGVkX19LrXWbg1OTp574hl+fLgQerTg7428Y6JbBeUHZe8RYZTG54JZTlTvmZv5zpoNbYlE5iitGrFZ9yWFwaSxtjeAft4ZXb0zZcEP+MEShUdEbolSPeuBz+4s8IK+UYvngIbGV/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fTvhb9KPZbSA6TUCZ++mtoQ2Jt9QZTm+alCUj2FZ4= 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Introduce a store type enum for the Maple tree
|
expand
|
diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 884e2d130876..407c0be6e42f 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 */ /** @@ -5509,8 +5516,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;
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 <sidhartha.kumar@oracle.com> --- lib/maple_tree.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)