The patch titled Subject: vmw_balloon: mark inflated pages PG_offline has been added to the -mm tree. Its filename is vmw_balloon-mark-inflated-pages-pg_offline.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/vmw_balloon-mark-inflated-pages-pg_offline.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/vmw_balloon-mark-inflated-pages-pg_offline.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: David Hildenbrand <david@xxxxxxxxxx> Subject: vmw_balloon: mark inflated pages PG_offline Mark inflated and never onlined pages PG_offline, to tell the world that the content is stale and should not be dumped. Link: http://lkml.kernel.org/r/20181119101616.8901-7-david@xxxxxxxxxx Signed-off-by: David Hildenbrand <david@xxxxxxxxxx> Cc: Xavier Deguillard <xdeguillard@xxxxxxxxxx> Cc: Nadav Amit <namit@xxxxxxxxxx> Cc: Arnd Bergmann <arnd@xxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Cc: Julien Freche <jfreche@xxxxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: "Michael S. Tsirkin" <mst@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- --- a/drivers/misc/vmw_balloon.c~vmw_balloon-mark-inflated-pages-pg_offline +++ a/drivers/misc/vmw_balloon.c @@ -545,6 +545,36 @@ unsigned int vmballoon_page_order(enum v } /** + * vmballoon_mark_page_offline() - mark a page as offline + * @page: pointer for the page + * @page_size: the size of the page. + */ +static void +vmballoon_mark_page_offline(struct page *page, + enum vmballoon_page_size_type page_size) +{ + int i; + + for (i = 0; i < 1ULL << vmballoon_page_order(page_size); i++) + __SetPageOffline(page + i); +} + +/** + * vmballoon_mark_page_online() - mark a page as online + * @page: pointer for the page + * @page_size: the size of the page. + */ +static void +vmballoon_mark_page_online(struct page *page, + enum vmballoon_page_size_type page_size) +{ + int i; + + for (i = 0; i < 1ULL << vmballoon_page_order(page_size); i++) + __ClearPageOffline(page + i); +} + +/** * vmballoon_page_in_frames() - returns the number of frames in a page. * @page_size: the size of the page. * @@ -612,6 +642,7 @@ static int vmballoon_alloc_page_list(str ctl->page_size); if (page) { + vmballoon_mark_page_offline(page, ctl->page_size); /* Success. Add the page to the list and continue. */ list_add(&page->lru, &ctl->pages); continue; @@ -850,6 +881,7 @@ static void vmballoon_release_page_list( list_for_each_entry_safe(page, tmp, page_list, lru) { list_del(&page->lru); + vmballoon_mark_page_online(page, page_size); __free_pages(page, vmballoon_page_order(page_size)); } _ Patches currently in -mm which might be from david@xxxxxxxxxx are mm-balloon-update-comment-about-isolation-migration-compaction.patch mm-convert-pg_balloon-to-pg_offline.patch kexec-export-pg_offline-to-vmcoreinfo.patch xen-balloon-mark-inflated-pages-pg_offline.patch hv_balloon-mark-inflated-pages-pg_offline.patch vmw_balloon-mark-inflated-pages-pg_offline.patch pm-hibernate-use-pfn_to_online_page.patch pm-hibernate-exclude-all-pageoffline-pages.patch