mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: "Liam R . Howlett" <Liam.Howlett@oracle.com>,
	Jann Horn <jannh@google.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5] mm: further refactor commit_merge()
Date: Tue, 28 Jan 2025 16:05:57 +0100	[thread overview]
Message-ID: <b05380ba-7d8a-48a4-9457-dc689b75919a@suse.cz> (raw)
In-Reply-To: <0bbb2efbdc2ac2af2f6d73679cbb0811544d0647.1737929364.git.lorenzo.stoakes@oracle.com>

On 1/27/25 16:50, Lorenzo Stoakes wrote:
> The current VMA merge mechanism contains a number of confusing mechanisms
> around removal of VMAs on merge and the shrinking of the VMA adjacent to
> vma->target in the case of merges which result in a partial merge with that
> adjacent VMA.
> 
> Since we now have a STABLE set of VMAs - prev, middle, next - we are now
> able to have the caller of commit_merge() explicitly tell us which VMAs
> need deleting, using newly introduced internal VMA merge flags.
> 
> Doing so allows us to embed this state within the VMG and remove the
> confusing remove, remove2 parameters from commit_merge().
> 
> We additionally are able to eliminate the highly confusing and misleading
> 'expanded' parameter - a parameter that in reality refers to whether or not
> the return VMA is the target one or the one immediately adjacent.
> 
> We can infer which is the case from whether or not the adj_start parameter
> is negative. This also allows us to simplify further logic around iterator
> configuration and VMA iterator stores.
> 
> Doing so means we can also eliminate the adjust parameter, as we are able
> to infer which VMA ought to be adjusted from adj_start - a positive value
> implies we adjust the start of 'middle', a negative one implies we adjust
> the start of 'next'.
> 
> We are then able to have commit_merge() explicitly return the target VMA,
> or NULL on inability to pre-allocate memory. Errors were previously
> filtered so behaviour does not change.
> 
> This patch has no change in functional behaviour.
> 
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>

Some of the parts would be quite a hack for a final state of things, but I
understand it's a intermediate step for review purposes.

Reviewed-by: Vlastimil Babka <vbabka@suse.cz>


  reply	other threads:[~2025-01-28 15:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-27 15:50 [PATCH 0/5] mm: further simplify VMA merge operation Lorenzo Stoakes
2025-01-27 15:50 ` [PATCH 1/5] mm: simplify vma merge structure and expand comments Lorenzo Stoakes
2025-01-28 11:38   ` Vlastimil Babka
2025-01-28 14:05     ` Lorenzo Stoakes
2025-01-27 15:50 ` [PATCH 2/5] mm: further refactor commit_merge() Lorenzo Stoakes
2025-01-28 15:05   ` Vlastimil Babka [this message]
2025-01-28 15:45   ` Vlastimil Babka
2025-01-28 16:07     ` Lorenzo Stoakes
2025-01-28 16:42       ` Lorenzo Stoakes
2025-01-27 15:50 ` [PATCH 3/5] mm: eliminate adj_start parameter from commit_merge() Lorenzo Stoakes
2025-01-29 14:13   ` Vlastimil Babka
2025-01-29 14:19     ` Lorenzo Stoakes
2025-01-27 15:50 ` [PATCH 4/5] mm: make vmg->target consistent and further simplify commit_merge() Lorenzo Stoakes
2025-01-29 14:45   ` Vlastimil Babka
2025-01-29 14:51     ` Lorenzo Stoakes
2025-01-29 15:19   ` Vlastimil Babka
2025-01-29 15:30     ` Lorenzo Stoakes
2025-01-27 15:50 ` [PATCH 5/5] mm: completely abstract unnecessary adj_start calculation Lorenzo Stoakes
2025-01-27 18:50   ` kernel test robot
2025-01-27 18:56     ` Lorenzo Stoakes
2025-01-27 19:58     ` Lorenzo Stoakes
2025-01-27 20:13   ` kernel test robot
2025-01-27 20:35   ` kernel test robot
2025-01-28  7:54   ` kernel test robot
2025-01-29 15:42   ` Vlastimil Babka
2025-01-29 16:19     ` 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=b05380ba-7d8a-48a4-9457-dc689b75919a@suse.cz \
    --to=vbabka@suse.cz \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=jannh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    /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

all inboxes | Powered by JetHome®