Re: [replace-alexv-buffer.c-patch] Re: [PATCH] Several bad bugs in

Stephen C. Tweedie (sct@redhat.com)
Fri, 23 Apr 1999 14:44:32 +0100 (BST)


Hi,

On Thu, 22 Apr 1999 15:42:15 -0400 (EDT), Alexander Viro
<viro@math.psu.edu> said:

>[snip]
>> @@ -653,10 +629,13 @@
>> * around on the free list, and we can get in a loop if we are not careful.
>> */
>> for(nlist = 0; nlist < NR_LIST; nlist++) {
>> + refiled:
>> bh = lru_list[nlist];
>> for (i = nr_buffers_type[nlist]*2 ; --i > 0 ; bh = bhnext) {
>> if(!bh)
>> break;
>> + if (bh->b_list != nlist)
>> + goto refiled;

> Ahem... Busy-waiting is fun, ain't it? What did you really mean
>in the chunk above?

It's not a busy-wait. If bh->b_list has changed, it just means that the
"bhnext" buffer got refiled while we blocked in wait_on_buffer the
previous time round the loop. That buffer is no longer on the current
lru_list so we won't see it after the reattempt.

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/