proc: convert to kstrto*()/kstrto*_from_user()
[cascardo/linux.git] / mm / vmscan.c
index 0b1aab4..2d978b2 100644 (file)
@@ -985,7 +985,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
                 *    __GFP_IO|__GFP_FS for this reason); but more thought
                 *    would probably show more reasons.
                 *
-                * 3) Legacy memcg encounters a page that is not already marked
+                * 3) Legacy memcg encounters a page that is already marked
                 *    PageReclaim. memcg does not have any dirty pages
                 *    throttling so we could easily OOM just because too many
                 *    pages are in writeback and there is nothing else to
@@ -1015,12 +1015,15 @@ static unsigned long shrink_page_list(struct list_head *page_list,
                                 */
                                SetPageReclaim(page);
                                nr_writeback++;
-
                                goto keep_locked;
 
                        /* Case 3 above */
                        } else {
+                               unlock_page(page);
                                wait_on_page_writeback(page);
+                               /* then go back and try same page again */
+                               list_add_tail(&page->lru, page_list);
+                               continue;
                        }
                }
 
@@ -1196,7 +1199,7 @@ cull_mlocked:
                if (PageSwapCache(page))
                        try_to_free_swap(page);
                unlock_page(page);
-               putback_lru_page(page);
+               list_add(&page->lru, &ret_pages);
                continue;
 
 activate_locked: