search for: xb_find_zero

Displaying 15 results from an estimated 15 matches for "xb_find_zero".

2017 Dec 21
7
[PATCH v20 3/7 RESEND] xbitmap: add more operations
...xb_test_bit(const struct xb *xb, unsigned long bit); void xb_clear_bit(struct xb *xb, unsigned long bit); +void xb_clear_bit_range(struct xb *xb, unsigned long start, + unsigned long nbits); +unsigned long xb_find_set(struct xb *xb, unsigned long size, + unsigned long offset); +unsigned long xb_find_zero(struct xb *xb, unsigned long size, + unsigned long offset); static inline bool xb_empty(const struct xb *xb) { diff --git a/lib/xbitmap.c b/lib/xbitmap.c index a1c0abd..1c99586 100644 --- a/lib/xbitmap.c +++ b/lib/xbitmap.c @@ -3,6 +3,16 @@ #include <linux/bitmap.h> #include <li...
2017 Dec 21
7
[PATCH v20 3/7 RESEND] xbitmap: add more operations
...xb_test_bit(const struct xb *xb, unsigned long bit); void xb_clear_bit(struct xb *xb, unsigned long bit); +void xb_clear_bit_range(struct xb *xb, unsigned long start, + unsigned long nbits); +unsigned long xb_find_set(struct xb *xb, unsigned long size, + unsigned long offset); +unsigned long xb_find_zero(struct xb *xb, unsigned long size, + unsigned long offset); static inline bool xb_empty(const struct xb *xb) { diff --git a/lib/xbitmap.c b/lib/xbitmap.c index a1c0abd..1c99586 100644 --- a/lib/xbitmap.c +++ b/lib/xbitmap.c @@ -3,6 +3,16 @@ #include <linux/bitmap.h> #include <li...
2017 Dec 20
0
[PATCH v20 0/7] Virtio-balloon Enhancement
...truct xb *xb, unsigned long bit); void xb_clear_bit_range(struct xb *xb, unsigned long start, unsigned long nbits); -unsigned long xb_find_set(struct xb *xb, unsigned long size, - unsigned long offset); +bool xb_find_set(struct xb *xb, unsigned long max, unsigned long *bit); unsigned long xb_find_zero(struct xb *xb, unsigned long size, unsigned long offset); diff --git a/lib/xbitmap.c b/lib/xbitmap.c index 0bd3027b082d..58c26c8dd595 100644 --- a/lib/xbitmap.c +++ b/lib/xbitmap.c @@ -150,48 +150,39 @@ EXPORT_SYMBOL(xb_test_bit); /** * xb_find_set - find the next set bit in a range of...
2017 Dec 21
0
[PATCH v20 3/7 RESEND] xbitmap: add more operations
...*xb, unsigned long bit); +void xb_clear_bit(struct xb *xb, unsigned long bit); +void xb_zero(struct xb *xb, unsigned long min, unsigned long max); +void xb_fill(struct xb *xb, unsigned long min, unsigned long max); +bool xb_find_set(const struct xb *xb, unsigned long max, unsigned long *bit); +bool xb_find_zero(const struct xb *xb, unsigned long max, unsigned long *bit); + +static inline bool xb_empty(const struct xb *xb) +{ + return radix_tree_empty(&xb->xbrt); +} + +int __must_check xb_preload(gfp_t); + +static inline void xb_preload_end(void) +{ + preempt_enable(); +} diff --git a/lib/Makefile b...
2018 Jan 09
0
[PATCH v21 1/5] xbitmap: Introduce xbitmap
...*xb, unsigned long bit); +void xb_clear_bit(struct xb *xb, unsigned long bit); +void xb_zero(struct xb *xb, unsigned long min, unsigned long max); +void xb_fill(struct xb *xb, unsigned long min, unsigned long max); +bool xb_find_set(const struct xb *xb, unsigned long max, unsigned long *bit); +bool xb_find_zero(const struct xb *xb, unsigned long max, unsigned long *bit); + +static inline bool xb_empty(const struct xb *xb) +{ + return radix_tree_empty(&xb->xbrt); +} + +int __must_check xb_preload(gfp_t); + +static inline void xb_preload_end(void) +{ + preempt_enable(); +} diff --git a/lib/Makefile b...
2017 Dec 20
2
[PATCH v20 0/7] Virtio-balloon Enhancement
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
2017 Dec 20
2
[PATCH v20 0/7] Virtio-balloon Enhancement
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
2017 Dec 23
0
[PATCH v20 3/7 RESEND] xbitmap: add more operations
...o we hit ERR_PTR(-ENOSPC) path? > Isn't removing both bitmap_full() and ERR_PTR(-ENOSPC) better? You're assuming that the purpose of using IDR_FREE is to save xb_set_bit from walking the tree unnecessarily. It isn't; that's just a happy side-effect. Its main purpose is to make xb_find_zero() efficient. If we have large ranges of set bits, xb_find_zero() will be able to skip them. > > This is just a lazy test. We "know" that the bits in the range 1024-2047 > > will all land in the same bitmap, so there's no need to preload for each > > of them. >...
2017 Dec 22
2
[PATCH v20 3/7 RESEND] xbitmap: add more operations
On 12/22/2017 05:03 AM, Matthew Wilcox wrote: > OK, here's a rewrite of xbitmap. > > Compared to the version you sent: > - xb_find_set() is the rewrite I sent out yesterday. > - xb_find_clear() is a new implementation. I use the IDR_FREE tag to find > clear bits. This led to me finding a bug in radix_tree_for_each_tagged(). > - xb_zero() is also a new
2017 Dec 22
2
[PATCH v20 3/7 RESEND] xbitmap: add more operations
On 12/22/2017 05:03 AM, Matthew Wilcox wrote: > OK, here's a rewrite of xbitmap. > > Compared to the version you sent: > - xb_find_set() is the rewrite I sent out yesterday. > - xb_find_clear() is a new implementation. I use the IDR_FREE tag to find > clear bits. This led to me finding a bug in radix_tree_for_each_tagged(). > - xb_zero() is also a new
2018 Jan 09
6
[PATCH v21 0/5] Virtio-balloon Enhancement
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 host. The second feature can be used to accelerate live migration of VMs. Here are some details: Live
2017 Dec 19
15
[PATCH v20 0/7] Virtio-balloon Enhancement
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 host. The second feature can be used to accelerate live migration of VMs. Here are some details: Live
2017 Dec 19
15
[PATCH v20 0/7] Virtio-balloon Enhancement
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 host. The second feature can be used to accelerate live migration of VMs. Here are some details: Live
2017 Dec 19
0
[PATCH v20 4/7] virtio-balloon: VIRTIO_BALLOON_F_SG
...start, pfn_end; + uint32_t max_len = round_down(UINT_MAX, PAGE_SIZE); + uint64_t len; + + pfn_start = page_xb_start; + while (pfn_start < page_xb_end) { + pfn_start = xb_find_set(&vb->page_xb, page_xb_end + 1, + pfn_start); + if (pfn_start == page_xb_end + 1) + break; + pfn_end = xb_find_zero(&vb->page_xb, page_xb_end + 1, + pfn_start); + len = (pfn_end - pfn_start) << PAGE_SHIFT; + while (len > max_len) { + batch_balloon_page_sg(vb, vq, pfn_start, max_len); + pfn_start += max_len >> PAGE_SHIFT; + len -= max_len; + } + batch_balloon_page_sg(vb,...
2018 Jan 09
0
[PATCH v21 2/5 RESEND] virtio-balloon: VIRTIO_BALLOON_F_SG
...d) +{ + unsigned long pfn_start, pfn_end; + uint32_t max_len = round_down(UINT_MAX, PAGE_SIZE); + uint64_t len; + + pfn_start = page_xb_start; + while (pfn_start < page_xb_end) { + if (!xb_find_set(&vb->page_xb, page_xb_end, &pfn_start)) + break; + pfn_end = pfn_start + 1; + if (!xb_find_zero(&vb->page_xb, page_xb_end, &pfn_end)) + pfn_end = page_xb_end + 1; + len = (pfn_end - pfn_start) << PAGE_SHIFT; + while (len > max_len) { + batch_balloon_page_sg(vb, vq, pfn_start, max_len); + pfn_start += max_len >> PAGE_SHIFT; + len -= max_len; + } + batch_ba...