Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Miguel Ojeda <ojeda@kernel.org>
To: gregkh@linuxfoundation.org
Cc: 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: Sat, 14 Nov 2026 01:39:12 +0100	[thread overview]
Message-ID: <20261114003912.82206-1-ojeda@kernel.org> (raw)
In-Reply-To: <20261113153812.408825269@linuxfoundation.org>

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 hope this helps!

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: linux-mm@kvack.org

Cc: Jose A. Perez de Azpillaga <azpijr@gmail.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Hildenbrand (Arm) <david@kernel.org>

Cheers,
Miguel


           reply	other threads:[~2026-11-14  0:39 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20261113153812.408825269@linuxfoundation.org>]

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=20261114003912.82206-1-ojeda@kernel.org \
    --to=ojeda@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=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