From patchwork Tue Mar 14 12:42:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Zhang X-Patchwork-Id: 13174287 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 937C9C6FD1C for ; Tue, 14 Mar 2023 12:42:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2B6498E0001; Tue, 14 Mar 2023 08:42:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 266476B0074; Tue, 14 Mar 2023 08:42:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 12EA68E0001; Tue, 14 Mar 2023 08:42: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 F3ACF6B0072 for ; Tue, 14 Mar 2023 08:42:19 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id BEB5F120EEC for ; Tue, 14 Mar 2023 12:42:19 +0000 (UTC) X-FDA: 80567466798.02.6D46233 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by imf12.hostedemail.com (Postfix) with ESMTP id 375674001C for ; Tue, 14 Mar 2023 12:42:16 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=Lc4umaDT; spf=pass (imf12.hostedemail.com: domain of zhangpeng.00@bytedance.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=zhangpeng.00@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678797738; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=pdc7UbNBneHho9oqmigekem1agGN/vBMBnNuJZM71Vw=; b=a/XEEoQ5y3xtPJo9YFjVFdnFGle2Qsc1DbtVgIDhl7Lzg7CsghTghXRt7w4yRbXEmJzMh4 6VKOALAYXdIB1cZaNj0Lrn2g0Mv1IijbwrWKE5c/jJhMV7ez9lYTGMWE3uML6FMxRLprss Re3pz92/yeXigBQDkBkROFgGe8eBDAA= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=Lc4umaDT; spf=pass (imf12.hostedemail.com: domain of zhangpeng.00@bytedance.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=zhangpeng.00@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678797738; a=rsa-sha256; cv=none; b=F+1mvx+EZXOzD4dE0nhzQyfm7pClM9+8paX9tRLWubc41e8WN6lCOrtAJZFDTqs4bSMwR5 KIVFGnosoisdtKBQZg/6lZwkdB8QGhJBpCorIALvFsRRt9sUtQyEa4aCJze8L1T5KnMSNm PvRUUOH+ORgAeJElzMfSitB7o0b/Qlo= Received: by mail-pf1-f179.google.com with SMTP id bj12so559249pfb.8 for ; Tue, 14 Mar 2023 05:42:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1678797735; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=pdc7UbNBneHho9oqmigekem1agGN/vBMBnNuJZM71Vw=; b=Lc4umaDTjOtkaLSsPc4M1IXUWPNZbqF5+yTINoM2IU/nhV4oARdpcU496yWvlohvRx rXsWb7j1wHmB2KIu6/AeKZAlEP3K4OwrVb0zmGG0ppXvUSzPgWkas1X5VSfaJTIqM1LR aPSlnmD5fkZT5PDs8UwHP4gLsNxpHotEjCj72aaJJeW41fmMZ7RtDgBo6XzThJC2U4za QwUlryeriPMTLlE28OTqxTeieaxWGojXBRjf/oH+kOg4l5PRXEIJFF744U6lOkEuqK6o NxabJczCwNOPnMXPHJ1KXGw+mFMQeaIw4ipNYBe75FDrl+KWubWCrFRXx7Z2yP3KcEVh uJ7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678797735; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pdc7UbNBneHho9oqmigekem1agGN/vBMBnNuJZM71Vw=; b=j/bk9zTjKSMJiBAip8d2rD54LOd0dC29VV5Q8Vzz+qn46k1RHGwRtKt+GjKFKSGa0T RIzJEj0yWmPPKxJnoJknxhFtmiHEVfrpIoTtBHSjpqFfD1qHW4Ruamb31vzuAiddjZFC e3eGzROXAi+vXwCada6L42n5fGoQQp+5gFlNwUYsIl7ZNnN+2CHBvViWwtXcS7SLH09X 1Hb9Wlfe1nmPLKi8NK5Ln8d7M09KEQDQPUNa3ExSEvpdsF0m7mITGdYTspnGRk84R3bo aCeVcciYpfEfVxV8dTRnFZEqS47K90qorX62D6VjRNzOCwzZ0pXYIRqqALol+nZbPco7 S3vQ== X-Gm-Message-State: AO0yUKXo/GSjMsn2Ttc7HHv0KFmcm8FyKQpyk0l3v+CQ1q3fChRixojm xXVUkIPsF1auYqI3o6WzOkLljQ== X-Google-Smtp-Source: AK7set9NbkFaKM3mIDwG+DR65lCy0qwYWOEvpNHAETvz3oGZOdr5D7ZbxTiZAQhaf7632ArGyBDNnQ== X-Received: by 2002:aa7:968e:0:b0:5aa:72c6:4a7d with SMTP id f14-20020aa7968e000000b005aa72c64a7dmr15664029pfk.16.1678797735679; Tue, 14 Mar 2023 05:42:15 -0700 (PDT) Received: from GL4FX4PXWL.bytedance.net ([139.177.225.234]) by smtp.gmail.com with ESMTPSA id s11-20020aa7828b000000b005ded5d2d571sm1509385pfm.185.2023.03.14.05.42.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Mar 2023 05:42:15 -0700 (PDT) From: Peng Zhang To: Liam.Howlett@oracle.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org, Peng Zhang Subject: [PATCH v2 0/3] Some fixes and cleanup for maple tree. Date: Tue, 14 Mar 2023 20:42:00 +0800 Message-Id: <20230314124203.91572-1-zhangpeng.00@bytedance.com> X-Mailer: git-send-email 2.37.0 (Apple Git-136) MIME-Version: 1.0 X-Rspamd-Queue-Id: 375674001C X-Stat-Signature: oprnukf51fsg4u16ababiwkcj51zyjfm X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1678797736-688575 X-HE-Meta: U2FsdGVkX1+xnoylFpWCTncrrohmbVA1Z4kEy+e6q5lmxBSW+0dBYbqAu2Z3MxbDVR1xdKfXZxbYVX99CDxuyn+QuvZXhPl4Tik8XRMME0/RhRiacCUQs6EFGlN3lwT5bTHbkUIYfkk1Px9uWGX+5X15vImWSSdEZjHjNAsFXgICIunSzJsmrzAtdqUDDbBibeYCLGi9PyvFj1m/53ahhbc3emKtcVr9geVX7giYQQZK837p2koHnNqV4PJ6M3izcZ/ahKLud14L2ynvzMYTrMDRaxa+ddzzmqQgVcvdB+Fywlrd7bEM6fMBiYcZomzTdsU3Q9MVAGpqSvxBNumVozT6ofV+nscj3uYpiA8spJeJmVIHQyWpCUruDi56i6n7Gh3RVmOxvq+/trumr1q9lJGcnNcNymnXLnpCxyiLxS5s3FqSCRwqfDaE9IWdd2yArCXa1n7vk/IvkcrQH9m0oJO6EIU+j6WB5eFCCce822Z3f7jXjcjJ/F9x6m8FOgpZPUebe8Ppc4A562Vt39Q4Glcpj6T0bwyh2E3dDtzsaoj2iG4mVn4QRc4Yp6E6ujvnoBLY2qtSiKt7sLmisZcI3cK6lhp5jJT5IUqdiynr4GlZRqhKKkOOD3iItpYaUUTY+eZ3uwEuQDA6I3FX1ibBOKvsCrVtQlvjjwjM7IuILqQW5HnOiYIwyc4XIN5d6g5zs6DGizFQHKVF57lFDadTV7PkAsSifBuP2dfH4lbc7DHSlrnsdvsgH8dFPYcUb16offdghBwb8w2lfXKDtLBG4sjgLvuN24urfTzHh4ETAaFqxPylox2zL2npbx5tLC5lLl1OdMYI04pEcV2hApz92zsv+VZC+nJjDLoVz7wa7BiP/YuQk99VYlq1L+VmHUvYf9oRlqUwE7CKUwDQQE+MKOnZdMaRuGsoAnicziOIkw/y/IwLHxH3wqa5LCVIo1pf+PJ115aUNhq7sbPTk6z YDpqu3S5 TCmY01bcwFi2O6EdxqlJAyIli1kD91gRmaIVvFsoiXta7lCbjFjR7E3/htvNFm9L3k7neJFqTBeNG+rUTd57vzeL8xisXZwTHU/dOf2mf+WgfVOx8E8y8MnTFZDOKJRqKmqtDAEFyracmsX17oJN4Cgw3HmPdkcsCrqhUwNW8Roje8a9VBrl6QnCUe/cX+xRFnIlIev+y9RUzWe7kFdy9FTnELX2Ug4/ys3JmEvKNpKGqZ1OA2PJt447YlNCX9FMaOr3FmFNeoW52nl6hB0PB/ZdtPskkPOBG2VwxcsKDHNQVokXaHJKN5Ybd5x1+hz3nvCEluTMBHZNHRfNfsI/wypnIPvimV1hmnhpdHr0UZbu+USg= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000010, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Some fixes and clean up for maple tree. The bug fixed by [PATCH v2 1/3] does not seem to be triggered due to some coincidences, because now the implementation of mtree_lookup_walk() scans pivots one by one and exits the loop early. The test cases for the bugs fixed by [PATCH v2 3/3] are difficult to write. If I think of how to write them later, I will send them out. So I send out the second edition first. Changes since v1: - drop [PATCH 4/4] - update the commit message of [PATCH 2/4] - collect Reviewed-bys - add fixes tags Peng Zhang (3): maple_tree: Fix get wrong data_end in mtree_lookup_walk() maple_tree: Simplify mas_wr_node_walk() maple_tree: Fix a potential concurrency bug in RCU mode lib/maple_tree.c | 52 ++++++++++-------------------------------------- 1 file changed, 11 insertions(+), 41 deletions(-) Reported-by: