Re: [PATCH v2 2/6] uprobes: protected uprobe lifetime with SRCU
From: Oleg Nesterov
Date: Thu Aug 08 2024 - 06:20:45 EST
On 08/07, Andrii Nakryiko wrote:
>
> struct uprobe {
> - struct rb_node rb_node; /* node in the rb tree */
> + union {
> + struct rb_node rb_node; /* node in the rb tree */
> + struct rcu_head rcu; /* mutually exclusive with rb_node */
Andrii, I am sorry.
I suggested this in reply to 3/8 before I read
[PATCH 7/8] uprobes: perform lockless SRCU-protected uprobes_tree lookup
I have no idea if rb_erase() is rcu-safe or not, but this union certainly
doesn't look right if we use rb_find_rcu/etc.
Yes, this version doesn't include the SRCU-protected uprobes_tree changes,
but still...
Oleg.