On Thu, 2007-04-19 at 15:02 -0500, Matt Mackall wrote:pfn_valid() will at least guarantee that pfn_to_page() will give you _some_ 'struct page' back. However, it isn't an absolute guarantee that there is actual physical memory backing that struct page. For your use here, it should be OK, but it might be a bit confusing if anyone ever ends up with more entries in that /proc file than they have pages of total memory. But, this is a pretty low-level debugging mechanism, and I'm not sure this is very easy to solve in an arch-independent way. I'd probably just leave it looking something like this: + for (; i < 2 * chunk / KPMSIZE; i += 2, pfn++) { + if (!pfn_valid(pfn)) { + page[i] = 0; + page[i + 1] = 0; + } else { + ppage = pfn_to_page(pfn); + page[i] = ppage->flags; + page[i + 1] = atomic_read(&ppage->_count); + } + } BTW, page->flags can be quite config-dependent on how stuff is stored in there, especially with the zone, node, and section information encoded in there. Do you, perhaps, want to just spit out the bits that are actual PageFoo() flags? -- Dave -
| Davide Libenzi | [patch 7/8] fdmap v2 - implement sys_socket2 |
| Greg Kroah-Hartman | [PATCH 018/196] coda: convert struct class_device to struct device |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| David Newall | Re: Slow DOWN, please!!! |
git: | |
| Christoph Lameter | Network latency regressions from 2.6.22 to 2.6.29 |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Arjan van de Ven | Re: [GIT]: Networking |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
