Message ID | 20241127012753.3393-2-richard.weiyang@gmail.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 9D408D66BA5 for <linux-mm@archiver.kernel.org>; Wed, 27 Nov 2024 01:28:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 135D36B0085; Tue, 26 Nov 2024 20:28:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C0136B0088; Tue, 26 Nov 2024 20:28:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D1C356B0089; Tue, 26 Nov 2024 20:28:33 -0500 (EST) 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 AFBC46B0085 for <linux-mm@kvack.org>; Tue, 26 Nov 2024 20:28:33 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 26534C17EE for <linux-mm@kvack.org>; Wed, 27 Nov 2024 01:28:33 +0000 (UTC) X-FDA: 82830139812.01.AA8114E Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by imf08.hostedemail.com (Postfix) with ESMTP id E2135160006 for <linux-mm@kvack.org>; Wed, 27 Nov 2024 01:28:27 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=im00ST3X; spf=pass (imf08.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.46 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1732670907; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references:dkim-signature; bh=uJkqhet0Mlq7bouP3wPXP5U6Dlrr4d3VEb6rJvN0xTc=; b=0XKM6UTFa6c+QZLkiRIGzJJoVKx7UHtGlkPOhI5x2qAMh4Nf3D1GGmxhqh6sihgku12Vwd du+dwjg0HAps84Sp9cbcmhctnDvJddk8nZyVEcQlWhvKoFENgAo+1w+FHST9cCJB4XmvxB 4rI2854qPI5Z1dGND1prvmHQ9dK0YrU= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=im00ST3X; spf=pass (imf08.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.46 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1732670907; a=rsa-sha256; cv=none; b=6Bnv9zzWM5BE1xIwb/cxy+x3xn8RvP+gx8zvbMynH5PtN9r8wtjkTR1h27mwUs+RkqQB5l ckK00FAKjQeiQhXr3uom8PqE0qePY4e1NFlUTQTpigsMK2DNz5onqiXQG/Tntiu+vAUKhq QGasCBLhR1TeRw6fTums/MKVcrae00M= Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5d0062e9c80so7876790a12.2 for <linux-mm@kvack.org>; Tue, 26 Nov 2024 17:28:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732670910; x=1733275710; darn=kvack.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=uJkqhet0Mlq7bouP3wPXP5U6Dlrr4d3VEb6rJvN0xTc=; b=im00ST3XEulsgCP2ZtBPW9RoZ7EDEZ+fq6gJCmODZKp2JlEu+3LEj7PdQX3azlZN1u DdLgE8cuAdz0OIlgMxPRZg8BkAZkxHaw13eCy10+Ho7h416zjHvydxgR9BjNcosqexdk bG3w5F1gWDhXPEUHFoneH326ly6Gnl9rxAk4pqQPRCWehTqwKXGkxj2O2S32MP1LKNEP wVOWizuyK4TwZA+XD6O45rMeTvSK/YvVaJViFifZtfHCPmtAxn3AzzTb6y9uKjQ3J1TX dSXJMZwcEvEfPV7pJSn0XcF53xnToS3M8CxgIH6QDtaMW7vUHfNi0MGbx6qZuRJzNeJG 7cOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732670910; x=1733275710; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uJkqhet0Mlq7bouP3wPXP5U6Dlrr4d3VEb6rJvN0xTc=; b=KaIsb92nUi3Rhc+dMqe483bnl6KkLcQK2yIg4SBeIavr21+uf6PKEV1jmbjwDmCWPv jONCGF56W2yT9LwwzjPvRUl56lYR0nCmdmI62wsa1KY2UZo52x1PUhzPuTWY0aGtoOpR yC2JklJEKcdG03x0x1YAswXembnaCGLavV+tBL5pJ3TANebVsy2LE4W1Rch8I3vTB2wG Lv8R4GUBSC40bw4RO1ISDmEo4WyTWODEjX3UfixYekabrAkBFrzHs7T0+cBhbkLyGpDG nnBv+WIx6ixH0S9Tli3RrR0i9SF0m7biUuIORK5oJFD1B8cJHZYj5a/q1W4is69/yJvy scKA== X-Forwarded-Encrypted: i=1; AJvYcCWx2yVax5tVwGrtD71t+qvUzAZCK28TTWxDLSvwvOWq8z2jMlAVSl250oQgWeSvUcWqEjzIqJJR2g==@kvack.org X-Gm-Message-State: AOJu0YxIw9VZWbepEGp0UucM2nEhCTcz2PaeI8Yl7iOUUPXokHUFzL7u fHF1DO65nvtCElikvuGZzL+MB6PCzbM8ba+6XXqFR07XNsbWD7nj X-Gm-Gg: ASbGncvbDc/YIQZVfgELGYsVdrWT7+lkR1WdaVwYdA5M4W4EqFFRq1+TaHuQQHCDUsB pLN3miAXrru3RCF+ciOqGoehlq2bIzxqr5ikmGsnjVAmWEipSjfyQ5cXuiJyXSl7GyhLfhIyuk7 BSc+vFklCas5qZ9UpgwE0VxHP1cXJzyQAHu1/TccD5P1J6WOXA9r+kqKHk/Ums4ChmorTtU6IFd zUBOoxFteFbra0+EAqoSBEGvwqE+bru8f5Iayfm9yN+0CqvFQ== X-Google-Smtp-Source: AGHT+IGCDgNdAkXiwwZr/isH9AIHOfJu1Ag94VrBy18uPUsvMK4UXxF/aUgCdoFgErCRouDYtkdlNg== X-Received: by 2002:a17:906:1db1:b0:aa5:479b:3d25 with SMTP id a640c23a62f3a-aa581062a7emr62038666b.51.1732670909729; Tue, 26 Nov 2024 17:28:29 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa54a4c06a0sm370685466b.58.2024.11.26.17.28.26 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Nov 2024 17:28:28 -0800 (PST) From: Wei Yang <richard.weiyang@gmail.com> To: akpm@linux-foundation.org, Liam.Howlett@oracle.com Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, Wei Yang <richard.weiyang@gmail.com>, "Liam R . Howlett" <Liam.Howlett@Oracle.com>, Sidhartha Kumar <sidhartha.kumar@oracle.com>, Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Subject: [PATCH 1/7] maple_tree: not necessary to check ahead if !content Date: Wed, 27 Nov 2024 01:27:47 +0000 Message-Id: <20241127012753.3393-2-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20241127012753.3393-1-richard.weiyang@gmail.com> References: <20241127012753.3393-1-richard.weiyang@gmail.com> X-Rspamd-Queue-Id: E2135160006 X-Rspamd-Server: rspam12 X-Stat-Signature: 1y514oxx76gc6pkoc78dn8ehcympu78o X-Rspam-User: X-H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ysYqdVxTxQXOtdbfN9FdkMPFIY1hSOsMG0Mebz1tYB+C8D9HCc+G/9ig7A9kAVQu1jC7FAjGToJysDHwoBbRK3ZS2q1Dl6diG/z+QAeMylAoVr2q5UcbyfXCQmpI+UBj3eU3mxsK9ZYBku9LjZLDhkWVCkcRlutlqsBEhT/OpcjdLEz0uJBI27mBroUHLf34IUl65XiwycPufGnGmEb7gO8bRQRTHrx+PmAomOiApDsS+y9r4Al4afGiXSf8alKE/MVsp7gonPW4Df4ZDoDIpZ0S42D6pFoI5gPJSeXQ7ZUT2VoG9P8ra7iJ4EKmuGEgu+QOy0COkt6kcuwz2nyaoAfJWApKuEFmzmiSgzdsXtYGLMl2vMMgBFrSQprnndfXuEL+AvRbaDqdJKkWRvi8rCVJmW7Qa8FL+diLz0J5/MRu/Nn65JwoQkS/gY3xfwpLRx4Gk3oX4jM83lob8XizNlkT+I/LZXftqnQkiSsXONQ= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000026, 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 |
spanning write related cleanup
|
expand
|
diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 7efb1520f9bd..98692704d773 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3568,18 +3568,20 @@ static inline void mas_extend_spanning_null(struct ma_wr_state *l_wr_mas, unsigned char l_slot; l_slot = l_mas->offset; - if (!l_wr_mas->content) + if (!l_wr_mas->content) { + /* If this one is null, the next and prev are not */ l_mas->index = l_wr_mas->r_min; + } else { + if ((l_mas->index == l_wr_mas->r_min) && + (l_slot && + !mas_slot_locked(l_mas, l_wr_mas->slots, l_slot - 1))) { + if (l_slot > 1) + l_mas->index = l_wr_mas->pivots[l_slot - 2] + 1; + else + l_mas->index = l_mas->min; - if ((l_mas->index == l_wr_mas->r_min) && - (l_slot && - !mas_slot_locked(l_mas, l_wr_mas->slots, l_slot - 1))) { - if (l_slot > 1) - l_mas->index = l_wr_mas->pivots[l_slot - 2] + 1; - else - l_mas->index = l_mas->min; - - l_mas->offset = l_slot - 1; + l_mas->offset = l_slot - 1; + } } if (!r_wr_mas->content) {
Just like mas_wr_extend_null(), only when content is not NULL, we may have a NULL slot ahead. So we can wrap it in an else. Signed-off-by: Wei Yang <richard.weiyang@gmail.com> CC: Liam R. Howlett <Liam.Howlett@Oracle.com> CC: Sidhartha Kumar <sidhartha.kumar@oracle.com> CC: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> --- lib/maple_tree.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)