Re: [PATCH v2 2/6] uprobes: protected uprobe lifetime with SRCU

2024-08-08 Thread Andrii Nakryiko
On Thu, Aug 8, 2024 at 9:58 AM Andrii Nakryiko wrote: > > On Thu, Aug 8, 2024 at 3:20 AM Oleg Nesterov wrote: > > > > On 08/07, Andrii Nakryiko wrote: > > > > > > struct uprobe { > > > - struct rb_node rb_node;/* node in the rb tree */ > > > + union { > > > +

Re: [PATCH v2 2/6] uprobes: protected uprobe lifetime with SRCU

2024-08-08 Thread Andrii Nakryiko
On Thu, Aug 8, 2024 at 3:20 AM Oleg Nesterov wrote: > > 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 */ >

Re: [PATCH v2 2/6] uprobes: protected uprobe lifetime with SRCU

2024-08-08 Thread Oleg Nesterov
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 ex

[PATCH v2 2/6] uprobes: protected uprobe lifetime with SRCU

2024-08-07 Thread Andrii Nakryiko
To avoid unnecessarily taking a (brief) refcount on uprobe during breakpoint handling in handle_swbp for entry uprobes, make find_uprobe() not take refcount, but protect the lifetime of a uprobe instance with RCU. This improves scalability, as refcount gets quite expensive due to cache line bouncin