Re: [PATCH v3 tip/perf/core 1/4] mm: introduce mmap_lock_speculation_{start|end}

2024-10-25 Thread Suren Baghdasaryan
On Thu, Oct 24, 2024 at 2:57 AM Peter Zijlstra wrote: > > On Wed, Oct 23, 2024 at 03:17:01PM -0700, Suren Baghdasaryan wrote: > > > > Or better yet, just use seqcount... > > > > Yeah, with these changes it does look a lot like seqcount now... > > I can take

Re: [PATCH v3 tip/perf/core 1/4] mm: introduce mmap_lock_speculation_{start|end}

2024-10-24 Thread Suren Baghdasaryan
On Thu, Oct 24, 2024 at 4:20 PM Andrii Nakryiko wrote: > > On Thu, Oct 24, 2024 at 2:04 PM Suren Baghdasaryan wrote: > > > > On Thu, Oct 24, 2024 at 9:28 AM Suren Baghdasaryan > > wrote: > > > > > > On Thu, Oct 24, 2024 at 2:57 AM Peter Zijlstra &

Re: [PATCH v3 tip/perf/core 1/4] mm: introduce mmap_lock_speculation_{start|end}

2024-10-24 Thread Suren Baghdasaryan
On Thu, Oct 24, 2024 at 9:28 AM Suren Baghdasaryan wrote: > > On Thu, Oct 24, 2024 at 2:57 AM Peter Zijlstra wrote: > > > > On Wed, Oct 23, 2024 at 03:17:01PM -0700, Suren Baghdasaryan wrote: > > > > > > Or better yet, just use seqcount... > > > >

Re: [PATCH v3 tip/perf/core 1/4] mm: introduce mmap_lock_speculation_{start|end}

2024-10-23 Thread Suren Baghdasaryan
On Wed, Oct 23, 2024 at 1:10 PM Peter Zijlstra wrote: > > On Thu, Oct 10, 2024 at 01:56:41PM -0700, Andrii Nakryiko wrote: > > From: Suren Baghdasaryan > > > > Add helper functions to speculatively perform operations without > > read-locking mmap_lock, expect

Re: [PATCH v3 tip/perf/core 2/4] mm: switch to 64-bit mm_lock_seq/vm_lock_seq on 64-bit architectures

2024-10-17 Thread Suren Baghdasaryan
On Thu, Oct 17, 2024 at 11:55 AM Andrii Nakryiko wrote: > > On Wed, Oct 16, 2024 at 7:02 PM Suren Baghdasaryan wrote: > > > > On Sun, Oct 13, 2024 at 12:56 AM Shakeel Butt > > wrote: > > > > > > On Thu, Oct 10, 2024 at 01:56:42PM GMT, Andrii Nakryiko

Re: [PATCH v3 tip/perf/core 2/4] mm: switch to 64-bit mm_lock_seq/vm_lock_seq on 64-bit architectures

2024-10-16 Thread Suren Baghdasaryan
On Sun, Oct 13, 2024 at 12:56 AM Shakeel Butt wrote: > > On Thu, Oct 10, 2024 at 01:56:42PM GMT, Andrii Nakryiko wrote: > > To increase mm->mm_lock_seq robustness, switch it from int to long, so > > that it's a 64-bit counter on 64-bit systems and we can stop worrying > > about it wrapping around

Re: [PATCH v3 tip/perf/core 1/4] mm: introduce mmap_lock_speculation_{start|end}

2024-10-14 Thread Suren Baghdasaryan
On Mon, Oct 14, 2024 at 1:27 PM Andrii Nakryiko wrote: > > On Sun, Oct 13, 2024 at 12:56 AM Shakeel Butt wrote: > > > > On Thu, Oct 10, 2024 at 01:56:41PM GMT, Andrii Nakryiko wrote: > > > From: Suren Baghdasaryan > > > > > > Add helper function

Re: [PATCH v2 1/1] mm: introduce mmap_lock_speculation_{start|end}

2024-09-12 Thread Suren Baghdasaryan
On Thu, Sep 12, 2024 at 3:20 PM Andrii Nakryiko wrote: > > On Thu, Sep 12, 2024 at 2:04 PM Suren Baghdasaryan wrote: > > > > On Thu, Sep 12, 2024 at 2:02 PM Suren Baghdasaryan > > wrote: > > > > > > Add helper functions to speculatively perform opera

Re: [PATCH v2 1/1] mm: introduce mmap_lock_speculation_{start|end}

2024-09-12 Thread Suren Baghdasaryan
On Thu, Sep 12, 2024 at 2:02 PM Suren Baghdasaryan wrote: > > Add helper functions to speculatively perform operations without > read-locking mmap_lock, expecting that mmap_lock will not be > write-locked and mm is not modified from under us. Here you go. I hope I got the orderin

[PATCH v2 1/1] mm: introduce mmap_lock_speculation_{start|end}

2024-09-12 Thread Suren Baghdasaryan
Add helper functions to speculatively perform operations without read-locking mmap_lock, expecting that mmap_lock will not be write-locked and mm is not modified from under us. Suggested-by: Peter Zijlstra Signed-off-by: Suren Baghdasaryan Signed-off-by: Andrii Nakryiko --- Changes since v1 [1

Re: [PATCH 1/2] mm: introduce mmap_lock_speculation_{start|end}

2024-09-11 Thread Suren Baghdasaryan
On Wed, Sep 11, 2024 at 2:35 PM Andrii Nakryiko wrote: > > On Mon, Sep 9, 2024 at 7:09 PM Suren Baghdasaryan wrote: > > > > On Mon, Sep 9, 2024 at 5:35 AM Jann Horn wrote: > > > > > > On Fri, Sep 6, 2024 at 7:12 AM Andrii Nakryiko wrote: > > > &g

Re: [PATCH 2/2] uprobes: add speculative lockless VMA-to-inode-to-uprobe resolution

2024-09-10 Thread Suren Baghdasaryan
On Mon, Sep 9, 2024 at 2:29 PM Andrii Nakryiko wrote: > > On Mon, Sep 9, 2024 at 6:13 AM Jann Horn wrote: > > > > On Fri, Sep 6, 2024 at 7:12 AM Andrii Nakryiko wrote: > > > Given filp_cachep is already marked SLAB_TYPESAFE_BY_RCU, we can safely > > > access vma->vm_file->f_inode field locklessl

Re: [PATCH 1/2] mm: introduce mmap_lock_speculation_{start|end}

2024-09-09 Thread Suren Baghdasaryan
On Mon, Sep 9, 2024 at 5:35 AM Jann Horn wrote: > > On Fri, Sep 6, 2024 at 7:12 AM Andrii Nakryiko wrote: > > +static inline bool mmap_lock_speculation_end(struct mm_struct *mm, int seq) > > +{ > > + /* Pairs with RELEASE semantics in inc_mm_lock_seq(). */ > > + return seq == smp_load