David Hildenbrand
2020-Mar-11 17:19 UTC
[PATCH v2 07/10] mm/memory_hotplug: Introduce offline_and_remove_memory()
On 11.03.20 18:14, David Hildenbrand wrote:> virtio-mem wants to offline and remove a memory block once it unplugged > all subblocks (e.g., using alloc_contig_range()). Let's provide > an interface to do that from a driver. virtio-mem already supports to > offline partially unplugged memory blocks. Offlining a fully unplugged > memory block will not require to migrate any pages. All unplugged > subblocks are PageOffline() and have a reference count of 0 - so > offlining code will simply skip them. > > All we need is an interface to offline and remove the memory from kernel > module context, where we don't have access to the memory block devices > (esp. find_memory_block() and device_offline()) and the device hotplug > lock. > > To keep things simple, allow to only work on a single memory block. >Lost the ACK from Michael Acked-by: Michal Hocko <mhocko at suse.com> [1] [1] https://lkml.kernel.org/r/20200302142737.GP4380 at dhcp22.suse.cz -- Thanks, David / dhildenb
Michael S. Tsirkin
2020-Apr-14 16:35 UTC
[PATCH v2 07/10] mm/memory_hotplug: Introduce offline_and_remove_memory()
On Wed, Mar 11, 2020 at 06:19:04PM +0100, David Hildenbrand wrote:> On 11.03.20 18:14, David Hildenbrand wrote: > > virtio-mem wants to offline and remove a memory block once it unplugged > > all subblocks (e.g., using alloc_contig_range()). Let's provide > > an interface to do that from a driver. virtio-mem already supports to > > offline partially unplugged memory blocks. Offlining a fully unplugged > > memory block will not require to migrate any pages. All unplugged > > subblocks are PageOffline() and have a reference count of 0 - so > > offlining code will simply skip them. > > > > All we need is an interface to offline and remove the memory from kernel > > module context, where we don't have access to the memory block devices > > (esp. find_memory_block() and device_offline()) and the device hotplug > > lock. > > > > To keep things simple, allow to only work on a single memory block. > > > > Lost the ACK from Michael > > Acked-by: Michal Hocko <mhocko at suse.com> [1] > > [1] https://lkml.kernel.org/r/20200302142737.GP4380 at dhcp22.suse.czAndrew, could you pls ack merging this through the vhost tree, with the rest of the patchset?> -- > Thanks, > > David / dhildenb
Andrew Morton
2020-Apr-15 00:30 UTC
[PATCH v2 07/10] mm/memory_hotplug: Introduce offline_and_remove_memory()
On Tue, 14 Apr 2020 12:35:02 -0400 "Michael S. Tsirkin" <mst at redhat.com> wrote:> On Wed, Mar 11, 2020 at 06:19:04PM +0100, David Hildenbrand wrote: > > On 11.03.20 18:14, David Hildenbrand wrote: > > > virtio-mem wants to offline and remove a memory block once it unplugged > > > all subblocks (e.g., using alloc_contig_range()). Let's provide > > > an interface to do that from a driver. virtio-mem already supports to > > > offline partially unplugged memory blocks. Offlining a fully unplugged > > > memory block will not require to migrate any pages. All unplugged > > > subblocks are PageOffline() and have a reference count of 0 - so > > > offlining code will simply skip them. > > > > > > All we need is an interface to offline and remove the memory from kernel > > > module context, where we don't have access to the memory block devices > > > (esp. find_memory_block() and device_offline()) and the device hotplug > > > lock. > > > > > > To keep things simple, allow to only work on a single memory block. > > > > > > > Lost the ACK from Michael > > > > Acked-by: Michal Hocko <mhocko at suse.com> [1] > > > > [1] https://lkml.kernel.org/r/20200302142737.GP4380 at dhcp22.suse.cz > > > Andrew, could you pls ack merging this through the vhost tree, > with the rest of the patchset?I wish the device_offline() return value was documented :( Yes, please go ahead and merge. Acked-by: Andrew Morton <akpm at linux-foundation.org>
Possibly Parallel Threads
- [PATCH v2 07/10] mm/memory_hotplug: Introduce offline_and_remove_memory()
- [PATCH v1 08/11] mm/memory_hotplug: Introduce offline_and_remove_memory()
- [PATCH v2 07/10] mm/memory_hotplug: Introduce offline_and_remove_memory()
- [PATCH v3 07/15] mm/memory_hotplug: Introduce offline_and_remove_memory()
- [PATCH v3 07/15] mm/memory_hotplug: Introduce offline_and_remove_memory()