Re: [PATCH RFC 0/6] mm/kdump: allow to exclude pages that are logically offline
From: David Hildenbrand Sent: November 14, 2018 at 9:16:58 PM GMT > Subject: [PATCH RFC 0/6] mm/kdump: allow to exclude pages that are logically > offline > > > Right now, pages inflated as part of a balloon driver will be dumped > by dump tools like makedumpfile. While XEN is able to check in the > crash kernel whether a certain pfn is actuall backed by memory in the > hypervisor (see xen_oldmem_pfn_is_ram) and optimize this case, dumps of > virtio-balloon and hv-balloon inflated memory will essentially result in > zero pages getting allocated by the hypervisor and the dump getting > filled with this data. Is there any reason that VMware balloon driver is not mentioned? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH RFC 0/6] mm/kdump: allow to exclude pages that are logically offline
From: David Hildenbrand Sent: November 14, 2018 at 11:05:38 PM GMT > Subject: Re: [PATCH RFC 0/6] mm/kdump: allow to exclude pages that are > logically offline > > > On 14.11.18 23:57, Nadav Amit wrote: >> From: David Hildenbrand >> Sent: November 14, 2018 at 9:16:58 PM GMT >>> Subject: [PATCH RFC 0/6] mm/kdump: allow to exclude pages that are >>> logically offline >>> >>> >>> Right now, pages inflated as part of a balloon driver will be dumped >>> by dump tools like makedumpfile. While XEN is able to check in the >>> crash kernel whether a certain pfn is actuall backed by memory in the >>> hypervisor (see xen_oldmem_pfn_is_ram) and optimize this case, dumps of >>> virtio-balloon and hv-balloon inflated memory will essentially result in >>> zero pages getting allocated by the hypervisor and the dump getting >>> filled with this data. >> >> Is there any reason that VMware balloon driver is not mentioned? > > Definitely ... > > ... not ;) . I haven't looked at vmware's balloon driver yet (I only saw > that there was quite some activity recently). I guess it should have > similar problems. (I mean reading and dumping data nobody cares about is > certainly not desired) > > Can you share if something like this is also desired for vmware's > implementation? (I tagged this as RFC to get some more feedback) > > It should in theory be as simple as adding a handful of > _SetPageOffline()/_ClearPageOffline() at the right spots. Thanks, I was just suspecting it is personal ;-) Actually, some patches that I sent for 4.20 to use the balloon-compaction infrastructure by the VMware balloon fell between the cracks, and I need to resend them. I would obviously prefer that your changes would be done on top of those that were skipped. This patch-set sounds very reasonable to me, but I prefer that Julien (cc’d) would also give his opinion. Regards, Nadav ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v1 6/8] vmw_balloon: mark inflated pages PG_offline
Thanks for this patch! > On Nov 19, 2018, at 2:16 AM, David Hildenbrand wrote: > > Mark inflated and never onlined pages PG_offline, to tell the world that > the content is stale and should not be dumped. > > Cc: Xavier Deguillard > Cc: Nadav Amit > Cc: Arnd Bergmann > Cc: Greg Kroah-Hartman > Cc: Julien Freche > Cc: Andrew Morton > Cc: Matthew Wilcox > Cc: Michal Hocko > Cc: "Michael S. Tsirkin" > Signed-off-by: David Hildenbrand > --- > drivers/misc/vmw_balloon.c | 32 > 1 file changed, 32 insertions(+) > > diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c > index e6126a4b95d3..8cc8bd9a4e32 100644 > --- a/drivers/misc/vmw_balloon.c > +++ b/drivers/misc/vmw_balloon.c > @@ -544,6 +544,36 @@ unsigned int vmballoon_page_order(enum > vmballoon_page_size_type page_size) > return page_size == VMW_BALLOON_2M_PAGE ? VMW_BALLOON_2M_ORDER : 0; > } > > +/** > + * vmballoon_mark_page_offline() - mark a page as offline > + * @page: pointer for the page If possible, please add a period at the end of the sentence (yes, I know I got it wrong in some places too). > + * @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++) Can you please do instead: unsigned int; for (i = 0; i < vmballoon_page_in_frames(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); Same here (use vmballoon_page_in_frames). > +} > + > /** > * 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(struct vmballoon *b, >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(struct list_head > *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)); > } We would like to test it in the next few days, but in the meanwhile, after you address these minor issues: Acked-by: Nadav Amit Thanks again, Nadav ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel