[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170615145224.66200-1-kirill.shutemov@linux.intel.com>
Date: Thu, 15 Jun 2017 17:52:21 +0300
From: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Vlastimil Babka <vbabka@...e.cz>,
Vineet Gupta <vgupta@...opsys.com>,
Russell King <linux@...linux.org.uk>,
Will Deacon <will.deacon@....com>,
Catalin Marinas <catalin.marinas@....com>,
Ralf Baechle <ralf@...ux-mips.org>,
"David S. Miller" <davem@...emloft.net>,
"Aneesh Kumar K . V" <aneesh.kumar@...ux.vnet.ibm.com>,
Martin Schwidefsky <schwidefsky@...ibm.com>,
Heiko Carstens <heiko.carstens@...ibm.com>,
Andrea Arcangeli <aarcange@...hat.com>
Cc: linux-arch@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Subject: [HELP-NEEDED, PATCHv2 0/3] Do not loose dirty bit on THP pages
Hi,
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 doesn't lead to user-visible misbehaviour in current kernel, but
fixing this would be critical for future work on THP: both huge-ext4 and THP
swap out rely on proper dirty tracking.
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.
I've fixed the issue for x86, but I need help with the rest.
So far THP is supported on 7 architectures, beyond x86:
- arc;
- arm;
- arm64;
- mips;
- power;
- s390;
- sparc;
Please, help me with them.
v2:
- Introduce pmdp_estabish(), instead of pmdp_mknonpresent();
- Change pmdp_invalidate() to return previous value of the pmd;
arch/x86/include/asm/pgtable-3level.h | 18 ++++++++++++++++++
arch/x86/include/asm/pgtable.h | 14 ++++++++++++++
fs/proc/task_mmu.c | 8 ++++----
include/asm-generic/pgtable.h | 2 +-
mm/huge_memory.c | 29 ++++++++++++-----------------
mm/pgtable-generic.c | 9 +++++----
6 files changed, 54 insertions(+), 26 deletions(-)
--
2.11.0
Powered by blists - more mailing lists