From patchwork Tue Feb 6 12:10:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 197425 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1502092dyb; Tue, 6 Feb 2024 04:28:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IHFWT6CKxZUMqDM+Vbqvy2Jh1e2RakHB+u9c92aV5iHAslzR/o81ua5w2WdNJjlJRjCEDzo X-Received: by 2002:a17:906:3ad9:b0:a37:478a:929b with SMTP id z25-20020a1709063ad900b00a37478a929bmr1511701ejd.8.1707222536429; Tue, 06 Feb 2024 04:28:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707222536; cv=pass; d=google.com; s=arc-20160816; b=JGH1PjHJF5DDMsXxEfHdXONit4hYQkTM4V/BlUcgTNCp19COuRVfHZBeysczFRAe3g Kw2xJ9iyx+Y5iESbOjnax13zAy+eRxdtHpm4xu/EBpGDtM9bEtZOQoeXHG7GJPsjYvfr M9gSpjd55yffdLMeSuBi9yENnBgVNFmoG5wG4O7TYzr920Bl+SHYpJvoZjLNCJs5XW1a pGUd5hHReU2/tUpwcErTXaoKeu5hxbp6lb4of2wDmCaaJH325aGU09f7mwMxgxxMKMR/ PoRGahM0czmRR3AoVAjlg2r0OT/jZBZcny92SF95Zj9jo7q/u0dOnGhp9OLkFdKUGQlT hmrg== 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=fi4gwqOVN/O8XiaqR51qoZHTPe73FS9RXefVlSn0v0E=; b=ErMo6snbxdMvU9Ekpr69oF+M1NBGLs7Yk4wpBERegPVeqR/93FHUoiqL4z38xoRHHR 9jH5u492cI011ySvhy7Oe/jMLClRMK+Ka3tH9QHjOeayfs3tyc+z/SPJAY7aOQZZy+cl 3uY4ycu6U5cdsGgXWy7k8HB/RlJYVdzSWrfqA/+ssakPOAvpbmq6SGXvryD3lgiFixNr SE4kPnkhEanyq5lwJ7LRFsUvm1kDEV8KKcC6hLNDrFJ1i9P3nRn+fBY96tTlyoZXtCHG k/jlQg5h9pMRQF/d+CJv4gvq4VjGVLlgbpT0T7feTJcTg4VDGDCd0lRftggxhPbAh9NR 0iYg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-54932-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54932-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCVSsvayFBuYX+0jkzWYUG57K42j8Oodwk5YabROLZFxwhIi/+SuguYk2E+2z2zahLRfGKLJGleW6kZbf6ZTRaToTVcB3A== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d15-20020a17090648cf00b00a3549e68608si982185ejt.664.2024.02.06.04.28.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 04:28:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54932-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-54932-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54932-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0AE791F2341E for ; Tue, 6 Feb 2024 12:28:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 07C69152E1F; Tue, 6 Feb 2024 12:09:44 +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 990B913C1CB; Tue, 6 Feb 2024 12:09:27 +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=1707221367; cv=none; b=IU8Ae4sisJwWOg1W9b0ri4pi7j/bLs5QjX/1zqQZKp/uOA6dHZYHOV/44UY4TZ6VlTCZK5aQCK3srFQXDmoIPZcvEC9V9TQR67Yg2IRsAv3M25HN0YKFVi/mt9yQPWoJyaXs9x4vaDPTEqJ0njI8XIiPF1DS1qSjiCGfIy3fUzg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707221367; c=relaxed/simple; bh=ovB9zqm93FTVxxBECSNPxdclrmbXtlerbnuNH1s24zo=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=dP0bV3VisWN6AcdQS757tjpt+GNZ8J7Zpy0sjJysZk/gCMmQD0QsiFeiodTbHyvXZw8RXm4KZZbBUx7JIZVH0X+7agN2dBhZvgjeUscSHnYZP13bVo28Cerbgr9E9EGv3oik68eO4vdnWT1pX8zIPBabuQMOoiDkwtbDsnkZm2s= 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 0DD28C43601; Tue, 6 Feb 2024 12:09:27 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rXKGx-00000006bSq-20U5; Tue, 06 Feb 2024 07:09:55 -0500 Message-ID: <20240206120955.335266477@rostedt.homelinux.com> User-Agent: quilt/0.67 Date: Tue, 06 Feb 2024 07:10:00 -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.6][PATCH 55/57] eventfs: Restructure eventfs_inode structure to be more condensed References: <20240206120905.570408983@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: 1790152578329903789 X-GMAIL-MSGID: 1790152578329903789 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)