Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: SJ Park <sj@kernel.org>
To: Miguel Ojeda <ojeda@kernel.org>
Cc: SJ Park <sj@kernel.org>,
	gregkh@linuxfoundation.org, 4ncienth@gmail.com,
	akpm@linux-foundation.org, azpijr@gmail.com, corbet@lwn.net,
	david@kernel.org, jannh@google.com, liam@infradead.org,
	ljs@kernel.org, mhocko@suse.com, patches@lists.linux.dev,
	pfalcato@suse.de, rdunlap@infradead.org, rppt@kernel.org,
	sashal@kernel.org, shakeel.butt@linux.dev,
	stable@vger.kernel.org, surenb@google.com, vbabka@kernel.org,
	linux-mm@kvack.org, Dave Hansen <dave.hansen@linux.intel.com>
Subject: Re: [PATCH 7.3 463/507] mm/vma: avoid spurious write locks when mm->mm_lock_seq overflows
Date: Fri, 13 Nov 2026 19:19:42 -0800	[thread overview]
Message-ID: <20261114031943.192867-1-sj@kernel.org> (raw)
In-Reply-To: <20261114003912.82206-1-ojeda@kernel.org>

On Sat, 14 Nov 2026 01:39:12 +0100 Miguel Ojeda <ojeda@kernel.org> wrote:

> On Fri, 13 Nov 2026 10:52:47 -0500 Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> >
> > @@ -589,6 +593,16 @@ static inline void vma_end_write_all(struct mm_struct *mm)
> >  {
> >  	mmap_assert_write_locked(mm);
> >  	mm_lock_seqcount_end(mm);
> > +
> > +	/*
> > +	 * VMA seqcounts are not updated on unlock, so once the mm seqcount has
> > +	 * wrapped, any VMA still carrying a sequence number from before the
> > +	 * wrap would satisfy __is_vma_write_locked() when that number comes
> > +	 * round again, and readers would not be excluded. Reset every VMA's
> > +	 * seqcount so that no stale value survives the wrap.
> > +	 */
> > +	if (unlikely(!mm->mm_lock_seq.sequence))
> > +		__mm_reset_vma_seqcounts(mm);
> >  }
> 
> In a UM ~defconfig build with LLVM:
> 
>     In file included from arch/um/kernel/asm-offsets.c:8:
>     In file included from ./include/linux/audit.h:13:
>     In file included from ./include/linux/ptrace.h:10:
>     In file included from ./include/linux/pid_namespace.h:7:
>     In file included from ./include/linux/mm.h:18:
>     ./include/linux/mmap_lock.h:604:20: error: no member named 'mm_lock_seq' in 'struct mm_struct'
>       604 |         if (unlikely(!mm->mm_lock_seq.sequence))
>           |                       ~~  ^
>     ./include/linux/compiler.h:77:42: note: expanded from macro 'unlikely'
>        77 | # define unlikely(x)    __builtin_expect(!!(x), 0)
>           |
> 
> That exists only under `CONFIG_PER_VMA_LOCK` (commit 47e725702b0b ("mm:
> make per-VMA locks available universally") from Dave's series was not
> backported).

I found same thing while running kunit.  I also confirmed both applying commit
47e725702b0b from Dave and reverting this patch fix the problem on my setup.


Thanks,
SJ

[...]


      reply	other threads:[~2026-11-14  3:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20261113153812.408825269@linuxfoundation.org>
2026-11-14  0:39 ` [PATCH 7.3 463/507] mm/vma: avoid spurious write locks when mm->mm_lock_seq overflows Miguel Ojeda
2026-11-14  3:19   ` SJ Park [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261114031943.192867-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=4ncienth@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=azpijr@gmail.com \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=david@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jannh@google.com \
    --cc=liam@infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=ojeda@kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=pfalcato@suse.de \
    --cc=rdunlap@infradead.org \
    --cc=rppt@kernel.org \
    --cc=sashal@kernel.org \
    --cc=shakeel.butt@linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox