Skip to contentSkip to conversation

potential for buffer_head shrinkage.

DISCUSSION Dave Jones 1 participant 2 messages Dec 30, 2006

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

Looking at struct buffer_head, it seems that b_state uses at most 15 bits, where it's defined as a 64bit entity due to it being used by bit_spin_lock and friends.

Given it's not uncommon for a few hundred thousand of these to be present, I wonder if it's worth the effort of folding b_count into the upper bits of b_state, thus shrinking buffer_head by 16 bits? This would still leave 32 bits 'wasted' for further bh_state_bits expansion if necessary.

Opinions?

Dave

Signature · 1 line
http://www.codemonkey.org.uk
author
#1 lore raw
Quoted 9 lines · Dave Jones

Looking at struct buffer_head, it seems that b_state uses at most 15 bits, where it's defined as a 64bit entity due to it being used by bit_spin_lock and friends.

Given it's not uncommon for a few hundred thousand of these to be present, I wonder if it's worth the effort of folding b_count into the upper bits of b_state, thus shrinking buffer_head by 16 bits? This would still leave 32 bits 'wasted' for further bh_state_bits expansion if necessary.

My math here based on a 64 bit compile btw in case that wasn't obvious. 32 bit wouldn't leave room for expansion.

Dave

Signature · 1 line
http://www.codemonkey.org.uk