]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm-fix-nonuniform-page-status-when-writing-new-file-with-small-buffer-fix-fix
authorAndrew Morton <akpm@linux-foundation.org>
Wed, 26 Sep 2012 01:33:13 +0000 (11:33 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 27 Sep 2012 07:25:39 +0000 (17:25 +1000)
grab better comment from the v3 patch

Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Robin Dong <sanbai@taobao.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/swap.c

index 7a555e227d6121a651d30baf45cf026280ac8c0b..f76c76c7501b5ae47cf0144791a7d1626c65f26d 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -447,8 +447,12 @@ void mark_page_accessed(struct page *page)
 EXPORT_SYMBOL(mark_page_accessed);
 
 /*
- * Check the pagevec space before adding a new page into it, to prevent
- * nonuniform page status in mark_page_accessed() after __lru_cache_add().
+ * Order of operations is important: flush the pagevec when it's already
+ * full, not when adding the last page, to make sure that last page is
+ * not added to the LRU directly when passed to this function. Because
+ * mark_page_accessed() (called after this when writing) only activates
+ * pages that are on the LRU, linear writes in subpage chunks would see
+ * every PAGEVEC_SIZE page activated, which is unexpected.
  */
 void __lru_cache_add(struct page *page, enum lru_list lru)
 {