For the exclusive reference page, the non-atomic operations is enough,
so replace them to non-atomic operations.

Signed-off-by: Muchun Song <[email protected]>
---
 include/linux/page-flags.h | 2 ++
 mm/memory.c                | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index fbbb841a9346..ec039dde5e4b 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -401,6 +401,8 @@ static __always_inline int PageSwapCache(struct page *page)
 }
 SETPAGEFLAG(SwapCache, swapcache, PF_NO_TAIL)
 CLEARPAGEFLAG(SwapCache, swapcache, PF_NO_TAIL)
+__SETPAGEFLAG(SwapCache, swapcache, PF_NO_TAIL)
+__CLEARPAGEFLAG(SwapCache, swapcache, PF_NO_TAIL)
 #else
 PAGEFLAG_FALSE(SwapCache)
 #endif
diff --git a/mm/memory.c b/mm/memory.c
index 2d267ef6621a..02dd62da26e0 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3128,10 +3128,10 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
                                set_page_private(page, entry.val);
 
                                /* Tell memcg to use swap ownership records */
-                               SetPageSwapCache(page);
+                               __SetPageSwapCache(page);
                                err = mem_cgroup_charge(page, vma->vm_mm,
                                                        GFP_KERNEL);
-                               ClearPageSwapCache(page);
+                               __ClearPageSwapCache(page);
                                if (err) {
                                        ret = VM_FAULT_OOM;
                                        goto out_page;
-- 
2.20.1

Reply via email to