Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-23 Thread David Hildenbrand
On 23.10.19 11:43, Michal Hocko wrote: On Tue 22-10-19 16:02:09, David Hildenbrand wrote: [...] MEM_CANCEL_OFFLINE could gain the reference back to balance the MEM_GOING_OFFLINE step. The pages are already unisolated and could be used by the buddy. But again, I think you have an idea that

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-23 Thread Michal Hocko
On Tue 22-10-19 16:02:09, David Hildenbrand wrote: [...] > >>> MEM_CANCEL_OFFLINE could gain the reference back to balance the > >>> MEM_GOING_OFFLINE step. > >> > >> The pages are already unisolated and could be used by the buddy. But again, > >> I think you have an idea that tries to avoid

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-22 Thread David Hildenbrand
>> Please note that we have other users that use PG_offline + refcount >= 1 >> (HyperV balloon, XEN). We should not affect these users (IOW, >> has_unmovable_pages() has to stop right there if we see one of these pages). > > OK, this is exactly what I was worried about. I can see why you might >

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-22 Thread Michal Hocko
On Fri 18-10-19 14:35:06, David Hildenbrand wrote: > On 18.10.19 13:20, Michal Hocko wrote: > > On Fri 18-10-19 10:50:24, David Hildenbrand wrote: > > > On 18.10.19 10:15, Michal Hocko wrote: [...] > > > > for that - MEM_GOING_OFFLINE notification. This sounds like a good place > > > > for the

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-18 Thread David Hildenbrand
On 18.10.19 13:20, Michal Hocko wrote: On Fri 18-10-19 10:50:24, David Hildenbrand wrote: On 18.10.19 10:15, Michal Hocko wrote: On Wed 16-10-19 16:14:52, David Hildenbrand wrote: On 16.10.19 16:03, Michal Hocko wrote: [...] But why cannot you keep the reference count at 1 (do get_page when

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-18 Thread Michal Hocko
On Fri 18-10-19 10:50:24, David Hildenbrand wrote: > On 18.10.19 10:15, Michal Hocko wrote: > > On Wed 16-10-19 16:14:52, David Hildenbrand wrote: > > > On 16.10.19 16:03, Michal Hocko wrote: > > [...] > > > > But why cannot you keep the reference count at 1 (do get_page when > > > > offlining the

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-18 Thread David Hildenbrand
On 18.10.19 10:15, Michal Hocko wrote: On Wed 16-10-19 16:14:52, David Hildenbrand wrote: On 16.10.19 16:03, Michal Hocko wrote: [...] But why cannot you keep the reference count at 1 (do get_page when offlining the page)? In other words as long as the driver knows the page has been returned

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-18 Thread Michal Hocko
On Wed 16-10-19 16:14:52, David Hildenbrand wrote: > On 16.10.19 16:03, Michal Hocko wrote: [...] > > But why cannot you keep the reference count at 1 (do get_page when > > offlining the page)? In other words as long as the driver knows the page > > has been returned to the host then it has ref

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread David Hildenbrand
On 16.10.19 16:09, Michal Hocko wrote: On Wed 16-10-19 15:55:00, David Hildenbrand wrote: On 16.10.19 15:45, Michal Hocko wrote: [...] There is state stored in the struct page. In other words this shouldn't be really different from HWPoison pages. I cannot find the code that is doing that and

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread David Hildenbrand
On 16.10.19 16:03, Michal Hocko wrote: On Wed 16-10-19 15:45:06, David Hildenbrand wrote: On 16.10.19 13:43, Michal Hocko wrote: On Thu 19-09-19 16:22:25, David Hildenbrand wrote: virtio-mem wants to allow to offline memory blocks of which some parts were unplugged, especially, to later

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread Michal Hocko
On Wed 16-10-19 15:55:00, David Hildenbrand wrote: > On 16.10.19 15:45, Michal Hocko wrote: [...] > > There is state stored in the struct page. In other words this shouldn't > > be really different from HWPoison pages. I cannot find the code that is > > doing that and maybe we don't handle that.

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread Michal Hocko
On Wed 16-10-19 15:45:06, David Hildenbrand wrote: > On 16.10.19 13:43, Michal Hocko wrote: > > On Thu 19-09-19 16:22:25, David Hildenbrand wrote: > > > virtio-mem wants to allow to offline memory blocks of which some parts > > > were unplugged, especially, to later offline and remove completely >

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread David Hildenbrand
On 16.10.19 15:45, Michal Hocko wrote: On Wed 16-10-19 14:50:30, David Hildenbrand wrote: On 16.10.19 13:43, Michal Hocko wrote: On Thu 19-09-19 16:22:25, David Hildenbrand wrote: virtio-mem wants to allow to offline memory blocks of which some parts were unplugged, especially, to later

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread David Hildenbrand
On 16.10.19 15:45, Michal Hocko wrote: On Wed 16-10-19 14:50:30, David Hildenbrand wrote: On 16.10.19 13:43, Michal Hocko wrote: On Thu 19-09-19 16:22:25, David Hildenbrand wrote: virtio-mem wants to allow to offline memory blocks of which some parts were unplugged, especially, to later

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread David Hildenbrand
On 16.10.19 13:43, Michal Hocko wrote: On Thu 19-09-19 16:22:25, David Hildenbrand wrote: virtio-mem wants to allow to offline memory blocks of which some parts were unplugged, especially, to later offline and remove completely unplugged memory blocks. The important part is that PageOffline()

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread Michal Hocko
On Wed 16-10-19 14:50:30, David Hildenbrand wrote: > On 16.10.19 13:43, Michal Hocko wrote: > > On Thu 19-09-19 16:22:25, David Hildenbrand wrote: > > > virtio-mem wants to allow to offline memory blocks of which some parts > > > were unplugged, especially, to later offline and remove completely >

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread David Hildenbrand
On 16.10.19 13:43, Michal Hocko wrote: On Thu 19-09-19 16:22:25, David Hildenbrand wrote: virtio-mem wants to allow to offline memory blocks of which some parts were unplugged, especially, to later offline and remove completely unplugged memory blocks. The important part is that PageOffline()

Re: [PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-10-16 Thread Michal Hocko
On Thu 19-09-19 16:22:25, David Hildenbrand wrote: > virtio-mem wants to allow to offline memory blocks of which some parts > were unplugged, especially, to later offline and remove completely > unplugged memory blocks. The important part is that PageOffline() has > to remain set until the section

[PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0

2019-09-19 Thread David Hildenbrand
virtio-mem wants to allow to offline memory blocks of which some parts were unplugged, 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.,