to replace pgdat lru_lock.

Signed-off-by: Alex Shi <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Jason Gunthorpe <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Peng Fan <[email protected]>
Cc: Nikolay Borisov <[email protected]>
Cc: Ira Weiny <[email protected]>
Cc: Andrey Ryabinin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
 mm/swap.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/mm/swap.c b/mm/swap.c
index 2a8fe6df08fc..d2dad08fcfd0 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -325,11 +325,14 @@ static inline void activate_page_drain(int cpu)
 void activate_page(struct page *page)
 {
        pg_data_t *pgdat = page_pgdat(page);
+       struct lruvec *lruvec;
 
        page = compound_head(page);
-       spin_lock_irq(&pgdat->lruvec.lru_lock);
+       lruvec = mem_cgroup_page_lruvec(page, pgdat);
+       spin_lock_irq(&lruvec->lru_lock);
+       sync_lruvec_pgdat(lruvec, pgdat);
        __activate_page(page, mem_cgroup_page_lruvec(page, pgdat), NULL);
-       spin_unlock_irq(&pgdat->lruvec.lru_lock);
+       spin_unlock_irq(&lruvec->lru_lock);
 }
 #endif
 
-- 
1.8.3.1

Reply via email to