lkml.org 
[lkml]   [2010]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: mem_map array on NUMA
On Fri, 12 Nov 2010, Artur Baruchi wrote:

> Hi David.
>
> Thanks for your answer.
>
> Basically, I would like to get information about memory pages, without
> "worry" about which zone its owned. I tried to use the code you've send, but
> some macros are not beeing exported by the Kernel (I cannot use it in
> drivers/modules). Im facing the follow errors:
>
> *WARNING: "next_zone" [/root/DRIVER/xxxxxxxx.ko] undefined!
> WARNING: "first_online_pgdat" [/root/DRIVER/**xxxxxxxx.ko**] undefined!*
>
> Do you have any idea about how can I handle this error?
>

For your use-case, you can simply iterate through each pfn without
worrying about their zones, something like:

unsigned long pfn;

for (pfn = 0; pfn < max_pfn; pfn++) {
struct page *page;
if (!pfn_valid(pfn))
continue;
page = pfn_to_page(pfn);
/* do something with page */
}
> Thanks in advance.
>
> Att.
> Artur Baruchi


\
 
 \ /
  Last update: 2010-11-12 19:39    [from the cache]
©2003-2011 Jasper Spaans