Messages in this thread | | | Date | Fri, 12 Nov 2010 10:36:14 -0800 (PST) | From | David Rientjes <> | Subject | Re: 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
| |