Re: [PATCH perf/core 07/22] uprobes: Remove breakpoint in unapply_uprobe under mmap_write_lock

Jiri Olsa
2025-04-28T11:11:16Z

On Sun, Apr 27, 2025 at 04:24:01PM +0200, Oleg Nesterov wrote:
> On 04/21, Jiri Olsa wrote:
> >
> > @@ -1483,7 +1483,7 @@ static int unapply_uprobe(struct uprobe *uprobe, struct mm_struct *mm)
> > struct vm_area_struct *vma;
> > int err = 0;
> >
> > - mmap_read_lock(mm);
> > + mmap_write_lock(mm);
>
> So uprobe_write_opcode() is always called under down_write(), right?
> Then this
>
> * Called with mm->mmap_lock held for read or write.
>
> comment should be probably updated.

yes

>
> And perhaps the comment above mmap_write_lock() in register_for_each_vma()
> should be updated too... or even removed.

hum, not sure now how it's related to this change, but will stare at it bit more

thanks,
jirka