From patchwork Sun Sep 15 01:25:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13804615 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 5E0ABC35FE1 for ; Sun, 15 Sep 2024 01:26:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DF60B6B0083; Sat, 14 Sep 2024 21:26:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D7EA46B0088; Sat, 14 Sep 2024 21:26:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C46D06B0089; Sat, 14 Sep 2024 21:26:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id A8B4E6B0083 for ; Sat, 14 Sep 2024 21:26:04 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 5B58EC1136 for ; Sun, 15 Sep 2024 01:26:04 +0000 (UTC) X-FDA: 82565231448.07.C6C9B1F Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) by imf30.hostedemail.com (Postfix) with ESMTP id 9C8B480013 for ; Sun, 15 Sep 2024 01:26:02 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=g7SHPj80; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf30.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.52 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726363483; a=rsa-sha256; cv=none; b=HBkHv/k1ik+uuviP+Rn/wEWu5olkITvh3J9Oi1Zj/Xa3tCdtI2IeHP9JIdrHaOOye8edUa 5yDK9psFxFcbDmQcvgk588m5Rm+oThsWMBZbJPbuiN0/H98y3zpw6OB5qIZJ6F6BjPFnk/ nNUG5zbGndshA/0LZkV90C/rQ7wSJls= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=g7SHPj80; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf30.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.52 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726363483; 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=LwXzK57KhSWrPIrhtsWNseb3FjKQNSwwcTHophZJya4=; b=3ujAxq1syFSQv+tCXvqCfRcIYFckHIQRoaS4lpcW37nBl5d+pFCwH5fvuvl1qFeCP28bTp bImuYwobfv//Uh1WMSnQZteRPf24/Q52Ofua0PXY5j8Y+zHo5LzimeFJxV/UREv9sg7FLz LsyHVsmjThT1qoC1Ceh8VwYSR/gVKVU= Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5c27067b81aso2410842a12.0 for ; Sat, 14 Sep 2024 18:26:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726363561; x=1726968361; 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=LwXzK57KhSWrPIrhtsWNseb3FjKQNSwwcTHophZJya4=; b=g7SHPj80xmvr2MFbnGnOYoMZBWW7f3Eeti54Ib+9uxemCqZAT8PDRwPF4oLTGIl3yQ E0pedeXnkL+kMnqvWBk/GPLD4qKG0c1WstK9LKdehRlwx0/vgwsxAhbtZRz21RF62pQs mrKLhSrhJhalPYGyEpf5938z6WP6ayCEZUst2a1K6ALJDr5O8ts0a1XEAV+3KVp+ZIaX xOHEo9OwSl6zfGpAMlKToh/oT6/DMtlK2ooMH4iwNOTQbxNxSYubfkiNglMPa2IhpHA8 2D080AigxuPRhHAhTp/GbwJupF5bxWnlVmU2/ASEqFV17tIRLtgcOJbjcI11qssnD7zt a1cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726363561; x=1726968361; 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=LwXzK57KhSWrPIrhtsWNseb3FjKQNSwwcTHophZJya4=; b=nDNEj7MwQvLxOm8ARsmZ9+mL/tozkSahpvrFFc1gdAEwdi22KmtVwaIyfSitywC6og OsOEzmOE2zutfaOl/q1Qav9T9vPAwmQEYfnUGz9hmA5sR3NZJ6Q+AmJ3okP0e1RY0vs5 DJO3oxf2hi+bt0dNvh2dpHhpcLdT+CwdA5ilHxDs9Nj6vT9UY+0ITJnBXTKwCWSvYtiP gJd/Ndy+5oGQRHUjf9KFiLeQa58gCdJKQ1Aa3dE2MTjw114dbZPB5ZKBvrgBLIcaG2Q4 vVEONb3mZuv+1zYP54eBMKMRSdCg7TIHei/eseBBgwBYCN+4cc8cwBefmQ5XZESGP/hY RwBA== X-Forwarded-Encrypted: i=1; AJvYcCVBkAYramdGq7W+6VRioh033ob3MdzlCQ3SpZDi8QQUCx6gPlStR9uJ/fjASQ86iy/WXojsZ1IkCA==@kvack.org X-Gm-Message-State: AOJu0YxHvB/uMKGADssnFO8m1BkmPN0NxUgW61facBq4E1uy20heYv2t NymrwcOLGUlP1E9DHlNyiNb55NxuHeWovHAe/8XjkeleBb+Mu3ij X-Google-Smtp-Source: AGHT+IF9x/OMAHSPbNH3t9z+qUkSfiU5khEV8Ulql6udsiqsWwU+/QHUUPboZOxECaddc+jpX+/J9w== X-Received: by 2002:a05:6402:50c8:b0:5c2:5d97:ec9c with SMTP id 4fb4d7f45d1cf-5c41df9df96mr6931373a12.1.1726363561157; Sat, 14 Sep 2024 18:26:01 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bb568basm1157220a12.37.2024.09.14.18.25.58 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Sep 2024 18:25:59 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org, Liam.Howlett@oracle.com Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, Wei Yang Subject: [PATCH 2/2] maple_tree: not necessary to set pivot 0 before mab_mas_cp() Date: Sun, 15 Sep 2024 01:25:48 +0000 Message-Id: <20240915012548.31724-3-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240915012548.31724-1-richard.weiyang@gmail.com> References: <20240915012548.31724-1-richard.weiyang@gmail.com> X-Rspamd-Queue-Id: 9C8B480013 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: jfjgnhdusadofqi1rhfok6t3agbm9t1q X-HE-Tag: 1726363562-624221 X-HE-Meta: U2FsdGVkX18TThAVh4dQK4PSqvuWCF3tZKktAW56V73/N3fgUomVupXZmyc5+W0iAK+RnH6yNVzdbIzmWVj5n4EPo5Vq0l0lFBs+D6zlUXJAKu9iuiK//YXLOsGirHSbJ7rsqCdemE6ty/jxmqg7g9Rj8gIgtMr1LaJ2dGA2t6NUM8lnskjDP94FezDCvXanTJP7bwz9lXq/Rt3t+XMwvJqA2Nl5l4ncr2ZWTpCl3cFXOwlZyKaZ6kOw1JH+/GQmXYUEkNnJRvvwK5+gzDSEDLMWf0Wlx79tPexo3I7Q6p+tFrJBz40UkDnWultckZnEBc1Da9Q8cABIdMCifu6k5ckFOED9OVgSNPkl2t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ZHeUWv3Wvt4xIh+JUeSC/IN48XF1TJdAh+SGrS2vlZ+pBfT9TdatI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000029, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: mab_mas_cp() at least copy one pivot, which is pivot 0. This means the pivot 0 set by mte_set_pivot() will be overwritten. Just remote this redundant code. Signed-off-by: Wei Yang --- lib/maple_tree.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 31964c5c677a..b02d812e1489 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3174,7 +3174,6 @@ static inline void mast_split_data(struct maple_subtree_state *mast, unsigned char p_slot; mab_mas_cp(mast->bn, 0, split, mast->l, true); - mte_set_pivot(mast->r->node, 0, mast->r->max); mab_mas_cp(mast->bn, split + 1, mast->bn->b_end, mast->r, false); mast->l->offset = mte_parent_slot(mas->node); mast->r->min = mast->l->max + 1;