• Nadav Amit's avatar
    vmw_balloon: treat all refused pages equally · 8fa3c61a
    Nadav Amit authored
    Currently, when the hypervisor rejects a page during lock operation, the
    VM treats pages differently according to the error-code: in certain
    cases the page is immediately freed, and in others it is put on a
    rejection list and only freed later.
    
    The behavior does not make too much sense. If the page is freed
    immediately it is very likely to be used again in the next batch of
    allocations, and be rejected again.
    
    In addition, for support of compaction and OOM notifiers, we wish to
    separate the logic that communicates with the hypervisor (as well as
    analyzes the status of each page) from the logic that allocates or free
    pages.
    
    Treat all errors the same way, queuing the pages on the refuse list.
    Move to the next allocation size (4k) when too many pages are refused.
    Free the refused pages when moving to the next size to avoid situations
    in which too much memory is waiting to be freed on the refused list.
    Reviewed-by: default avatarXavier Deguillard <xdeguillard@vmware.com>
    Signed-off-by: default avatarNadav Amit <namit@vmware.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    8fa3c61a
vmw_balloon.c 29.1 KB