From: Brad Hawthorne <brad@sim.vu>
To: ljs@kernel.org
Cc: akpm@linux-foundation.org, liam@infradead.org, vbabka@kernel.org,
jannh@google.com, pfalcato@suse.de, david@kernel.org,
surenb@google.com, shakeel.butt@linux.dev, linux-mm@kvack.org,
thehajime@gmail.com, stable@vger.kernel.org
Subject: Re: [PATCH] mm/nommu: keep the maple tree in step when mremap() resizes in place
Date: Tue, 24 Nov 2026 17:02:34 -0600 [thread overview]
Message-ID: <20261124230235.859633-1-brad@sim.vu> (raw)
In-Reply-To: <awXMCqK5H2TOlvtf@gremlin>
Thanks for the review, Lorenzo.
On the points you raised:
- The comments: agreed, they go.
- The unused iterator and setting it up twice: you're right. The
iterator can start at the old end, check for an overlap there with
vma_find(), and do the store, set up once.
- The preallocation: there's no lock here that forces it. A single
vma_iter_store_gfp() would do.
- The casts: they follow the rest of do_mremap(), but they aren't
needed on new lines.
- Why the tree is updated: a shrink has to clear the range it gives
up, or the tree still points there after the VMA is freed. Once it
is cleared, a grow back has to store the VMA over that range again,
or find_vma() misses addresses that are mapped.
That leads to the question that decides how small this can be: does
nommu mremap() need to grow at all? If not, a grow could simply be
refused, and only the shrink half is needed.
Understood that it won't be looked at this cycle. Hajime is working
on nommu mremap(), so I'll leave the fix with him and test his patch
on the board.
Brad
prev parent reply other threads:[~2026-11-24 23:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-21 8:31 [PATCH] mm/nommu: keep the maple tree in step when mremap() resizes in place Brad Hawthorne
2026-11-23 11:41 ` Hajime Tazaki
2026-11-24 17:51 ` Lorenzo Stoakes (ARM)
2026-11-24 23:02 ` Brad Hawthorne [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=20261124230235.859633-1-brad@sim.vu \
--to=brad@sim.vu \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=jannh@google.com \
--cc=liam@infradead.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=pfalcato@suse.de \
--cc=shakeel.butt@linux.dev \
--cc=stable@vger.kernel.org \
--cc=surenb@google.com \
--cc=thehajime@gmail.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