From patchwork Thu Oct 17 01:58:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13839298 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 371E0D2F7DA for ; Thu, 17 Oct 2024 01:58:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9C28A6B0083; Wed, 16 Oct 2024 21:58:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 971726B0089; Wed, 16 Oct 2024 21:58:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7EC966B008A; Wed, 16 Oct 2024 21:58:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 61E156B0083 for ; Wed, 16 Oct 2024 21:58:22 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id C304D40E8A for ; Thu, 17 Oct 2024 01:58:15 +0000 (UTC) X-FDA: 82681434192.05.46DB15A Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) by imf23.hostedemail.com (Postfix) with ESMTP id 60955140005 for ; Thu, 17 Oct 2024 01:58:14 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ZZC5pIUx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf23.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.49 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729130193; a=rsa-sha256; cv=none; b=pUr3fAcPcmjxgCTaCDW3zwMvOHnF9i2cO2KAh8aKjx3hYthHJIpFKj0A48DIa1jVe5wwGz APUNU4cWXfXiGgw2O4I1llom9OVXQsd8Pg+dbmoIBrKCrWDKgoUEuV2EnT9OXrh4cRH8qi H0ZmglJHPeKdn8fqpUJFLYjHSSCILIk= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ZZC5pIUx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf23.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.49 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=1729130193; 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=DQ2ddgwWsofHye65P/kkdhhPoGeJwWjg6dpShq7nH7o=; b=PfMae8K66K4ZI/Sz2YIxACGVL4hBdfKpgFT20BpU2nrXUfsufSZPSuiSmyG38coGc+LDHj ZASEtzvtu6k7QXOV/1ykalqnHf+57WDLyjY8bQ4LQP3OyhF8lVhG7XL5JqjXyRTU0SioUA Kr/mfRRKb7TkR64duqFuSOlwQBK7c0E= Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a9a0ef5179dso51171166b.1 for ; Wed, 16 Oct 2024 18:58:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729130299; x=1729735099; 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=DQ2ddgwWsofHye65P/kkdhhPoGeJwWjg6dpShq7nH7o=; b=ZZC5pIUxDnjZoIzArUUkv6ZHx5fjgms76g9Szm3Jhl8mnRnmwQPzrPoewAoeCeEgjK Jh1kmZonsCGmy7WhRQARBprCDdIft/szxii/8GhV2BptJfNhUPopkOqgWv8v93Q5IduC OglJ8TsUlJD5JhDosnvr8twaUcwqQQ7D1WNjsKwqjNDx2uL+HveZKiyNqjGGJGHNlJxh Ji9z7TwEIQ9RzTBQW/2NLj33OSY9kdiNC+axP37vBmAwfA6YgNhsejBnqhg8ZqWKDErB Iy13vVutkqwj+M0AnqtjH/9YbFav9mzLwgVEB13Guc3bHVpkTW9ilUIEu5DTuuAxPjSJ yiSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729130299; x=1729735099; 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=DQ2ddgwWsofHye65P/kkdhhPoGeJwWjg6dpShq7nH7o=; b=B47FoMViYQGc62CkB+xFipX8NOifhvrEG3GHeOaUWHAN6U2rw/QmiTRRKIqYuQLsnd IES8U3EeYFU4GX71uVC2nFer6UmWQ8ZSfoHrEpkXo/xzRHCzwS/fj3Wlte5hTZawQITa xc/9oXNh2blanSHrLgVrgpInTn5ioiSxUNmmSab3z6i7psI1n9koMrPZNPxF3L6L3NDj wfWJphkLZlZ5N+VNyAgthDowwvfIdxqTHBGMwrnhVGAm3o3hib2UDTNQBixGWJXLx++x H8Bz68DhCuduB4oLkJGc5TkFsoS5UK7UgIhvs44M1uzsXyOxtwz9+zMH3IEin1Ro9ELQ OD3w== X-Forwarded-Encrypted: i=1; AJvYcCX4CXulnHYoeZN5moa7TBHTxldbPGzOcVklW0wc9qStZ1/qjzFCG001pFDXkEmQRoYTqTSQW2VHCw==@kvack.org X-Gm-Message-State: AOJu0YwDVD0vH4z5UMT7eqEbDo70Bnrrr8Xn83E4DjkTUGxqS1dVfZBp LJwRDprcqVUeuapVew5FM5rNCr+aTx3HUXy/KZkT9TSx16keg3HN X-Google-Smtp-Source: AGHT+IGaQ9Ovix1O+VSsy3cJBEhl7ISk2YZEJIIw/5FUta5KoxOx/yZnpaIw3NEjGP841BteiNE92A== X-Received: by 2002:a17:907:2da6:b0:a9a:17f5:79a8 with SMTP id a640c23a62f3a-a9a34c83b87mr465991666b.13.1729130298670; Wed, 16 Oct 2024 18:58:18 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a2974cb16sm235222766b.90.2024.10.16.18.58.16 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 Oct 2024 18:58:16 -0700 (PDT) From: Wei Yang To: Liam.Howlett@oracle.com, akpm@linux-foundation.org Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, Wei Yang , "Liam R . Howlett" , Sidhartha Kumar , Lorenzo Stoakes Subject: [PATCH v2 2/2] maple_tree: remove sanity check from mas_wr_slot_store() Date: Thu, 17 Oct 2024 01:58:09 +0000 Message-Id: <20241017015809.23392-3-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20241017015809.23392-1-richard.weiyang@gmail.com> References: <20241017015809.23392-1-richard.weiyang@gmail.com> X-Rspamd-Queue-Id: 60955140005 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 9enc67obxg68o8s1h6o6ney8ntnbwhqh X-HE-Tag: 1729130294-707788 X-HE-Meta: U2FsdGVkX1+hcsleWufLQLMxiSNV+OXDIT/02KK8TB+h9JAPhgrCt4iQS4EbgVyycY6NVVyMMyqWG2TrP85HanXusJkZv20ggPep40Vrh5mUhYgpVbB/9N77YMdJQ+0DBf4NokVdM9Q4fX2ocnuBqQ+8ZPF63oF39YuHvSl9TSVLkdy428TYsZVsI3x4MQzVXTrvs4hbQ0RH3vGDbU8eTfBuVdFEe1PwCeeFdHTiSnaJC6ACFcbq4R/KLjqqBuun7QEgVXQzS7P9O3O6DAz6nPiSn8sWxwPjitriivWj6M4+WsJ0Hw140dzmEbMnCWMcBokCZGIjEojd4MME9V2kD2VfY0fEO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xWe0so9Bb+FEDHlL0OYwHKTVgPglNnQRzNOFuBspXl5XwagEhyHqUyBJy6xck0QlzMciXKwm4qSJ3Uy7feui/CP3IrEnZC 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: List-Subscribe: List-Unsubscribe: After commit 5d659bbb52a2 ("maple_tree: introduce mas_wr_store_type()"), the check here is redundant. Let's remove it. Signed-off-by: Wei Yang CC: Liam R. Howlett CC: Sidhartha Kumar CC: Lorenzo Stoakes Reviewed-by: Sidhartha Kumar Reviewed-by: Liam R. Howlett --- v2: add a WARN_ON_ONCE() as suggested by Liam --- lib/maple_tree.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index b26f8df09588..54dd0e256315 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3805,7 +3805,8 @@ static inline void mas_wr_slot_store(struct ma_wr_state *wr_mas) wr_mas->pivots[offset] = mas->index - 1; mas->offset++; /* Keep mas accurate. */ } - } else if (!mt_in_rcu(mas->tree)) { + } else { + WARN_ON_ONCE(mt_in_rcu(mas->tree)); /* * Expand the range, only partially overwriting the previous and * next ranges @@ -3815,8 +3816,6 @@ static inline void mas_wr_slot_store(struct ma_wr_state *wr_mas) wr_mas->pivots[offset] = mas->index - 1; wr_mas->pivots[offset + 1] = mas->last; mas->offset++; /* Keep mas accurate. */ - } else { - return; } trace_ma_write(__func__, mas, 0, wr_mas->entry);