Message ID | 20231027033845.90608-10-zhangpeng.00@bytedance.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp336645vqb; Thu, 26 Oct 2023 20:42:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUWv9E1xe1gXeuWWTyEMFE2l7Fdok4L9eUyFPynIsbd3kgGRLyI0kPC5UBkeqIe9LBXDye X-Received: by 2002:a05:6808:3bb:b0:3b2:ee67:71e5 with SMTP id n27-20020a05680803bb00b003b2ee6771e5mr1176708oie.42.1698378165957; Thu, 26 Oct 2023 20:42:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698378165; cv=none; d=google.com; s=arc-20160816; b=uZMzHQG/dBHiFhYWbLKlg5QXRygA1H5Elrhf+a9wK75OTYZQnK1X3pTqrR4FLRma2e QCzqy+wZs0AXtd9twTJ7qHdC/Gsk2i0uCuVmzTMc0q0MkXo9zS4y7oTWihzl2qGnrrjy uf2wKLcJ6sw5OH8HGdOHQsKfok5DtJf/7/WV7AGY/aZ+I2JiBwbCpVvOUeppGZemehSW Xw8xOUEOaDbAx5C6dJKvaxWfr+GAHGF6ruacsv5B2wmuktWyXT1awRTnZFmC/1ZmgMnV SmRZl8zz6/wLoqfYpD1ozgmElZiLhHgN9JZCB2/LoIYcirHnuVoORBdddJKAq61WcjtB droA== 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=t/TBSsqo/3PZG//kKjzBxqBhIhs+Qitm7vuazfD4aPI=; fh=W1ujNbDikRM6mL+MA7cZ93eipzimk+g+Mb7QYnlff5s=; b=Xh7m7C8Jl1CD8OKI3YtP8A30hkJqgjSDoXwfMeZlv1K9kuHaeH+FoU1EyivWyvZnOq QSaGdiNYbwBa0y8x8zOZ3FEWJxcD0dT0gsP7A3HZzoZjkXc9SoqIVN6ikbJ3GSDGxlaz BPY5oEo5yKSvYuRqXFdlKwE80lbY3bVMify6CGZ/bxu+h1szDxOvqY6A9T/QR8t9dxmm d48RctRQoubL4FWGNoo6P5od/jk6anmb3ZhjvK0Gp+m4SKNTlg1hDNYvyed2RslESBoi Bhaoca5qYdpD/wOjKscKc3FTow2ICJGJIo+YiDzxosKhv+V13HU0oi2Y491aeWX4BPDR VQ4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=DDk4A7es; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id z185-20020a254cc2000000b00d9ad33acd66si1160955yba.122.2023.10.26.20.42.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 20:42:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=DDk4A7es; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 8E0488092149; Thu, 26 Oct 2023 20:41:37 -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 S1345260AbjJ0DlH (ORCPT <rfc822;aposhian.dev@gmail.com> + 26 others); Thu, 26 Oct 2023 23:41:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235084AbjJ0Dkl (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 26 Oct 2023 23:40:41 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D0CFD55 for <linux-kernel@vger.kernel.org>; Thu, 26 Oct 2023 20:40:09 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-27ffa7e32feso1021876a91.3 for <linux-kernel@vger.kernel.org>; Thu, 26 Oct 2023 20:40:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1698378008; x=1698982808; 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=t/TBSsqo/3PZG//kKjzBxqBhIhs+Qitm7vuazfD4aPI=; b=DDk4A7esaWB+86LNddvgqDFGUgvg28BtPxHclNVDfMg4e3q3fLwhP8/DGVObzZieaI /w7z3IrEiny0Z7GMRYS8WS6hhYXYzf6WkejXu8aJ5lzWacs4Vy8El4yX25hSWNC6YvwS utVcdaYgeReeIEfM8FE0CoUc1jCAvOpDQnw1aFpsakX6dkxB4mzjkBlghN/1ltsZPjDI If5DLS0+Jc+ER+3Swkg8YwzyumXanbouv4Q0BdgXJwIdtGdM0yDKBZWJLq8lEbVX3O7f MHODGKbBPvnAGdAVBqwrqNLi402k7beZvvnCiq6/BktDFqiId6l3XWX8sJU82Tub/OWq 1SKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698378008; x=1698982808; 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=t/TBSsqo/3PZG//kKjzBxqBhIhs+Qitm7vuazfD4aPI=; b=CEqMV7bZX4V7ugq4PcDh2TBwpAS6CtlEUG80Wisip1mSdxX7JDpYPwN3czHPo+BzcK GORqnYPrw68lWNrvCqCFjhrs/sUlole9U8oIlcKlC3mUrgc7GUOsMyOwZqR9ZjNTho3h YRKY39ewfbYaQibUw+mBON4RJ6TxCDHjvlwWB0T5vFlGq0/6fhnGvy+5vHnAUt5N+h8j XuZE0uTQqKbKMfvbpkR+xf2Adj9SYcqAlpoGHF3xHvB7TwpD8KE5n4eUz9e6h/hvTYxJ 9SVplmuNrb04WQNvNO1ZLW+iZCD2I5DVOOuHpCg1dsqYqwjmdu65MAwqzKG/w73pLSCM pntw== X-Gm-Message-State: AOJu0YzGTvyOgwkzw9SK2sNh8OAnd5zehbJdNUS5ZYWPAdyVv4+dKxqe 5I9nWOqI+8VsTLyc6x/FXy1n3Q== X-Received: by 2002:a17:90b:18e:b0:27d:2663:c5f4 with SMTP id t14-20020a17090b018e00b0027d2663c5f4mr1538778pjs.47.1698378008501; Thu, 26 Oct 2023 20:40:08 -0700 (PDT) Received: from GL4FX4PXWL.bytedance.net ([203.208.189.7]) by smtp.gmail.com with ESMTPSA id ms19-20020a17090b235300b00267d9f4d340sm2345676pjb.44.2023.10.26.20.40.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 26 Oct 2023 20:40:08 -0700 (PDT) From: Peng Zhang <zhangpeng.00@bytedance.com> 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 v7 09/10] maple_tree: Preserve the tree attributes when destroying maple tree Date: Fri, 27 Oct 2023 11:38:44 +0800 Message-Id: <20231027033845.90608-10-zhangpeng.00@bytedance.com> X-Mailer: git-send-email 2.39.3 (Apple Git-145) In-Reply-To: <20231027033845.90608-1-zhangpeng.00@bytedance.com> References: <20231027033845.90608-1-zhangpeng.00@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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: <linux-kernel.vger.kernel.org> 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]); Thu, 26 Oct 2023 20:41:37 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780878584057254012 X-GMAIL-MSGID: 1780878584057254012 |
Series |
Introduce __mt_dup() to improve the performance of fork()
|
|
Commit Message
Peng Zhang
Oct. 27, 2023, 3:38 a.m. UTC
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 <zhangpeng.00@bytedance.com> Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com> --- 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 718a222cc090..4439469442c7 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -6763,7 +6763,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);