Messages in this thread | | | Date | Thu, 22 Apr 1999 17:09:19 -0400 (EDT) | From | Alexander Viro <> | Subject | Re: [replace-alexv-buffer.c-patch] Re: [PATCH] Several bad bugs in fs/* |
| |
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 at buffer.c situation tonight - sorry, right now I'm way too low on caffeine.
- 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/
| |