[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5bc2a2ff-1ae0-6746-b32a-c27962804cef@redhat.com>
Date: Tue, 10 Mar 2020 12:48:48 +0100
From: David Hildenbrand <david@...hat.com>
To: Michal Hocko <mhocko@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
virtio-dev@...ts.oasis-open.org,
virtualization@...ts.linux-foundation.org, kvm@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
"Michael S . Tsirkin" <mst@...hat.com>,
Juergen Gross <jgross@...e.com>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Pavel Tatashin <pavel.tatashin@...rosoft.com>,
Alexander Duyck <alexander.h.duyck@...ux.intel.com>,
Vlastimil Babka <vbabka@...e.cz>,
Johannes Weiner <hannes@...xchg.org>,
Anthony Yznaga <anthony.yznaga@...cle.com>,
Oscar Salvador <osalvador@...e.de>,
Mel Gorman <mgorman@...hsingularity.net>,
Mike Rapoport <rppt@...ux.ibm.com>,
Dan Williams <dan.j.williams@...el.com>,
Anshuman Khandual <anshuman.khandual@....com>,
Qian Cai <cai@....pw>, Pingfan Liu <kernelfans@...il.com>
Subject: Re: [PATCH v1 06/11] mm: Allow to offline unmovable PageOffline()
pages via MEM_GOING_OFFLINE
On 10.03.20 12:47, Michal Hocko wrote:
> On Mon 02-03-20 14:49:36, David Hildenbrand wrote:
>> virtio-mem wants to allow to offline memory blocks of which some parts
>> were unplugged (allocated via alloc_contig_range()), especially, to later
>> offline and remove completely unplugged memory blocks. The important part
>> is that PageOffline() has to remain set until the section is offline, so
>> these pages will never get accessed (e.g., when dumping). The pages should
>> not be handed back to the buddy (which would require clearing PageOffline()
>> and result in issues if offlining fails and the pages are suddenly in the
>> buddy).
>>
>> Let's allow to do that by allowing to isolate any PageOffline() page
>> when offlining. This way, we can reach the memory hotplug notifier
>> MEM_GOING_OFFLINE, where the driver can signal that he is fine with
>> offlining this page by dropping its reference count. PageOffline() pages
>> with a reference count of 0 can then be skipped when offlining the
>> pages (like if they were free, however they are not in the buddy).
>>
>> Anybody who uses PageOffline() pages and does not agree to offline them
>> (e.g., Hyper-V balloon, XEN balloon, VMWare balloon for 2MB pages) will not
>> decrement the reference count and make offlining fail when trying to
>> migrate such an unmovable page. So there should be no observable change.
>> Same applies to balloon compaction users (movable PageOffline() pages), the
>> pages will simply be migrated.
>>
>> Note 1: If offlining fails, a driver has to increment the reference
>> count again in MEM_CANCEL_OFFLINE.
>>
>> Note 2: A driver that makes use of this has to be aware that re-onlining
>> the memory block has to be handled by hooking into onlining code
>> (online_page_callback_t), resetting the page PageOffline() and
>> not giving them to the buddy.
>>
>> Cc: Andrew Morton <akpm@...ux-foundation.org>
>> Cc: Juergen Gross <jgross@...e.com>
>> Cc: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
>> Cc: Pavel Tatashin <pavel.tatashin@...rosoft.com>
>> Cc: Alexander Duyck <alexander.h.duyck@...ux.intel.com>
>> Cc: Vlastimil Babka <vbabka@...e.cz>
>> Cc: Johannes Weiner <hannes@...xchg.org>
>> Cc: Anthony Yznaga <anthony.yznaga@...cle.com>
>> Cc: Michal Hocko <mhocko@...e.com>
>> Cc: Oscar Salvador <osalvador@...e.de>
>> Cc: Mel Gorman <mgorman@...hsingularity.net>
>> Cc: Mike Rapoport <rppt@...ux.ibm.com>
>> Cc: Dan Williams <dan.j.williams@...el.com>
>> Cc: Anshuman Khandual <anshuman.khandual@....com>
>> Cc: Qian Cai <cai@....pw>
>> Cc: Pingfan Liu <kernelfans@...il.com>
>> Signed-off-by: David Hildenbrand <david@...hat.com>
>
> Looks good to me. Thanks for dropping __put_page hooks!
> Acked-by: Michal Hocko <mhocko@...e.com>
Thanks a lot Michal - looks much cleaner this way.
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists