From patchwork Thu Oct 17 01:58:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13839297 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 EE1F2D2F7DE for ; Thu, 17 Oct 2024 01:58:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 79EEA6B0082; Wed, 16 Oct 2024 21:58:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 728626B0083; Wed, 16 Oct 2024 21:58:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 616A16B0088; Wed, 16 Oct 2024 21:58:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 4553D6B0082 for ; Wed, 16 Oct 2024 21:58:20 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id A09FFA0D40 for ; Thu, 17 Oct 2024 01:58:00 +0000 (UTC) X-FDA: 82681433940.13.49613A2 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by imf15.hostedemail.com (Postfix) with ESMTP id DC5D1A0013 for ; Thu, 17 Oct 2024 01:58:08 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=VqN84w52; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf15.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.44 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=1729130138; 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=EaEg0wGc17TdM1UZZJx2y7Net+EjkdZZR/dSLX+TIiQ=; b=fz9TUwtIK7ZVRP+jTJFF0ugbSE5tTn6RDZuRjOngcO3nDHFcfDSh53oYHtWhpEdAoFB6fC IKxZypwU/HbBLE1HpOfCMKzr0iKKwBuP9uQjZCZb2WAX7kvib+nMX7gR4Z4kJQiqSOQldt 8B32zK1Dq/t6EQ5RR9/owVp2KcnR4J4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729130138; a=rsa-sha256; cv=none; b=4fUD8ZafHsCzaJ0aR5ywXxYvtnfvL+E6odWA2fL9eKeQLJ08fif6h5ex+0kZdyEjUvxVaM 91Id7Q8B9v5r5oArnb3zbOux9+VTrmiovfhwhdbbFSElq1U3j+Qr5+lSjNzKpvW0dKl9Ko CBZ7Cte6g+zX1SEmz0WEcaTz2NgthA0= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=VqN84w52; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf15.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.44 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a9a0474e70eso50799266b.0 for ; Wed, 16 Oct 2024 18:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729130297; x=1729735097; 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=EaEg0wGc17TdM1UZZJx2y7Net+EjkdZZR/dSLX+TIiQ=; b=VqN84w526W6hsHgYeOJijPVi/cEfyRGZY9ev2aMJJ4JuEIUCFGGfyjEYPUwNfzqHO2 UozOlDcHHIMENDX81MTPyXsvezC47yqlwYTcQJFoTShbh6f2wOmOqX7jv3jkbM9aPrg6 ab9ofX0OV+QRkdGjq3vaZfplgcb0XL3J89EZwFT9mt8o5SBtsK3b5Lzie5MmnY6yfDbW qqKVqBcFYFXjr6hbJXCuN5ImN3rgfxqVi69333M5u0G3Xy7XtfPUwOPXjc7HVCjeyVT1 AZPK/feePLD5ZzZTql7CYNLC0EIRc7HJ4cdjEc1xWrIJizBWT+ursLPr2sNWydp0p8iV +OLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729130297; x=1729735097; 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=EaEg0wGc17TdM1UZZJx2y7Net+EjkdZZR/dSLX+TIiQ=; b=MYZHXquT8AP3DGG24XOlAwZ2AgrsT4Tw+z934kxal3cA5cytmF2GauPLjN33gPKEAp wh0kdpsqgLdzejJVtK1Yjb3ml3cPUR+mZq/NA7N4hmQvlm33bOPPkxwv3oL9K0vB+hLB pzNWYW3iwdUpWvvZOjXcLCtkq5jarWd/yh/UxdYWZWM1MGxlTws0kvNhXwg/RvNhTsbb Oj4r5qOx1/J4LcsXdHfe0/P6VFhbRihYUSRq5w7mKDiRYV3ZBbG64p+dDJRZ4ND9QtxK kQ13++LvgAGxedwfa8wjU86O+dqwV0kdZF/UKA5APoelBhxvhtDmsK1CL5RQPMpqgAxx qXLQ== X-Forwarded-Encrypted: i=1; AJvYcCUhlQER8jJ7ilIw0wqwFo3dmGEoBWkRI0B+yP4ZnAvIT34f6jbwXaDjTezOGW+2h6bTjFu95C1BWA==@kvack.org X-Gm-Message-State: AOJu0YyzRP3IisqvVUAAbMm+/RIguwBHrNmw0/CkTW+cojW1+RFM37Y0 YmvxRujz3vPppEeRab87YxkApIcyVI7rkz0caT/NxlItI0cuht7k X-Google-Smtp-Source: AGHT+IHl66GNqs8n9QTMGMM5F1WL20o8QHz3zzNlLsjl7MQ1VZtjuZCbXx+J1xqkKfR5BHqHYNCoNg== X-Received: by 2002:a17:907:1ca1:b0:a9a:bcd:b726 with SMTP id a640c23a62f3a-a9a0bcdbe59mr1209399566b.25.1729130296498; Wed, 16 Oct 2024 18:58:16 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a29818257sm235963566b.99.2024.10.16.18.58.13 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 Oct 2024 18:58:14 -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 1/2] maple_tree: calculate new_end when needed Date: Thu, 17 Oct 2024 01:58:08 +0000 Message-Id: <20241017015809.23392-2-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-Server: rspam07 X-Rspamd-Queue-Id: DC5D1A0013 X-Stat-Signature: igm6mc76t65g89gormykcx6tbgbgajzh X-Rspam-User: X-HE-Tag: 1729130288-592637 X-HE-Meta: U2FsdGVkX19mhN3nWXvx7EzOyYpFk5YuLfdtPPdAf6RIgfZCTFc5gK0Y3fmH4sqPRALowhgeTcF42HT26tBUuIRxMrFQtaM+ETBNOjDJQOlcth6TdKSqu50EqBI5vhjdmBHj4ii50yTwsjZKXOWQcyli5j9EsISpyip8H2rtqqjNx7l/DJWebW9mobsf59ETLM5KK3eC6Aj+Dhe4J1Ii8G8nXNOnmV2mc04F6U2xFeR4GCxZ7OF/mJo/7dVcZxW17Ryrgl386E3I6Yl4bmXlTEuPSD+/NZAXdJ0nn2eVFWdsqLZ8OQgTNURfNvYJbLxZpanotfaoQgt3EcJw3Jinn3OgTUhkMYJ2+SCjzBlj02rzIxjLqcrAPW92Vd2Z9LCN+uk/6x60lgSmn93wUK2iJ7zCysfPQtol91MfypfCHsn8BmFq0MmXrM1Axs25VUVqUy+MwvqSK7U8qHk8JNJxo99mQ7ZDQUa1rBq+aKrQjn1z/siFynIa1a2q4wAgRAj20/y/9TjxzugUtKDQDEfzVFSTEpCecilN174znC/rqY/a6Ig3NEho3r8fzsiSmq1JI0OTcNtWWQ9tlMFvYL5pmjp30rDMFLrk6H9qRIIvacIykfr5ozBZy/CKSruW3D5dI2DCthiTKG1rvg5L3kaedqegK2WngT/Vgmth457zXTd2p4UbrWzsJhrhJeWwd8lWGolOZsLSE1WejrOAB2rKYyYVpBBtqyVYgPHNKUoq16Na3PG2SQqF7DbGbPdX2aaj8qDHXkHRWzbDNaEG2Psj80In5AacqNTRgtMAfkHxF7nouGYLt2CgR0w3oBD2yfEmNoDKMHkpV1iB/x4MdxR2EFvQSD7QQj4MyMluNTdElppd+mUZ4ndSwgzIWztcfUpxPG899JR4ouU8JEGuUY5iQ17UvOlwEy0/o4eEmt1iIvWiGyJXgBVT1zxxUc94dBwRCBKE8Y2apXYif7bu6Js 5lj3fjwn 0Kt4zMVdbFhBOg8yBz/l2PSqxWXm41wsC21gJcHyrjWY3WNUqCeKR2OFuqU2eVk0ec1iD5UnqPqZSrGfOhK5PxzaVNJz1zQrZ+FIdsGpE8kWo6BdWP/GASWtKJco0AUtvskVCQaWgabbspbZ08mmDVqIhc+JG1+VELm3b4QJPfolVwB8d7aP70jcNdyHfrNWZFMv4n+hx3kPKJMWTP9V8b5u2l8HK8O0sELAEybyWlneTX/ijqbFqmDbcuKN/Bw4HmcV0Tv2Hk4kwCGA/+9hfDx7EvffqQXrHWXKdUlSqUvoqoZ9zpOoY0eB9ZovFIkjeRcbzOXbu+oas9IYafdqR9ExXAhk/r6+EIRwx6737+M2VxEJi0gwObJei62vVk1Zek2QzEiE85tUj33mjM0n+2kWirv2Tn8DZiu+cmRBG3QKgFHj0MFhtoNSmDB0Z8C1vdx2KJnQMxsudWcjWKC/SZLj5BQV0yFku3nX0SwfAOMWrdfx+UFby19bqHZAWAuDhyjOa 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: For wr_exact_fit/wr_new_root, we don't need to calculate new_end. Let's postpone it until necessary. Signed-off-by: Wei Yang CC: Liam R. Howlett CC: Sidhartha Kumar CC: Lorenzo Stoakes Reviewed-by: Sidhartha Kumar Reviewed-by: Liam R. Howlett --- lib/maple_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 511afb8ad1dc..b26f8df09588 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4117,7 +4117,6 @@ static inline void mas_wr_store_type(struct ma_wr_state *wr_mas) if (!wr_mas->entry) mas_wr_extend_null(wr_mas); - new_end = mas_wr_new_end(wr_mas); if ((wr_mas->r_min == mas->index) && (wr_mas->r_max == mas->last)) { mas->store_type = wr_exact_fit; return; @@ -4128,6 +4127,7 @@ static inline void mas_wr_store_type(struct ma_wr_state *wr_mas) return; } + new_end = mas_wr_new_end(wr_mas); /* Potential spanning rebalance collapsing a node */ if (new_end < mt_min_slots[wr_mas->type]) { if (!mte_is_root(mas->node)) { 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+WsJ0Hw140dzmEbMnCWMcBokCZGIjEojd4MME9V2kD2VfY0fEOaAmrow/uhXUkXJVjOybpU19FfXLQyFCeZkMKdBIOiRpIwTsIG3ADqL/QCcNassp/bC3P8/QLWrKold3/DBpUl0Y+pZwxb/73ehoT4pxRAxmEyj6gU0vmbs3l1u6+fyMlOLJ3XJFLn87NYbYJjLQwf2XkGiDLweLpjZEQykikbJkgkns6e6KnMw91HdWvIP/j361QU9eGnIemWC0nx6qTb4w2Ws/Gqyxh6e1EgeQpJcnh5aOvItmIwuE6EjBnnaKCrBbDG4pHEWVViYMduMBRnW6XfRcpajBjBAP2aWVwzKthYWxitkX389fUPsfbILTZpdMDBJgrc0RP7zhIx08TaNpwjRZ/jtHOOkHHkB/sG/Zp/c56dIL+vEyb2/ti0eNUWMzvUAd6xa4eFiRsTJ7E7Gb4/mqzMEXc9ANxcYl6KQAAMRUMvPP5/VllzEe9SkNgTfDo68fPck5ZWEQe4JEiBpPda8N3dqo+Mc+JMNWlaiYW1FmPbxSU+yuWgJ7DCnkHFRsVj5DzJCy12ojUFvE5tiqR+PEjk3Eh9mfiC4DvhHV8SXp0fOLTuhb2rGdLcI4G06HhY4UGVbJN4yAjGP6u8b6l8Uepjiil4MKfOHwoAhk+WYxH8HXDro WPmfZDRT xYw8ZKwXi/4OZMiqIGPMA+RHje3UGqiNfe7YqoYgtTicS4Ao6+L52Aw1c27KBzWRyDeh0veWqGK8wx6A6MrKyMISB9+3ElcG3PQ2hA+HM2wR5b7SX2HIc5blqD7AoLCP3zRdeiT3YmVMT+A5ewhwoZ/OtI3h45ZB54UX3S3+h+FhzqU5kjAKhgjpj6sMBJYr8v1Dpr7oiEUYzmDlfj95s4xmB1IeAtmWuqSpLht3H6s624TklwctSW5XGKz9S8mN5yKcl4BaXUj9wwezS7yijZC2Z8DOsCTih6kO/ppGlaTTZ2J/qYsf1w36uAe3ERX2Mo4av2pvXDZxKfGuDi9+syKzWmVrqlLed9MMV4wBfnSS1RR5Z1moEhMcJ6oZrAGbLFRn9TchWMXGHDGBLa8BJWzmm46cJGTDdCMOWnqxWe0so9Bb+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);