linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv3 00/11] Do not loose dirty bit on THP pages
@ 2017-09-12 15:39 Kirill A. Shutemov
  2017-09-12 15:39 ` [PATCHv3 01/11] asm-generic: Provide generic_pmdp_establish() Kirill A. Shutemov
                   ` (10 more replies)
  0 siblings, 11 replies; 15+ messages in thread
From: Kirill A. Shutemov @ 2017-09-12 15:39 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Vineet Gupta, Russell King,
	Will Deacon, Catalin Marinas, Ralf Baechle, David S. Miller,
	Aneesh Kumar K . V, Martin Schwidefsky, Heiko Carstens,
	Andrea Arcangeli
  Cc: linux-arch, linux-mm, linux-kernel, Kirill A. Shutemov

Vlastimil noted that pmdp_invalidate() is not atomic and we can loose
dirty and access bits if CPU sets them after pmdp dereference, but
before set_pmd_at().

The bug can lead to data loss, but the race window is tiny and I haven't
seen any reports that suggested that it happens in reality. So I don't
think it worth sending it to stable.

Unfortunately, there's no way to address the issue in a generic way. We need to
fix all architectures that support THP one-by-one.

All architectures that have THP supported have to provide atomic
pmdp_invalidate() that returns previous value.

If generic implementation of pmdp_invalidate() is used, architecture needs to
provide atomic pmdp_estabish().

pmdp_estabish() is not used out-side generic implementation of
pmdp_invalidate() so far, but I think this can change in the future.

Aneesh Kumar K.V (2):
  powerpc/mm: update pmdp_invalidate to return old pmd value
  sparc64: update pmdp_invalidate to return old pmd value

Catalin Marinas (1):
  arm64: Provide pmdp_establish() helper

Kirill A. Shutemov (7):
  asm-generic: Provide generic_pmdp_establish()
  arc: Use generic_pmdp_establish as pmdp_establish
  arm/mm: Provide pmdp_establish() helper
  mips: Use generic_pmdp_establish as pmdp_establish
  x86/mm: Provide pmdp_establish() helper
  mm: Do not loose dirty and access bits in pmdp_invalidate()
  mm: Use updated pmdp_invalidate() interface to track dirty/accessed
    bits

Martin Schwidefsky (1):
  s390/mm: Modify pmdp_invalidate to return old value.

 arch/arc/include/asm/hugepage.h              |  3 +++
 arch/arm/include/asm/pgtable-3level.h        |  3 +++
 arch/arm64/include/asm/pgtable.h             |  7 ++++++
 arch/mips/include/asm/pgtable.h              |  3 +++
 arch/powerpc/include/asm/book3s/64/pgtable.h |  4 +--
 arch/powerpc/mm/pgtable-book3s64.c           |  7 ++++--
 arch/s390/include/asm/pgtable.h              |  5 ++--
 arch/sparc/include/asm/pgtable_64.h          |  2 +-
 arch/sparc/mm/tlb.c                          | 23 +++++++++++++----
 arch/x86/include/asm/pgtable-3level.h        | 37 +++++++++++++++++++++++++++-
 arch/x86/include/asm/pgtable.h               | 15 +++++++++++
 fs/proc/task_mmu.c                           |  8 +++---
 include/asm-generic/pgtable.h                | 17 ++++++++++++-
 mm/huge_memory.c                             | 29 +++++++++-------------
 mm/pgtable-generic.c                         |  6 ++---
 15 files changed, 131 insertions(+), 38 deletions(-)

-- 
2.14.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-12-13 10:14 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-12 15:39 [PATCHv3 00/11] Do not loose dirty bit on THP pages Kirill A. Shutemov
2017-09-12 15:39 ` [PATCHv3 01/11] asm-generic: Provide generic_pmdp_establish() Kirill A. Shutemov
2017-09-12 15:39 ` [PATCHv3 02/11] arc: Use generic_pmdp_establish as pmdp_establish Kirill A. Shutemov
2017-09-12 15:39 ` [PATCHv3 03/11] arm/mm: Provide pmdp_establish() helper Kirill A. Shutemov
2017-09-12 15:39 ` [PATCHv3 04/11] arm64: " Kirill A. Shutemov
2017-09-12 15:39 ` [PATCHv3 05/11] mips: Use generic_pmdp_establish as pmdp_establish Kirill A. Shutemov
2017-09-12 15:39 ` [PATCHv3 06/11] powerpc/mm: update pmdp_invalidate to return old pmd value Kirill A. Shutemov
2017-09-12 15:39 ` [PATCHv3 07/11] s390/mm: Modify pmdp_invalidate to return old value Kirill A. Shutemov
2017-09-12 15:39 ` [PATCHv3 08/11] sparc64: update pmdp_invalidate to return old pmd value Kirill A. Shutemov
2017-09-13  5:06   ` Aneesh Kumar K.V
2017-09-12 15:39 ` [PATCHv3 09/11] x86/mm: Provide pmdp_establish() helper Kirill A. Shutemov
2017-09-12 15:39 ` [PATCHv3 10/11] mm: Do not loose dirty and access bits in pmdp_invalidate() Kirill A. Shutemov
2017-09-12 15:39 ` [PATCHv3 11/11] mm: Use updated pmdp_invalidate() interface to track dirty/accessed bits Kirill A. Shutemov
2017-09-13  2:08   ` Aneesh Kumar K.V
2017-12-13 10:13     ` Kirill A. Shutemov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).