From: Andrew Morton <akpm@linux-foundation.org>
To: Josef Bacik <josef@toxicpanda.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>,
"Liam R. Howlett" <liam@infradead.org>,
David Hildenbrand <david@kernel.org>,
Vlastimil Babka <vbabka@kernel.org>, Jann Horn <jannh@google.com>,
Pedro Falcato <pfalcato@suse.de>,
Muchun Song <muchun.song@linux.dev>,
Oscar Salvador <osalvador@suse.de>,
"Jose A. Perez de Azpillaga" <azpijr@gmail.com>,
linux-mm@kvack.org, stable@vger.kernel.org
Subject: Re: [PATCH v2 0/5] mm/mremap: fix accounting on a partial move
Date: Mon, 2 Nov 2026 16:23:04 -0800 [thread overview]
Message-ID: <20261102162304.c3585fc3fb88644118c152d7@linux-foundation.org> (raw)
In-Reply-To: <20261102-b4-mremap-pre-split-v2-0-d281dd11ad7d@toxicpanda.com>
On Mon, 02 Nov 2026 23:45:56 +0000 Josef Bacik <josef@toxicpanda.com> wrote:
> I went through the callers of __split_vma() to see who can't cope with
> it failing, and mremap() is the bad one. If you move part of a VMA we
> don't split it until the very end, when we unmap the old range. By then
> the page tables have moved and there's nothing to go back to, so we fix
> up the accounting and return success with the old range still mapped.
>
> Lorenzo recently added a way to split ahead of the move for the mlock()
> + MREMAP_DONTUNMAP case. This series uses that for every move that
> unmaps its source, so a split that fails is reported before we've done
> anything.
>
> Doing that turned up a real bug in hugetlb. We take the reservation map
> away from the whole old VMA before the part that's moving is split off,
> so the parts that stay never give their reservations back. That fix is
> the first patch so it can go to stable by itself, and the second patch
> is a selftest for it.
>
> The next two fix the accounting for when the unmap at the end does fail,
> we either charged memory that was never accounted or lost track of the
> charge for the whole VMA. That gets a lot harder to hit with the last
> patch but it's still possible. There's also a test for an old size of
> 0, which nothing covered.
Thanks.
So we have two userspace-visible accounting fixups: htlb reservation
leak, Committed_AS if mremap's unmap failed. Yes?
How come the first is cc:stable and the second is not?
next prev parent reply other threads:[~2026-11-03 0:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 23:45 [PATCH v2 0/5] mm/mremap: fix accounting on a partial move Josef Bacik
2026-11-02 23:45 ` [PATCH v2 1/5] mm/mremap: fix hugetlb reservation leak on " Josef Bacik
2026-11-03 10:42 ` Jose A. Perez de Azpillaga
2026-11-03 0:23 ` Andrew Morton [this message]
2026-11-04 14:32 ` [PATCH v2 0/5] mm/mremap: fix accounting on a " Josef Bacik
2026-11-04 14:46 ` Lorenzo Stoakes (ARM)
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=20261102162304.c3585fc3fb88644118c152d7@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=azpijr@gmail.com \
--cc=david@kernel.org \
--cc=jannh@google.com \
--cc=josef@toxicpanda.com \
--cc=liam@infradead.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=muchun.song@linux.dev \
--cc=osalvador@suse.de \
--cc=pfalcato@suse.de \
--cc=stable@vger.kernel.org \
--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