Re: unregister_netdevice: waiting for eth0 to become free. Usage count = 1

2017-08-09 Thread Wei Wang
p them all?) Thanks a lot. Wei On Wed, Aug 9, 2017 at 6:36 PM, Wei Wang <wei...@google.com> wrote: > On Wed, Aug 9, 2017 at 6:26 PM, John Stultz <john.stu...@linaro.org> wrote: >> On Wed, Aug 9, 2017 at 5:36 PM, Wei Wang <wei...@google.com> wrote: >>> On Wed,

Re: unregister_netdevice: waiting for eth0 to become free. Usage count = 1

2017-08-09 Thread Wei Wang
p them all?) Thanks a lot. Wei On Wed, Aug 9, 2017 at 6:36 PM, Wei Wang wrote: > On Wed, Aug 9, 2017 at 6:26 PM, John Stultz wrote: >> On Wed, Aug 9, 2017 at 5:36 PM, Wei Wang wrote: >>> On Wed, Aug 9, 2017 at 4:44 PM, John Stultz wrote: >>>> On Wed, Aug 9, 2017 at

Re: unregister_netdevice: waiting for eth0 to become free. Usage count = 1

2017-08-09 Thread Wei Wang
On Wed, Aug 9, 2017 at 6:26 PM, John Stultz <john.stu...@linaro.org> wrote: > On Wed, Aug 9, 2017 at 5:36 PM, Wei Wang <wei...@google.com> wrote: >> On Wed, Aug 9, 2017 at 4:44 PM, John Stultz <john.stu...@linaro.org> wrote: >>> On Wed, Aug 9, 2017 at 4:34 PM,

Re: unregister_netdevice: waiting for eth0 to become free. Usage count = 1

2017-08-09 Thread Wei Wang
On Wed, Aug 9, 2017 at 6:26 PM, John Stultz wrote: > On Wed, Aug 9, 2017 at 5:36 PM, Wei Wang wrote: >> On Wed, Aug 9, 2017 at 4:44 PM, John Stultz wrote: >>> On Wed, Aug 9, 2017 at 4:34 PM, Cong Wang wrote: >>>> (Cc'ing Wei whose commit was blamed) >>&g

Re: unregister_netdevice: waiting for eth0 to become free. Usage count = 1

2017-08-09 Thread Wei Wang
On Wed, Aug 9, 2017 at 4:44 PM, John Stultz wrote: > On Wed, Aug 9, 2017 at 4:34 PM, Cong Wang wrote: >> (Cc'ing Wei whose commit was blamed) >> >> On Mon, Aug 7, 2017 at 2:15 PM, John Stultz wrote: >>> On Mon, Aug 7,

Re: unregister_netdevice: waiting for eth0 to become free. Usage count = 1

2017-08-09 Thread Wei Wang
On Wed, Aug 9, 2017 at 4:44 PM, John Stultz wrote: > On Wed, Aug 9, 2017 at 4:34 PM, Cong Wang wrote: >> (Cc'ing Wei whose commit was blamed) >> >> On Mon, Aug 7, 2017 at 2:15 PM, John Stultz wrote: >>> On Mon, Aug 7, 2017 at 2:05 PM, John Stultz wrote: So, with recent testing with my

Re: [virtio-dev] Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-08 Thread Wei Wang
On 08/08/2017 02:12 PM, Wei Wang wrote: On 08/03/2017 05:11 PM, Michal Hocko wrote: On Thu 03-08-17 14:38:18, Wei Wang wrote: This is just too ugly and wrong actually. Never provide struct page pointers outside of the zone->lock. What I've had in mind was to simply walk free li

Re: [virtio-dev] Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-08 Thread Wei Wang
On 08/08/2017 02:12 PM, Wei Wang wrote: On 08/03/2017 05:11 PM, Michal Hocko wrote: On Thu 03-08-17 14:38:18, Wei Wang wrote: This is just too ugly and wrong actually. Never provide struct page pointers outside of the zone->lock. What I've had in mind was to simply walk free li

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-08 Thread Wei Wang
On 08/03/2017 05:11 PM, Michal Hocko wrote: On Thu 03-08-17 14:38:18, Wei Wang wrote: This is just too ugly and wrong actually. Never provide struct page pointers outside of the zone->lock. What I've had in mind was to simply walk free lists of the suitable order and call the callback for e

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-08 Thread Wei Wang
On 08/03/2017 05:11 PM, Michal Hocko wrote: On Thu 03-08-17 14:38:18, Wei Wang wrote: This is just too ugly and wrong actually. Never provide struct page pointers outside of the zone->lock. What I've had in mind was to simply walk free lists of the suitable order and call the callback for e

Re: [PATCH RESEND] mm: don't zero ballooned pages

2017-08-07 Thread Wei Wang
On 08/07/2017 04:44 PM, David Hildenbrand wrote: On 03.08.2017 13:59, Wei Wang wrote: This patch is a revert of 'commit bb01b64cfab7 ("mm/balloon_compaction.c: enqueue zero page to balloon device")' Ballooned pages will be marked as MADV_DONTNEED by the hypervisor and shouldn'

Re: [PATCH RESEND] mm: don't zero ballooned pages

2017-08-07 Thread Wei Wang
On 08/07/2017 04:44 PM, David Hildenbrand wrote: On 03.08.2017 13:59, Wei Wang wrote: This patch is a revert of 'commit bb01b64cfab7 ("mm/balloon_compaction.c: enqueue zero page to balloon device")' Ballooned pages will be marked as MADV_DONTNEED by the hypervisor and shouldn'

Re: [PATCH v13 1/5] Introduce xbitmap

2017-08-07 Thread Wei Wang
On 08/03/2017 02:38 PM, Wei Wang wrote: From: Matthew Wilcox <mawil...@microsoft.com> The eXtensible Bitmap is a sparse bitmap representation which is efficient for set bits which tend to cluster. It supports up to 'unsigned long' worth of bits, and this commit adds the bare

Re: [PATCH v13 1/5] Introduce xbitmap

2017-08-07 Thread Wei Wang
On 08/03/2017 02:38 PM, Wei Wang wrote: From: Matthew Wilcox The eXtensible Bitmap is a sparse bitmap representation which is efficient for set bits which tend to cluster. It supports up to 'unsigned long' worth of bits, and this commit adds the bare bones -- xb_set_bit(), xb_clear_bit

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-04 Thread Wei Wang
On 08/04/2017 04:24 PM, Michal Hocko wrote: For our use case, the callback just puts the reported page block to the ring, then returns. If the ring is full as the host is busy, then I think it should skip this one, and just return. Because: A. This is an optimization feature, losing a

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-04 Thread Wei Wang
On 08/04/2017 04:24 PM, Michal Hocko wrote: For our use case, the callback just puts the reported page block to the ring, then returns. If the ring is full as the host is busy, then I think it should skip this one, and just return. Because: A. This is an optimization feature, losing a

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-04 Thread Wei Wang
On 08/04/2017 03:53 PM, Michal Hocko wrote: On Fri 04-08-17 00:02:01, Michael S. Tsirkin wrote: On Thu, Aug 03, 2017 at 03:20:09PM +, Wang, Wei W wrote: On Thursday, August 3, 2017 9:51 PM, Michal Hocko: As I've said earlier. Start simple optimize incrementally with some numbers to

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-04 Thread Wei Wang
On 08/04/2017 03:53 PM, Michal Hocko wrote: On Fri 04-08-17 00:02:01, Michael S. Tsirkin wrote: On Thu, Aug 03, 2017 at 03:20:09PM +, Wang, Wei W wrote: On Thursday, August 3, 2017 9:51 PM, Michal Hocko: As I've said earlier. Start simple optimize incrementally with some numbers to

Re: [PATCH v13 5/5] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2017-08-03 Thread Wei Wang
On 08/03/2017 09:05 PM, Pankaj Gupta wrote: On 08/03/2017 04:13 PM, Pankaj Gupta wrote: +/* Allocate space for find_vqs parameters */ +vqs = kcalloc(nvqs, sizeof(*vqs), GFP_KERNEL); +if (!vqs) +goto err_vq; +callbacks = kmalloc_array(nvqs,

Re: [PATCH v13 5/5] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2017-08-03 Thread Wei Wang
On 08/03/2017 09:05 PM, Pankaj Gupta wrote: On 08/03/2017 04:13 PM, Pankaj Gupta wrote: +/* Allocate space for find_vqs parameters */ +vqs = kcalloc(nvqs, sizeof(*vqs), GFP_KERNEL); +if (!vqs) +goto err_vq; +callbacks = kmalloc_array(nvqs,

Re: [PATCH RESEND] mm: don't zero ballooned pages

2017-08-03 Thread Wei Wang
On 08/03/2017 08:54 PM, Michal Hocko wrote: On Thu 03-08-17 19:59:17, Wei Wang wrote: This patch is a revert of 'commit bb01b64cfab7 ("mm/balloon_compaction.c: enqueue zero page to balloon device")' Ballooned pages will be marked as MADV_DONTNEED by the hypervisor and shouldn'

Re: [PATCH RESEND] mm: don't zero ballooned pages

2017-08-03 Thread Wei Wang
On 08/03/2017 08:54 PM, Michal Hocko wrote: On Thu 03-08-17 19:59:17, Wei Wang wrote: This patch is a revert of 'commit bb01b64cfab7 ("mm/balloon_compaction.c: enqueue zero page to balloon device")' Ballooned pages will be marked as MADV_DONTNEED by the hypervisor and shouldn'

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wei Wang
On 08/03/2017 08:41 PM, Michal Hocko wrote: On Thu 03-08-17 20:11:58, Wei Wang wrote: On 08/03/2017 07:28 PM, Michal Hocko wrote: On Thu 03-08-17 19:27:19, Wei Wang wrote: On 08/03/2017 06:44 PM, Michal Hocko wrote: On Thu 03-08-17 18:42:15, Wei Wang wrote: On 08/03/2017 05:11 PM, Michal

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wei Wang
On 08/03/2017 08:41 PM, Michal Hocko wrote: On Thu 03-08-17 20:11:58, Wei Wang wrote: On 08/03/2017 07:28 PM, Michal Hocko wrote: On Thu 03-08-17 19:27:19, Wei Wang wrote: On 08/03/2017 06:44 PM, Michal Hocko wrote: On Thu 03-08-17 18:42:15, Wei Wang wrote: On 08/03/2017 05:11 PM, Michal

Re: [PATCH v13 5/5] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2017-08-03 Thread Wei Wang
On 08/03/2017 04:13 PM, Pankaj Gupta wrote: +/* Allocate space for find_vqs parameters */ +vqs = kcalloc(nvqs, sizeof(*vqs), GFP_KERNEL); +if (!vqs) +goto err_vq; +callbacks = kmalloc_array(nvqs, sizeof(*callbacks), GFP_KERNEL); +if

Re: [PATCH v13 5/5] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2017-08-03 Thread Wei Wang
On 08/03/2017 04:13 PM, Pankaj Gupta wrote: +/* Allocate space for find_vqs parameters */ +vqs = kcalloc(nvqs, sizeof(*vqs), GFP_KERNEL); +if (!vqs) +goto err_vq; +callbacks = kmalloc_array(nvqs, sizeof(*callbacks), GFP_KERNEL); +if

[PATCH RESEND] mm: don't zero ballooned pages

2017-08-03 Thread Wei Wang
ch is very time consuming when the page amount is large. The ongoing fast balloon tests show that the time to balloon 7G pages is increased from ~491ms to 2.8 seconds with __GFP_ZERO added. So, this patch removes the flag. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Cc: Michal Hocko <mh

[PATCH RESEND] mm: don't zero ballooned pages

2017-08-03 Thread Wei Wang
ch is very time consuming when the page amount is large. The ongoing fast balloon tests show that the time to balloon 7G pages is increased from ~491ms to 2.8 seconds with __GFP_ZERO added. So, this patch removes the flag. Signed-off-by: Wei Wang Cc: Michal Hocko Cc: Michael S. Tsirki

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wei Wang
On 08/03/2017 07:28 PM, Michal Hocko wrote: On Thu 03-08-17 19:27:19, Wei Wang wrote: On 08/03/2017 06:44 PM, Michal Hocko wrote: On Thu 03-08-17 18:42:15, Wei Wang wrote: On 08/03/2017 05:11 PM, Michal Hocko wrote: On Thu 03-08-17 14:38:18, Wei Wang wrote: [...] +static int

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wei Wang
On 08/03/2017 07:28 PM, Michal Hocko wrote: On Thu 03-08-17 19:27:19, Wei Wang wrote: On 08/03/2017 06:44 PM, Michal Hocko wrote: On Thu 03-08-17 18:42:15, Wei Wang wrote: On 08/03/2017 05:11 PM, Michal Hocko wrote: On Thu 03-08-17 14:38:18, Wei Wang wrote: [...] +static int

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wei Wang
On 08/03/2017 06:44 PM, Michal Hocko wrote: On Thu 03-08-17 18:42:15, Wei Wang wrote: On 08/03/2017 05:11 PM, Michal Hocko wrote: On Thu 03-08-17 14:38:18, Wei Wang wrote: [...] +static int report_free_page_block(struct zone *zone, unsigned int order

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wei Wang
On 08/03/2017 06:44 PM, Michal Hocko wrote: On Thu 03-08-17 18:42:15, Wei Wang wrote: On 08/03/2017 05:11 PM, Michal Hocko wrote: On Thu 03-08-17 14:38:18, Wei Wang wrote: [...] +static int report_free_page_block(struct zone *zone, unsigned int order

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wei Wang
On 08/03/2017 05:11 PM, Michal Hocko wrote: On Thu 03-08-17 14:38:18, Wei Wang wrote: This patch adds support to walk through the free page blocks in the system and report them via a callback function. Some page blocks may leave the free list after the report function returns, so

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wei Wang
On 08/03/2017 05:11 PM, Michal Hocko wrote: On Thu 03-08-17 14:38:18, Wei Wang wrote: This patch adds support to walk through the free page blocks in the system and report them via a callback function. Some page blocks may leave the free list after the report function returns, so

[PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wei Wang
-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michal Hocko <mho...@kernel.org> Cc: Michael S. Tsirkin <m...@redhat.com> --- include/linux/mm.h | 7 include/linux/mmzone.h | 5 +++ mm/p

[PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wei Wang
-by: Wei Wang Signed-off-by: Liang Li Cc: Michal Hocko Cc: Michael S. Tsirkin --- include/linux/mm.h | 7 include/linux/mmzone.h | 5 +++ mm/page_alloc.c| 109 + 3 files changed, 121 insertions(+) diff --git a/include/linux/mm.h b

[PATCH v13 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-08-03 Thread Wei Wang
() in chunks rather than page by page. With this new feature, the above ballooning process takes ~541ms resulting in an improvement of ~87%. TODO: optimize stage 1) by allocating/freeing a chunk of pages instead of a single page each time. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Sign

[PATCH v13 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-08-03 Thread Wei Wang
() in chunks rather than page by page. With this new feature, the above ballooning process takes ~541ms resulting in an improvement of ~87%. TODO: optimize stage 1) by allocating/freeing a chunk of pages instead of a single page each time. Signed-off-by: Wei Wang Signed-off-by: Liang Li Suggested

[PATCH v13 0/5] Virtio-balloon Enhancement

2017-08-03 Thread Wei Wang
e-write the virtio-balloon implementation patch. 3) commit changes 4) patch re-org Matthew Wilcox (1): Introduce xbitmap Wei Wang (4): xbitmap: add xb_find_next_bit() and xb_zero() virtio-balloon: VIRTIO_BALLOON_F_SG mm: support reporting free page blocks virtio-balloon: VIRTIO_BALLOON_F_FREE

[PATCH v13 0/5] Virtio-balloon Enhancement

2017-08-03 Thread Wei Wang
e-write the virtio-balloon implementation patch. 3) commit changes 4) patch re-org Matthew Wilcox (1): Introduce xbitmap Wei Wang (4): xbitmap: add xb_find_next_bit() and xb_zero() virtio-balloon: VIRTIO_BALLOON_F_SG mm: support reporting free page blocks virtio-balloon: VIRTIO_BALLOON_F_FREE

[PATCH v13 5/5] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2017-08-03 Thread Wei Wang
Add a new vq to report hints of guest free pages to the host. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> --- drivers/virtio/virtio_balloon.c | 164 ++-- include/uapi/linux/virtio_balloon.h |

[PATCH v13 5/5] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2017-08-03 Thread Wei Wang
Add a new vq to report hints of guest free pages to the host. Signed-off-by: Wei Wang Signed-off-by: Liang Li --- drivers/virtio/virtio_balloon.c | 164 ++-- include/uapi/linux/virtio_balloon.h | 1 + 2 files changed, 140 insertions(+), 25 deletions

[PATCH v13 1/5] Introduce xbitmap

2017-08-03 Thread Wei Wang
st_bit(). Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> Signed-off-by: Wei Wang <wei.w.w...@intel.com> --- include/linux/radix-tree.h | 2 + include/linux/xbitmap.h| 49 lib/radix-tree.c | 139 - 3

[PATCH v13 1/5] Introduce xbitmap

2017-08-03 Thread Wei Wang
Wilcox Signed-off-by: Wei Wang --- include/linux/radix-tree.h | 2 + include/linux/xbitmap.h| 49 lib/radix-tree.c | 139 - 3 files changed, 188 insertions(+), 2 deletions(-) create mode 100644 include/linux/xbitmap.h

[PATCH v13 2/5] xbitmap: add xb_find_next_bit() and xb_zero()

2017-08-03 Thread Wei Wang
xb_find_next_bit() supports to find the next "1" or "0" bit in the given range. xb_zero() supports to zero the given range of bits. Signed-off-by: Wei Wang <wei.w.w...@intel.com> --- include/linux/xbitmap.h | 4 lib/radix-tree.c| 28 +++

[PATCH v13 2/5] xbitmap: add xb_find_next_bit() and xb_zero()

2017-08-03 Thread Wei Wang
xb_find_next_bit() supports to find the next "1" or "0" bit in the given range. xb_zero() supports to zero the given range of bits. Signed-off-by: Wei Wang --- include/linux/xbitmap.h | 4 lib/radix-tree.c| 28 2 files changed, 32

Re: [PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-07-31 Thread Wei Wang
On 07/31/2017 12:20 AM, Michael S. Tsirkin wrote: On Sun, Jul 30, 2017 at 07:18:33PM +0300, Michael S. Tsirkin wrote: On Sun, Jul 30, 2017 at 05:59:17AM +, Wang, Wei W wrote: That's a hypervisor implementation detail. From guest point of view, discarding contents can not be distinguished

Re: [PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-07-31 Thread Wei Wang
On 07/31/2017 12:20 AM, Michael S. Tsirkin wrote: On Sun, Jul 30, 2017 at 07:18:33PM +0300, Michael S. Tsirkin wrote: On Sun, Jul 30, 2017 at 05:59:17AM +, Wang, Wei W wrote: That's a hypervisor implementation detail. From guest point of view, discarding contents can not be distinguished

Re: [PATCH] mm: don't zero ballooned pages

2017-07-31 Thread Wei Wang
On 07/31/2017 03:43 PM, Michal Hocko wrote: On Mon 31-07-17 15:41:49, Wei Wang wrote: On 07/31/2017 02:55 PM, Michal Hocko wrote: On Mon 31-07-17 12:13:33, Wei Wang wrote: Ballooned pages will be marked as MADV_DONTNEED by the hypervisor and shouldn't be given to the host ksmd to scan. Could

Re: [PATCH] mm: don't zero ballooned pages

2017-07-31 Thread Wei Wang
On 07/31/2017 03:43 PM, Michal Hocko wrote: On Mon 31-07-17 15:41:49, Wei Wang wrote: On 07/31/2017 02:55 PM, Michal Hocko wrote: On Mon 31-07-17 12:13:33, Wei Wang wrote: Ballooned pages will be marked as MADV_DONTNEED by the hypervisor and shouldn't be given to the host ksmd to scan. Could

Re: [PATCH] mm: don't zero ballooned pages

2017-07-31 Thread Wei Wang
On 07/31/2017 02:55 PM, Michal Hocko wrote: On Mon 31-07-17 12:13:33, Wei Wang wrote: Ballooned pages will be marked as MADV_DONTNEED by the hypervisor and shouldn't be given to the host ksmd to scan. Could you point me where this MADV_DONTNEED is done, please? Sure. It's done

Re: [PATCH] mm: don't zero ballooned pages

2017-07-31 Thread Wei Wang
On 07/31/2017 02:55 PM, Michal Hocko wrote: On Mon 31-07-17 12:13:33, Wei Wang wrote: Ballooned pages will be marked as MADV_DONTNEED by the hypervisor and shouldn't be given to the host ksmd to scan. Could you point me where this MADV_DONTNEED is done, please? Sure. It's done

[PATCH] mm: don't zero ballooned pages

2017-07-30 Thread Wei Wang
pages is increased from ~491ms to 2.8 seconds with __GFP_ZERO added. So, this patch removes the flag. Signed-off-by: Wei Wang <wei.w.w...@intel.com> --- mm/balloon_compaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/balloon_compaction.c b/mm/balloon_compaction.c

[PATCH] mm: don't zero ballooned pages

2017-07-30 Thread Wei Wang
pages is increased from ~491ms to 2.8 seconds with __GFP_ZERO added. So, this patch removes the flag. Signed-off-by: Wei Wang --- mm/balloon_compaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/balloon_compaction.c b/mm/balloon_compaction.c index 9075aa5..b06d9fe

Re: [PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-07-29 Thread Wei Wang
On 07/29/2017 07:08 AM, Michael S. Tsirkin wrote: On Thu, Jul 27, 2017 at 10:50:11AM +0800, Wei Wang wrote: OK I thought this over. While we might need these new APIs in the future, I think that at the moment, there's a way to implement this feature that is significantly simpler. Just add each

Re: [PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-07-29 Thread Wei Wang
On 07/29/2017 07:08 AM, Michael S. Tsirkin wrote: On Thu, Jul 27, 2017 at 10:50:11AM +0800, Wei Wang wrote: OK I thought this over. While we might need these new APIs in the future, I think that at the moment, there's a way to implement this feature that is significantly simpler. Just add each

Re: [PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-07-28 Thread Wei Wang
On 07/12/2017 08:40 PM, Wei Wang wrote: Add a new feature, VIRTIO_BALLOON_F_SG, which enables to transfer a chunk of ballooned (i.e. inflated/deflated) pages using scatter-gather lists to the host. The implementation of the previous virtio-balloon is not very efficient, because the balloon

Re: [PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-07-28 Thread Wei Wang
On 07/12/2017 08:40 PM, Wei Wang wrote: Add a new feature, VIRTIO_BALLOON_F_SG, which enables to transfer a chunk of ballooned (i.e. inflated/deflated) pages using scatter-gather lists to the host. The implementation of the previous virtio-balloon is not very efficient, because the balloon

Re: [PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-07-26 Thread Wei Wang
On 07/27/2017 01:02 AM, Michael S. Tsirkin wrote: On Wed, Jul 26, 2017 at 11:48:41AM +0800, Wei Wang wrote: On 07/23/2017 09:45 AM, Michael S. Tsirkin wrote: On Fri, Jul 14, 2017 at 03:12:43PM +0800, Wei Wang wrote: On 07/14/2017 04:19 AM, Michael S. Tsirkin wrote: On Thu, Jul 13, 2017 at 03

Re: [PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-07-26 Thread Wei Wang
On 07/27/2017 01:02 AM, Michael S. Tsirkin wrote: On Wed, Jul 26, 2017 at 11:48:41AM +0800, Wei Wang wrote: On 07/23/2017 09:45 AM, Michael S. Tsirkin wrote: On Fri, Jul 14, 2017 at 03:12:43PM +0800, Wei Wang wrote: On 07/14/2017 04:19 AM, Michael S. Tsirkin wrote: On Thu, Jul 13, 2017 at 03

Re: [PATCH v12 6/8] mm: support reporting free page blocks

2017-07-26 Thread Wei Wang
On 07/26/2017 06:24 PM, Michal Hocko wrote: On Wed 26-07-17 10:22:23, Wei Wang wrote: On 07/25/2017 10:53 PM, Michal Hocko wrote: On Tue 25-07-17 14:47:16, Wang, Wei W wrote: On Tuesday, July 25, 2017 8:42 PM, hal Hocko wrote: On Tue 25-07-17 19:56:24, Wei Wang wrote: On 07/25/2017 07:25 PM

Re: [PATCH v12 6/8] mm: support reporting free page blocks

2017-07-26 Thread Wei Wang
On 07/26/2017 06:24 PM, Michal Hocko wrote: On Wed 26-07-17 10:22:23, Wei Wang wrote: On 07/25/2017 10:53 PM, Michal Hocko wrote: On Tue 25-07-17 14:47:16, Wang, Wei W wrote: On Tuesday, July 25, 2017 8:42 PM, hal Hocko wrote: On Tue 25-07-17 19:56:24, Wei Wang wrote: On 07/25/2017 07:25 PM

Re: [PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-07-25 Thread Wei Wang
On 07/23/2017 09:45 AM, Michael S. Tsirkin wrote: On Fri, Jul 14, 2017 at 03:12:43PM +0800, Wei Wang wrote: On 07/14/2017 04:19 AM, Michael S. Tsirkin wrote: On Thu, Jul 13, 2017 at 03:42:35PM +0800, Wei Wang wrote: On 07/12/2017 09:56 PM, Michael S. Tsirkin wrote: So the way I see

Re: [PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-07-25 Thread Wei Wang
On 07/23/2017 09:45 AM, Michael S. Tsirkin wrote: On Fri, Jul 14, 2017 at 03:12:43PM +0800, Wei Wang wrote: On 07/14/2017 04:19 AM, Michael S. Tsirkin wrote: On Thu, Jul 13, 2017 at 03:42:35PM +0800, Wei Wang wrote: On 07/12/2017 09:56 PM, Michael S. Tsirkin wrote: So the way I see

Re: [PATCH v12 6/8] mm: support reporting free page blocks

2017-07-25 Thread Wei Wang
On 07/25/2017 10:53 PM, Michal Hocko wrote: On Tue 25-07-17 14:47:16, Wang, Wei W wrote: On Tuesday, July 25, 2017 8:42 PM, hal Hocko wrote: On Tue 25-07-17 19:56:24, Wei Wang wrote: On 07/25/2017 07:25 PM, Michal Hocko wrote: On Tue 25-07-17 17:32:00, Wei Wang wrote: On 07/24/2017 05:00 PM

Re: [PATCH v12 6/8] mm: support reporting free page blocks

2017-07-25 Thread Wei Wang
On 07/25/2017 10:53 PM, Michal Hocko wrote: On Tue 25-07-17 14:47:16, Wang, Wei W wrote: On Tuesday, July 25, 2017 8:42 PM, hal Hocko wrote: On Tue 25-07-17 19:56:24, Wei Wang wrote: On 07/25/2017 07:25 PM, Michal Hocko wrote: On Tue 25-07-17 17:32:00, Wei Wang wrote: On 07/24/2017 05:00 PM

Re: [PATCH v12 6/8] mm: support reporting free page blocks

2017-07-25 Thread Wei Wang
On 07/25/2017 07:25 PM, Michal Hocko wrote: On Tue 25-07-17 17:32:00, Wei Wang wrote: On 07/24/2017 05:00 PM, Michal Hocko wrote: On Wed 19-07-17 20:01:18, Wei Wang wrote: On 07/19/2017 04:13 PM, Michal Hocko wrote: [... All you should need is the check for the page reference count, no? I

Re: [PATCH v12 6/8] mm: support reporting free page blocks

2017-07-25 Thread Wei Wang
On 07/25/2017 07:25 PM, Michal Hocko wrote: On Tue 25-07-17 17:32:00, Wei Wang wrote: On 07/24/2017 05:00 PM, Michal Hocko wrote: On Wed 19-07-17 20:01:18, Wei Wang wrote: On 07/19/2017 04:13 PM, Michal Hocko wrote: [... All you should need is the check for the page reference count, no? I

Re: [PATCH v12 6/8] mm: support reporting free page blocks

2017-07-25 Thread Wei Wang
On 07/24/2017 05:00 PM, Michal Hocko wrote: On Wed 19-07-17 20:01:18, Wei Wang wrote: On 07/19/2017 04:13 PM, Michal Hocko wrote: [... All you should need is the check for the page reference count, no? I assume you do some sort of pfn walk and so you should be able to get an access

Re: [PATCH v12 6/8] mm: support reporting free page blocks

2017-07-25 Thread Wei Wang
On 07/24/2017 05:00 PM, Michal Hocko wrote: On Wed 19-07-17 20:01:18, Wei Wang wrote: On 07/19/2017 04:13 PM, Michal Hocko wrote: [... All you should need is the check for the page reference count, no? I assume you do some sort of pfn walk and so you should be able to get an access

Re: [PATCH v12 6/8] mm: support reporting free page blocks

2017-07-19 Thread Wei Wang
On 07/19/2017 04:13 PM, Michal Hocko wrote: On Tue 18-07-17 10:12:14, Wei Wang wrote: [...] Probably I should have included the introduction of the usages in the log. Hope it is not too later to explain here: Yes this should have been described in the cover. OK, I will do it in the next

Re: [PATCH v12 6/8] mm: support reporting free page blocks

2017-07-19 Thread Wei Wang
On 07/19/2017 04:13 PM, Michal Hocko wrote: On Tue 18-07-17 10:12:14, Wei Wang wrote: [...] Probably I should have included the introduction of the usages in the log. Hope it is not too later to explain here: Yes this should have been described in the cover. OK, I will do it in the next

Re: [PATCH v12 6/8] mm: support reporting free page blocks

2017-07-17 Thread Wei Wang
On 07/17/2017 11:24 PM, Michal Hocko wrote: On Fri 14-07-17 22:17:13, Michael S. Tsirkin wrote: On Fri, Jul 14, 2017 at 02:30:23PM +0200, Michal Hocko wrote: On Wed 12-07-17 20:40:19, Wei Wang wrote: This patch adds support for reporting blocks of pages on the free list specified

Re: [PATCH v12 6/8] mm: support reporting free page blocks

2017-07-17 Thread Wei Wang
On 07/17/2017 11:24 PM, Michal Hocko wrote: On Fri 14-07-17 22:17:13, Michael S. Tsirkin wrote: On Fri, Jul 14, 2017 at 02:30:23PM +0200, Michal Hocko wrote: On Wed 12-07-17 20:40:19, Wei Wang wrote: This patch adds support for reporting blocks of pages on the free list specified

Re: [PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-07-14 Thread Wei Wang
On 07/14/2017 04:19 AM, Michael S. Tsirkin wrote: On Thu, Jul 13, 2017 at 03:42:35PM +0800, Wei Wang wrote: On 07/12/2017 09:56 PM, Michael S. Tsirkin wrote: So the way I see it, there are several issues: - internal wait - forces multiple APIs like kick/kick_sync note how kick_sync can

Re: [PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-07-14 Thread Wei Wang
On 07/14/2017 04:19 AM, Michael S. Tsirkin wrote: On Thu, Jul 13, 2017 at 03:42:35PM +0800, Wei Wang wrote: On 07/12/2017 09:56 PM, Michael S. Tsirkin wrote: So the way I see it, there are several issues: - internal wait - forces multiple APIs like kick/kick_sync note how kick_sync can

Re: [PATCH v12 8/8] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ

2017-07-13 Thread Wei Wang
On 07/13/2017 08:22 AM, Michael S. Tsirkin wrote: On Wed, Jul 12, 2017 at 08:40:21PM +0800, Wei Wang wrote: Add a new vq, cmdq, to handle requests between the device and driver. This patch implements two commands sent from the device and handled in the driver. 1

Re: [PATCH v12 8/8] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ

2017-07-13 Thread Wei Wang
On 07/13/2017 08:22 AM, Michael S. Tsirkin wrote: On Wed, Jul 12, 2017 at 08:40:21PM +0800, Wei Wang wrote: Add a new vq, cmdq, to handle requests between the device and driver. This patch implements two commands sent from the device and handled in the driver. 1

Re: [virtio-dev] Re: [PATCH v12 7/8] mm: export symbol of next_zone and first_online_pgdat

2017-07-13 Thread Wei Wang
On 07/13/2017 08:16 AM, Michael S. Tsirkin wrote: On Wed, Jul 12, 2017 at 08:40:20PM +0800, Wei Wang wrote: This patch enables for_each_zone()/for_each_populated_zone() to be invoked by a kernel module. ... for use by virtio balloon. With this patch, other kernel modules can also use

Re: [virtio-dev] Re: [PATCH v12 7/8] mm: export symbol of next_zone and first_online_pgdat

2017-07-13 Thread Wei Wang
On 07/13/2017 08:16 AM, Michael S. Tsirkin wrote: On Wed, Jul 12, 2017 at 08:40:20PM +0800, Wei Wang wrote: This patch enables for_each_zone()/for_each_populated_zone() to be invoked by a kernel module. ... for use by virtio balloon. With this patch, other kernel modules can also use

Re: [PATCH v12 6/8] mm: support reporting free page blocks

2017-07-13 Thread Wei Wang
On 07/13/2017 08:33 AM, Michael S. Tsirkin wrote: On Wed, Jul 12, 2017 at 08:40:19PM +0800, Wei Wang wrote: This patch adds support for reporting blocks of pages on the free list specified by the caller. As pages can leave the free list during this call or immediately afterwards

Re: [PATCH v12 6/8] mm: support reporting free page blocks

2017-07-13 Thread Wei Wang
On 07/13/2017 08:33 AM, Michael S. Tsirkin wrote: On Wed, Jul 12, 2017 at 08:40:19PM +0800, Wei Wang wrote: This patch adds support for reporting blocks of pages on the free list specified by the caller. As pages can leave the free list during this call or immediately afterwards

Re: [PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-07-13 Thread Wei Wang
On 07/12/2017 09:56 PM, Michael S. Tsirkin wrote: So the way I see it, there are several issues: - internal wait - forces multiple APIs like kick/kick_sync note how kick_sync can fail but your code never checks return code - need to re-write the last descriptor - might not work for

Re: [PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-07-13 Thread Wei Wang
On 07/12/2017 09:56 PM, Michael S. Tsirkin wrote: So the way I see it, there are several issues: - internal wait - forces multiple APIs like kick/kick_sync note how kick_sync can fail but your code never checks return code - need to re-write the last descriptor - might not work for

Re: [PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-07-12 Thread Wei Wang
On 07/12/2017 09:06 PM, Michael S. Tsirkin wrote: On Wed, Jul 12, 2017 at 08:40:18PM +0800, Wei Wang wrote: diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 28b0e96..9f27101 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -57,8 +57,28 @@ int

Re: [PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-07-12 Thread Wei Wang
On 07/12/2017 09:06 PM, Michael S. Tsirkin wrote: On Wed, Jul 12, 2017 at 08:40:18PM +0800, Wei Wang wrote: diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 28b0e96..9f27101 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -57,8 +57,28 @@ int

Re: [virtio-dev] Re: [PATCH v11 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS

2017-07-12 Thread Wei Wang
Hi Matthew, On 06/28/2017 11:04 PM, Matthew Wilcox wrote: On Thu, Jun 15, 2017 at 04:10:17PM +0800, Wei Wang wrote: So you still have a home-grown bitmap. I'd like to know why isn't xbitmap suggested for this purpose by Matthew Wilcox appropriate. Please add a comment explaining

Re: [virtio-dev] Re: [PATCH v11 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS

2017-07-12 Thread Wei Wang
Hi Matthew, On 06/28/2017 11:04 PM, Matthew Wilcox wrote: On Thu, Jun 15, 2017 at 04:10:17PM +0800, Wei Wang wrote: So you still have a home-grown bitmap. I'd like to know why isn't xbitmap suggested for this purpose by Matthew Wilcox appropriate. Please add a comment explaining

Re: [virtio-dev] Re: [PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ

2017-07-12 Thread Wei Wang
On 06/28/2017 11:01 PM, Michael S. Tsirkin wrote: On Thu, Jun 22, 2017 at 04:40:39PM +0800, Wei Wang wrote: On 06/21/2017 08:28 PM, Michael S. Tsirkin wrote: On Wed, Jun 21, 2017 at 11:28:00AM +0800, Wei Wang wrote: On 06/21/2017 12:18 AM, Michael S. Tsirkin wrote: On Fri, Jun 09, 2017 at 06

Re: [virtio-dev] Re: [PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ

2017-07-12 Thread Wei Wang
On 06/28/2017 11:01 PM, Michael S. Tsirkin wrote: On Thu, Jun 22, 2017 at 04:40:39PM +0800, Wei Wang wrote: On 06/21/2017 08:28 PM, Michael S. Tsirkin wrote: On Wed, Jun 21, 2017 at 11:28:00AM +0800, Wei Wang wrote: On 06/21/2017 12:18 AM, Michael S. Tsirkin wrote: On Fri, Jun 09, 2017 at 06

[PATCH v12 3/8] Introduce xbitmap

2017-07-12 Thread Wei Wang
st_bit(). Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> Signed-off-by: Wei Wang <wei.w.w...@intel.com> --- include/linux/radix-tree.h | 2 + include/linux/xbitmap.h| 49 lib/radix-tree.c | 138 - 3

[PATCH v12 6/8] mm: support reporting free page blocks

2017-07-12 Thread Wei Wang
the function was invoked. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> --- include/linux/mm.h | 5 +++ mm/page_alloc.c| 96 ++ 2 files changed, 101 insertions(+) diff --git a/include/

[PATCH v12 6/8] mm: support reporting free page blocks

2017-07-12 Thread Wei Wang
the function was invoked. Signed-off-by: Wei Wang Signed-off-by: Liang Li --- include/linux/mm.h | 5 +++ mm/page_alloc.c| 96 ++ 2 files changed, 101 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 46b9ac5..76cb433

[PATCH v12 3/8] Introduce xbitmap

2017-07-12 Thread Wei Wang
Wilcox Signed-off-by: Wei Wang --- include/linux/radix-tree.h | 2 + include/linux/xbitmap.h| 49 lib/radix-tree.c | 138 - 3 files changed, 187 insertions(+), 2 deletions(-) create mode 100644 include/linux/xbitmap.h

[PATCH v12 7/8] mm: export symbol of next_zone and first_online_pgdat

2017-07-12 Thread Wei Wang
This patch enables for_each_zone()/for_each_populated_zone() to be invoked by a kernel module. Signed-off-by: Wei Wang <wei.w.w...@intel.com> --- mm/mmzone.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/mmzone.c b/mm/mmzone.c index a51c0a6..08a2a3a 100644 --- a/mm/mmzone.c ++

[PATCH v12 8/8] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ

2017-07-12 Thread Wei Wang
() and END_USE() to lock on each vq operation. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> --- drivers/virtio/virtio_balloon.c | 245 ++-- drivers/virtio/virtio_ring.c| 25 +++- include/li

[PATCH v12 7/8] mm: export symbol of next_zone and first_online_pgdat

2017-07-12 Thread Wei Wang
This patch enables for_each_zone()/for_each_populated_zone() to be invoked by a kernel module. Signed-off-by: Wei Wang --- mm/mmzone.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/mmzone.c b/mm/mmzone.c index a51c0a6..08a2a3a 100644 --- a/mm/mmzone.c +++ b/mm/mmzone.c @@ -13,6 +13,7

[PATCH v12 8/8] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ

2017-07-12 Thread Wei Wang
() and END_USE() to lock on each vq operation. Signed-off-by: Wei Wang Signed-off-by: Liang Li --- drivers/virtio/virtio_balloon.c | 245 ++-- drivers/virtio/virtio_ring.c| 25 +++- include/linux/virtio.h | 2 + include/uapi/linux/virtio_balloon.h

[PATCH v12 2/8] virtio-balloon: coding format cleanup

2017-07-12 Thread Wei Wang
Clean up the comment format. Signed-off-by: Wei Wang <wei.w.w...@intel.com> --- drivers/virtio/virtio_balloon.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 7f38ae6..f0b3a0b 100644 --- a/d

[PATCH v12 4/8] xbitmap: add xb_find_next_bit() and xb_zero()

2017-07-12 Thread Wei Wang
xb_find_next_bit() is added to support find the next "1" or "0" bit in the given range. xb_zero() is added to support zero the given range of bits. Signed-off-by: Wei Wang <wei.w.w...@intel.com> --- include/linux/xbitmap.h | 4 lib/radix-tree.c| 26 +++

<    4   5   6   7   8   9   10   11   >