RE: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-13 Thread Wang, Wei W
On Sunday, March 12, 2017 12:04 PM, Michael S. Tsirkin wrote: > On Sun, Mar 12, 2017 at 01:59:54AM +, Wang, Wei W wrote: > > On 03/11/2017 10:10 PM, Matthew Wilcox wrote: > > > On Sat, Mar 11, 2017 at 07:59:31PM +0800, Wei Wang wrote: > > > > I'm thinking what if the guest needs to transfer

RE: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-13 Thread Wang, Wei W
On Sunday, March 12, 2017 12:04 PM, Michael S. Tsirkin wrote: > On Sun, Mar 12, 2017 at 01:59:54AM +, Wang, Wei W wrote: > > On 03/11/2017 10:10 PM, Matthew Wilcox wrote: > > > On Sat, Mar 11, 2017 at 07:59:31PM +0800, Wei Wang wrote: > > > > I'm thinking what if the guest needs to transfer

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-11 Thread Michael S. Tsirkin
On Sun, Mar 12, 2017 at 01:59:54AM +, Wang, Wei W wrote: > On 03/11/2017 10:10 PM, Matthew Wilcox wrote: > > On Sat, Mar 11, 2017 at 07:59:31PM +0800, Wei Wang wrote: > > > I'm thinking what if the guest needs to transfer these much physically > > > continuous memory to host:

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-11 Thread Michael S. Tsirkin
On Sun, Mar 12, 2017 at 01:59:54AM +, Wang, Wei W wrote: > On 03/11/2017 10:10 PM, Matthew Wilcox wrote: > > On Sat, Mar 11, 2017 at 07:59:31PM +0800, Wei Wang wrote: > > > I'm thinking what if the guest needs to transfer these much physically > > > continuous memory to host:

RE: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-11 Thread Wang, Wei W
On 03/11/2017 10:10 PM, Matthew Wilcox wrote: > On Sat, Mar 11, 2017 at 07:59:31PM +0800, Wei Wang wrote: > > I'm thinking what if the guest needs to transfer these much physically > > continuous memory to host: 1GB+2MB+64KB+32KB+16KB+4KB. > > Is it going to use Six 64-bit chunks? Would it be

RE: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-11 Thread Wang, Wei W
On 03/11/2017 10:10 PM, Matthew Wilcox wrote: > On Sat, Mar 11, 2017 at 07:59:31PM +0800, Wei Wang wrote: > > I'm thinking what if the guest needs to transfer these much physically > > continuous memory to host: 1GB+2MB+64KB+32KB+16KB+4KB. > > Is it going to use Six 64-bit chunks? Would it be

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-11 Thread Michael S. Tsirkin
On Sat, Mar 11, 2017 at 07:59:31PM +0800, Wei Wang wrote: > On 03/11/2017 01:11 AM, Matthew Wilcox wrote: > > On Fri, Mar 10, 2017 at 05:58:28PM +0200, Michael S. Tsirkin wrote: > > > One of the issues of current balloon is the 4k page size > > > assumption. For example if you free a huge page you

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-11 Thread Michael S. Tsirkin
On Sat, Mar 11, 2017 at 07:59:31PM +0800, Wei Wang wrote: > On 03/11/2017 01:11 AM, Matthew Wilcox wrote: > > On Fri, Mar 10, 2017 at 05:58:28PM +0200, Michael S. Tsirkin wrote: > > > One of the issues of current balloon is the 4k page size > > > assumption. For example if you free a huge page you

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-11 Thread Michael S. Tsirkin
On Fri, Mar 10, 2017 at 01:25:41PM -0800, Matthew Wilcox wrote: > On Fri, Mar 10, 2017 at 09:35:21PM +0200, Michael S. Tsirkin wrote: > > > bit 0 clear => bits 1-11 encode a page count, bits 12-63 encode a PFN, > > > page size 4k. > > > bit 0 set, bit 1 clear => bits 2-12 encode a page count,

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-11 Thread Michael S. Tsirkin
On Fri, Mar 10, 2017 at 01:25:41PM -0800, Matthew Wilcox wrote: > On Fri, Mar 10, 2017 at 09:35:21PM +0200, Michael S. Tsirkin wrote: > > > bit 0 clear => bits 1-11 encode a page count, bits 12-63 encode a PFN, > > > page size 4k. > > > bit 0 set, bit 1 clear => bits 2-12 encode a page count,

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-11 Thread Matthew Wilcox
On Sat, Mar 11, 2017 at 07:59:31PM +0800, Wei Wang wrote: > I'm thinking what if the guest needs to transfer these much physically > continuous > memory to host: 1GB+2MB+64KB+32KB+16KB+4KB. > Is it going to use Six 64-bit chunks? Would it be simpler if we just > use the 128-bit chunk format (we

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-11 Thread Matthew Wilcox
On Sat, Mar 11, 2017 at 07:59:31PM +0800, Wei Wang wrote: > I'm thinking what if the guest needs to transfer these much physically > continuous > memory to host: 1GB+2MB+64KB+32KB+16KB+4KB. > Is it going to use Six 64-bit chunks? Would it be simpler if we just > use the 128-bit chunk format (we

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-11 Thread Wei Wang
On 03/11/2017 01:11 AM, Matthew Wilcox wrote: On Fri, Mar 10, 2017 at 05:58:28PM +0200, Michael S. Tsirkin wrote: One of the issues of current balloon is the 4k page size assumption. For example if you free a huge page you have to split it up and pass 4k chunks to host. Quite often host can't

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-11 Thread Wei Wang
On 03/11/2017 01:11 AM, Matthew Wilcox wrote: On Fri, Mar 10, 2017 at 05:58:28PM +0200, Michael S. Tsirkin wrote: One of the issues of current balloon is the 4k page size assumption. For example if you free a huge page you have to split it up and pass 4k chunks to host. Quite often host can't

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread Matthew Wilcox
On Fri, Mar 10, 2017 at 09:35:21PM +0200, Michael S. Tsirkin wrote: > > bit 0 clear => bits 1-11 encode a page count, bits 12-63 encode a PFN, page > > size 4k. > > bit 0 set, bit 1 clear => bits 2-12 encode a page count, bits 13-63 encode > > a PFN, page size 8k > > bits 0+1 set, bit 2 clear =>

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread Matthew Wilcox
On Fri, Mar 10, 2017 at 09:35:21PM +0200, Michael S. Tsirkin wrote: > > bit 0 clear => bits 1-11 encode a page count, bits 12-63 encode a PFN, page > > size 4k. > > bit 0 set, bit 1 clear => bits 2-12 encode a page count, bits 13-63 encode > > a PFN, page size 8k > > bits 0+1 set, bit 2 clear =>

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread Matthew Wilcox
On Fri, Mar 10, 2017 at 09:10:53PM +0200, Michael S. Tsirkin wrote: > > I completely agree with you that we should be able to pass a hugepage > > as a single chunk. Also we shouldn't assume that host and guest have > > the same page size. I think we can come up with a scheme that actually > >

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread Matthew Wilcox
On Fri, Mar 10, 2017 at 09:10:53PM +0200, Michael S. Tsirkin wrote: > > I completely agree with you that we should be able to pass a hugepage > > as a single chunk. Also we shouldn't assume that host and guest have > > the same page size. I think we can come up with a scheme that actually > >

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread Michael S. Tsirkin
On Fri, Mar 10, 2017 at 09:11:44AM -0800, Matthew Wilcox wrote: > On Fri, Mar 10, 2017 at 05:58:28PM +0200, Michael S. Tsirkin wrote: > > One of the issues of current balloon is the 4k page size > > assumption. For example if you free a huge page you > > have to split it up and pass 4k chunks to

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread Michael S. Tsirkin
On Fri, Mar 10, 2017 at 09:11:44AM -0800, Matthew Wilcox wrote: > On Fri, Mar 10, 2017 at 05:58:28PM +0200, Michael S. Tsirkin wrote: > > One of the issues of current balloon is the 4k page size > > assumption. For example if you free a huge page you > > have to split it up and pass 4k chunks to

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread Michael S. Tsirkin
On Fri, Mar 10, 2017 at 09:11:44AM -0800, Matthew Wilcox wrote: > On Fri, Mar 10, 2017 at 05:58:28PM +0200, Michael S. Tsirkin wrote: > > One of the issues of current balloon is the 4k page size > > assumption. For example if you free a huge page you > > have to split it up and pass 4k chunks to

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread Michael S. Tsirkin
On Fri, Mar 10, 2017 at 09:11:44AM -0800, Matthew Wilcox wrote: > On Fri, Mar 10, 2017 at 05:58:28PM +0200, Michael S. Tsirkin wrote: > > One of the issues of current balloon is the 4k page size > > assumption. For example if you free a huge page you > > have to split it up and pass 4k chunks to

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread Matthew Wilcox
On Fri, Mar 10, 2017 at 05:58:28PM +0200, Michael S. Tsirkin wrote: > One of the issues of current balloon is the 4k page size > assumption. For example if you free a huge page you > have to split it up and pass 4k chunks to host. > Quite often host can't free these 4k chunks at all (e.g. > when

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread Matthew Wilcox
On Fri, Mar 10, 2017 at 05:58:28PM +0200, Michael S. Tsirkin wrote: > One of the issues of current balloon is the 4k page size > assumption. For example if you free a huge page you > have to split it up and pass 4k chunks to host. > Quite often host can't free these 4k chunks at all (e.g. > when

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread Michael S. Tsirkin
On Fri, Mar 10, 2017 at 07:37:28PM +0800, Wei Wang wrote: > On 03/09/2017 10:14 PM, Matthew Wilcox wrote: > > On Fri, Mar 03, 2017 at 01:40:28PM +0800, Wei Wang wrote: > > > From: Liang Li > > > 1) allocating pages (6.5%) > > > 2) sending PFNs to host (68.3%) > > > 3)

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread Michael S. Tsirkin
On Fri, Mar 10, 2017 at 07:37:28PM +0800, Wei Wang wrote: > On 03/09/2017 10:14 PM, Matthew Wilcox wrote: > > On Fri, Mar 03, 2017 at 01:40:28PM +0800, Wei Wang wrote: > > > From: Liang Li > > > 1) allocating pages (6.5%) > > > 2) sending PFNs to host (68.3%) > > > 3) address translation (6.1%) >

Re: [virtio-dev] Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread Michael S. Tsirkin
On Fri, Mar 10, 2017 at 06:02:31PM +0800, Wei Wang wrote: > On 03/08/2017 12:01 PM, Michael S. Tsirkin wrote: > > On Fri, Mar 03, 2017 at 01:40:28PM +0800, Wei Wang wrote: > > > From: Liang Li > > > > > > The implementation of the current virtio-balloon is not very > > >

Re: [virtio-dev] Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread Michael S. Tsirkin
On Fri, Mar 10, 2017 at 06:02:31PM +0800, Wei Wang wrote: > On 03/08/2017 12:01 PM, Michael S. Tsirkin wrote: > > On Fri, Mar 03, 2017 at 01:40:28PM +0800, Wei Wang wrote: > > > From: Liang Li > > > > > > The implementation of the current virtio-balloon is not very > > > efficient, because the

Re: [virtio-dev] Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread David Hildenbrand
Am 10.03.2017 um 11:02 schrieb Wei Wang: > On 03/08/2017 12:01 PM, Michael S. Tsirkin wrote: >> On Fri, Mar 03, 2017 at 01:40:28PM +0800, Wei Wang wrote: >>> From: Liang Li >>> >>> The implementation of the current virtio-balloon is not very >>> efficient, because the pages

Re: [virtio-dev] Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread David Hildenbrand
Am 10.03.2017 um 11:02 schrieb Wei Wang: > On 03/08/2017 12:01 PM, Michael S. Tsirkin wrote: >> On Fri, Mar 03, 2017 at 01:40:28PM +0800, Wei Wang wrote: >>> From: Liang Li >>> >>> The implementation of the current virtio-balloon is not very >>> efficient, because the pages are transferred to the

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread Wei Wang
On 03/09/2017 10:14 PM, Matthew Wilcox wrote: On Fri, Mar 03, 2017 at 01:40:28PM +0800, Wei Wang wrote: From: Liang Li 1) allocating pages (6.5%) 2) sending PFNs to host (68.3%) 3) address translation (6.1%) 4) madvise (19%) This patch optimizes step 2) by transfering

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread Wei Wang
On 03/09/2017 10:14 PM, Matthew Wilcox wrote: On Fri, Mar 03, 2017 at 01:40:28PM +0800, Wei Wang wrote: From: Liang Li 1) allocating pages (6.5%) 2) sending PFNs to host (68.3%) 3) address translation (6.1%) 4) madvise (19%) This patch optimizes step 2) by transfering pages to the host in

Re: [virtio-dev] Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread Wei Wang
On 03/08/2017 12:01 PM, Michael S. Tsirkin wrote: On Fri, Mar 03, 2017 at 01:40:28PM +0800, Wei Wang wrote: From: Liang Li The implementation of the current virtio-balloon is not very efficient, because the pages are transferred to the host one by one. Here is the

Re: [virtio-dev] Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-10 Thread Wei Wang
On 03/08/2017 12:01 PM, Michael S. Tsirkin wrote: On Fri, Mar 03, 2017 at 01:40:28PM +0800, Wei Wang wrote: From: Liang Li The implementation of the current virtio-balloon is not very efficient, because the pages are transferred to the host one by one. Here is the breakdown of the time in

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-09 Thread Matthew Wilcox
On Fri, Mar 03, 2017 at 01:40:28PM +0800, Wei Wang wrote: > From: Liang Li > 1) allocating pages (6.5%) > 2) sending PFNs to host (68.3%) > 3) address translation (6.1%) > 4) madvise (19%) > > This patch optimizes step 2) by transfering pages to the host in > chunks. A

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-09 Thread Matthew Wilcox
On Fri, Mar 03, 2017 at 01:40:28PM +0800, Wei Wang wrote: > From: Liang Li > 1) allocating pages (6.5%) > 2) sending PFNs to host (68.3%) > 3) address translation (6.1%) > 4) madvise (19%) > > This patch optimizes step 2) by transfering pages to the host in > chunks. A chunk consists of guest

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-07 Thread Michael S. Tsirkin
On Fri, Mar 03, 2017 at 01:40:28PM +0800, Wei Wang wrote: > From: Liang Li > > The implementation of the current virtio-balloon is not very > efficient, because the pages are transferred to the host one by one. > Here is the breakdown of the time in percentage spent on each

Re: [PATCH v7 kernel 3/5] virtio-balloon: implementation of VIRTIO_BALLOON_F_CHUNK_TRANSFER

2017-03-07 Thread Michael S. Tsirkin
On Fri, Mar 03, 2017 at 01:40:28PM +0800, Wei Wang wrote: > From: Liang Li > > The implementation of the current virtio-balloon is not very > efficient, because the pages are transferred to the host one by one. > Here is the breakdown of the time in percentage spent on each > step of the balloon