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] [day] [month] [year] [list]
Date:	Mon, 28 Dec 2009 09:35:25 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Yinghai Lu <yinghai@...nel.org>
Cc:	"H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Jesse Barnes <jbarnes@...tuousgeek.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Christoph Lameter <cl@...ux-foundation.org>,
	Pekka Enberg <penberg@...helsinki.fi>
Subject: Re: [PATCH 2/2] sparsemem: put mem map for one node together.


* Yinghai Lu <yinghai@...nel.org> wrote:

> add vmemmap_alloc_block_buf for mem map only.
> 
> it will fallback old wayif can not get that big.
> 
> it will help system with more memory that use early_res instead of bootmem
> that can not handle too many entries
> 
> Signed-off-by: Yinghai Lu <yinghai@...nel.org>
> 
> ---
>  arch/x86/mm/init_64.c |    2 
>  include/linux/mm.h    |    7 +++
>  mm/sparse-vmemmap.c   |   70 +++++++++++++++++++++++++++++++
>  mm/sparse.c           |  111 +++++++++++++++++++++++++++++++++++++++++++++++++-
>  4 files changed, 187 insertions(+), 3 deletions(-)


> +++ linux-2.6/mm/sparse-vmemmap.c
> @@ -43,6 +43,8 @@ static void * __init_refok __earlyonly_b
>  	return __alloc_bootmem_node_high(NODE_DATA(node), size, align, goal);
>  }
>  
> +static void *buf;
> +static void *buf_end;

there's so many buf's in the kernel - this naming isnt very intuitive. Also, 
they should perhaps be __initdata-ish?

>  void * __meminit vmemmap_alloc_block(unsigned long size, int node)
>  {
> @@ -64,6 +66,24 @@ void * __meminit vmemmap_alloc_block(uns
>  				__pa(MAX_DMA_ADDRESS));
>  }
>  
> +/* need to make sure size is all the same during early stage */
> +void * __meminit vmemmap_alloc_block_buf(unsigned long size, int node)
> +{
> +	void *ptr;
> +
> +	if (!buf)
> +		return vmemmap_alloc_block(size, node);
> +
> +	/* take the from buf */
> +	ptr = (void *)ALIGN((unsigned long)buf, size);

Hm, two type cast in the same line.

these kinds of x86-64-isms:

> +++ linux-2.6/mm/sparse.c
>
> +#ifndef CONFIG_X86_64
> +#ifdef CONFIG_X86_64
> +#ifdef CONFIG_X86_64
> +#else
> +#endif
> +#ifdef CONFIG_X86_64
> +#endif

are not particularly welcome constructs in core MM files. Appropriately 
structured Kconfig helper bools, selected by arch's, are cleaner.

These patches need more work.

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists