Re: [PATCH 5/8] uprobes: travers uprobe's consumer list locklessly under SRCU protection

2024-08-06 Thread Oleg Nesterov
On 08/05, Andrii Nakryiko wrote: > > On Mon, Aug 5, 2024 at 8:59 AM Oleg Nesterov wrote: > > > > > int uprobe_apply(struct uprobe *uprobe, struct uprobe_consumer *uc, bool > > > add) > > > { > > > struct uprobe_consumer *con; > > > - int ret = -ENOENT; > > > + int ret = -ENOENT, s

Re: [PATCH 5/8] uprobes: travers uprobe's consumer list locklessly under SRCU protection

2024-08-05 Thread Andrii Nakryiko
On Mon, Aug 5, 2024 at 8:59 AM Oleg Nesterov wrote: > > On 07/31, Andrii Nakryiko wrote: > > > > @@ -1120,17 +1098,19 @@ void uprobe_unregister(struct uprobe *uprobe, > > struct uprobe_consumer *uc) > > int err; > > > > down_write(&uprobe->register_rwsem); > > - if (WARN_ON(!consu

Re: [PATCH 5/8] uprobes: travers uprobe's consumer list locklessly under SRCU protection

2024-08-05 Thread Oleg Nesterov
On 07/31, Andrii Nakryiko wrote: > > @@ -1120,17 +1098,19 @@ void uprobe_unregister(struct uprobe *uprobe, struct > uprobe_consumer *uc) > int err; > > down_write(&uprobe->register_rwsem); > - if (WARN_ON(!consumer_del(uprobe, uc))) { > - err = -ENOENT; OK, I agree, th

Re: [PATCH 5/8] uprobes: travers uprobe's consumer list locklessly under SRCU protection

2024-08-01 Thread Andrii Nakryiko
On Thu, Aug 1, 2024 at 7:27 AM Jiri Olsa wrote: > > On Wed, Jul 31, 2024 at 02:42:53PM -0700, Andrii Nakryiko wrote: > > SNIP > > > static int __copy_insn(struct address_space *mapping, struct file *filp, > > void *insn, int nbytes, loff_t offset) > > { > > @@ -924,7 +901,8

Re: [PATCH 5/8] uprobes: travers uprobe's consumer list locklessly under SRCU protection

2024-08-01 Thread Jiri Olsa
On Wed, Jul 31, 2024 at 02:42:53PM -0700, Andrii Nakryiko wrote: SNIP > static int __copy_insn(struct address_space *mapping, struct file *filp, > void *insn, int nbytes, loff_t offset) > { > @@ -924,7 +901,8 @@ static bool filter_chain(struct uprobe *uprobe, struct > mm_

[PATCH 5/8] uprobes: travers uprobe's consumer list locklessly under SRCU protection

2024-07-31 Thread Andrii Nakryiko
uprobe->register_rwsem is one of a few big bottlenecks to scalability of uprobes, so we need to get rid of it to improve uprobe performance and multi-CPU scalability. First, we turn uprobe's consumer list to a typical doubly-linked list and utilize existing RCU-aware helpers for traversing such li