linux-stable/drivers/virtio
David Hildenbrand 27f852795a virtio-mem: don't special-case ZONE_MOVABLE
When introducing virtio-mem, the semantics of ZONE_MOVABLE were rather
unclear, which is why we special-cased ZONE_MOVABLE such that partially
plugged blocks would never end up in ZONE_MOVABLE.

Now that the semantics are much clearer (and will be documented in a
follow-up patch including the new virtio-mem behavior), let's allow to
online partially plugged memory blocks to ZONE_MOVABLE and also consider
memory blocks that were onlined to ZONE_MOVABLE when unplugging memory.
While unplugged memory pages are, in general, unmovable, they can be
skipped when offlining memory.

virtio-mem only unplugs fairly big chunks (in the megabyte range) and
rather tries to shrink the memory region than randomly choosing memory.
In theory, if all other pages in the movable zone would be movable,
virtio-mem would only shrink that zone and not create any kind of
fragmentation.

In the future, we might want to remember the zone again and use the
information when (un)plugging memory.  For now, let's keep it simple.

Note: Support for defragmentation is planned, to deal with fragmentation
after unplug due to memory chunks within memory blocks that could not get
unplugged before (e.g., somebody pinning pages within ZONE_MOVABLE for a
longer time).

Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Qian Cai <cai@lca.pw>
Link: http://lkml.kernel.org/r/20200816125333.7434-6-david@redhat.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-10-13 18:38:33 -07:00
..
Kconfig virtio-mem: Fix build error due to improper use 'select' 2020-07-30 11:28:17 -04:00
Makefile virtio-mem: Paravirtualized memory hotplug 2020-06-04 15:36:52 -04:00
virtio.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
virtio_balloon.c virtio_balloon: use LE config space accesses 2020-08-05 11:08:41 -04:00
virtio_input.c virtio_input: convert to LE accessors 2020-08-05 11:08:41 -04:00
virtio_mem.c virtio-mem: don't special-case ZONE_MOVABLE 2020-10-13 18:38:33 -07:00
virtio_mmio.c virtio-mmio: Reject invalid IRQ 0 command line argument 2020-07-22 10:31:45 -05:00
virtio_pci_common.c virtio-pci: check name when counting MSI-X vectors 2020-02-06 03:40:26 -05:00
virtio_pci_common.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 78 2019-05-24 17:37:51 +02:00
virtio_pci_legacy.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 78 2019-05-24 17:37:51 +02:00
virtio_pci_modern.c virtio: pci: constify ioreadX() iomem argument (as in generic implementation) 2020-08-14 19:56:57 -07:00
virtio_ring.c virtio: fixes, features 2020-08-11 14:34:17 -07:00
virtio_vdpa.c virtio_vdpa: legacy features handling 2020-08-05 11:08:40 -04:00