Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1766720rdb; Mon, 9 Oct 2023 02:05:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgVvYwCz32e8WHFFdkTqmelmw8CGUmX9ktfcK8Z276Dxiuyy+WdNwIMGNWILDKDnl/oZEh X-Received: by 2002:a05:6358:e49d:b0:133:a8e:6feb with SMTP id by29-20020a056358e49d00b001330a8e6febmr15369845rwb.12.1696842350707; Mon, 09 Oct 2023 02:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696842350; cv=none; d=google.com; s=arc-20160816; b=UGRaSwak53zoGqCZJbanLJyFcovOcpOQbN6EtOjk2fFvZ0vq3M3CWwUF5vyxydFjuS 9oM1Hee0fOJc6NU9veVY+JXYeLivqdyV7Obt+EcmO8H2yzkl2UqvdDIM1YBLBvBREPiZ BWfj4ekDRJQUc0jPv4nMiB2YALknZyMVH6MqPIAI2RXfhVBxbDymReE8/Z1wLTQtfI4M DLjaYZ8YC5HX7/bkJV1Xc2UjbyI1gfkvHyvBumQqN+bjGuz9KWHw/8HGDcWS4bpT8rZE PuVvFyGkmznlftJkPlOjVpDnPtTK+eZIm3EPDhtf9isxCurW72d0lFJlNIi6iN9n8RQ0 j3sQ== 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=54w8Wcln7nae9IbjCMSOqwvs+RMz0++Lh1/ZpbM0xiI=; fh=W1ujNbDikRM6mL+MA7cZ93eipzimk+g+Mb7QYnlff5s=; b=kh/guAp8AQuxBJ3cSScq8tnCQZ9mrpvgTeOxXEGVlA4m5duI2sFKPIc2EDvIs6WPto V4B+9X8bB98uRhnTHQZWxd4kMNU3WaA8Wa+B+UfFRwhjwdhCUgzLG0JqWrdnwmPxIe+C qS3beOrEAfPsU8aoGaX3xwNApU5eZTpLYheiuEy8BreUKTMBSWpYWAKtsrWIrAjUt/Sm tFFDfHYyrhbEfJRiO4VoENIDwzX6yxt8JBOQIWv/Lv00miugUkflXHvGaqyDT9QpHVhh 5hUALofvyGlQpKxWBWfrGaGWFCbfKnnLDYjVC508tBt6Nuo4OBwoZi9WRdOvwzjWkXm+ jS/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=f2DWQqj3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id p24-20020a637418000000b0058978136252si8604310pgc.484.2023.10.09.02.05.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:05:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=f2DWQqj3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 91DB88058B4F; Mon, 9 Oct 2023 02:05:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345830AbjJIJFM (ORCPT + 99 others); Mon, 9 Oct 2023 05:05:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345849AbjJIJE4 (ORCPT ); Mon, 9 Oct 2023 05:04:56 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F07310B for ; Mon, 9 Oct 2023 02:04:43 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-690ce3c55f1so3096524b3a.0 for ; Mon, 09 Oct 2023 02:04:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1696842282; x=1697447082; darn=vger.kernel.org; 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=54w8Wcln7nae9IbjCMSOqwvs+RMz0++Lh1/ZpbM0xiI=; b=f2DWQqj3SkSdkdLTab30oLpi4Y8Kawjhs2tG4cyJWvrMCRFpT7wzt/9/G9TU8s47uT iGUokyT0cRllLpKrf3BkPc0wW3pkCrgZpG31yUca8v8SuH8NX3WwsNAQd0J1ITDNGm44 0EAGKlSlAby4sSV8zVXDQC/XTbwjcAyomW1owGH0E+6wJB/MwfQx3xA3GFqDnv7/bx2p cLunqfBdQ6vmIJ6ZHYRq9Hx4tRgVMAkgt9w1sJPSO/demnCs7HadFvpe6BYWAJ3/UGut R45+V9tsVqtT031UPv8gW3Uvuqc5oUQH3TmzVGA30GItE4n6TLx6pnE7M4fHHUCItPTQ WnZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696842282; x=1697447082; 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=54w8Wcln7nae9IbjCMSOqwvs+RMz0++Lh1/ZpbM0xiI=; b=hh5zjH0mTp2PcV6LG2krIE0Cn8V//OGlhTyaGUSwC08NPvXPfr2+TZqorZYHj9B2VZ bVqbPIzargS5rBduunmhcvZJocqwl8L6Cc5l/C+ma57araVazRnVgyT6Y/rMt6fJ5uLd 8fdBEyHgesvcBAbhplgy9oEjPInuj3oKsoMyYwxPMbtLQQOJhKe7nLlBVXuf6c1qqAZT x9qYlYTdzcOfraxa9dJTa9lSTEPkSncOWTxaMDFiWr0MlZkqYWo+iXwaJQIUtgQPInOn BX6l5a9+sOvH9xkCbsjeZaFfv+jtX88xAGZxiX2FdADeHU88OiRCrpwD8P7HFlUFLzY5 WB1g== X-Gm-Message-State: AOJu0Yx0XlDWcNJoan+yrziBF74oFzf/+OvS3CVKdAO1tDTpidxro67i 9xwSro/e7gi24Ww33RiuLDae4A== X-Received: by 2002:a05:6a00:1346:b0:68f:e0f0:85f4 with SMTP id k6-20020a056a00134600b0068fe0f085f4mr14645034pfu.25.1696842282594; Mon, 09 Oct 2023 02:04:42 -0700 (PDT) Received: from GL4FX4PXWL.bytedance.net ([139.177.225.243]) by smtp.gmail.com with ESMTPSA id fk3-20020a056a003a8300b00690ca4356f1sm5884847pfb.198.2023.10.09.02.04.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 02:04:42 -0700 (PDT) From: Peng Zhang To: Liam.Howlett@oracle.com, corbet@lwn.net, akpm@linux-foundation.org, willy@infradead.org, brauner@kernel.org, surenb@google.com, michael.christie@oracle.com, mjguzik@gmail.com, mathieu.desnoyers@efficios.com, npiggin@gmail.com, peterz@infradead.org, oliver.sang@intel.com, mst@redhat.com Cc: zhangpeng.00@bytedance.com, maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v4 09/10] maple_tree: Preserve the tree attributes when destroying maple tree Date: Mon, 9 Oct 2023 17:03:19 +0800 Message-Id: <20231009090320.64565-10-zhangpeng.00@bytedance.com> X-Mailer: git-send-email 2.37.0 (Apple Git-136) In-Reply-To: <20231009090320.64565-1-zhangpeng.00@bytedance.com> References: <20231009090320.64565-1-zhangpeng.00@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:05:47 -0700 (PDT) X-Spam-Level: ** When destroying maple tree, preserve its attributes and then turn it into an empty tree. This allows it to be reused without needing to be reinitialized. Signed-off-by: Peng Zhang --- 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 d5544382ff15..1745242092fb 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -6775,7 +6775,7 @@ void __mt_destroy(struct maple_tree *mt) if (xa_is_node(root)) mte_destroy_walk(root, mt); - mt->ma_flags = 0; + mt->ma_flags = mt_attr(mt); } EXPORT_SYMBOL_GPL(__mt_destroy); -- 2.20.1