Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1564743 > unrolled thread

Re: [PATCH 10/21] MIPS memblock: Discard bootmem allocator initialization

Started byMarcin Nowakowski <marcin.nowakowski@imgtec.com>
First post2017-01-23 09:00 +0100
Last post2017-01-23 09:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 10/21] MIPS memblock: Discard bootmem allocator  initialization Marcin Nowakowski <marcin.nowakowski@imgtec.com> - 2017-01-23 09:00 +0100

#1564743 — Re: [PATCH 10/21] MIPS memblock: Discard bootmem allocator initialization

FromMarcin Nowakowski <marcin.nowakowski@imgtec.com>
Date2017-01-23 09:00 +0100
SubjectRe: [PATCH 10/21] MIPS memblock: Discard bootmem allocator initialization
Message-ID<t2HHI-3EH-19@gated-at.bofh.it>
Hi Serge,

On 19.12.2016 03:07, Serge Semin wrote:
> Bootmem allocator initialization needs to be discarded.
> PFN limit constants are still in use by some subsystems, so they
> need to be properly initialized. The initialization is moved into
> a separate method and performed with help of commonly used
> platform-specific constants. It might me too simplified, but most
> of the kernel platforms do it the same way. Moreover it's much
> easier to debug it, when it's not that complicated.
>
> Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
> ---
>  arch/mips/kernel/setup.c | 193 ++++-------------------------
>  1 file changed, 21 insertions(+), 172 deletions(-)
>
> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
> index e746793..6562f55 100644
> --- a/arch/mips/kernel/setup.c
> +++ b/arch/mips/kernel/setup.c
> @@ -626,6 +626,25 @@ static void __init request_crashkernel(struct resource *res) { }
>  #endif /* !CONFIG_KEXEC */
>
>  /*
> + * Calcualte PFN limits with respect to the defined memory layout
> + */
> +static void __init find_pfn_limits(void)
> +{
> +	phys_addr_t ram_end = memblock_end_of_DRAM();
> +
> +	min_low_pfn = ARCH_PFN_OFFSET;
> +	max_low_pfn = PFN_UP(HIGHMEM_START);

This doesn't look right - as this may set max_low_pfn to more than the 
actual physical memory size. In some cases this might be a serious 
problem and it doesn't look like any other platform does that.
Even in MIPS code you can find uses of max_low_pfn that would be 
seriously affected by this change (vpe loader with 
CONFIG_MIPS_VPE_LOADER_TOM).

> +	max_pfn = PFN_UP(ram_end);
> +#ifdef CONFIG_HIGHMEM
> +	highstart_pfn = max_low_pfn;
> +	highend_pfn = max_pfn <= highstart_pfn ? highstart_pfn : max_pfn;
> +#endif
> +	pr_info("PFNs: low min %lu, low max %lu, high start %lu, high end %lu,"
> +		"max %lu\n",
> +		min_low_pfn, max_low_pfn, highstart_pfn, highend_pfn, max_pfn);
> +}
> +
> +/*
>   * Initialize the bootmem allocator. It also setup initrd related data
>   * if needed.
>   */



I fully agree with you that the current initialisation code is really 
complex and difficult to debug, but the modified one seems a bit too 
simplified.

Regards,
Marcin

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web