Skip to contentSkip to conversation

BH_Req question

DISCUSSION Rajagopal Ananthanarayanan 2 participants 3 messages Apr 10, 2001

lore
Share & tools
lore
#0 lore raw

Hi,

It seems BH_Req is set on a buffer_head by submit_bh.
What part of the code unsets this flag during normal operations? One path seems to be block_flushpage->unmap_buffer ->clear_bit(BH_Req), but IIRC block_flushpage is used only for truncates. There must be another path to unset BH_Req under normal memory pressure, or (more unambiguously) on IO completion.

So: in what ways can BH_Req be unset?

Thanks for any input, i've been staring at the code for long without avail ...

cheers,

ananth.

PS: In case why the question: I've got a system with tons of pages with buffers marked BH_Req, so try_to_free_buffers() bails out thinking that the buffer is busy ...

Signature · 4 lines
--------------------------------------------------------------------------
Rajagopal Ananthanarayanan ("ananth")
Member Technical Staff, SGI.
--------------------------------------------------------------------------
#1 lore raw
Quoted 11 lines · Rajagopal Ananthanarayanan

Hi,

It seems BH_Req is set on a buffer_head by submit_bh.
What part of the code unsets this flag during normal operations? One path seems to be block_flushpage->unmap_buffer ->clear_bit(BH_Req), but IIRC block_flushpage is used only for truncates. There must be another path to unset BH_Req under normal memory pressure, or (more unambiguously) on IO completion.

So: in what ways can BH_Req be unset?

BH_Req is never unset until the buffer is destroyed (put back on the freelist). BH_Req only says if such a buffer ever did any I/O yet or not. It is basically only used to deal with I/O errors in sync_buffers().

Quoted 3 lines

PS: In case why the question: I've got a system with tons of pages with buffers marked BH_Req, so try_to_free_buffers() bails out thinking that the buffer is busy ...

Either your debugging is wrong or you broke try_to_free_buffers because a buffer with BH_Req must still be perfectly freeable.

Andrea

#2 lore raw
In reply to Rajagopal Ananthanarayanan
Quoted 1 line · Andrea Arcangeli
	[ ... ]
Quoted 4 lines

BH_Req is never unset until the buffer is destroyed (put back on the freelist). BH_Req only says if such a buffer ever did any I/O yet or not. It is basically only used to deal with I/O errors in sync_buffers().

Interesting. Thanks for the explanation. Since submit_bh was setting BH_Req, I was misled into thinking that end_io would unset it ...

Quoted 7 lines
Quoted 4 lines

PS: In case why the question: I've got a system with tons of pages with buffers marked BH_Req, so try_to_free_buffers() bails out thinking that the buffer is busy ...

Either your debugging is wrong or you broke try_to_free_buffers because a buffer with BH_Req must still be perfectly freeable.

Okay, I got distracted by BH_Req, which I mistook to be in BUFFER_BUSY_BITS. There was also BH_Lock set on the buffers, which would qualify for BUFFER_BUSY_BITS ... so may be it is a buffer_locking problem somewhere.

cheers,

ananth.

--------------------------------------------------------------------------
Rajagopal Ananthanarayanan ("ananth")
Member Technical Staff, SGI.
--------------------------------------------------------------------------