Re: 2.6.4-mm2
From: Andrew Morton
Date: Wed Mar 17 2004 - 18:16:58 EST
Chris Mason <mason@xxxxxxxx> wrote:
>
> wait_on_page_writeback_range() does a pagevec_lookup_tag on
> min(end - index + 1, (pgoff_t)PAGEVEC_SIZE)
>
> Which translates to: (unsigned long)-1 - 0 + 1, which is 0.
I made a mental note to test that code.
How's this look?
--- 25/mm/filemap.c~stop-using-locked-pages-fix-2 2004-03-17 15:01:47.466260848 -0800
+++ 25-akpm/mm/filemap.c 2004-03-17 15:04:10.730481376 -0800
@@ -186,8 +186,8 @@ static int wait_on_page_writeback_range(
pagevec_init(&pvec, 0);
index = start;
while ((nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
- PAGECACHE_TAG_WRITEBACK,
- min(end - index + 1, (pgoff_t)PAGEVEC_SIZE)))) {
+ PAGECACHE_TAG_WRITEBACK,
+ min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1))) {
unsigned i;
for (i = 0; i < nr_pages; i++) {
_
> It doesn't look like anyone is using the range feature of this function,
> can we make it just wait on all the writeback pages?
We could, but there are the dreaded "future plans". In several places
we're syncing the whole file unnecessarily. Most notably, O_SYNC writes.
I'd like to get us to the stage where an O_SYNC write writes and waits upon
just the pages which are within the range of the caller's write(), without
holding i_sem.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/