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: <201006291156.38178.bjorn.helgaas@hp.com>
Date:	Tue, 29 Jun 2010 11:56:36 -0600
From:	Bjorn Helgaas <bjorn.helgaas@...com>
To:	Yinghai Lu <yinghai@...nel.org>
Cc:	Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	David Miller <davem@...emloft.net>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Johannes Weiner <hannes@...xchg.org>,
	linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
	Jan Beulich <jbeulich@...ell.com>
Subject: Re: [PATCH 12/25] x86, lmb: Add get_free_all_memory_range()

On Tuesday, June 22, 2010 11:26:41 am Yinghai Lu wrote:

> +	pr_info("Subtract (%d early reservations)\n", count);
> +
> +	for_each_lmb(reserved, r) {
> +		pr_info("  [%010llx - %010llx]\n", (u64)r->base, (u64)r->base + r->size);

Use %pR format and consider adding text to the line, e.g.,
"lmb: early reservation [%#010llx-%#010llx] removed" so that
grep output is useful all by itself, without requiring the
context of the preceding lines.

> +		final_start = PFN_DOWN(r->base);
> +		final_end = PFN_UP(r->base + r->size);
> +		if (final_start >= final_end)
> +			continue;
> +		subtract_range(range, az, final_start, final_end);
> +	}
> +	/* Put region array back ? */
> +	if (lmb.reserved.regions != lmb_reserved_init_regions)
> +		lmb_reserve(__pa(lmb.reserved.regions), sizeof(struct lmb_region) * lmb.reserved.max);
> +}
> +
> +struct count_data {
> +	int nr;
> +};
> +
> +static int __init count_work_fn(unsigned long start_pfn,
> +				unsigned long end_pfn, void *datax)
> +{
> +	struct count_data *data = datax;
> +
> +	data->nr++;
> +
> +	return 0;
> +}
> +
> +static int __init count_early_node_map(int nodeid)
> +{
> +	struct count_data data;
> +
> +	data.nr = 0;
> +	work_with_active_regions(nodeid, count_work_fn, &data);
> +
> +	return data.nr;
> +}
> +
> +int __init get_free_all_memory_range(struct range **rangep, int nodeid)
> +{
> +	int count;
> +	struct range *range;
> +	int nr_range;
> +
> +	count = (lmb.reserved.cnt + count_early_node_map(nodeid)) * 2;
> +
> +	range = find_range_array(count);
> +	nr_range = 0;
> +
> +	/*
> +	 * Use early_node_map[] and lmb.reserved.region to get range array
> +	 * at first
> +	 */
> +	nr_range = add_from_early_node_map(range, count, nr_range, nodeid);
> +#ifdef CONFIG_X86_32
> +	subtract_range(range, count, max_low_pfn, -1ULL);
> +#endif
> +	subtract_lmb_reserved(range, count);
> +	nr_range = clean_sort_range(range, count);
> +
> +	*rangep = range;
> +	return nr_range;
> +}
> +#else
>  void __init lmb_to_bootmem(u64 start, u64 end)
>  {
>  	int count;
> 
--
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