]> Git Repo - linux.git/commit - mm/rmap.c
mm: use __SetPageSwapBacked and dont ClearPageSwapBacked
authorHugh Dickins <[email protected]>
Fri, 20 May 2016 00:12:41 +0000 (17:12 -0700)
committerLinus Torvalds <[email protected]>
Fri, 20 May 2016 02:12:14 +0000 (19:12 -0700)
commitfa9949da59a15017a02c86b087c7499d7b5702be
tree1191eac8b64eb3ba21b1286d9f3842db0388af82
parent9d5e6a9f22311b00a20ff9b072760ad3e73f0d99
mm: use __SetPageSwapBacked and dont ClearPageSwapBacked

v3.16 commit 07a427884348 ("mm: shmem: avoid atomic operation during
shmem_getpage_gfp") rightly replaced one instance of SetPageSwapBacked
by __SetPageSwapBacked, pointing out that the newly allocated page is
not yet visible to other users (except speculative get_page_unless_zero-
ers, who may not update page flags before their further checks).

That was part of a series in which Mel was focused on tmpfs profiles:
but almost all SetPageSwapBacked uses can be so optimized, with the same
justification.

Remove ClearPageSwapBacked from __read_swap_cache_async() error path:
it's not an error to free a page with PG_swapbacked set.

Follow a convention of __SetPageLocked, __SetPageSwapBacked instead of
doing it differently in different places; but that's for tidiness - if
the ordering actually mattered, we should not be using the __variants.

There's probably scope for further __SetPageFlags in other places, but
SwapBacked is the one I'm interested in at the moment.

Signed-off-by: Hugh Dickins <[email protected]>
Cc: "Kirill A. Shutemov" <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Cc: Andres Lagar-Cavilla <[email protected]>
Cc: Yang Shi <[email protected]>
Cc: Ning Qu <[email protected]>
Reviewed-by: Mel Gorman <[email protected]>
Cc: Konstantin Khlebnikov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/migrate.c
mm/rmap.c
mm/shmem.c
mm/swap_state.c
This page took 0.062737 seconds and 4 git commands to generate.