Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement

2017-12-21 Thread Tetsuo Handa
Wei Wang wrote: > Thanks for the effort. That's actually caused by the previous "!node" > path, which incorrectly changed "index = (index | RADIX_TREE_MAP_MASK) + > 1". With the change below, it will run pretty well with the test cases. > > if (!node && !bitmap) > return size; > > Would yo

Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement

2017-12-21 Thread Matthew Wilcox
On Thu, Dec 21, 2017 at 10:49:44AM +0800, Wei Wang wrote: > On 12/21/2017 01:10 AM, Matthew Wilcox wrote: > One more question is about the return value, why would it be ambiguous? I > think it is the same as find_next_bit() which returns the found bit or size > if not found. Because find_next_bit

Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement

2017-12-20 Thread Wei Wang
On 12/21/2017 01:10 AM, Matthew Wilcox wrote: On Wed, Dec 20, 2017 at 04:13:16PM +, Wang, Wei W wrote: On Wednesday, December 20, 2017 8:26 PM, Matthew Wilcox wrote: unsigned long bit; xb_preload(GFP_KERNEL); xb_set_bit(xb, 700); xb_preload_end(); bit

Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement

2017-12-20 Thread Matthew Wilcox
On Wed, Dec 20, 2017 at 04:13:16PM +, Wang, Wei W wrote: > On Wednesday, December 20, 2017 8:26 PM, Matthew Wilcox wrote: > > unsigned long bit; > > xb_preload(GFP_KERNEL); > > xb_set_bit(xb, 700); > > xb_preload_end(); > > bit = xb_find_set(xb, ULONG_MAX, 0); > > assert

Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement

2017-12-20 Thread Wang, Wei W
On Wednesday, December 20, 2017 8:26 PM, Matthew Wilcox wrote: > On Wed, Dec 20, 2017 at 06:34:36PM +0800, Wei Wang wrote: > > On 12/19/2017 10:05 PM, Tetsuo Handa wrote: > > > I think xb_find_set() has a bug in !node path. > > > > I think we can probably remove the "!node" path for now. It would b

Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement

2017-12-20 Thread Matthew Wilcox
On Wed, Dec 20, 2017 at 06:34:36PM +0800, Wei Wang wrote: > On 12/19/2017 10:05 PM, Tetsuo Handa wrote: > > I think xb_find_set() has a bug in !node path. > > I think we can probably remove the "!node" path for now. It would be good to > get the fundamental part in first, and leave optimization to

Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement

2017-12-20 Thread Wei Wang
On 12/19/2017 10:05 PM, Tetsuo Handa wrote: Wei Wang wrote: ChangeLog: v19->v20: 1) patch 1: xbitmap - add __rcu to "void **slot"; - remove the exceptional path. 2) patch 3: xbitmap - DeveloperNotes: add an item to comment that the current bit range related APIs

Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement

2017-12-19 Thread Tetsuo Handa
Matthew Wilcox wrote: > > I think xb_find_set() has a bug in !node path. > > Don't think. Write a test-case. Please. If it shows a bug, then great, +unsigned long xb_find_set(struct xb *xb, unsigned long size, + unsigned long offset) +{ + struct radix_tree_root *r

Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement

2017-12-19 Thread Michael S. Tsirkin
On Tue, Dec 19, 2017 at 11:05:11PM +0900, Tetsuo Handa wrote: > Wei Wang wrote: > > ChangeLog: > > v19->v20: > > 1) patch 1: xbitmap > > - add __rcu to "void **slot"; > > - remove the exceptional path. > > 2) patch 3: xbitmap > > - DeveloperNotes: add an item to comment that the current

Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement

2017-12-19 Thread Matthew Wilcox
On Tue, Dec 19, 2017 at 11:05:11PM +0900, Tetsuo Handa wrote: > Removing exceptional path made this patch easier to read. > But what I meant is > > Can you eliminate exception path and fold all xbitmap patches into one, and > post only one xbitmap patch without virtio-balloon changes? > > .

Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement

2017-12-19 Thread Tetsuo Handa
Wei Wang wrote: > ChangeLog: > v19->v20: > 1) patch 1: xbitmap > - add __rcu to "void **slot"; > - remove the exceptional path. > 2) patch 3: xbitmap > - DeveloperNotes: add an item to comment that the current bit range > related APIs operating on extremely large ranges (e

[Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement

2017-12-19 Thread Wei Wang
This patch series enhances the existing virtio-balloon with the following new features: 1) fast ballooning: transfer ballooned pages between the guest and host in chunks using sgs, instead of one array each time; and 2) free page block reporting: a new virtqueue to report guest free pages to the ho