Re: [Qemu-devel] [RFC 1/5] virtio-balloon: Remove unnecessary MADV_WILLNEED on deflate

2018-12-03 Thread David Gibson
On Mon, Oct 15, 2018 at 06:43:06AM -0400, Michael S. Tsirkin wrote: > On Mon, Oct 15, 2018 at 08:54:27AM +0200, David Hildenbrand wrote: > > On 12/10/2018 20:05, Michael S. Tsirkin wrote: > > > On Fri, Oct 12, 2018 at 02:24:27PM +1100, David Gibson wrote: > > >> When the balloon is inflated, we

Re: [Qemu-devel] [RFC 1/5] virtio-balloon: Remove unnecessary MADV_WILLNEED on deflate

2018-10-15 Thread David Hildenbrand
>> (And "Expect access in the near future." does not sound like guarantees >> to me either way) > > Should we be concerned about impact on performance though? Yes, it really depends on the use case (and most of the time, the memory won't be directly reused). Let's document it in the commit log

Re: [Qemu-devel] [RFC 1/5] virtio-balloon: Remove unnecessary MADV_WILLNEED on deflate

2018-10-15 Thread Michael S. Tsirkin
On Mon, Oct 15, 2018 at 08:54:27AM +0200, David Hildenbrand wrote: > On 12/10/2018 20:05, Michael S. Tsirkin wrote: > > On Fri, Oct 12, 2018 at 02:24:27PM +1100, David Gibson wrote: > >> When the balloon is inflated, we discard memory place in it using madvise() > >> with MADV_DONTNEED. And when

Re: [Qemu-devel] [RFC 1/5] virtio-balloon: Remove unnecessary MADV_WILLNEED on deflate

2018-10-15 Thread David Hildenbrand
On 12/10/2018 20:05, Michael S. Tsirkin wrote: > On Fri, Oct 12, 2018 at 02:24:27PM +1100, David Gibson wrote: >> When the balloon is inflated, we discard memory place in it using madvise() >> with MADV_DONTNEED. And when we deflate it we use MADV_WILLNEED, which >> sounds like it makes sense but

Re: [Qemu-devel] [RFC 1/5] virtio-balloon: Remove unnecessary MADV_WILLNEED on deflate

2018-10-13 Thread David Gibson
On Fri, Oct 12, 2018 at 09:40:24AM +0200, David Hildenbrand wrote: > On 12/10/2018 05:24, David Gibson wrote: > > When the balloon is inflated, we discard memory place in it using madvise() > > with MADV_DONTNEED. And when we deflate it we use MADV_WILLNEED, which > > sounds like it makes sense

Re: [Qemu-devel] [RFC 1/5] virtio-balloon: Remove unnecessary MADV_WILLNEED on deflate

2018-10-13 Thread David Gibson
On Fri, Oct 12, 2018 at 10:41:33AM -0700, Richard Henderson wrote: > On 10/11/18 8:24 PM, David Gibson wrote: > > When the balloon is inflated, we discard memory place in it using madvise() > > with MADV_DONTNEED. And when we deflate it we use MADV_WILLNEED, which > > sounds like it makes sense

Re: [Qemu-devel] [RFC 1/5] virtio-balloon: Remove unnecessary MADV_WILLNEED on deflate

2018-10-12 Thread Michael S. Tsirkin
On Fri, Oct 12, 2018 at 02:24:27PM +1100, David Gibson wrote: > When the balloon is inflated, we discard memory place in it using madvise() > with MADV_DONTNEED. And when we deflate it we use MADV_WILLNEED, which > sounds like it makes sense but is actually unnecessary. > > The misleadingly

Re: [Qemu-devel] [RFC 1/5] virtio-balloon: Remove unnecessary MADV_WILLNEED on deflate

2018-10-12 Thread Eric Blake
On 10/12/18 12:41 PM, Richard Henderson wrote: On 10/11/18 8:24 PM, David Gibson wrote: When the balloon is inflated, we discard memory place in it using madvise() with MADV_DONTNEED. And when we deflate it we use MADV_WILLNEED, which sounds like it makes sense but is actually unnecessary.

Re: [Qemu-devel] [RFC 1/5] virtio-balloon: Remove unnecessary MADV_WILLNEED on deflate

2018-10-12 Thread Richard Henderson
On 10/11/18 8:24 PM, David Gibson wrote: > When the balloon is inflated, we discard memory place in it using madvise() > with MADV_DONTNEED. And when we deflate it we use MADV_WILLNEED, which > sounds like it makes sense but is actually unnecessary. > > The misleadingly named MADV_DONTNEED just

Re: [Qemu-devel] [RFC 1/5] virtio-balloon: Remove unnecessary MADV_WILLNEED on deflate

2018-10-12 Thread David Hildenbrand
On 12/10/2018 05:24, David Gibson wrote: > When the balloon is inflated, we discard memory place in it using madvise() > with MADV_DONTNEED. And when we deflate it we use MADV_WILLNEED, which > sounds like it makes sense but is actually unnecessary. > > The misleadingly named MADV_DONTNEED just

[Qemu-devel] [RFC 1/5] virtio-balloon: Remove unnecessary MADV_WILLNEED on deflate

2018-10-11 Thread David Gibson
When the balloon is inflated, we discard memory place in it using madvise() with MADV_DONTNEED. And when we deflate it we use MADV_WILLNEED, which sounds like it makes sense but is actually unnecessary. The misleadingly named MADV_DONTNEED just discards the memory in question, it doesn't set any