From: Andy Whitcroft Improve code commentary on the initial writeback wait in synchronous reclaim mode. Signed-off-by: Andy Whitcroft Signed-off-by: Andrew Morton --- mm/vmscan.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff -puN mm/vmscan.c~wait-for-page-writeback-when-directly-reclaiming-contiguous-areas-fix mm/vmscan.c --- a/mm/vmscan.c~wait-for-page-writeback-when-directly-reclaiming-contiguous-areas-fix +++ a/mm/vmscan.c @@ -479,6 +479,14 @@ static unsigned long shrink_page_list(st (PageSwapCache(page) && (sc->gfp_mask & __GFP_IO)); if (PageWriteback(page)) { + /* + * Synchronous reclaim is performed in two passes, + * first an asynchronous pass over the list to + * start parallel writeback, and a second synchronous + * pass to wait for the IO to complete. Wait here + * for any page for which writeback has already + * started. + */ if (sync_writeback == PAGEOUT_IO_SYNC && may_enter_fs) wait_on_page_writeback(page); else _