All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>,
	LKML <linux-kernel@vger.kernel.org>,
	Gavin Shan <gshan@redhat.com>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Gerald Schaefer <gerald.schaefer@linux.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"the arch/x86 maintainers" <x86@kernel.org>
Subject: Re: [BUG] WARNING: CPU: 3 PID: 1 at mm/debug_vm_pgtable.c:493
Date: Tue, 12 Oct 2021 12:15:40 -0700	[thread overview]
Message-ID: <CAHk-=wg6fw130AkO72GPFow9PHvP9odnC5LZ0UaY9bJQuF-C5A@mail.gmail.com> (raw)
In-Reply-To: <20211012145540.343541e9@gandalf.local.home>

[-- Attachment #1: Type: text/plain, Size: 746 bytes --]

On Tue, Oct 12, 2021 at 11:55 AM Steven Rostedt <rostedt@goodmis.org> wrote:
>
>
> I saved off that warning from a different branch, and looking at the dmesg,
> it is:
>
>   Linux version 5.14.0-rc2-test+
>
> Which shows this happened on 5.14 as well (and explains why the line
> numbers are different).

Ok, yes, that's the exact same "pud_set_huge()" failure.

So it's the same issue, and has been going on for a while, and
presumably very few people end up enabling DEBUG_VM_PGTABLE (together
with it being hard to trigger).

Or it's something specific to your setup, but that sounds unlikely.

You might add some debugging to the x86 pud_set_huge() function,
something like the attached (obviously entirely untested) patch.

           Linus

[-- Attachment #2: patch.diff --]
[-- Type: text/x-patch, Size: 904 bytes --]

 arch/x86/mm/pgtable.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 3481b35cb4ec..0a3d67ec73d4 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -706,12 +706,16 @@ int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot)
 
 	mtrr = mtrr_type_lookup(addr, addr + PUD_SIZE, &uniform);
 	if ((mtrr != MTRR_TYPE_INVALID) && (!uniform) &&
-	    (mtrr != MTRR_TYPE_WRBACK))
+	    (mtrr != MTRR_TYPE_WRBACK)) {
+		pr_debug("mtrr_type_lookup() returned %d (%d)\n", mtrr, uniform);
 		return 0;
+	}
 
 	/* Bail out if we are we on a populated non-leaf entry: */
-	if (pud_present(*pud) && !pud_huge(*pud))
+	if (pud_present(*pud) && !pud_huge(*pud)) {
+		pr_debug("pud is already present (%lx)\n", (unsigned long)pud_val(*pud));
 		return 0;
+	}
 
 	set_pte((pte_t *)pud, pfn_pte(
 		(u64)addr >> PAGE_SHIFT,

  reply	other threads:[~2021-10-12 19:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-12 18:11 [BUG] WARNING: CPU: 3 PID: 1 at mm/debug_vm_pgtable.c:493 Steven Rostedt
2021-10-12 18:34 ` Linus Torvalds
2021-10-12 18:55   ` Steven Rostedt
2021-10-12 19:15     ` Linus Torvalds [this message]
2021-10-12 19:19       ` Steven Rostedt
2021-10-13 21:37       ` Steven Rostedt
2021-10-22 12:38       ` Steven Rostedt
2021-10-22 19:34         ` Linus Torvalds
2021-10-22 21:19           ` Steven Rostedt
2021-11-18 16:47           ` Steven Rostedt
2021-11-18 18:33             ` Linus Torvalds
2021-11-18 18:52               ` Steven Rostedt
2021-11-22  6:31               ` Anshuman Khandual
2021-10-13  4:10   ` Anshuman Khandual
2021-10-13 14:27     ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHk-=wg6fw130AkO72GPFow9PHvP9odnC5LZ0UaY9bJQuF-C5A@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=bp@alien8.de \
    --cc=christophe.leroy@csgroup.eu \
    --cc=dave.hansen@linux.intel.com \
    --cc=gerald.schaefer@linux.ibm.com \
    --cc=gshan@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.