Re: [dm-devel] The DM_BUFIO_HASH_BITS is defined as 20, any plan to make it flexible?

From: zhangxiao
Date: Wed Dec 03 2014 - 20:27:49 EST

On 2014å12æ03æ 22:19, Joe Thornber wrote:
On Tue, Dec 02, 2014 at 09:00:17AM -0500, Mike Snitzer wrote:
On Tue, Dec 02 2014 at 3:43am -0500,
zhangxiao <xiao.zhang@xxxxxxxxxxxxx> wrote:

Hi Experts,

See drivers/md/dm-bufio.c as below:
50 /*
51 * Buffer hash
52 */
53 #define DM_BUFIO_HASH_BITS 20
54 #define DM_BUFIO_HASH(block) \
55 ((((block) >> DM_BUFIO_HASH_BITS) ^ (block)) & \
56 ((1 << DM_BUFIO_HASH_BITS) - 1))
"drivers/md/dm-bufio.c" 1854L, 45375C

DM_BUFIO_HASH_BITS was defined as 20 and it maybe not fit for some
use case with limited resources. Do we have any plan to make it more
flexible? Like module parameter or something else?

No immediate plans.

That hash table has been replaced with a red/black tree.

Great Thanks!

Best Regards
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at