[PATCH] thp: document barrier() in wrprotect THP fault path

From: Andrea Arcangeli
Date: Fri Aug 03 2012 - 15:10:44 EST


Inline doc.

Signed-off-by: Andrea Arcangeli <aarcange@xxxxxxxxxx>
---
mm/memory.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/mm/memory.c b/mm/memory.c
index 420a449..9ec5bba 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3522,6 +3522,12 @@ retry:
pmd_t orig_pmd = *pmd;
int ret;

+ /*
+ * flush orig_pmd on the stack to avoid invalidating
+ * the pmd_trans_huge(orig_pmd) check and to allow
+ * do_huge_pmd_wp_page to run a reliable
+ * pmd_same(*pmd, orig_pmd).
+ */
barrier();
if (pmd_trans_huge(orig_pmd)) {
if (flags & FAULT_FLAG_WRITE &&
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/