search for: bits_per_long

Displaying 20 results from an estimated 285 matches for "bits_per_long".

2016 May 24
2
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...t; VIRTIO_BALLOON_F_PAGE_BITMAP)) { > > > > + u32 page_shift = PAGE_SHIFT; > > > > + unsigned long start_pfn, end_pfn, flags = 0, bmap_len; > > > > + struct scatterlist sg[5]; > > > > + > > > > + start_pfn = rounddown(vb->start_pfn, BITS_PER_LONG); > > > > + end_pfn = roundup(vb->end_pfn, BITS_PER_LONG); > > > > + bmap_len = (end_pfn - start_pfn) / BITS_PER_LONG * > > > sizeof(long); > > > > + > > > > + sg_init_table(sg, 5); > > > > + sg_set_buf(&sg[0], &fla...
2016 May 24
2
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...t; VIRTIO_BALLOON_F_PAGE_BITMAP)) { > > > > + u32 page_shift = PAGE_SHIFT; > > > > + unsigned long start_pfn, end_pfn, flags = 0, bmap_len; > > > > + struct scatterlist sg[5]; > > > > + > > > > + start_pfn = rounddown(vb->start_pfn, BITS_PER_LONG); > > > > + end_pfn = roundup(vb->end_pfn, BITS_PER_LONG); > > > > + bmap_len = (end_pfn - start_pfn) / BITS_PER_LONG * > > > sizeof(long); > > > > + > > > > + sg_init_table(sg, 5); > > > > + sg_set_buf(&sg[0], &fla...
2016 May 24
3
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...e? Is it no good to send a large page bitmap? or to save the memory used for page bitmap? Or some other reason? > > > > > + unsigned long start_pfn, end_pfn, flags = 0, bmap_len; > > + struct scatterlist sg[5]; > > + > > + start_pfn = rounddown(vb->start_pfn, BITS_PER_LONG); > > + end_pfn = roundup(vb->end_pfn, BITS_PER_LONG); > > + bmap_len = (end_pfn - start_pfn) / BITS_PER_LONG * > sizeof(long); > > + > > + sg_init_table(sg, 5); > > + sg_set_buf(&sg[0], &flags, sizeof(flags)); > > + sg_set_buf(&sg[1], &amp...
2016 May 24
3
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...e? Is it no good to send a large page bitmap? or to save the memory used for page bitmap? Or some other reason? > > > > > + unsigned long start_pfn, end_pfn, flags = 0, bmap_len; > > + struct scatterlist sg[5]; > > + > > + start_pfn = rounddown(vb->start_pfn, BITS_PER_LONG); > > + end_pfn = roundup(vb->end_pfn, BITS_PER_LONG); > > + bmap_len = (end_pfn - start_pfn) / BITS_PER_LONG * > sizeof(long); > > + > > + sg_init_table(sg, 5); > > + sg_set_buf(&sg[0], &flags, sizeof(flags)); > > + sg_set_buf(&sg[1], &amp...
2017 Nov 03
1
[PATCH v17 1/6] lib/xbitmap: Introduce xbitmap
...+ ebit = bit + 2; > + > + err = __radix_tree_create(root, index, 0, &node, &slot); > + if (err) > + return err; > + bitmap = rcu_dereference_raw(*slot); > + if (radix_tree_exception(bitmap)) { > + unsigned long tmp = (unsigned long)bitmap; > + > + if (ebit < BITS_PER_LONG) { > + tmp |= 1UL << ebit; > + rcu_assign_pointer(*slot, (void *)tmp); > + return 0; > + } > + bitmap = this_cpu_xchg(ida_bitmap, NULL); > + if (!bitmap) Please write locking rules, in order to explain how memory allocated by __radix_tree_create() will not leak. &...
2017 Nov 03
1
[PATCH v17 1/6] lib/xbitmap: Introduce xbitmap
...+ ebit = bit + 2; > + > + err = __radix_tree_create(root, index, 0, &node, &slot); > + if (err) > + return err; > + bitmap = rcu_dereference_raw(*slot); > + if (radix_tree_exception(bitmap)) { > + unsigned long tmp = (unsigned long)bitmap; > + > + if (ebit < BITS_PER_LONG) { > + tmp |= 1UL << ebit; > + rcu_assign_pointer(*slot, (void *)tmp); > + return 0; > + } > + bitmap = this_cpu_xchg(ida_bitmap, NULL); > + if (!bitmap) Please write locking rules, in order to explain how memory allocated by __radix_tree_create() will not leak. &...
2017 Dec 16
0
[PATCH v19 3/7] xbitmap: add more operations
...tally. Please let me know if anywhere still looks fuzzy. > I don't think it is the same for xb_find_next_bit() with set == 0. > > + if (radix_tree_exception(bmap)) { > + unsigned long tmp = (unsigned long)bmap; > + unsigned long ebit = bit + 2; > + > + if (ebit >= BITS_PER_LONG) > + continue; > + if (set) > + ret = find_next_bit(&tmp, BITS_PER_LONG, ebit); > + else > + ret = find_next_zero_bit(&tmp, BITS_PER_LONG, > + ebit); > + if (ret < BITS_PER_LONG) > + return ret - 2 + IDA_BITMAP_BITS * index; > > What...
2017 Nov 03
0
[PATCH v17 2/6] radix tree test suite: add tests for xbitmap
...bitmap.h @@ -36,6 +36,40 @@ static inline void bitmap_zero(unsigned long *dst, int nbits) } } +static inline void __bitmap_clear(unsigned long *map, unsigned int start, + int len) +{ + unsigned long *p = map + BIT_WORD(start); + const unsigned int size = start + len; + int bits_to_clear = BITS_PER_LONG - (start % BITS_PER_LONG); + unsigned long mask_to_clear = BITMAP_FIRST_WORD_MASK(start); + + while (len - bits_to_clear >= 0) { + *p &= ~mask_to_clear; + len -= bits_to_clear; + bits_to_clear = BITS_PER_LONG; + mask_to_clear = ~0UL; + p++; + } + if (len) { + mask_to_clear &= BITMA...
2016 May 24
0
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...BITMAP)) { > > > > > + u32 page_shift = PAGE_SHIFT; > > > > > + unsigned long start_pfn, end_pfn, flags = 0, bmap_len; > > > > > + struct scatterlist sg[5]; > > > > > + > > > > > + start_pfn = rounddown(vb->start_pfn, BITS_PER_LONG); > > > > > + end_pfn = roundup(vb->end_pfn, BITS_PER_LONG); > > > > > + bmap_len = (end_pfn - start_pfn) / BITS_PER_LONG * > > > > sizeof(long); > > > > > + > > > > > + sg_init_table(sg, 5); > > > > > + s...
2013 Apr 03
0
[PATCH] Btrfs-progs: add a free space cache checker to fsck
...e bit as value to start with */ +#define for_each_set_bit_from(bit, addr, size) \ + for ((bit) = find_next_bit((addr), (size), (bit)); \ + (bit) < (size); \ + (bit) = find_next_bit((addr), (size), (bit) + 1)) + +static inline void set_bit(int nr, unsigned long *addr) +{ + addr[nr / BITS_PER_LONG] |= 1UL << (nr % BITS_PER_LONG); +} + +static inline void clear_bit(int nr, unsigned long *addr) +{ + addr[nr / BITS_PER_LONG] &= ~(1UL << (nr % BITS_PER_LONG)); +} + +/** + * hweightN - returns the hamming weight of a N-bit word + * @x: the word to weigh + * + * The Hamming Weight...
2017 Dec 13
0
[PATCH v19 3/7] xbitmap: add more operations
...ITMAP_BITS; >> + >> + bitmap = __radix_tree_lookup(root, index, &node, &slot); >> + if (radix_tree_exception(bitmap)) { >> + unsigned long ebit = bit + 2; >> + unsigned long tmp = (unsigned long)bitmap; >> + >> + nbits = min(end - start + 1, BITS_PER_LONG - ebit); >> + >> + if (ebit >= BITS_PER_LONG) > What happens if we hit this "continue;" when "index == ULONG_MAX / IDA_BITMAP_BITS" ? Thanks. I also improved the test case for this. I plan to change the implementation a little bit to avoid such overflow (ha...
2001 Mar 28
1
Ext3 and LFS - possible? fatal?
Has anyone tried LFS (ie >2G files support) and Ext3 together? Are there good reasons why this should/should not work? I see the RH enterprise kernel patch set specifically does not attempt both lfs and ext3, but the lfs patches themselves touch some reasonably localised parts of ext2, so I would hope (without having dived in there to test), that the ext3 changes would mirror that
2017 Dec 14
0
[PATCH v19 3/7] xbitmap: add more operations
...p = __radix_tree_lookup(root, index, &node, &slot); >>>> + if (radix_tree_exception(bitmap)) { >>>> + unsigned long ebit = bit + 2; >>>> + unsigned long tmp = (unsigned long)bitmap; >>>> + >>>> + nbits = min(end - start + 1, BITS_PER_LONG - ebit); >>>> + >>>> + if (ebit >= BITS_PER_LONG) >>> What happens if we hit this "continue;" when "index == ULONG_MAX / IDA_BITMAP_BITS" ? >> Thanks. I also improved the test case for this. I plan to change the >> implementation...
2016 May 20
6
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...* at vb_dev_info->pages list. @@ -111,15 +116,66 @@ static void balloon_ack(struct virtqueue *vq) wake_up(&vb->acked); } +static int balloon_page_bitmap_init(struct virtio_balloon *vb) +{ + unsigned long max_pfn, bmap_bytes; + + max_pfn = get_max_pfn(); + bmap_bytes = ALIGN(max_pfn, BITS_PER_LONG) / BITS_PER_BYTE; + if (!vb->page_bitmap) + vb->page_bitmap = kzalloc(bmap_bytes, GFP_KERNEL); + else { + if (bmap_bytes <= vb->bmap_len) + memset(vb->page_bitmap, 0, bmap_bytes); + else { + kfree(vb->page_bitmap); + vb->page_bitmap = kzalloc(bmap_bytes, GFP_KERNEL); +...
2016 May 20
6
[PATCH RFC kernel] balloon: speed up inflating/deflating process
...* at vb_dev_info->pages list. @@ -111,15 +116,66 @@ static void balloon_ack(struct virtqueue *vq) wake_up(&vb->acked); } +static int balloon_page_bitmap_init(struct virtio_balloon *vb) +{ + unsigned long max_pfn, bmap_bytes; + + max_pfn = get_max_pfn(); + bmap_bytes = ALIGN(max_pfn, BITS_PER_LONG) / BITS_PER_BYTE; + if (!vb->page_bitmap) + vb->page_bitmap = kzalloc(bmap_bytes, GFP_KERNEL); + else { + if (bmap_bytes <= vb->bmap_len) + memset(vb->page_bitmap, 0, bmap_bytes); + else { + kfree(vb->page_bitmap); + vb->page_bitmap = kzalloc(bmap_bytes, GFP_KERNEL); +...
2017 Dec 12
0
[PATCH v19 3/7] xbitmap: add more operations
...= start / IDA_BITMAP_BITS; + unsigned long bit = start % IDA_BITMAP_BITS; + + bitmap = __radix_tree_lookup(root, index, &node, &slot); + if (radix_tree_exception(bitmap)) { + unsigned long ebit = bit + 2; + unsigned long tmp = (unsigned long)bitmap; + + nbits = min(end - start + 1, BITS_PER_LONG - ebit); + + if (ebit >= BITS_PER_LONG) + continue; + bitmap_clear(&tmp, ebit, nbits); + if (tmp == RADIX_TREE_EXCEPTIONAL_ENTRY) + __radix_tree_delete(root, node, slot); + else + rcu_assign_pointer(*slot, (void *)tmp); + } else if (bitmap) { + nbits = min(end - start + 1...
2017 Nov 03
0
[PATCH v17 1/6] lib/xbitmap: Introduce xbitmap
...d long index, + * the high order XB_INDEX_BITS bits of the index is used to find the + * corresponding item (i.e. ida bitmap) from the radix tree, and the low + * order (i.e. ilog2(IDA_BITMAP_BITS)) bits of the index are indexed into + * the ida bitmap to find the bit. + */ +#define XB_INDEX_BITS (BITS_PER_LONG - ilog2(IDA_BITMAP_BITS)) +#define XB_MAX_PATH (DIV_ROUND_UP(XB_INDEX_BITS, \ + RADIX_TREE_MAP_SHIFT)) +#define XB_PRELOAD_SIZE (XB_MAX_PATH * 2 - 1) + +/* * Per-cpu pool of preloaded nodes */ struct radix_tree_preload { @@ -840,6 +853,8 @@ int __radix_tree_create(struct radix_tree...
2005 Jan 12
3
syslinux build fails with 2.6 linux headers
...from /usr/include/linux/percpu_counter.h:11, from /usr/include/linux/ext2_fs_sb.h:20, from /usr/include/linux/ext2_fs.h:20, from extlinux.c:39: /usr/include/linux/bitmap.h: In function `bitmap_zero': /usr/include/linux/bitmap.h:110: error: `BITS_PER_LONG' undeclared (first use in this function) /usr/include/linux/bitmap.h: In function `bitmap_fill': /usr/include/linux/bitmap.h:125: error: `BITS_PER_LONG' undeclared (first use in this function) /usr/include/linux/bitmap.h: In function `bitmap_copy': /usr/include/linux/bitmap.h:131: e...
2020 Jun 30
0
[PATCH v2 2/5] mm/hmm: add output flags for PMD/PUD page mapping
...UD_SIZE and fully mapped by the CPU with consistent + * protection (e.g., all writeable if HMM_PFN_WRITE is set). * * On input: * 0 - Return the current state of the page, do not fault it. @@ -41,12 +47,15 @@ enum hmm_pfn_flags { HMM_PFN_VALID = 1UL << (BITS_PER_LONG - 1), HMM_PFN_WRITE = 1UL << (BITS_PER_LONG - 2), HMM_PFN_ERROR = 1UL << (BITS_PER_LONG - 3), + HMM_PFN_PMD = 1UL << (BITS_PER_LONG - 4), + HMM_PFN_PUD = 1UL << (BITS_PER_LONG - 5), /* Input flags */ HMM_PFN_REQ_FAULT = HMM_PFN_VALID, HMM_PFN_REQ_WRITE = HMM_PFN_...
2017 Dec 12
0
[PATCH v19 2/7] xbitmap: potential improvement
This patch made some changes to the original xbitmap implementation from the linux-dax tree: - remove xb_fill() and xb_zero() from xbitmap.h since they are not implemented; - xb_test_bit: changed "ebit > BITS_PER_LONG" to "ebit >= BITS_PER_LONG", because bit 64 beyonds the "unsigned long" exceptional entry (0 to 63); - xb_set_bit: delete the new inserted radix_tree_node when failing to get the per cpu ida bitmap, this avoids the kind of memory leak of the unused radix tree node...