All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/8] mm/kdump: allow to exclude pages that are logically offline
@ 2018-11-19 10:16 ` David Hildenbrand
  0 siblings, 0 replies; 116+ messages in thread
From: David Hildenbrand @ 2018-11-19 10:16 UTC (permalink / raw)
  To: linux-mm
  Cc: linux-kernel, linux-doc, devel, linux-fsdevel, linux-pm,
	xen-devel, kexec-ml, pv-drivers, David Hildenbrand,
	Alexander Duyck, Alexey Dobriyan, Andrew Morton, Arnd Bergmann,
	Baoquan He, Borislav Petkov, Boris Ostrovsky, Christian Hansen,
	Dave Young, David Rientjes, Greg Kroah-Hartman, Haiyang Zhang,
	Jonathan Corbet, Juergen Gross, Julien Freche, Kairui Song,
	Kazuhito Hagio, Kirill A. Shutemov, Konstantin Khlebnikov,
	K. Y. Srinivasan, Len Brown, Lianbo Jiang, Matthew Wilcox,
	Michael S. Tsirkin, Michal Hocko, Michal Hocko, Mike Rapoport,
	Miles Chen, Nadav Amit, Naoya Horiguchi, Omar Sandoval,
	Pavel Machek, Pavel Tatashin, Rafael J. Wysocki,
	Stefano Stabellini, Stephen Hemminger, Stephen Rothwell,
	Vitaly Kuznetsov, Vlastimil Babka, Xavier Deguillard

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, hv-balloon and VMWare balloon inflated memory will
essentially result in zero pages getting allocated by the hypervisor and
the dump getting filled with this data.

The allocation and reading of zero pages can directly be avoided if a
dumping tool could know which pages only contain stale information not to
be dumped.

Also for XEN, calling into the kernel and asking the hypervisor if a
pfn is backed can be avoided if the duming tool would skip such pages
right from the beginning.

Dumping tools have no idea whether a given page is part of a balloon driver
and shall not be dumped. Esp. PG_reserved cannot be used for that purpose
as all memory allocated during early boot is also PG_reserved, see
discussion at [1]. So some other way of indication is required and a new
page flag is frowned upon.

We have PG_balloon (MAPCOUNT value), which is essentially unused now. I
suggest renaming it to something more generic (PG_offline) to mark pages as
logically offline. This flag can than e.g. also be used by virtio-mem in
the future to mark subsections as offline. Or by other code that wants to
put pages logically offline (e.g. later maybe poisoned pages that shall
no longer be used).

This series converts PG_balloon to PG_offline, allows dumping tools to
query the value to detect such pages and marks pages in the hv-balloon
and XEN balloon properly as PG_offline. Note that virtio-balloon already
set pages to PG_balloon (and now PG_offline).

Please note that this is also helpful for a problem we were seeing under
Hyper-V: Dumping logically offline memory (pages kept fake offline while
onlining a section via online_page_callback) would under some condicions
result in a kernel panic when dumping them.

As I don't have access to neither XEN nor Hyper-V nor VMWare installations,
this was only tested with the virtio-balloon and pages were properly
skipped when dumping. I'll also attach the makedumpfile patch to this
series.

[1] https://lkml.org/lkml/2018/7/20/566

RFC -> v1:
- Add "PM / Hibernate: use pfn_to_online_page()"
- Add "vmw_balloon: mark inflated pages PG_offline"
- "mm: convert PG_balloon to PG_offline"
-- After discussions, also rename the UAPI bit name (KPF_BALLOON -> KPF_OFFLINE)

David Hildenbrand (8):
  mm: balloon: update comment about isolation/migration/compaction
  mm: convert PG_balloon to PG_offline
  kexec: export PG_offline to VMCOREINFO
  xen/balloon: mark inflated pages PG_offline
  hv_balloon: mark inflated pages PG_offline
  vmw_balloon: mark inflated pages PG_offline
  PM / Hibernate: use pfn_to_online_page()
  PM / Hibernate: exclude all PageOffline() pages

 Documentation/admin-guide/mm/pagemap.rst |  9 ++++---
 drivers/hv/hv_balloon.c                  | 14 ++++++++--
 drivers/misc/vmw_balloon.c               | 32 ++++++++++++++++++++++
 drivers/xen/balloon.c                    |  3 +++
 fs/proc/page.c                           |  4 +--
 include/linux/balloon_compaction.h       | 34 +++++++++---------------
 include/linux/page-flags.h               | 11 +++++---
 include/uapi/linux/kernel-page-flags.h   |  2 +-
 kernel/crash_core.c                      |  2 ++
 kernel/power/snapshot.c                  | 13 +++++----
 tools/vm/page-types.c                    |  2 +-
 11 files changed, 87 insertions(+), 39 deletions(-)

-- 
2.17.2

^ permalink raw reply	[flat|nested] 116+ messages in thread

end of thread, other threads:[~2018-11-21 15:35 UTC | newest]

Thread overview: 116+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-19 10:16 [PATCH v1 0/8] mm/kdump: allow to exclude pages that are logically offline David Hildenbrand
2018-11-19 10:16 ` David Hildenbrand
2018-11-19 10:16 ` David Hildenbrand
2018-11-19 10:16 ` [PATCH v1 1/8] mm: balloon: update comment about isolation/migration/compaction David Hildenbrand
2018-11-19 10:16   ` David Hildenbrand
2018-11-21  1:56   ` Michael S. Tsirkin
2018-11-21  1:56     ` Michael S. Tsirkin
2018-11-21  1:56     ` Michael S. Tsirkin
2018-11-21  1:56   ` Michael S. Tsirkin
2018-11-19 10:16 ` David Hildenbrand
2018-11-19 10:16 ` [PATCH v1 2/8] mm: convert PG_balloon to PG_offline David Hildenbrand
2018-11-19 10:16   ` David Hildenbrand
2018-11-19 10:16   ` David Hildenbrand
2018-11-19 11:56   ` Konstantin Khlebnikov
2018-11-19 11:56     ` Konstantin Khlebnikov
2018-11-19 11:56     ` Konstantin Khlebnikov
2018-11-19 11:56   ` Konstantin Khlebnikov
2018-11-19 16:06   ` David Hildenbrand
2018-11-19 16:06     ` David Hildenbrand
2018-11-19 16:06     ` David Hildenbrand
2018-11-19 16:06   ` David Hildenbrand
2018-11-21  1:58   ` Michael S. Tsirkin
2018-11-21  1:58   ` Michael S. Tsirkin
2018-11-21  1:58     ` Michael S. Tsirkin
2018-11-21  1:58     ` Michael S. Tsirkin
2018-11-21  2:44   ` Pankaj Gupta
2018-11-21  2:44     ` Pankaj Gupta
2018-11-21  2:44     ` Pankaj Gupta
2018-11-21  2:44   ` Pankaj Gupta
2018-11-19 10:16 ` David Hildenbrand
2018-11-19 10:16 ` [PATCH v1 3/8] kexec: export PG_offline to VMCOREINFO David Hildenbrand
2018-11-19 10:16   ` David Hildenbrand
2018-11-21  1:59   ` Michael S. Tsirkin
2018-11-21  1:59   ` Michael S. Tsirkin
2018-11-21  1:59     ` Michael S. Tsirkin
2018-11-21  2:58   ` Dave Young
2018-11-21  2:58   ` Dave Young
2018-11-21  2:58     ` Dave Young
2018-11-21  2:58     ` Dave Young
2018-11-21  6:04   ` Baoquan He
2018-11-21  6:04     ` Baoquan He
2018-11-21  6:04     ` Baoquan He
2018-11-21  8:50     ` David Hildenbrand
2018-11-21  8:50       ` David Hildenbrand
2018-11-21  8:50     ` David Hildenbrand
2018-11-21  6:04   ` Baoquan He
2018-11-19 10:16 ` David Hildenbrand
2018-11-19 10:16 ` [PATCH v1 4/8] xen/balloon: mark inflated pages PG_offline David Hildenbrand
2018-11-19 10:16 ` David Hildenbrand
2018-11-19 10:16   ` David Hildenbrand
2018-11-19 12:22   ` Juergen Gross
2018-11-19 12:22     ` Juergen Gross
2018-11-19 13:07     ` David Hildenbrand
2018-11-19 13:07       ` David Hildenbrand
2018-11-19 13:07       ` David Hildenbrand
2018-11-19 13:07     ` David Hildenbrand
2018-11-19 12:22   ` Juergen Gross
2018-11-19 10:16 ` [PATCH v1 5/8] hv_balloon: " David Hildenbrand
2018-11-19 10:16 ` David Hildenbrand
2018-11-19 10:16   ` David Hildenbrand
2018-11-20  8:45   ` Pankaj Gupta
2018-11-20  8:45   ` Pankaj Gupta
2018-11-20  8:45     ` Pankaj Gupta
2018-11-20  8:49     ` David Hildenbrand
2018-11-20  8:49       ` David Hildenbrand
2018-11-20  9:37       ` Pankaj Gupta
2018-11-20  9:37         ` Pankaj Gupta
2018-11-21  1:04         ` Pankaj Gupta
2018-11-21  1:04         ` Pankaj Gupta
2018-11-21  1:04           ` Pankaj Gupta
2018-11-20  9:37       ` Pankaj Gupta
2018-11-20  8:49     ` David Hildenbrand
2018-11-19 10:16 ` [PATCH v1 6/8] vmw_balloon: " David Hildenbrand
2018-11-19 10:16 ` David Hildenbrand
2018-11-19 10:16   ` David Hildenbrand
2018-11-21  3:22   ` Nadav Amit
2018-11-21  3:22     ` Nadav Amit
2018-11-21  8:54     ` David Hildenbrand
2018-11-21  8:54     ` David Hildenbrand
2018-11-21  8:54       ` David Hildenbrand
2018-11-21  3:22   ` Nadav Amit
2018-11-19 10:16 ` [PATCH v1 7/8] PM / Hibernate: use pfn_to_online_page() David Hildenbrand
2018-11-19 10:16 ` David Hildenbrand
2018-11-19 10:16   ` David Hildenbrand
2018-11-19 12:13   ` Michal Hocko
2018-11-19 12:13     ` Michal Hocko
2018-11-19 12:13   ` Michal Hocko
2018-11-19 13:16   ` Pavel Machek
2018-11-19 13:16   ` Pavel Machek
2018-11-19 13:16     ` Pavel Machek
2018-11-20 21:23   ` Rafael J. Wysocki
2018-11-20 21:23     ` Rafael J. Wysocki
2018-11-20 21:23   ` Rafael J. Wysocki
2018-11-19 10:16 ` [PATCH v1 8/8] PM / Hibernate: exclude all PageOffline() pages David Hildenbrand
2018-11-19 10:16 ` David Hildenbrand
2018-11-19 10:16   ` David Hildenbrand
2018-11-20 21:22   ` Rafael J. Wysocki
2018-11-20 21:22   ` Rafael J. Wysocki
2018-11-20 21:22     ` Rafael J. Wysocki
2018-11-21 11:35   ` William Kucharski
2018-11-21 11:35   ` William Kucharski
2018-11-21 11:35     ` William Kucharski
2018-11-21 11:35     ` William Kucharski
2018-11-21 12:21     ` David Hildenbrand
2018-11-21 12:21     ` David Hildenbrand
2018-11-21 12:21       ` David Hildenbrand
2018-11-19 10:18 ` [PATCH v1] makedumpfile: exclude pages that are logically offline David Hildenbrand
2018-11-19 10:18   ` David Hildenbrand
2018-11-21 14:58   ` Kazuhito Hagio
2018-11-21 14:58     ` Kazuhito Hagio
2018-11-21 14:58     ` Kazuhito Hagio
2018-11-21 15:35     ` David Hildenbrand
2018-11-21 15:35       ` David Hildenbrand
2018-11-21 15:35     ` David Hildenbrand
2018-11-21 14:58   ` Kazuhito Hagio
2018-11-19 10:18 ` David Hildenbrand

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.