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: <Pine.LNX.4.64.0611271310200.11949@skynet.skynet.ie>
Date:	Mon, 27 Nov 2006 13:18:37 +0000 (GMT)
From:	Mel Gorman <mel@....ul.ie>
To:	Rohit Seth <rohitseth@...gle.com>
Cc:	Andi Kleen <ak@...e.de>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	David Rientjes <rientjes@...washington.edu>,
	Paul Menage <menage@...gle.com>, Andrew Morton <akpm@...l.org>
Subject: Re: [Patch1/4]: fake numa for x86_64 patch

On Wed, 22 Nov 2006, Rohit Seth wrote:

> This patch provides a IO hole size in a given address range.
>

Hi,

This patch reintroduces a function that doubles up what 
absent_pages_in_range(start_pfn, end_pfn). I recognise you do this because 
you are interested in hole sizes before add_active_range() is called. 
However, what is not clear is why these patches are so specific to x86_64.

It looks possible to do the work of functions like split_nodes_equal() in 
an architecture-independent manner using early_node_map rather than 
dealing with the arch-specific nodes array. That would open the 
possibility of providing fake nodes on more than one architecture in the 
future.

What I think can be done is that you register memory as normal and then 
split up the nodes into fake nodes. This would remove the need for having 
e820_hole_size() reintroduced.

> Signed-off-by: David Rientjes <reintjes@...gle.com>
> Signed-off-by: Paul Menage <menage@...gle.com>
> Signed-off-by: Rohit Seth <rohitseth@...gle.com>
>
> --- linux-2.6.19-rc5-mm2.org/include/asm-x86_64/e820.h	2006-11-22 12:20:39.000000000 -0800
> +++ linux-2.6.19-rc5-mm2/include/asm-x86_64/e820.h	2006-11-22 12:17:25.000000000 -0800
> @@ -46,6 +46,7 @@ extern void e820_mark_nosave_regions(voi
> extern void e820_print_map(char *who);
> extern int e820_any_mapped(unsigned long start, unsigned long end, unsigned type);
> extern int e820_all_mapped(unsigned long start, unsigned long end, unsigned type);
> +extern unsigned long e820_hole_size(unsigned long start, unsigned long end);
>
> extern void e820_setup_gap(void);
> extern void e820_register_active_regions(int nid,
> --- linux-2.6.19-rc5-mm2.org/arch/x86_64/kernel/e820.c	2006-11-22 12:20:55.000000000 -0800
> +++ linux-2.6.19-rc5-mm2/arch/x86_64/kernel/e820.c	2006-11-21 18:48:15.000000000 -0800
> @@ -184,6 +184,38 @@ unsigned long __init e820_end_of_ram(voi
> }
>
> /*
> + * Find the hole size in the range.
> + */
> +unsigned long __init e820_hole_size(unsigned long start, unsigned long end)
> +{
> +	unsigned long ram = 0;
> +	int i;
> +
> +	for (i = 0; i < e820.nr_map; i++) {
> +		struct e820entry *ei = &e820.map[i];
> +		unsigned long last, addr;
> +
> +		if (ei->type != E820_RAM ||
> +		    ei->addr+ei->size <= start ||
> +		    ei->addr >= end)
> +			continue;
> +
> +		addr = round_up(ei->addr, PAGE_SIZE);
> +		if (addr < start)
> +			addr = start;
> +
> +		last = round_down(ei->addr + ei->size, PAGE_SIZE);
> +		if (last >= end)
> +			last = end;
> +
> +		if (last > addr)
> +			ram += last - addr;
> +	}
> +	return ((end - start) - ram);
> +}
> +
> +
> +/*
>  * Mark e820 reserved areas as busy for the resource manager.
>  */
> void __init e820_reserve_resources(void)
>
>

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab
-
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ