Re: sync_file_range(SYNC_FILE_RANGE_WRITE) blocks?
From: Rik van Riel
Date: Tue Jun 17 2008 - 09:41:06 EST
On Mon, 16 Jun 2008 21:54:06 -0700
Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
> > The problem with lots of CFQ requests is simpler.
> >
> > If you look at balance_dirty_pages() you will see that it only
> > takes dirty and NFS unstable pages into account when checking
> > the dirty limit. The pages that are in flight (under IO) are
> > not counted at all.
>
> That would be totally busted. All that nr_writeback logic in there is very
> much supposed to handle under-writeback pages?
Mmm, you are right. It is counting the number of writeback
pages.
It just isn't waiting on them. After moving enough pages from
dirty state to writeback state, it breaks out of the loop and
allows memory dirtying to continue.
if (pages_written >= write_chunk)
break; /* We've done our duty */
I wonder if we should wait for some IO to complete, or at least
do a simple congestion_wait() if the number of writeback pages
is very large?
--
All rights reversed.
--
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/