Re: [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-21 Thread David Hildenbrand
On 21.06.2017 14:56, Christian Borntraeger wrote: > On 06/20/2017 06:49 PM, David Hildenbrand wrote: >> On 20.06.2017 18:44, Rik van Riel wrote: >>> On Mon, 2017-06-12 at 07:10 -0700, Dave Hansen wrote: >>> The hypervisor is going to throw away the contents of these pages, right? As soon

Re: [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-21 Thread Christian Borntraeger
On 06/20/2017 06:49 PM, David Hildenbrand wrote: > On 20.06.2017 18:44, Rik van Riel wrote: >> On Mon, 2017-06-12 at 07:10 -0700, Dave Hansen wrote: >> >>> The hypervisor is going to throw away the contents of these pages, >>> right? As soon as the spinlock is released, someone can allocate a >>>

Re: [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-21 Thread Michael S. Tsirkin
On Tue, Jun 20, 2017 at 03:51:00PM -0400, Rik van Riel wrote: > On Tue, 2017-06-20 at 21:26 +0300, Michael S. Tsirkin wrote: > > On Tue, Jun 20, 2017 at 01:29:00PM -0400, Rik van Riel wrote: > > > I agree with that.  Let me go into some more detail of > > > what Nitesh is implementing: > > > > > >

Re: [Qemu-devel] [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-21 Thread Wei Wang
On 06/21/2017 01:29 AM, Rik van Riel wrote: On Tue, 2017-06-20 at 18:49 +0200, David Hildenbrand wrote: On 20.06.2017 18:44, Rik van Riel wrote: Nitesh Lal (on the CC list) is working on a way to efficiently batch recently freed pages for free page hinting to the hypervisor. If that is done ef

Re: [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-20 Thread Rik van Riel
On Tue, 2017-06-20 at 21:26 +0300, Michael S. Tsirkin wrote: > On Tue, Jun 20, 2017 at 01:29:00PM -0400, Rik van Riel wrote: > > I agree with that.  Let me go into some more detail of > > what Nitesh is implementing: > > > > 1) In arch_free_page, the being-freed page is added > >    to a per-cpu s

Re: [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-20 Thread David Hildenbrand
>> IMHO even simply writing all-zeros to all free pages before starting >> migration (or even when freeing a page) would be a cleaner interface >> than this (because it atomically works with the entity the host cares >> about for migration). But yes, performance is horrible that's why I am >> not

Re: [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-20 Thread Michael S. Tsirkin
On Tue, Jun 20, 2017 at 08:54:29PM +0200, David Hildenbrand wrote: > On 20.06.2017 20:17, Michael S. Tsirkin wrote: > > On Tue, Jun 20, 2017 at 06:49:33PM +0200, David Hildenbrand wrote: > >> On 20.06.2017 18:44, Rik van Riel wrote: > >>> On Mon, 2017-06-12 at 07:10 -0700, Dave Hansen wrote: > >>>

Re: [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-20 Thread David Hildenbrand
On 20.06.2017 20:17, Michael S. Tsirkin wrote: > On Tue, Jun 20, 2017 at 06:49:33PM +0200, David Hildenbrand wrote: >> On 20.06.2017 18:44, Rik van Riel wrote: >>> On Mon, 2017-06-12 at 07:10 -0700, Dave Hansen wrote: >>> The hypervisor is going to throw away the contents of these pages,

Re: [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-20 Thread Michael S. Tsirkin
On Tue, Jun 20, 2017 at 06:49:33PM +0200, David Hildenbrand wrote: > On 20.06.2017 18:44, Rik van Riel wrote: > > On Mon, 2017-06-12 at 07:10 -0700, Dave Hansen wrote: > > > >> The hypervisor is going to throw away the contents of these pages, > >> right? As soon as the spinlock is released, some

Re: [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-20 Thread Michael S. Tsirkin
On Tue, Jun 20, 2017 at 01:29:00PM -0400, Rik van Riel wrote: > On Tue, 2017-06-20 at 18:49 +0200, David Hildenbrand wrote: > > On 20.06.2017 18:44, Rik van Riel wrote: > > > > Nitesh Lal (on the CC list) is working on a way > > > to efficiently batch recently freed pages for > > > free page hinti

Re: [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-20 Thread Rik van Riel
On Tue, 2017-06-20 at 18:49 +0200, David Hildenbrand wrote: > On 20.06.2017 18:44, Rik van Riel wrote: > > Nitesh Lal (on the CC list) is working on a way > > to efficiently batch recently freed pages for > > free page hinting to the hypervisor. > > > > If that is done efficiently enough (eg. wit

Re: [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-20 Thread David Hildenbrand
On 20.06.2017 18:44, Rik van Riel wrote: > On Mon, 2017-06-12 at 07:10 -0700, Dave Hansen wrote: > >> The hypervisor is going to throw away the contents of these pages, >> right? As soon as the spinlock is released, someone can allocate a >> page, and put good data in it. What keeps the hypervis

Re: [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-20 Thread Rik van Riel
On Mon, 2017-06-12 at 07:10 -0700, Dave Hansen wrote: > The hypervisor is going to throw away the contents of these pages, > right?  As soon as the spinlock is released, someone can allocate a > page, and put good data in it.  What keeps the hypervisor from > throwing > away good data? That looks

Re: [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-12 Thread Wei Wang
On 06/13/2017 04:54 AM, Dave Hansen wrote: On 06/12/2017 01:34 PM, Michael S. Tsirkin wrote: On Mon, Jun 12, 2017 at 09:42:36AM -0700, Dave Hansen wrote: On 06/12/2017 09:28 AM, Michael S. Tsirkin wrote: The hypervisor is going to throw away the contents of these pages, right? It should be ca

Re: [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-12 Thread Dave Hansen
On 06/12/2017 01:34 PM, Michael S. Tsirkin wrote: > On Mon, Jun 12, 2017 at 09:42:36AM -0700, Dave Hansen wrote: >> On 06/12/2017 09:28 AM, Michael S. Tsirkin wrote: >>> The hypervisor is going to throw away the contents of these pages, right? >>> It should be careful and only throw away

Re: [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-12 Thread Michael S. Tsirkin
On Mon, Jun 12, 2017 at 09:42:36AM -0700, Dave Hansen wrote: > On 06/12/2017 09:28 AM, Michael S. Tsirkin wrote: > > > >> The hypervisor is going to throw away the contents of these pages, > >> right? > > It should be careful and only throw away contents that was there before > > report_unused_pag

Re: [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-12 Thread Dave Hansen
On 06/12/2017 09:28 AM, Michael S. Tsirkin wrote: > >> The hypervisor is going to throw away the contents of these pages, >> right? > It should be careful and only throw away contents that was there before > report_unused_page_block was invoked. Hypervisor is responsible for not > corrupting gues

Re: [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-12 Thread Michael S. Tsirkin
On Mon, Jun 12, 2017 at 07:10:12AM -0700, Dave Hansen wrote: > Please stop cc'ing me on things also sent to closed mailing lists > (virtio-...@lists.oasis-open.org). I'm happy to review things on open > lists, but I'm not fond of the closed lists bouncing things at me. > > On 06/09/2017 03:41 AM,

Re: [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-12 Thread Dave Hansen
Please stop cc'ing me on things also sent to closed mailing lists (virtio-...@lists.oasis-open.org). I'm happy to review things on open lists, but I'm not fond of the closed lists bouncing things at me. On 06/09/2017 03:41 AM, Wei Wang wrote: > Add a function to find a page block on the free list

[PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-09 Thread Wei Wang
Add a function to find a page block on the free list specified by the caller. Pages from the page block may be used immediately after the function returns. The caller is responsible for detecting or preventing the use of such pages. Signed-off-by: Wei Wang Signed-off-by: Liang Li --- include/li