• David Hildenbrand's avatar
    virtio-mem: Allow to offline partially unplugged memory blocks · 8e5c921c
    David Hildenbrand authored
    Dropping the reference count of PageOffline() pages during MEM_GOING_ONLINE
    allows offlining code to skip them. However, we also have to clear
    PG_reserved, because PG_reserved pages get detected as unmovable right
    away. Take care of restoring the reference count when offlining is
    canceled.
    
    Clarify why we don't have to perform any action when unloading the
    driver. Also, let's add a warning if anybody is still holding a
    reference to unplugged pages when offlining.
    Tested-by: default avatarPankaj Gupta <pankaj.gupta.linux@gmail.com>
    Cc: "Michael S. Tsirkin" <mst@redhat.com>
    Cc: Jason Wang <jasowang@redhat.com>
    Cc: Oscar Salvador <osalvador@suse.de>
    Cc: Michal Hocko <mhocko@kernel.org>
    Cc: Igor Mammedov <imammedo@redhat.com>
    Cc: Dave Young <dyoung@redhat.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
    Cc: Stefan Hajnoczi <stefanha@redhat.com>
    Cc: Vlastimil Babka <vbabka@suse.cz>
    Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
    Link: https://lore.kernel.org/r/20200507140139.17083-8-david@redhat.comSigned-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    8e5c921c
virtio_mem.c 50.3 KB