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

Andrea Arcangeli (andrea@e-mind.com)
Thu, 22 Apr 1999 23:25:25 +0200 (CEST)


On Thu, 22 Apr 1999, Alexander Viro wrote:

>
>
>On Thu, 22 Apr 1999, Andrea Arcangeli wrote:
>
>> >> @@ -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?
>>
>> Starting from the second run of the loop bh is == bhnext. But bhnext is
>> been moved from the dirty list to the clean list while we was sleeping in
>> wait_on_buffer(). So without my patch we could continue browsing the clean
>> list instead of continue to browse the dirty list.
>
>Andrea, look what will happen if lru_list[nlist]->b_list!=nlist. You will
>not get to the end of the inner loop - it will just spin. I'll try to look

But lru_list[nlist]->b_list is always == nlist, otherwise the buffer
pointed by lru_list[nlist] wouldn't be there ;).

Andrea Arcangeli

-
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/