Re: patch for free_async_buffers SMP problem

Bill Hawes (
Sat, 26 Jul 1997 16:47:37 -0400

Colin Plumb wrote:
> Um, as long as free_async_buffers absolutely *insists* that its
> argument be a circularly linked list, if you don't mind not
> checking *each* BH_FreeOnIO flag, how about:

The buffer heads in free_async_buffers are linked by the circular
bh->b_this_page list. (It's not circular when it leaves create_buffers,
but the circular link is added later in all cases.)
Recover_reusable_buffer_heads wants the list linked using b_next_free.

In the patch I did want to maintain the test on BH_FreeOnIO; it's really
a debugging check, but a problem here would be very hard to trace. If
at some point this test could be dropped, then recover_reusable_xxx
could be changed to use the b_this_page list, and then it wouldn't be
necessary to walk the list. This would be a good future improvement.

I did remove the clear_bit(), as buffer heads are cleared when placed on
the unused list.