diff --git a/mm/vmscan.c b/mm/vmscan.c index fbcac3bdcf1965c3997966ffb5b3979f33684290..777af57fd8c8c80971d7abaf4edb974e360288c9 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -544,6 +544,16 @@ void putback_lru_page(struct page *page) */ lru = LRU_UNEVICTABLE; add_page_to_unevictable_list(page); + /* + * When racing with an mlock clearing (page is + * unlocked), make sure that if the other thread does + * not observe our setting of PG_lru and fails + * isolation, we see PG_mlocked cleared below and move + * the page back to the evictable list. + * + * The other side is TestClearPageMlocked(). + */ + smp_mb(); } /*