[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240610112223.151faf65@rorschach.local.home>
Date: Mon, 10 Jun 2024 11:22:23 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Julia Lawall <Julia.Lawall@...ia.fr>
Cc: kernel-janitors@...r.kernel.org, Masami Hiramatsu <mhiramat@...nel.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org, "Paul E .
McKenney" <paulmck@...nel.org>, Vlastimil Babka <vbabka@...e.cz>
Subject: Re: [PATCH 05/14] tracefs: replace call_rcu by kfree_rcu for simple
kmem_cache_free callback
On Sun, 9 Jun 2024 10:27:17 +0200
Julia Lawall <Julia.Lawall@...ia.fr> wrote:
> diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c
> index 7c29f4afc23d..338c52168e61 100644
> --- a/fs/tracefs/inode.c
> +++ b/fs/tracefs/inode.c
> @@ -53,14 +53,6 @@ static struct inode *tracefs_alloc_inode(struct super_block *sb)
> return &ti->vfs_inode;
> }
>
> -static void tracefs_free_inode_rcu(struct rcu_head *rcu)
> -{
> - struct tracefs_inode *ti;
> -
> - ti = container_of(rcu, struct tracefs_inode, rcu);
> - kmem_cache_free(tracefs_inode_cachep, ti);
Does this work?
tracefs needs to be freed via the tracefs_inode_cachep. Does
kfree_rcu() handle specific frees for objects that were not allocated
via kmalloc()?
-- Steve
> -}
> -
> static void tracefs_free_inode(struct inode *inode)
> {
> struct tracefs_inode *ti = get_tracefs(inode);
> @@ -70,7 +62,7 @@ static void tracefs_free_inode(struct inode *inode)
> list_del_rcu(&ti->list);
> spin_unlock_irqrestore(&tracefs_inode_lock, flags);
>
> - call_rcu(&ti->rcu, tracefs_free_inode_rcu);
> + kfree_rcu(ti, rcu);
> }
>
> static ssize_t default_read_file(struct file *file, char __user *buf,
Powered by blists - more mailing lists