Skip to contentSkip to conversation

The DM_BUFIO_HASH_BITS is defined as 20, any plan to make it flexible?

DISCUSSION zhangxiao 3 participants 5 messages Dec 2, 2014 – Dec 4, 2014

Subsystems (2)
lore
Share & tools
lore

zhangxiao

author
#0 lore raw

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?

Thanks
Xiao

#1 lore raw
Quoted 12 lines · zhangxiao

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

Quoted 3 lines

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.

#2 lore raw
Quoted 15 lines · Mike Snitzer
Quoted 12 lines · zhangxiao

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

Quoted 5 lines
Quoted 3 lines

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.

https://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-for-3.19&id=4e420c452b11edf9d510c8180ac66f529e5b6206

#3 lore raw
Quoted 20 lines · Joe Thornber
Quoted 19 lines · Mike Snitzer
Quoted 15 lines · zhangxiao

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?

Quoted 5 lines
Quoted 1 line

No immediate plans.

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

https://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-for-3.19&id=4e420c452b11edf9d510c8180ac66f529e5b6206

Ah yes, you'd think I'd have remembered that change. Thanks for keeping me honest Joe!

author
#4 lore raw
In reply to Joe Thornber
Quoted 20 lines · Joe Thornber
Quoted 19 lines · Mike Snitzer
Quoted 15 lines · zhangxiao

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?

Quoted 7 lines
Quoted 1 line

No immediate plans.

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

https://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-for-3.19&id=4e420c452b11edf9d510c8180ac66f529e5b6206

Great Thanks!

Best Regards
Xiao