Re: [RFC][PATCH 1/1] Expose per-node reclaim and migration to userspace

Christoph Lameter
2006-11-30T04:10:53Z

On Tue, 28 Nov 2006, menage@google.com wrote:

> + for (i = 0; i < pgdat->node_spanned_pages; ++i) {
> + struct page *page = pgdat_page_nr(pgdat, i);
> + if (!isolate_lru_page(page, &pagelist)) {
> + pagecount++;
> + } else {
> + failcount++;
> + }
> + }

Go along the active / inactive LRU lists? isolate_lru_page will not
allow you isolate other pages.

If you go along the lru lists then you also avoid having to deal with
holes in the memory map. You cannot simply assume that all struct pages in
the area are accessible.