How to alloc page as anon page in Linux

48 views Asked by At

I want to allocate pages as anon page, but when I use alloc_page_node(), pages were allocated as file page.

struct page* page;
int node = 0;

page = alloc_pages_node(node, GFP_KERNEL, 0);
printk(KERN_INFO "File page: %d\n", !PageSwapBacked(page));

Result: File page: 1

How to allocate page as anon page?

0

There are 0 answers