lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b05380ba-7d8a-48a4-9457-dc689b75919a@suse.cz>
Date: Tue, 28 Jan 2025 16:05:57 +0100
From: Vlastimil Babka <vbabka@...e.cz>
To: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
 Andrew Morton <akpm@...ux-foundation.org>
Cc: "Liam R . Howlett" <Liam.Howlett@...cle.com>, Jann Horn
 <jannh@...gle.com>, linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/5] mm: further refactor commit_merge()

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@...cle.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@...e.cz>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ