[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement
From: |
Wang, Wei W |
Subject: |
Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement |
Date: |
Wed, 20 Dec 2017 16:13:16 +0000 |
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 be
> > good to get the fundamental part in first, and leave optimization to
> > come as separate patches with corresponding test cases in the future.
>
> You can't remove the !node path. You'll see !node when the highest set bit
> is less than 1024. So do something like this:
>
> unsigned long bit;
> xb_preload(GFP_KERNEL);
> xb_set_bit(xb, 700);
> xb_preload_end();
> bit = xb_find_set(xb, ULONG_MAX, 0);
> assert(bit == 700);
This above test will result in "!node with bitmap !=NULL", and it goes to the
regular "if (bitmap)" path, which finds 700.
A better test would be
...
xb_set_bit(xb, 700);
assert(xb_find_set(xb, ULONG_MAX, 800) == ULONG_MAX);
...
The first try with the "if (bitmap)" path doesn't find a set bit, and the
remaining tries will always result in "!node && !bitmap", which implies no set
bit anymore and no need to try in this case.
So, I think we can change it to
If (!node && !bitmap)
return size;
Best,
Wei
- [Qemu-devel] [PATCH v20 5/7] mm: support reporting free page blocks, (continued)
- [Qemu-devel] [PATCH v20 5/7] mm: support reporting free page blocks, Wei Wang, 2017/12/19
- [Qemu-devel] [PATCH v20 4/7] virtio-balloon: VIRTIO_BALLOON_F_SG, Wei Wang, 2017/12/19
- [Qemu-devel] [PATCH v20 7/7] virtio-balloon: don't report free pages when page poisoning is enabled, Wei Wang, 2017/12/19
- [Qemu-devel] [PATCH v20 6/7] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ, Wei Wang, 2017/12/19
- Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement, Tetsuo Handa, 2017/12/19
- Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement, Matthew Wilcox, 2017/12/19
- Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement, Michael S. Tsirkin, 2017/12/19
- Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement, Wei Wang, 2017/12/20
- Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement, Matthew Wilcox, 2017/12/20
- Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement,
Wang, Wei W <=
- Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement, Matthew Wilcox, 2017/12/20
- Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement, Wei Wang, 2017/12/20
- Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement, Matthew Wilcox, 2017/12/21
- Re: [Qemu-devel] [PATCH v20 0/7] Virtio-balloon Enhancement, Tetsuo Handa, 2017/12/21