From patchwork Tue Feb 6 11:32:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 197347 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1482546dyb; Tue, 6 Feb 2024 03:53:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IFIQGMd9ULAvW1MUoM1cSWpsxdnP+9f6KgJd4r8yhicMgf2SQjh4EjrAMEHKP4aIDu+Ktax X-Received: by 2002:a17:902:e80e:b0:1d9:3d72:b296 with SMTP id u14-20020a170902e80e00b001d93d72b296mr1332697plg.35.1707220404509; Tue, 06 Feb 2024 03:53:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707220404; cv=pass; d=google.com; s=arc-20160816; b=IKRsf0P7zE72ikqEUnFwm4L39LkjpqtfXN1rnhZJ+EP3OjOOWp9oDLL/gqUIV2nD2e fWqRUA72ApWNggGPJ+dwJX4JjKPOyzzMs3yOdz3ZujgOnZuxC1AMgx1TFG/oJcwBa6tb FIYIgc1JE2Wq3yYw/q+Ex1sKpBYimsHvE4T6LOkKgNlvOIkFlXc5Gvh2Gntbu0hwHVbt l4rR1I8Vi3DsTanjwccE7ESh+22AN7lDOAYvjHYgc4F3rV+suAsWRoHaLHX45RDx4NFA TpvJzBw2aVuJhDNsHvMoSJ9t1vp6U2/hQNS0/Ti/F/Oh7TFAvgZ1cM8dBfqW6strKUiG wRxQ== 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=yQvYu4PlEpv1rOx1zrXjk3aBdiBZnT+MjoFuOI8rBCM=; fh=Je29vOftpQjkhRFvQH0oQq74xN/iJ8xAywjnscmezpA=; b=0GB9N/IhU0rDOzg6zqkWh6PBx5/fKgnwTppP5Yw8zvlqcI986EuXKBcueVXYp9Ol4G YGzlhSY7QAye9LxQSiQFcVM7zVNkm7NYdYbpNipkvDIshddloA2ZXY60JeO1f/H7TX92 O7te6Gu7zL8eNtwdlGIkZQigrDDrm6yM+ZTRYCudOod1mTdm95ndSGwqs5HtOtVmorIi 9FYuQxgasoYXy4FOV+v56iJynJnqFryUvoiwF4XTjJJZgweCyz4Qs/Hz682tFfb1uU60 09BDhN4Q4FzOtZ+CvVhiKCMM+aDUj+BxF/2+/dWXsWXTPYEiAKFO81p6t1MVPuUxitEv TcLg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-54806-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54806-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCWhroTwRnRk+SZmeBgFQUHF2eQbwLRjJLqTs0qiqxwiTY+7ZzajmuZpwdhtm4+PMxv7sLGfV2H6ht0hKX1zOereG6gAiQ== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id b11-20020a170903228b00b001d942aa254csi1546482plh.294.2024.02.06.03.53.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 03:53:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54806-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-54806-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54806-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 1D767285150 for ; Tue, 6 Feb 2024 11:53:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6419D13A25B; Tue, 6 Feb 2024 11:33:39 +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 69FCD134CFD; Tue, 6 Feb 2024 11:33:33 +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=1707219213; cv=none; b=GELwH/kn162Pyy/qhPD9MsW0W/8Uy9tpR9oXxFiC0BcpGzvLAEJvktt5cCHSGIi+6727WO1puPsBPeaPQWoKrbPTrzFJqbplJu3Tis66pvmXmWEhrDzbfc3AhMIjWYMzgk93UiTyuI6cmux/f1uSJu9JS5a+kBm/CtZrzN0RU2M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707219213; c=relaxed/simple; bh=ovB9zqm93FTVxxBECSNPxdclrmbXtlerbnuNH1s24zo=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=cFHJmruJDfhbljS00I7crpY/KsKIJvcQBgGia9xeXWuhx6zJLKHvEe8TGVAyK5gyDtgumDiSesg/QJNAoBHui5inxNtPGyGUDwqypLlLcsqtxcDVdkLuVdlOUnWrfmk9I8pInv/MOm/BZx3v4PtomN/6w2HGHY7TxD0s+8ZvkYs= 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 430E6C43394; Tue, 6 Feb 2024 11:33:33 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rXJiD-00000006aQq-2eTT; Tue, 06 Feb 2024 06:34:01 -0500 Message-ID: <20240206113401.490005209@rostedt.homelinux.com> User-Agent: quilt/0.67 Date: Tue, 06 Feb 2024 06:32:19 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Linus Torvalds , Greg Kroah-Hartman , Sasha Levin , Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Christian Brauner , Al Viro , Ajay Kaher Subject: [v6.7][PATCH v2 21/23] eventfs: Restructure eventfs_inode structure to be more condensed References: <20240206113158.822006147@rostedt.homelinux.com> 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: 1790150342600830155 X-GMAIL-MSGID: 1790150342600830155 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) (cherry picked from commit 264424dfdd5cbd92bc5b5ddf93944929fc877fac) --- 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)