From patchwork Sun Feb 4 01:16:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 196395 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp148370dyb; Sat, 3 Feb 2024 17:23:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGTi3wcVkneDC1IoHKQSiBb1P/cK5BFQT4+2dnzksT/CA1loVsZB8W4EgchbRnrLwiUL9A X-Received: by 2002:a05:6808:118c:b0:3be:2f6e:5a93 with SMTP id j12-20020a056808118c00b003be2f6e5a93mr11064941oil.14.1707009813565; Sat, 03 Feb 2024 17:23:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707009813; cv=pass; d=google.com; s=arc-20160816; b=KrG/wIOYU9rdLWoBoZPUY4rHdEh3mzGB1qEW9Zgzy7G4FZ07o+nuYKqnQZT8fAygss HPG8HljWnh1vlypXMsQ8uwatKUACynSudCuDgZ+ZYwRVRvclZh1izG5UD6Eb8UtRUJcK /eP4hNyUq3uoA4y+IyZLDTMkDRJOcE+S5shD5PIO99vO14EvwusmWsuXT2I1ugmUmo+5 Gc4oIcbyFow+9Obje5MM5bZzxcvLr8TMyCVrOmyffZe/JQBJl5wH8dSTidlOR/DfTqhn 5jUfToPk/3SN204EHpAw26DqLoA84AlINYfiGJqT8hxFnTrGs0JVvy97VdGhk6HfxbEG aKuQ== 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=smh3nPhj+1ACE/S0RaleWW0gJufEBDnXh2ESqzR86bg=; b=jcg0a7DXCR8uc+Z0l7dS3JMf7/tlM0kQH+SZTDafeOzaBn282gMAyMmNbDwH+BotJW GfObAhg+3fu0mX+u5cnmb4UboNdzTPOrDcwu0iH8PUU1pQJczAb5ZyMYRU1u31fgEj2l aX5N+Rel3fuPLt+kWJ6kwAJS4LCPhdHL2NZ5Dzkb6o6ELJFcT5F2R/vB3DwnRUQJVd3U mC7A2csxIG4/W/iLi0YCQUqw6+P5YszGEPypBoEkGX3oZLCyxN9begHZRyxY0sysp24E Y5/980d/h9PNwtIx9awwJ0owG0VG3c19S/Lgi7nB+DLlcgXPsGhggtpjzEV+TlzExxEp fbSA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-51357-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51357-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCV1ELSjUHIjAwy19KZ/H1l0Zob873XTZx2ORHqlcIUmqI0BDtqGo8U1YUiIo4FgwCJ+butp1qdLPAgwDYohJ9H2E7xDJA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e10-20020a05622a110a00b0042c134e4232si1905811qty.341.2024.02.03.17.23.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 17:23:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51357-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-51357-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51357-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 5A5681C20924 for ; Sun, 4 Feb 2024 01:23:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1549218B14; Sun, 4 Feb 2024 01:18:13 +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 42F5F101FA; Sun, 4 Feb 2024 01:18:08 +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=1707009488; cv=none; b=baHu0vwkzBR0gYKnYacZ96zEsLEe4OXT7d+lchAYJY5421xBTz8XFDTRYaIkrjM7ee3I05x0UE2rCLNbMK8rj9r6kqnQc0qoIjViT/SI6oR92arEvhP5C0F++qXaNO2T9xesV6GwCb1FXUNj4sSifJ5S7R++D3yvDNlpg6bm8/A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707009488; c=relaxed/simple; bh=1bWv9KlxHQzO4IJ5J8Xlt8xuUk/3QGMai5L7xRHgYPA=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=biJZ+0qtNlzu7Y098Z4rxo7BzuoQX8QjlNd9JdvaY/KojfJupkWW24G5k0fDr29v24gIvXqHr43j7EVTN0lD6LY615/vvOjrL/GmDK6HkIV8k6oJdBdJvBOtBXHfjr09ikLVJ4xUZbkBs8SS24Sv5R8G8rgD6gDL6NwfbqmXBP4= 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 C497BC32799; Sun, 4 Feb 2024 01:18:07 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rWR9S-00000006Our-1vXx; Sat, 03 Feb 2024 20:18:30 -0500 Message-ID: <20240204011830.314244430@goodmis.org> User-Agent: quilt/0.67 Date: Sat, 03 Feb 2024 20:16:36 -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 , Andrew Morton , Christian Brauner , Al Viro , Ajay Kaher Subject: [v6.7][PATCH 21/23] eventfs: Restructure eventfs_inode structure to be more condensed References: <20240204011615.703023949@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: 1789929522423459512 X-GMAIL-MSGID: 1789929522423459512 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)