kswapd should only wait on IO if there is IO
commitf1a9ee758de7de1e040de849fdef46e6802ea117
authorRik van Riel <riel@redhat.com>
Thu, 7 Feb 2008 08:14:08 +0000 (7 00:14 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 7 Feb 2008 16:42:19 +0000 (7 08:42 -0800)
tree99dfac0c81de111025e12546d97aaebd3d8d576c
parentfef1bdd68c81b71882ccb6f47c70980a03182063
kswapd should only wait on IO if there is IO

The current kswapd (and try_to_free_pages) code has an oddity where the
code will wait on IO, even if there is no IO in flight.  This problem is
notable especially when the system scans through many unfreeable pages,
causing unnecessary stalls in the VM.

Additionally, tasks without __GFP_FS or __GFP_IO in the direct reclaim path
will sleep if a significant number of pages are encountered that should be
written out.  This gives kswapd a chance to write out those pages, while
the direct reclaim task sleeps.

Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/vmscan.c