Commit 07a42788 authored by Mel Gorman's avatar Mel Gorman Committed by Linus Torvalds

mm: shmem: avoid atomic operation during shmem_getpage_gfp

shmem_getpage_gfp uses an atomic operation to set the SwapBacked field
before it's even added to the LRU or visible.  This is unnecessary as what
could it possible race against?  Use an unlocked variant.
Signed-off-by: default avatarMel Gorman <>
Acked-by: default avatarJohannes Weiner <>
Acked-by: default avatarRik van Riel <>
Cc: Vlastimil Babka <>
Cc: Jan Kara <>
Cc: Michal Hocko <>
Cc: Hugh Dickins <>
Cc: Dave Hansen <>
Cc: Theodore Ts'o <>
Cc: "Paul E. McKenney" <>
Cc: Oleg Nesterov <>
Cc: Peter Zijlstra <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent b745bc85
......@@ -208,6 +208,7 @@ PAGEFLAG(Pinned, pinned) TESTSCFLAG(Pinned, pinned) /* Xen */
PAGEFLAG(SavePinned, savepinned); /* Xen */
PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved)
PAGEFLAG(SwapBacked, swapbacked) __CLEARPAGEFLAG(SwapBacked, swapbacked)
__SETPAGEFLAG(SwapBacked, swapbacked)
__PAGEFLAG(SlobFree, slob_free)
......@@ -1132,7 +1132,7 @@ repeat:
goto decused;
error = mem_cgroup_charge_file(page, current->mm,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment