From eacbf207aacb511e3f58f5a86d023407c68d3439 Mon Sep 17 00:00:00 2001 From: Moinak Ghosh Date: Thu, 8 Nov 2012 19:41:33 +0530 Subject: [PATCH] Tweak chunking parameters for better block size distribution and dedupe ratio. --- rabin/rabin_dedup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rabin/rabin_dedup.c b/rabin/rabin_dedup.c index d36fc11..aed8989 100755 --- a/rabin/rabin_dedup.c +++ b/rabin/rabin_dedup.c @@ -92,7 +92,7 @@ dedupe_min_blksz(int rab_blk_sz) { uint32_t min_blk; - min_blk = 1 << (rab_blk_sz + RAB_BLK_MIN_BITS - 1); + min_blk = (1 << (rab_blk_sz + RAB_BLK_MIN_BITS)) - 1024; return (min_blk); } @@ -180,7 +180,7 @@ create_dedupe_context(uint64_t chunksize, uint64_t real_chunksize, int rab_blk_s ctx->fixed_flag = fixed_flag; ctx->rabin_break_patt = 0; ctx->rabin_poly_avg_block_size = 1 << (rab_blk_sz + RAB_BLK_MIN_BITS); - ctx->rabin_avg_block_mask = ((ctx->rabin_poly_avg_block_size - 1) >> 1); + ctx->rabin_avg_block_mask = ((ctx->rabin_poly_avg_block_size - 1) >> 2); ctx->rabin_poly_min_block_size = dedupe_min_blksz(rab_blk_sz); ctx->delta_flag = 0;