@@ -3294,7 +3294,15 @@ static vm_fault_t do_wp_page(struct vm_f
*
* PageKsm() doesn't necessarily raise the page refcount.
*/
- if (PageKsm(page) || page_count(page) > 1 + PageSwapCache(page))
+ if (PageKsm(page) || page_count(page) > 3)
+ goto copy;
+ if (!PageLRU(page))
+ /*
+ * Note: We cannot easily detect+handle references from
+ * remote LRU pagevecs or references to PageLRU() pages.
+ */
+ lru_add_drain();
+ if (page_count(page) > 1 + PageSwapCache(page))
goto copy;
if (!trylock_page(page))
goto copy;