From: "Jose A. Perez de Azpillaga" <azpijr@gmail.com>
To: Josef Bacik <josef@toxicpanda.com>,
Andrew Morton <akpm@linux-foundation.org>,
Lorenzo Stoakes <ljs@kernel.org>,
"Liam R. Howlett" <liam@infradead.org>,
David Hildenbrand <david@kernel.org>
Cc: 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>,
linux-mm@kvack.org
Subject: Re: [PATCH v2 3/5] mm/mremap: reaccount on unmap failure only if accounted
Date: Tue, 3 Nov 2026 11:53:46 +0100 [thread overview]
Message-ID: <533f3f57-dc95-4a97-abb0-14b88a7e1018@gmail.com> (raw)
In-Reply-To: <20261102-b4-mremap-pre-split-v2-3-d281dd11ad7d@toxicpanda.com>
On 11/3/26 12:45 AM, Josef Bacik wrote:
> When the unmap of the source range fails at the end of an mremap() move,
> the length of the range is charged to vm_committed_as even if the VMA was
> never accounted, for example a MAP_SHARED or MAP_NORESERVE mapping. Nothing
> ever uncharges these pages, so each such failure permanently inflates the
> committed memory count.
>
> This was reproduced with fault injection: each failure on a shmem mapping
> left Committed_AS higher by the size of the moved range after everything
> was unmapped.
>
> Fix by charging the range again only when accountable_move is set.
>
> Fixes: b714ccb02a76 ("mm/mremap: complete refactor of move_vma()")
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
>
> Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
LGTM:
Reviewed-by: Jose A. Perez de Azpillaga <azpijr@gmail.com>
--
cheers,
jose a. p-a
next prev parent reply other threads:[~2026-11-03 10:53 UTC|newest]
Thread overview: 16+ 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-02 23:45 ` [PATCH v2 2/5] selftests/mm: test a partial mremap() of hugetlb memory Josef Bacik
2026-11-03 10:48 ` Jose A. Perez de Azpillaga
2026-11-02 23:45 ` [PATCH v2 3/5] mm/mremap: reaccount on unmap failure only if accounted Josef Bacik
2026-11-03 10:53 ` Jose A. Perez de Azpillaga [this message]
2026-11-02 23:46 ` [PATCH v2 4/5] mm/mremap: restore VMA_ACCOUNT_BIT if the unmap fails Josef Bacik
2026-11-03 8:31 ` Lorenzo Stoakes (ARM)
2026-11-03 11:08 ` Jose A. Perez de Azpillaga
2026-11-02 23:46 ` [PATCH v2 5/5] selftests/mm: test mremap() with an old size of 0 Josef Bacik
2026-11-03 11:27 ` Jose A. Perez de Azpillaga
2026-11-04 5:40 ` Sarthak Sharma
2026-11-03 0:23 ` [PATCH v2 0/5] mm/mremap: fix accounting on a partial move Andrew Morton
2026-11-04 14:32 ` 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=533f3f57-dc95-4a97-abb0-14b88a7e1018@gmail.com \
--to=azpijr@gmail.com \
--cc=akpm@linux-foundation.org \
--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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.