From 064650c180bfb2bcb9f347218675443bf6a73706 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 5 Jun 2017 17:14:16 +0000 Subject: Halve the memory being internally allocated by the blist allocator. In short, half of the memory that is allocated to implement the radix tree is wasted because we did not change "u_daddr_t" to be a 64-bit unsigned int when we changed "daddr_t" to be a 64-bit (signed) int. (See r96849 and r96851.) Reviewed by: kib, markj Tested by: pho MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D11028 --- sys/kern/subr_blist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/kern/subr_blist.c') diff --git a/sys/kern/subr_blist.c b/sys/kern/subr_blist.c index 39b0ce3951b2..7b2fe3d98f92 100644 --- a/sys/kern/subr_blist.c +++ b/sys/kern/subr_blist.c @@ -366,7 +366,7 @@ blst_leaf_alloc( j >>= 1; mask >>= j; } - scan->u.bmu_bitmap &= ~(1 << r); + scan->u.bmu_bitmap &= ~((u_daddr_t)1 << r); return(blk + r); } if (count <= BLIST_BMAP_RADIX) { @@ -658,7 +658,7 @@ static void blst_copy( int i; for (i = 0; i < BLIST_BMAP_RADIX && i < count; ++i) { - if (v & (1 << i)) + if (v & ((u_daddr_t)1 << i)) blist_free(dest, blk + i, 1); } } -- cgit v1.2.3