search for: xb1

Displaying 20 results from an estimated 48 matches for "xb1".

Did you mean: b1
2017 Dec 20
0
[PATCH v20 0/7] Virtio-balloon Enhancement
...ind_next_bit(bitmap->bitmap, nbits, first); + if (first != nbits) { + *bit = first + iter.index * IDA_BITMAP_BITS; + return true; + } } - bit = 0; - index++; + first = 0; } - return size; + return false; } EXPORT_SYMBOL(xb_find_set); @@ -246,19 +237,30 @@ static DEFINE_XB(xb1); void xbitmap_check_bit(unsigned long bit) { + unsigned long nbit = 0; + xb_preload(GFP_KERNEL); assert(!xb_test_bit(&xb1, bit)); assert(xb_set_bit(&xb1, bit) == 0); assert(xb_test_bit(&xb1, bit)); - assert(xb_clear_bit(&xb1, bit) == 0); + assert(xb_find_set(&xb1, U...
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
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
2018 Jan 09
0
[PATCH v21 1/5] xbitmap: Introduce xbitmap
...ndex) + nbits = max % IDA_BITMAP_BITS + 1; + first = find_next_zero_bit(bitmap->bitmap, nbits, first); + if (first != nbits) + break; + first = 0; + } + + *bit = first + iter.index * IDA_BITMAP_BITS; + return true; +} +EXPORT_SYMBOL(xb_find_zero); + +#ifndef __KERNEL__ + +static DEFINE_XB(xb1); + +static void xbitmap_check_bit(unsigned long bit) +{ + unsigned long nbit = 0; + + xb_preload(GFP_KERNEL); + assert(!xb_test_bit(&xb1, bit)); + assert(xb_set_bit(&xb1, bit) == 0); + assert(xb_test_bit(&xb1, bit)); + assert(xb_find_set(&xb1, ULONG_MAX, &nbit) == true); + asse...
2017 Dec 12
0
[PATCH v19 3/7] xbitmap: add more operations
...index of the found bit, or @end + 1 if no such bit is found. + */ +unsigned long xb_find_next_zero_bit(struct xb *xb, unsigned long start, + unsigned long end) +{ + return xb_find_next_bit(xb, start, end, 0); +} +EXPORT_SYMBOL(xb_find_next_zero_bit); + #ifndef __KERNEL__ static DEFINE_XB(xb1); @@ -160,6 +327,66 @@ void xbitmap_check_bit(unsigned long bit) xb_preload_end(); } +static void xbitmap_check_bit_range(void) +{ + /* + * Regular tests + * ebit tests: set 1030, 1031, 1034, 1035 + * Next 1 in [0, 10000) --> 1030 + * Next 1 in [1030, 1034) --> 1030 + * Next 1 i...
2017 Dec 21
0
[PATCH v20 3/7 RESEND] xbitmap: add more operations
...ndex) + nbits = max % IDA_BITMAP_BITS + 1; + first = find_next_zero_bit(bitmap->bitmap, nbits, first); + if (first != nbits) + break; + first = 0; + } + + *bit = first + iter.index * IDA_BITMAP_BITS; + return true; +} +EXPORT_SYMBOL(xb_find_zero); + +#ifndef __KERNEL__ + +static DEFINE_XB(xb1); + +static void xbitmap_check_bit(unsigned long bit) +{ + unsigned long nbit = 0; + + xb_preload(GFP_KERNEL); + assert(!xb_test_bit(&xb1, bit)); + assert(xb_set_bit(&xb1, bit) == 0); + assert(xb_test_bit(&xb1, bit)); + assert(xb_find_set(&xb1, ULONG_MAX, &nbit) == true); + asse...
2017 Dec 21
7
[PATCH v20 3/7 RESEND] xbitmap: add more operations
...et = find_next_zero_bit(bitmap->bitmap, nbits, bit); + if (ret != nbits) + return ret + index * IDA_BITMAP_BITS; + } else { + return bit + index * IDA_BITMAP_BITS; + } + bit = 0; + index++; + } + + return size; +} +EXPORT_SYMBOL(xb_find_zero); + #ifndef __KERNEL__ static DEFINE_XB(xb1); @@ -111,6 +256,64 @@ void xbitmap_check_bit(unsigned long bit) xb_preload_end(); } +static void xbitmap_check_bit_range(void) +{ + /* Regular test1: node = NULL */ + xb_preload(GFP_KERNEL); + xb_set_bit(&xb1, 700); + xb_preload_end(); + assert(xb_find_set(&xb1, ULONG_MAX, 0) == 700);...
2017 Dec 21
7
[PATCH v20 3/7 RESEND] xbitmap: add more operations
...et = find_next_zero_bit(bitmap->bitmap, nbits, bit); + if (ret != nbits) + return ret + index * IDA_BITMAP_BITS; + } else { + return bit + index * IDA_BITMAP_BITS; + } + bit = 0; + index++; + } + + return size; +} +EXPORT_SYMBOL(xb_find_zero); + #ifndef __KERNEL__ static DEFINE_XB(xb1); @@ -111,6 +256,64 @@ void xbitmap_check_bit(unsigned long bit) xb_preload_end(); } +static void xbitmap_check_bit_range(void) +{ + /* Regular test1: node = NULL */ + xb_preload(GFP_KERNEL); + xb_set_bit(&xb1, 700); + xb_preload_end(); + assert(xb_find_set(&xb1, ULONG_MAX, 0) == 700);...
2017 Nov 03
0
[PATCH v17 2/6] radix tree test suite: add tests for xbitmap
.../xbitmap.c new file mode 100644 index 0000000..bee8a38 --- /dev/null +++ b/tools/testing/radix-tree/xbitmap.c @@ -0,0 +1,278 @@ +#include <linux/bitmap.h> +#include <linux/slab.h> +#include <linux/kernel.h> +#include "../../../include/linux/xbitmap.h" + +static DEFINE_XB(xb1); + +int xb_set_bit(struct xb *xb, unsigned long bit) +{ + int err; + unsigned long index = bit / IDA_BITMAP_BITS; + struct radix_tree_root *root = &xb->xbrt; + struct radix_tree_node *node; + void **slot; + struct ida_bitmap *bitmap; + unsigned long ebit; + + bit %= IDA_BITMAP_BITS; + ebit...
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 12
0
[PATCH v19 2/7] xbitmap: potential improvement
...x_tree_exception(bitmap)) { bit += RADIX_TREE_EXCEPTIONAL_SHIFT; - if (bit > BITS_PER_LONG) + if (bit >= BITS_PER_LONG) return false; return (unsigned long)bitmap & (1UL << bit); } @@ -151,9 +153,9 @@ void xbitmap_check_bit(unsigned long bit) assert(!xb_test_bit(&xb1, bit)); assert(xb_set_bit(&xb1, bit) == 0); assert(xb_test_bit(&xb1, bit)); - assert(xb_clear_bit(&xb1, bit) == 0); + xb_clear_bit(&xb1, bit); assert(xb_empty(&xb1)); - assert(xb_clear_bit(&xb1, bit) == 0); + xb_clear_bit(&xb1, bit); assert(xb_empty(&xb1));...
2017 Dec 19
0
[PATCH v20 1/7] xbitmap: Introduce xbitmap
...; + const struct radix_tree_root *root = &xb->xbrt; + struct ida_bitmap *bitmap = radix_tree_lookup(root, index); + + bit %= IDA_BITMAP_BITS; + + if (!bitmap) + return false; + return test_bit(bit, bitmap->bitmap); +} +EXPORT_SYMBOL(xb_test_bit); + +#ifndef __KERNEL__ + +static DEFINE_XB(xb1); + +void xbitmap_check_bit(unsigned long bit) +{ + xb_preload(GFP_KERNEL); + assert(!xb_test_bit(&xb1, bit)); + assert(xb_set_bit(&xb1, bit) == 0); + assert(xb_test_bit(&xb1, bit)); + assert(xb_clear_bit(&xb1, bit) == 0); + assert(xb_empty(&xb1)); + assert(xb_clear_bit(&xb1...
2017 Dec 12
0
[PATCH v19 1/7] xbitmap: Introduce xbitmap
...radix_tree_exception(bitmap)) { + bit += RADIX_TREE_EXCEPTIONAL_SHIFT; + if (bit > BITS_PER_LONG) + return false; + return (unsigned long)bitmap & (1UL << bit); + } + return test_bit(bit, bitmap->bitmap); +} +EXPORT_SYMBOL(xb_test_bit); + +#ifndef __KERNEL__ + +static DEFINE_XB(xb1); + +void xbitmap_check_bit(unsigned long bit) +{ + xb_preload(GFP_KERNEL); + assert(!xb_test_bit(&xb1, bit)); + assert(xb_set_bit(&xb1, bit) == 0); + assert(xb_test_bit(&xb1, bit)); + assert(xb_clear_bit(&xb1, bit) == 0); + assert(xb_empty(&xb1)); + assert(xb_clear_bit(&xb1...
2009 Jul 01
0
probit with sample selection error?
...ssian=F)$par return(b) } heckpll<-function(bstart,y1,x1,y2,x2){ y1=as.vector(y1);y2=as.vector(y2); x1=as.matrix(x1);x2=as.matrix(x2); p=ncol(x1); k=ncol(x2); obs = length(y1); ll = numeric(obs); b1 =bstart[1:p]; b2 =bstart[(p+1):(k+p)]; rho=(exp(bstart[(k+p+1)]) - 1)/(exp(bstart[(k+p+1)]) - 1); xb1 = x1%*%b1; xb2 = x2%*%b2; prob = pnorm(xb1); for (i in 1:obs){ ll[i] = (1-y1[i])*log(1-prob[i])+ y1[i]*(1-y2[i])*log(pmvnorm(lower= -Inf,upper=c(-xb1[i],xb2[i]),corr=matrix(c(1,-rho,-rho,1),2,2)))+ y1[i]*y2[i]*log(pmvnorm(lower=-Inf,upper=c(xb1[i],xb2[i]),corr=matrix(c(1,rho,rho,1),2,2))) } return(...
2017 Dec 12
21
[PATCH v19 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 12
21
[PATCH v19 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 Nov 29
22
[PATCH v18 00/10] 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 Nov 29
22
[PATCH v18 00/10] 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