linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "David Hildenbrand (Red Hat)" <david@kernel.org>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: "Liam R . Howlett" <Liam.Howlett@oracle.com>,
	Vlastimil Babka <vbabka@suse.cz>, Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>, SeongJae Park <sj@kernel.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Chris Mason <clm@meta.com>
Subject: Re: [PATCH mm-hotfixes] mm: remove unnecessary and incorrect mmap lock assert
Date: Wed, 14 Jan 2026 13:35:05 +0100	[thread overview]
Message-ID: <fdcf51d1-9aa8-463b-82e6-97d6efe3750d@kernel.org> (raw)
In-Reply-To: <20260114115619.1087466-1-lorenzo.stoakes@oracle.com>

On 1/14/26 12:56, Lorenzo Stoakes wrote:
> This check was introduced by commit 42fc541404f2 ("mmap locking API: add
> mmap_assert_locked() and mmap_assert_write_locked()") which replaced a
> VM_BUG_ON_VMA() over rwsem_is_locked from commit a00cc7d9dd93 ("mm, x86:
> add support for PUD-sized transparent hugepages"), i.e. the commit that
> introduced PUD THPs.
> 
> These seem to be careful asserts introduced to ensure that locks are held
> in general, however for a zap we require that VMAs are kept stable, and
> this is a requirement that has held perfectly well for a long time.
> 
> These were long before VMA locks and thus there appears to be no reason to
> think this is assert is there for anything other than 'stabilised VMA'.
> 
> Asserting that the VMA under examination is stable only in the case of a
> THP PUD is strange and unnecessary. If we wish to be careful and assert
> such things, we should do so at the zap level.
> 
> However in any case the current situation is already simply incorrect - a
> VMA lock suffices here.
> 
> Remove the assert for now as it is unnecessarily, incorrect and unhelpful,
> subsequent work can introduce an assert in general for zapping if required.
> 
> Fixes: 2ab7f1bbafc9 ("mm/madvise: allow guard page install/remove under VMA lock")
> Reported-by: Chris Mason <clm@meta.com>
> Closes: https://lore.kernel.org/all/20260113220856.2358195-1-clm@meta.com/
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>

Makes sense to me

Acked-by: David Hildenbrand (Red Hat) <david@kernel.org>

-- 
Cheers

David


      reply	other threads:[~2026-01-14 12:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-14 11:56 Lorenzo Stoakes
2026-01-14 12:35 ` David Hildenbrand (Red Hat) [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=fdcf51d1-9aa8-463b-82e6-97d6efe3750d@kernel.org \
    --to=david@kernel.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=clm@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=sj@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    /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