Lines Matching full:page
7 * Balloon page migration makes use of the general non-lru movable page
10 * page->private is used to reference the responsible balloon device.
11 * page->mapping is used in context of non-lru page migration to reference
12 * the address space operations for page isolation/migration/compaction.
14 * As the page isolation scanning step a compaction thread does is a lockless
15 * procedure (from a page standpoint), it might bring some racy situations while
16 * performing balloon page compaction. In order to sort out these racy scenarios
17 * and safely perform balloon's page compaction and migration we must, always,
20 * i. when updating a balloon's page ->mapping element, strictly do it under
23 * +-page_lock(page);
25 * ... page->mapping updates here ...
27 * ii. isolation or dequeueing procedure must remove the page from balloon
28 * device page list under b_dev_info->pages_lock.
31 * the aforementioned balloon page corner case, as well as to ensure the simple
40 #include <linux/page-flags.h>
51 * have to cope for page compaction / migration, as well as it serves the
52 * balloon driver as a page book-keeper for its registered balloon devices.
58 int (*migratepage)(struct balloon_dev_info *, struct page *newpage,
59 struct page *page, enum migrate_mode mode);
62 extern struct page *balloon_page_alloc(void);
64 struct page *page);
65 extern struct page *balloon_page_dequeue(struct balloon_dev_info *b_dev_info);
83 * balloon_page_insert - insert a page into the balloon's page list and make
84 * the page->private assignment accordingly.
86 * @page : page to be assigned as a 'balloon page'
88 * Caller must ensure the page is locked and the spin_lock protecting balloon
89 * pages list is held before inserting a page into the balloon device.
92 struct page *page) in balloon_page_insert() argument
94 __SetPageOffline(page); in balloon_page_insert()
95 __SetPageMovable(page, &balloon_mops); in balloon_page_insert()
96 set_page_private(page, (unsigned long)balloon); in balloon_page_insert()
97 list_add(&page->lru, &balloon->pages); in balloon_page_insert()
101 * balloon_page_delete - delete a page from balloon's page list and clear
102 * the page->private assignement accordingly.
103 * @page : page to be released from balloon's page list
105 * Caller must ensure the page is locked and the spin_lock protecting balloon
106 * pages list is held before deleting a page from the balloon device.
108 static inline void balloon_page_delete(struct page *page) in balloon_page_delete() argument
110 __ClearPageOffline(page); in balloon_page_delete()
111 __ClearPageMovable(page); in balloon_page_delete()
112 set_page_private(page, 0); in balloon_page_delete()
114 * No touch page.lru field once @page has been isolated in balloon_page_delete()
117 if (!PageIsolated(page)) in balloon_page_delete()
118 list_del(&page->lru); in balloon_page_delete()
123 * that enqueues the given page.
125 static inline struct balloon_dev_info *balloon_page_device(struct page *page) in balloon_page_device() argument
127 return (struct balloon_dev_info *)page_private(page); in balloon_page_device()
138 struct page *page) in balloon_page_insert() argument
140 __SetPageOffline(page); in balloon_page_insert()
141 list_add(&page->lru, &balloon->pages); in balloon_page_insert()
144 static inline void balloon_page_delete(struct page *page) in balloon_page_delete() argument
146 __ClearPageOffline(page); in balloon_page_delete()
147 list_del(&page->lru); in balloon_page_delete()
158 * balloon_page_push - insert a page into a page list.
160 * @page : page to be added
162 * Caller must ensure the page is private and protect the list.
164 static inline void balloon_page_push(struct list_head *pages, struct page *page) in balloon_page_push() argument
166 list_add(&page->lru, pages); in balloon_page_push()
170 * balloon_page_pop - remove a page from a page list.
172 * @page : page to be added
174 * Caller must ensure the page is private and protect the list.
176 static inline struct page *balloon_page_pop(struct list_head *pages) in balloon_page_pop()
178 struct page *page = list_first_entry_or_null(pages, struct page, lru); in balloon_page_pop() local
180 if (!page) in balloon_page_pop()
183 list_del(&page->lru); in balloon_page_pop()
184 return page; in balloon_page_pop()