mbox series

[v3,0/2] x86/setup: consolidate early memory reservations

Message ID 20210302100406.22059-1-rppt@kernel.org (mailing list archive)
Headers show
Series x86/setup: consolidate early memory reservations | expand

Message

Mike Rapoport March 2, 2021, 10:04 a.m. UTC
From: Mike Rapoport <rppt@linux.ibm.com>

Hi,

David noticed that we do some of memblock_reserve() calls after allocations
are possible:

https://lore.kernel.org/lkml/6ba6bde3-1520-5cd0-f987-32d543f0b79f@redhat.com

The below patches consolidate early memory reservations done during
setup_arch() so that memory used by firmware, bootloader, kernel text/data
and the memory that should be excluded from the available memory for
whatever other reason is reserved before memblock allocations are possible.

The patches are rebased on v5.12-rc1 and I think x86 tree is the best way
to merge them.

v3:
* rebase on v5.12-rc1

v2: https://lore.kernel.org/lkml/20210128105711.10428-1-rppt@kernel.org
* get rid of trim_platform_memory_ranges() and call trim_snb_memory()
  directly, per Boris comments
* massage changelog and comments to use passive voice, per Boris
* add Acked-by and Reviewed-by, thanks Boris and David

v1: https://lore.kernel.org/lkml/20210115083255.12744-1-rppt@kernel.org

Mike Rapoport (2):
  x86/setup: consolidate early memory reservations
  x86/setup: merge several reservations of start of the memory

 arch/x86/kernel/setup.c | 95 ++++++++++++++++++++---------------------
 1 file changed, 46 insertions(+), 49 deletions(-)

Comments

Mike Rapoport March 10, 2021, 5:52 p.m. UTC | #1
Any comments on these?

On Tue, Mar 02, 2021 at 12:04:04PM +0200, Mike Rapoport wrote:
> From: Mike Rapoport <rppt@linux.ibm.com>
> 
> Hi,
> 
> David noticed that we do some of memblock_reserve() calls after allocations
> are possible:
> 
> https://lore.kernel.org/lkml/6ba6bde3-1520-5cd0-f987-32d543f0b79f@redhat.com
> 
> The below patches consolidate early memory reservations done during
> setup_arch() so that memory used by firmware, bootloader, kernel text/data
> and the memory that should be excluded from the available memory for
> whatever other reason is reserved before memblock allocations are possible.
> 
> The patches are rebased on v5.12-rc1 and I think x86 tree is the best way
> to merge them.
> 
> v3:
> * rebase on v5.12-rc1
> 
> v2: https://lore.kernel.org/lkml/20210128105711.10428-1-rppt@kernel.org
> * get rid of trim_platform_memory_ranges() and call trim_snb_memory()
>   directly, per Boris comments
> * massage changelog and comments to use passive voice, per Boris
> * add Acked-by and Reviewed-by, thanks Boris and David
> 
> v1: https://lore.kernel.org/lkml/20210115083255.12744-1-rppt@kernel.org
> 
> Mike Rapoport (2):
>   x86/setup: consolidate early memory reservations
>   x86/setup: merge several reservations of start of the memory
> 
>  arch/x86/kernel/setup.c | 95 ++++++++++++++++++++---------------------
>  1 file changed, 46 insertions(+), 49 deletions(-)
> 
> -- 
> 2.28.0
>
David Hildenbrand March 10, 2021, 5:59 p.m. UTC | #2
On 10.03.21 18:52, Mike Rapoport wrote:
> Any comments on these?
> 

Take my

Acked-by: David Hildenbrand <david@redhat.com>

it looks sane to me ... but not sure what it's worth in that x86-64 code :)
Mike Rapoport March 18, 2021, 6:53 a.m. UTC | #3
Another gentle ping.

On Wed, Mar 10, 2021 at 07:52:13PM +0200, Mike Rapoport wrote:
> Any comments on these?
> 
> On Tue, Mar 02, 2021 at 12:04:04PM +0200, Mike Rapoport wrote:
> > From: Mike Rapoport <rppt@linux.ibm.com>
> > 
> > Hi,
> > 
> > David noticed that we do some of memblock_reserve() calls after allocations
> > are possible:
> > 
> > https://lore.kernel.org/lkml/6ba6bde3-1520-5cd0-f987-32d543f0b79f@redhat.com
> > 
> > The below patches consolidate early memory reservations done during
> > setup_arch() so that memory used by firmware, bootloader, kernel text/data
> > and the memory that should be excluded from the available memory for
> > whatever other reason is reserved before memblock allocations are possible.
> > 
> > The patches are rebased on v5.12-rc1 and I think x86 tree is the best way
> > to merge them.
> > 
> > v3:
> > * rebase on v5.12-rc1
> > 
> > v2: https://lore.kernel.org/lkml/20210128105711.10428-1-rppt@kernel.org
> > * get rid of trim_platform_memory_ranges() and call trim_snb_memory()
> >   directly, per Boris comments
> > * massage changelog and comments to use passive voice, per Boris
> > * add Acked-by and Reviewed-by, thanks Boris and David
> > 
> > v1: https://lore.kernel.org/lkml/20210115083255.12744-1-rppt@kernel.org
> > 
> > Mike Rapoport (2):
> >   x86/setup: consolidate early memory reservations
> >   x86/setup: merge several reservations of start of the memory
> > 
> >  arch/x86/kernel/setup.c | 95 ++++++++++++++++++++---------------------
> >  1 file changed, 46 insertions(+), 49 deletions(-)
> > 
> > -- 
> > 2.28.0
> > 
> 
> -- 
> Sincerely yours,
> Mike.