Message ID | 20231016032226.59199-10-zhangpeng.00@bytedance.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 13673CDB465 for <linux-mm@archiver.kernel.org>; Mon, 16 Oct 2023 03:23:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A07AE8D002A; Sun, 15 Oct 2023 23:23:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9B84A8D0001; Sun, 15 Oct 2023 23:23:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 880198D002A; Sun, 15 Oct 2023 23:23:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 7A54A8D0001 for <linux-mm@kvack.org>; Sun, 15 Oct 2023 23:23:44 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 5F5C41CB4DC for <linux-mm@kvack.org>; Mon, 16 Oct 2023 03:23:44 +0000 (UTC) X-FDA: 81349879968.15.9EF92A8 Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by imf25.hostedemail.com (Postfix) with ESMTP id 95D3EA0008 for <linux-mm@kvack.org>; Mon, 16 Oct 2023 03:23:42 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=EpRufxpO; spf=pass (imf25.hostedemail.com: domain of zhangpeng.00@bytedance.com designates 209.85.215.171 as permitted sender) smtp.mailfrom=zhangpeng.00@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697426622; 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:in-reply-to:references:references:dkim-signature; bh=AVtomugZIRVe5XO/IomDBee5ri378ZRM5/INN5nVYsk=; b=RQF3CqDJfJR/ucxR0D4FZSnI/WL1Xygkz3iZv5ptX7MG+lNqoDzFKU9ARif5ARuMA8MqZE B96vxlIVuZIoW9yf18H1Y0yP60jFZuNJhDwdUrSFeivE+5W+osPJZrc8E9zA6l860n570I 7+Hd3/iRtZg4nFc9phc6NKX780l+kEk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697426622; a=rsa-sha256; cv=none; b=6qDPQpKwHe/X2gVm0WRD6feGJU6kkjq0zQDSR1YWTpCRZKXdvH2S93y7j+E5aISG3hhREI CVgetWVn3mZ9GDVC1Nuvh5czr/uAYlElMZu2FLwg7SoZeI/V/PDE07SfpLXIlHHJD20Vdi Qpa9NhB/qMwlq5C3XixIBPyAlLUNIdY= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=EpRufxpO; spf=pass (imf25.hostedemail.com: domain of zhangpeng.00@bytedance.com designates 209.85.215.171 as permitted sender) smtp.mailfrom=zhangpeng.00@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-5859a7d6556so3008845a12.0 for <linux-mm@kvack.org>; Sun, 15 Oct 2023 20:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1697426621; x=1698031421; darn=kvack.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=AVtomugZIRVe5XO/IomDBee5ri378ZRM5/INN5nVYsk=; b=EpRufxpOd3zFayw7sN/jwNEpbeL0MX1O4zAF9x5n4L4bN6P8eQ9bvYQNaVNu3jRnWE ZjszyzZremxyBfE4fdG3EfIvv3NhS4I/KyMvRLOOoIhJct3pIcV7DSMxB8muANBooXvJ 3VJvP20VsaVUGy80TdeCZKaW57Oc3UW7ZIJraGR2ZqffJHYWRqRzxqCmj9XOUsOxXazs fRKL9f7e92cKjzz0F2e4GyS2MeOtcM2K3W5IizNqI75fRG9EhJkc5H0mjpwUyGdNGi0H Y4yJGofa4v93bTqywyvQj+6e4RlH96MHLRmLtEtG5d8cxOjaCMh2dp31HlCnCd6jhCK0 883Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697426621; x=1698031421; 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=AVtomugZIRVe5XO/IomDBee5ri378ZRM5/INN5nVYsk=; b=noivsorRbIw9lNeBeenlPhu7MarRhzEQTvcUB2SZq7UQU3n+nSx/ldZt0XiIbo37Oc HETfg+SZQGo+DjZNfdxA05PhAak1E6twoD0f+XBWQT+gbrzpsqvbUONlVZ9AbQMBxEwj NuDfGxEZcCgHF879DYAosEd/HOuvBr+EywzhEPdLIaNE0KifNavuWzgvsZvvMfL9m8lf qVt4lM8sBKUNaN4uzOYxZRmh6H68r42q6fJZG9JxVm0exMRsq8LEKAg4IEAywL6wMBJq xQwxtML/BDWCh42ujr8VaP0W/00DxkZVR6DhDRxLi/7+8edWH/AhV2zpNYVF4Os++dh9 XGew== X-Gm-Message-State: AOJu0YzhZNKX8QT+EvUw3ajm4oxnqHBGAcQUuYIZApaHGKEV7tqbWvM2 +wIvUiaFYI0nfY1DtWx8V3lmig== X-Google-Smtp-Source: AGHT+IHSb0DNGBGR2h/8IDjSmu+jqGvudTUl4FEPI1UTDCPUIrsebdcLp2Rpr+bgZ6cxOHBljaILuA== X-Received: by 2002:a17:90a:d48b:b0:27c:f2e5:a82 with SMTP id s11-20020a17090ad48b00b0027cf2e50a82mr15318761pju.15.1697426621551; Sun, 15 Oct 2023 20:23:41 -0700 (PDT) Received: from GL4FX4PXWL.bytedance.net ([139.177.225.232]) by smtp.gmail.com with ESMTPSA id d8-20020a17090ae28800b0027758c7f585sm3452770pjz.52.2023.10.15.20.23.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 15 Oct 2023 20:23:41 -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 v5 09/10] maple_tree: Preserve the tree attributes when destroying maple tree Date: Mon, 16 Oct 2023 11:22:25 +0800 Message-Id: <20231016032226.59199-10-zhangpeng.00@bytedance.com> X-Mailer: git-send-email 2.39.3 (Apple Git-145) In-Reply-To: <20231016032226.59199-1-zhangpeng.00@bytedance.com> References: <20231016032226.59199-1-zhangpeng.00@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: a3g36rhczj479gghr14f3ofc6neyta84 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 95D3EA0008 X-Rspam-User: X-HE-Tag: 1697426622-684001 X-HE-Meta: U2FsdGVkX1+Hmv/M1zu9P2bxDYZfhtRbBQVQxscnw43o15+e4vm1//Nu4+16JUCBsRLp8xOuS8uJaKGNNnbGvcQL8GVGZBmb3Cq2ghH5xS5BmT39/Lb+pmGJJuCaFs5NKeIujEh45/GlVO32msHoM0lgdFRP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j6JM+EtpY0DpoDcNR7KCGuhInodS8BjWYOsEzQxUZXfdI9FjhDo3Tl9L+Rd9emxaKAAQ5cvfGDRnq3vCyPtbTA/ByarKtBEyyezuXdt/rszaC7gl7+aYBMRBWadEC5o/Bdg9AWA/RNXa9rFaxByOot39xwIWWIdam0DxBPQH+iW/muxDQu+zVDW4koI4JkRYkQ+pn3EEy4RyPnkvZUIcVF63t9LOwvRf4NVJ0eEykinnw49cgNw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000082, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
Introduce __mt_dup() to improve the performance of fork()
|
expand
|
diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 6e0ad83f14e3..9b5e5580b252 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -6779,7 +6779,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);
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> --- lib/maple_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)