BH_Req question
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.
--------------------------------------------------------------------------Quoted 11 lines · Rajagopal Ananthanarayanan
Hi,
It seems
BH_Reqis set on abuffer_headbysubmit_bh.
What part of the code unsets this flag during normal operations? One path seems to beblock_flushpage->unmap_buffer->clear_bit(BH_Req), but IIRCblock_flushpageis used only for truncates. There must be another path to unsetBH_Requnder normal memory pressure, or (more unambiguously) on IO completion.So: in what ways can
BH_Reqbe 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, sotry_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
Quoted 1 line · Andrea Arcangeli
[ ... ]
Quoted 4 lines
BH_Reqis never unset until the buffer is destroyed (put back on the freelist).BH_Reqonly says if such a buffer ever did any I/O yet or not. It is basically only used to deal with I/O errors insync_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, sotry_to_free_buffers()bails out thinking that the buffer is busy ...Either your debugging is wrong or you broke
try_to_free_buffersbecause a buffer withBH_Reqmust 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.
--------------------------------------------------------------------------