Message ID | 20240814161944.55347-16-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 D1C68C52D7B for <linux-mm@archiver.kernel.org>; Wed, 14 Aug 2024 16:20:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3575C6B00A5; Wed, 14 Aug 2024 12:20:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 330756B00A7; Wed, 14 Aug 2024 12:20:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1A7C66B00A8; Wed, 14 Aug 2024 12:20:13 -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 EF2D66B00A5 for <linux-mm@kvack.org>; Wed, 14 Aug 2024 12:20:12 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9258B1410A0 for <linux-mm@kvack.org>; Wed, 14 Aug 2024 16:20:11 +0000 (UTC) X-FDA: 82451363022.30.E98D72D Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf09.hostedemail.com (Postfix) with ESMTP id D36E714003D for <linux-mm@kvack.org>; Wed, 14 Aug 2024 16:20:08 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=loFM2EoE; dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf09.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723652355; a=rsa-sha256; cv=none; b=wGaSwhZ9H6xTCOw5g4gHA60RwWkeS3xy5i7t08VG2bpxf7woGcgSC+oY6cHTHKjj9mZolJ /OsX0XOFy9nCTIqMlA5Us87kHJeIhJUepYf+tDyzlqLyIDhdJWw4BXxVPGYLQ2ZGq9WmRu ozMpBXmt6HaQbGhwcHsNSTM3aS7oFIY= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=loFM2EoE; dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf09.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723652355; 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=ojgvkVfomFPmyla9upDrqtBp4pUg5X73oMV30GnXzGs=; b=YFUXRQoMLLDuRHlwxyT9h2452kWaEz8T+tsUTI/b8vUk2PQtfFK6lgdwHkdxejOI/5BAz9 NmIxt8nyGJ7PutcQmH3UHbc8GVOxAJJGwr19Duz1DiZxcISxThOpyrayK/wRPdHFF7RDuy 19CQ0YQquFxfEQJ2VIsWp7QHPtzl5II= 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 47EBtcB3006144; Wed, 14 Aug 2024 16:20:01 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=o jgvkVfomFPmyla9upDrqtBp4pUg5X73oMV30GnXzGs=; b=loFM2EoEus7A6VxsC HhRGiBXieoRciWl2FxqxJ4XUp7WSIQycNsvNGmTK4bhzG6AdaBKnk/nI4v+n8L0f r7W/rvkzpHrzdT98NoK1n2mLH6BqkAExXFs/1GkoVTYLLAdjYLP3ISHPG7Q6bhR8 uR+X2CUTjoH3Wj8JwAXdqNgbeMh3FY23COdEts49GVtrHJIgaDkkWbTmyHdWOMRD PtoC4h0zXzvQQy9IXxqvsolqBM640uka4DMP+GmZPBjd/kQ3iA4cLiqibR+4mxci YJmQ7N3zrNp5lk/0Lu7cfLFvWDkI7xc+yGSfevZIMNVGqVKzTLuTquzzn9CBQ9SW tu3zQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40wy4bguba-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Aug 2024 16:20:00 +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 47EG72um021274; Wed, 14 Aug 2024 16:19:59 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 40wxngn7ts-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Aug 2024 16:19:59 +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 47EGIvCQ035951; Wed, 14 Aug 2024 16:19:59 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-16; Wed, 14 Aug 2024 16:19:59 +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 15/17] maple_tree: remove repeated sanity checks from write helper functions Date: Wed, 14 Aug 2024 12:19:42 -0400 Message-ID: <20240814161944.55347-16-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: ZCBd3Df6Kl7Nj28ZCgCzu7Yk76nJyfKX X-Proofpoint-ORIG-GUID: ZCBd3Df6Kl7Nj28ZCgCzu7Yk76nJyfKX X-Rspamd-Queue-Id: D36E714003D X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 9jc5hrttqx9e9dgzj9i4kwt6wgnnryru X-HE-Tag: 1723652408-554952 X-HE-Meta: U2FsdGVkX188vhZvD/fJJLT2/gPcbuENMWIY9fEjaOe7G2mm1HrYQrCKgACGZbDlrJFUBBci3htSmg/L1RmTM/TEsTVNWxswaIzU4zCYL9oRelR+b4POk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q4TRFMxywTfiOwdXzqm88/PKckPMBpb0b66f5g1D95iMcvsfqTXi3/B0= 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 5f79be184377..8c1a1a483395 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3816,11 +3816,6 @@ static inline bool mas_wr_node_store(struct ma_wr_state *wr_mas, unsigned char copy_size, node_pivots = mt_pivots[wr_mas->type]; bool in_rcu = mt_in_rcu(mas->tree); - /* Check if there is enough data. The room is enough. */ - if (!mte_is_root(mas->node) && (new_end < mt_min_slots[wr_mas->type]) && - !(mas->mas_flags & MA_STATE_BULK)) - return false; - if (mas->last == wr_mas->end_piv) offset_end++; /* don't copy this offset */ else if (unlikely(wr_mas->r_max == ULONG_MAX)) @@ -4018,17 +4013,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];
These sanity checks are now redundant as they are already checked in mas_wr_store_type(). We can remove them from mas_wr_append() and mas_wr_node_store(). Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com> --- lib/maple_tree.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-)