Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6800672rwr; Tue, 25 Apr 2023 04:08:03 -0700 (PDT) X-Google-Smtp-Source: AKy350Y3GtE0LgWoYhzrxYKjxOpOcWCcSj2xdi3lv5hffPb4iyJTB7oxPiH179/rmP14r3SJN8kF X-Received: by 2002:a17:903:18d:b0:1a9:6bd4:236a with SMTP id z13-20020a170903018d00b001a96bd4236amr11399874plg.69.1682420883160; Tue, 25 Apr 2023 04:08:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682420883; cv=none; d=google.com; s=arc-20160816; b=v4k7iXZooR3hHYB++jlDwf1NHOi+XvqWjyxup68yuYiOxCObZfTOH49zd23l6ZqMIt bQqSwR3JRycFyij9SVp18QZrX7UCUM142sol5UwbOKB9BdQs/KkkYmNj3S032FUo49kN wFYJkX4KpTJACLV/FfIhnKRi20Qmw5DqWtyYtMDfZEHG6kmwovjwOrA1KcrczUxm9fzb BAS1v747qUHsKO8iYJI8Z7iEQCroPCfAlFo1+pknG76DHAn9eFheHUbie+CD5hnQfK/D QQ1CkT4JEWknRgKfLlHW66Ei9Efh6pwA+qXb77hI7WHrQh9O7d+JyOw/igo15aaWVHyR riVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/5HiaDQy1gV5OijIvJDqywUjC7+FvWItMLIDy/cp2lo=; b=As2fjTMz497wW0E0gSWPC6r/9pzw5yMaVnWpAAM2u2EUp3P1oCPtgDxcLQZOIbTLue +GL4XP4g8MXZAFWQE0tCv3U+iskgDl/fhzeS0t9fS361hjHwZGjqh6GwgHj22EDzM392 ggZFDg7dxl9KFHqqzR7IHAnZInHg1GfqQh3QIkibNt+6M0vWe3teVbsgJfGCvZfV+HcY Eb3lq0qr6fyEblMw4y2yQaBFdYtEbULKTpNFVZo8HI765Mb7FbCZJQI3ox3KKf+d11dT Om/tA7htjKkYmBCCvHNlv4rZNjHx/ecnN3ARiKl3zpBpQNwyQDT/yAPeHhz2wMnGiZl3 vr2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=Jmn8+k2S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a1-20020a1709027d8100b00195f4f578fasi12744509plm.564.2023.04.25.04.07.51; Tue, 25 Apr 2023 04:08:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=Jmn8+k2S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233892AbjDYLGC (ORCPT + 99 others); Tue, 25 Apr 2023 07:06:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233788AbjDYLF5 (ORCPT ); Tue, 25 Apr 2023 07:05:57 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FFD87ABF for ; Tue, 25 Apr 2023 04:05:51 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-63b4dfead1bso4700984b3a.3 for ; Tue, 25 Apr 2023 04:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1682420751; x=1685012751; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/5HiaDQy1gV5OijIvJDqywUjC7+FvWItMLIDy/cp2lo=; b=Jmn8+k2SfFfgMhLQds+Cr0nlYahkoptl1RwDbzAx8AZV4daLWkUna/d9KpjCx2Rfy9 rmCt9o71sj3yTlbe6K2B/hk/W22x/AoY5gUneeoO2WZBUgG67nocT5AJKOv91QCs4JN+ DZCnL7fxyHriXlCninrD3Zk7URi4nUfnyi5EmbP/3Gha1H6bcYRPYa70gVOJDs6+9d0S qnpA6xJhk/rQJkofq1EEOa8tqw8D0zjeLVXFud06M0NuAFQZVoamUgVTSmw9Qqf/CECK aW9WKvh1ndvQxmuIyREMN2Zd+vYx5GuyPdQSabCRBc2itdPqh0hvHYca5F8MEElf7xn+ 3LeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682420751; x=1685012751; h=content-transfer-encoding:mime-version: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=/5HiaDQy1gV5OijIvJDqywUjC7+FvWItMLIDy/cp2lo=; b=JImxG/15/ZMWVbuUB4mDZm9pAsS8pR01sCQWrZ4vZvEW50TRZH9Is8AjlWZmqdLl1v 0yHE+OUc2/2/oHOfI5VV29iExnbugnmCtn/IcUY65dv/VRJwhCZ+W5uGZkSTGdPKG7AC N/dEUMeiIGHob3hPdSnxk7lxrVaiBwxTJXaB6uzpzLukWFNzTH9CDdgAgjyY+m8enkjY bwBeT+OlDZkucKUj2Wak0RyOe7QJ7mq9+YdRdQogfKWyosj3NlEmspYBpigr0ti4Eb2h TjHuzbSSUPNbWJ4uUO6PpPg+20SwEX2PnbOEQpUyY1XhznAopZB/dOCAfkfo9TQMNK9m qvBg== X-Gm-Message-State: AAQBX9eRenNvFqdlSv9aZwAPCxpPk9xCj4yv2wJmESS9W+SrUE3z5Evy rxUqf+B7os9FHefnMZKvOnxJ4Gu00uDaZlyYkes= X-Received: by 2002:a05:6a00:2d20:b0:634:7ba3:d142 with SMTP id fa32-20020a056a002d2000b006347ba3d142mr24767709pfb.10.1682420750817; Tue, 25 Apr 2023 04:05:50 -0700 (PDT) Received: from GL4FX4PXWL.bytedance.net ([139.177.225.236]) by smtp.gmail.com with ESMTPSA id u3-20020a056a00158300b0063f3aac78b9sm4422169pfk.79.2023.04.25.04.05.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 25 Apr 2023 04:05:50 -0700 (PDT) From: Peng Zhang To: Liam.Howlett@oracle.com Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org, Peng Zhang Subject: [PATCH 8/9] maple_tree: Remove the redundant check of mas->offset in mas_empty_area/area_rev() Date: Tue, 25 Apr 2023 19:05:10 +0800 Message-Id: <20230425110511.11680-9-zhangpeng.00@bytedance.com> X-Mailer: git-send-email 2.37.0 (Apple Git-136) In-Reply-To: <20230425110511.11680-1-zhangpeng.00@bytedance.com> References: <20230425110511.11680-1-zhangpeng.00@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In mas_empty_area(), after mas_awalk() returns, if EBUSY is not set, then mas->offset must be valid, no need to check. Same in mas_empty_area_rev(), so delete it. Signed-off-by: Peng Zhang --- lib/maple_tree.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 8bfa837b7b752..964214de2ed18 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5305,13 +5305,9 @@ int mas_empty_area(struct ma_state *mas, unsigned long min, return xa_err(mas->node); offset = mas->offset; - if (unlikely(offset == MAPLE_NODE_SLOTS)) - return -EBUSY; - mt = mte_node_type(mas->node); pivots = ma_pivots(mas_mn(mas), mt); mas->index = max(mas->index, mas_safe_min(mas, pivots, offset)); - mas->last = mas->index + size - 1; return 0; } @@ -5365,9 +5361,6 @@ int mas_empty_area_rev(struct ma_state *mas, unsigned long min, if (mas_is_err(mas)) return xa_err(mas->node); - if (unlikely(mas->offset == MAPLE_NODE_SLOTS)) - return -EBUSY; - /* Trim the upper limit to the max. */ if (max < mas->last) mas->last = max; -- 2.20.1