linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	"Liam R . Howlett" <Liam.Howlett@oracle.com>,
	Jann Horn <jannh@google.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Harry Yoo <harry.yoo@oracle.com>,
	Yosry Ahmed <yosry.ahmed@linux.dev>
Subject: Re: [PATCH v2 4/7] mm/mremap: initial refactor of move_vma()
Date: Mon, 10 Mar 2025 14:28:47 +0000	[thread overview]
Message-ID: <97116f44-4934-4868-b810-021592e730e1@lucifer.local> (raw)
In-Reply-To: <92b633f0-1ac0-4074-ae7e-a8486052377b@suse.cz>

On Mon, Mar 10, 2025 at 03:11:01PM +0100, Vlastimil Babka wrote:
> On 3/6/25 11:34, Lorenzo Stoakes wrote:
> > Update move_vma() to use the threaded VRM object, de-duplicate code and
> > separate into smaller functions to aid readability and debug-ability.
> >
> > This in turn allows further simplification of expand_vma() as we can
> > simply thread VRM through the function.
> >
> > We also take the opportunity to abstract the account charging page count
> > into the VRM in order that we can correctly thread this through the
> > operation.
> >
> > We additionally do the same for tracking mm statistics - exec_vm,
> > stack_vm, data_vm, and locked_vm.
> >
> > As part of this change, we slightly modify when locked pages statistics
> > are counted for in mm_struct statistics.  However this should cause no
> > issues, as there is no chance of underflow, nor will any rlimit failures
> > occur as a result.
> >
> > This is an intermediate step before a further refactoring of move_vma() in
> > order to aid review.
> >
> > Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> > Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
>
> Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
>
> Can't wait what the bots report what I've missed in this one.
>

Thanks :)

To be fair the other one was an extremely weird edge case where a user
'remaps' a region of a VMA of length 0 onto itself expanding the length 0
mapping to the length of the VMA, i.e. a weird way of doing an unmap.

With that caught, and heavy testing of _real world_ usage of this series
done locally, I think we _should_ be ok... obviously bots have been
hammering with no issues other than aforementioned crazy case.


  reply	other threads:[~2025-03-10 14:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-06 10:33 [PATCH v2 0/7] refactor mremap and fix bug Lorenzo Stoakes
2025-03-06 10:33 ` [PATCH v2 1/7] mm/mremap: correctly handle partial mremap() of VMA starting at 0 Lorenzo Stoakes
2025-03-06 10:33 ` [PATCH v2 2/7] mm/mremap: refactor mremap() system call implementation Lorenzo Stoakes
2025-03-06 13:56   ` Vlastimil Babka
2025-03-06 10:33 ` [PATCH v2 3/7] mm/mremap: introduce and use vma_remap_struct threaded state Lorenzo Stoakes
2025-03-06 15:26   ` Vlastimil Babka
2025-03-10 10:19   ` Lorenzo Stoakes
2025-03-10 18:02     ` Lorenzo Stoakes
2025-03-06 10:34 ` [PATCH v2 4/7] mm/mremap: initial refactor of move_vma() Lorenzo Stoakes
2025-03-10 14:11   ` Vlastimil Babka
2025-03-10 14:28     ` Lorenzo Stoakes [this message]
2025-03-06 10:34 ` [PATCH v2 5/7] mm/mremap: complete " Lorenzo Stoakes
2025-03-10 15:11   ` Vlastimil Babka
2025-03-10 15:38     ` Lorenzo Stoakes
2025-03-06 10:34 ` [PATCH v2 6/7] mm/mremap: refactor move_page_tables(), abstracting state Lorenzo Stoakes
2025-03-10 17:05   ` Vlastimil Babka
2025-03-10 18:09     ` Lorenzo Stoakes
2025-03-06 10:34 ` [PATCH v2 7/7] mm/mremap: thread state through move page table operation Lorenzo Stoakes
2025-03-10 17:52   ` Vlastimil Babka
2025-03-10 18:13     ` Lorenzo Stoakes

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=97116f44-4934-4868-b810-021592e730e1@lucifer.local \
    --to=lorenzo.stoakes@oracle.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=harry.yoo@oracle.com \
    --cc=jannh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=vbabka@suse.cz \
    --cc=yosry.ahmed@linux.dev \
    /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