From patchwork Fri Feb 2 02:30:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 195537 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp165497dyc; Thu, 1 Feb 2024 18:32:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFD9vavKPEe4iUk8wOwi1UvSFegyKusyEEn+0SI7Prt961wVqb55mO6s3rxMIFeTixQSjWA X-Received: by 2002:ac8:120c:0:b0:42c:524:ef2b with SMTP id x12-20020ac8120c000000b0042c0524ef2bmr9646qti.8.1706841166167; Thu, 01 Feb 2024 18:32:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706841166; cv=pass; d=google.com; s=arc-20160816; b=Ajt4FHsZCKsl3LNo2mY2YtkxUsVQSBWCrj1q5p3KRjVXq2sTuG4EWPGtSjGH5j4jm6 3SPHg/zGp+fTp91GsPBRTZVwzqfbBrVPv2C22D4xoF4t3/boy2H7ZN5D/q6Io5g83ikA dZ1KAfZ5eqtcQwJGZ5Rq3xaYcou+kianpX14J1ixNEMtZvFghrioW803RyhaFNIIGzvU M7xaw/xhUVC7NPuKBRU8lV8Y8flnzOP4ntBBa+PYy99dL8AzjkJlhsQ0L+3sHnlKLG2v mVPTp5fyr4C4Av+uEoXv10OeuasywoI93h081P+/KFfn9NRSq4Lz2QGAK6QzPh1Qb21h aADw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:subject:cc:to:from:date:user-agent:message-id; bh=tzkWTNCsTQTwXNr62epHyvoEkAdMMSPbxF+s4xRRn/g=; fh=BlH24Hp+wE3pJTepBos8dWfi0DYhq58IiyfO/lVjDDY=; b=02V9b1VJSZHrPtxfYB0q5HP2KI+FzQRxjH+SKqfaefuCkcmFgnKwgbfUBxp93ZHmGo gTpP3HcEtj1HAcpyaf3tExnacXHF/ABjkK4WdKXNRnTADBuHomlnFJRZoUXT9OSW0FdK gTd45DR0fYtlZ/luW6HkWvRLyM+WEXVw8O9nrBLP7fnXcqgSfga4mnQC9oNpsL3ueJF+ w1OB5IuFR5TMWYz5dvopufwXDIGxC2rO+em8yQkweMhrHxt0+9IbGrkOE5c54tHr+8nI fQuGYFCnNApVEdW0RQN41ATMLPZwR9B7+d/rUeIvwCtlZJoKnSsb8r2h3//mzzGXSd2k 1MNQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-49104-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49104-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCXZFNRITtCtceP1dMb9gawyEl5nwDjGKKgfkcuqKzdfADS/To/REOX6VSs10CyeRcjJYNdbPtxWecs4A30zPnhlMNGYmw== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id u2-20020a05622a010200b0042bf207ab08si952903qtw.436.2024.02.01.18.32.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 18:32:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49104-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-49104-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49104-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id EFA401C240AB for ; Fri, 2 Feb 2024 02:32:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 77B7717BAC; Fri, 2 Feb 2024 02:30:09 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2ECE5F9E2 for ; Fri, 2 Feb 2024 02:30:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706841006; cv=none; b=bkoC6jHtMXhklHv2UU4SCbP0gogN8aQW11xocR0gP43PB3lZ97OK43CAQ+wWCjLmJr6H9rhNHnQt0pHXsRjYaU/2NRvgH+VZQNimfL9y8O4VKW6MtnTG2GghGvq6GA+d1YMCm0nMt94bY602nXpPvDH3E/eqpF1vuAYyaXJzzTs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706841006; c=relaxed/simple; bh=1bWv9KlxHQzO4IJ5J8Xlt8xuUk/3QGMai5L7xRHgYPA=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=hhB5Ton2OINDYq46qwVKd0xy5LkX+WUeGMOkHWYIJuGVGVmjZgdtkZ/VY5kzWOzmq0P0Kz0Z1zqmnCJ9TBHxzfc8UTM3idTUExNd+3vTp7Mth2t8adyONGlIBuC9wlATqRynglyjVpCeIcA/KSXlaIt6u8seTCROnPjYIbWYjHQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF115C4AF6A; Fri, 2 Feb 2024 02:30:05 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rVjJv-00000005kB4-3PGd; Thu, 01 Feb 2024 21:30:23 -0500 Message-ID: <20240202023023.672365977@goodmis.org> User-Agent: quilt/0.67 Date: Thu, 01 Feb 2024 21:30:10 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Linus Torvalds , Christian Brauner , Al Viro , Ajay Kaher Subject: [for-linus][PATCH 11/13] eventfs: Restructure eventfs_inode structure to be more condensed References: <20240202022959.515961549@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789752682339128932 X-GMAIL-MSGID: 1789752682339128932 From: "Steven Rostedt (Google)" Some of the eventfs_inode structure has holes in it. Rework the structure to be a bit more condensed, and also remove the no longer used llist field. Link: https://lore.kernel.org/linux-trace-kernel/20240201161617.002321438@goodmis.org Cc: Linus Torvalds Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Cc: Christian Brauner Cc: Al Viro Cc: Ajay Kaher Signed-off-by: Steven Rostedt (Google) --- fs/tracefs/internal.h | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/fs/tracefs/internal.h b/fs/tracefs/internal.h index 1886f1826cd8..beb3dcd0e434 100644 --- a/fs/tracefs/internal.h +++ b/fs/tracefs/internal.h @@ -32,40 +32,37 @@ struct eventfs_attr { /* * struct eventfs_inode - hold the properties of the eventfs directories. * @list: link list into the parent directory + * @rcu: Union with @list for freeing + * @children: link list into the child eventfs_inode * @entries: the array of entries representing the files in the directory * @name: the name of the directory to create - * @children: link list into the child eventfs_inode * @events_dir: the dentry of the events directory * @entry_attrs: Saved mode and ownership of the @d_children - * @attr: Saved mode and ownership of eventfs_inode itself * @data: The private data to pass to the callbacks + * @attr: Saved mode and ownership of eventfs_inode itself * @is_freed: Flag set if the eventfs is on its way to be freed * Note if is_freed is set, then dentry is corrupted. + * @is_events: Flag set for only the top level "events" directory * @nr_entries: The number of items in @entries + * @ino: The saved inode number */ struct eventfs_inode { - struct kref kref; - struct list_head list; + union { + struct list_head list; + struct rcu_head rcu; + }; + struct list_head children; const struct eventfs_entry *entries; const char *name; - struct list_head children; struct dentry *events_dir; struct eventfs_attr *entry_attrs; - struct eventfs_attr attr; void *data; + struct eventfs_attr attr; + struct kref kref; unsigned int is_freed:1; unsigned int is_events:1; unsigned int nr_entries:30; unsigned int ino; - /* - * Union - used for deletion - * @llist: for calling dput() if needed after RCU - * @rcu: eventfs_inode to delete in RCU - */ - union { - struct llist_node llist; - struct rcu_head rcu; - }; }; static inline struct tracefs_inode *get_tracefs(const struct inode *inode)