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:	Thu, 11 Nov 2010 13:18:02 -0800 (PST)
From:	David Rientjes <rientjes@...gle.com>
To:	Artur Baruchi <mail.baruchi@...il.com>
cc:	linux-kernel@...r.kernel.org
Subject: Re: mem_map array on NUMA

On Thu, 11 Nov 2010, Artur Baruchi wrote:

> Hi.
> 
> Im developing a module that get some information about memory pages.
> This module worked fine on non-NUMA machine, I was able to walk
> through the memory using the mem_map array. But, when I tried to
> compile this module in a NUMA machine, the mem_map is not beeing
> exported and I cannot use it.
> 

You're no longer using flatmem in that case.

> Does anybody knows what can be used to substitute the mem_map array in
> a NUMA machine ? Im using the kernel 2.6.35, and the
> comments/documentations for newer kernels seems to be outdated.
> 

It depends on what pages you want to iterate through: pageblock, zone, 
node, or the entire system.  You didn't say what information you're trying 
to obtain, so it's difficult to know whether you want to only look at 
pages within a certain zone or node, pageblocks that are migratable, pages 
mapped by a certain task, etc.

For pages bound to a certain mm or vma, I'd recommend using the 
walk_page_range() interface.  For zone iterations, do:

	struct zone *zone;

	for_each_populated_zone(zone) {
		spin_lock(&zone->lock);
		for (pfn = zone->zone_start_pfn;
		     pfn < zone->zone_start_pfn + zone->spanned_pages; pfn++) {
			if (pfn_valid(pfn)) {
				struct page *page = pfn_to_page(pfn);
	
				/* do something with page */
			}
		}
		spin_unlock(&zone->lock);
	}

Or you could iterate through node_zonelists for only a specified node of 
interest.
--
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