]> Git Repo - linux.git/commit
mm: make swapoff more robust against soft dirty
authorHugh Dickins <[email protected]>
Sat, 16 Jan 2016 00:57:34 +0000 (16:57 -0800)
committerLinus Torvalds <[email protected]>
Sat, 16 Jan 2016 01:56:32 +0000 (17:56 -0800)
commit9f8bdb3f3dad3f8f20df3e8903316cd5bb1c408e
tree5e1eb6e9a27377d4738ada576a2456629a310a27
parent88f306b68cbb36e500da4b9601b2e3d13dd683c4
mm: make swapoff more robust against soft dirty

Both s390 and powerpc have hit the issue of swapoff hanging, when
CONFIG_HAVE_ARCH_SOFT_DIRTY and CONFIG_MEM_SOFT_DIRTY ifdefs were not
quite as x86_64 had them.  I think it would be much clearer if
HAVE_ARCH_SOFT_DIRTY was just a Kconfig option set by architectures to
determine whether the MEM_SOFT_DIRTY option should be offered, and the
actual code depend upon CONFIG_MEM_SOFT_DIRTY alone.

But won't embark on that change myself: instead make swapoff more
robust, by using pte_swp_clear_soft_dirty() on each pte it encounters,
without an explicit #ifdef CONFIG_MEM_SOFT_DIRTY.  That being a no-op,
whether the bit in question is defined as 0 or the asm-generic fallback
is used, unless soft dirty is fully turned on.

Why "maybe" in maybe_same_pte()? Rename it pte_same_as_swp().

Signed-off-by: Hugh Dickins <[email protected]>
Reviewed-by: Aneesh Kumar K.V <[email protected]>
Acked-by: Cyrill Gorcunov <[email protected]>
Cc: Laurent Dufour <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/swapfile.c
This page took 0.049826 seconds and 4 git commands to generate.