arch/x86/mm/fault.c | 6 ++++++ arch/x86/mm/pgtable.c | 11 ----------- 2 files changed, 6 insertions(+), 11 deletions(-)
This venerable comment got detached from its context when the code moved
in commit 394158559d4c ("x86: move all the pgd_list handling to one
place"). Put it back next to its context. It was originally on
pgd_list_add() but it actually describes pgd_list so put it there.
While moving it, update it to strip away stale and superfluous info.
pageattr.c doesn't exist any more. pgd_list is now required
for all x86 architectures. Also be slightly more precise about what PGDs
are in this list.
Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
Changes in v2:
- Moved it next to pgd_list instead of back to old location
- Strip away stale bits from the comment
- Added note about PGDs that _aren't_ in this list
- Link to v1: https://lore.kernel.org/r/20260311-pgd_list-comment-v1-1-4ea51b41adee@google.com
---
arch/x86/mm/fault.c | 6 ++++++
arch/x86/mm/pgtable.c | 11 -----------
2 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index f0e77e0844820..cf7144d386b87 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -169,6 +169,12 @@ is_prefetch(struct pt_regs *regs, unsigned long error_code, unsigned long addr)
}
DEFINE_SPINLOCK(pgd_lock);
+/*
+ * List of all process' PGD pages (excluding init_mm and some other special
+ * system-wide PGDs); for kernel addresses the lower level pages are mostly
+ * shared but the PGD itself is local to each mm. This list is mainly used to
+ * keep those in sync.
+ */
LIST_HEAD(pgd_list);
#ifdef CONFIG_X86_32
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 2e5ecfdce73c3..2a84fdeca8874 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -99,17 +99,6 @@ static void pgd_dtor(pgd_t *pgd)
spin_unlock(&pgd_lock);
}
-/*
- * List of all pgd's needed for non-PAE so it can invalidate entries
- * in both cached and uncached pgd's; not needed for PAE since the
- * kernel pmd is shared. If PAE were not to share the pmd a similar
- * tactic would be needed. This is essentially codepath-based locking
- * against pageattr.c; it is the unique case in which a valid change
- * of kernel pagetables can't be lazily synchronized by vmalloc faults.
- * vmalloc faults work because attached pagetables are never freed.
- * -- nyc
- */
-
#ifdef CONFIG_X86_PAE
/*
* In PAE mode, we need to do a cr3 reload (=tlb flush) when
---
base-commit: 2ca26dad836fb4cd18694ef85af7a71d2878b239
change-id: 20260311-pgd_list-comment-2ee97876c552
Best regards,
--
Brendan Jackman <jackmanb@google.com>
© 2016 - 2026 Red Hat, Inc.