Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Jul 2013 11:26:19 -0700
From:      Neel Natu <neelnatu@gmail.com>
To:        =?ISO-8859-1?Q?Jean=2DS=E9bastien_P=E9dron?= <dumbbell@freebsd.org>
Cc:        svn-src-head@freebsd.org, neel@freebsd.org
Subject:   Re: svn commit: r252646 - head/sys/amd64/amd64
Message-ID:  <CAFgRE9G=Y-SPrjHXgAu3GwcjvbT0Cc7T6Tm7wNsjA=eLvhfe6Q@mail.gmail.com>
In-Reply-To: <51EABABD.8050906@FreeBSD.org>
References:  <201307032321.r63NLP3w059509@svn.freebsd.org> <51EABABD.8050906@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Jean-Sebastien,

On Sat, Jul 20, 2013 at 9:28 AM, Jean-S=E9bastien P=E9dron
<dumbbell@freebsd.org> wrote:
> Hello Neel!
>
> With commit r252646, I have a "vm_page_dirty: page is invalid!" panic
> almost each time an X11 application or the X.Org server itself exit.
> Everything runs fine if I revert this commit.
>
> FreeBSD is built with the experimental radeonkms driver. As I haven't
> seen any other report of this problem, I suppose I do something wrong in
> TTM or the driver itself.
>
> Here's the core.txt:
> http://people.freebsd.org/~dumbbell/radeonkms/r252646-panic-vm_page_dirty=
-page-is-invalid.core.txt
>
> Do you have any suggestion about what I should look for?
>

I would start looking by looking at the value of the page table entry
in question (this would be 'tpte' in pmap_remove_pages()).

In particular, it would be useful to identify whether this is pointing
to a superpage mapping and if so what page within the superpage is
triggering the "vm_page_dirty: page is invalid" panic.

The following patch may help to do that (but I haven't actually tested it):

Index: pmap.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- pmap.c	(revision 253505)
+++ pmap.c	(working copy)
@@ -4379,6 +4379,20 @@
 	return (rv);
 }

+static void
+pmap_check_valid(vm_page_t m, vm_offset_t va, pt_entry_t tpte)
+{
+	if (m->valid !=3D VM_PAGE_BITS_ALL) {
+		printf("va =3D %#lx\n", va);
+		printf("tpte =3D %#lx\n", tpte);
+		printf("m->phys_addr =3D %#lx\n", m->phys_addr);
+		printf("m->valid =3D %#x\n", m->valid);
+		printf("m->dirty=3D %#x\n", m->dirty);
+		printf("m->flags =3D %x, aflags =3D %x, oflags =3D %x\n",
+			m->flags, m->aflags, m->oflags);
+	}
+}
+
 /*
  * Remove all pages from specified address space
  * this aids process exit speeds.  Also, this code
@@ -4469,10 +4483,14 @@
 				 */
 				if ((tpte & (PG_M | PG_RW)) =3D=3D (PG_M | PG_RW)) {
 					if ((tpte & PG_PS) !=3D 0) {
-						for (mt =3D m; mt < &m[NBPDR / PAGE_SIZE]; mt++)
+						for (mt =3D m; mt < &m[NBPDR / PAGE_SIZE]; mt++) {
+							pmap_check_valid(mt, pv->pv_va, tpte);
 							vm_page_dirty(mt);
-					} else
+						}
+					} else {
+						pmap_check_valid(m, pv->pv_va, tpte);
 						vm_page_dirty(m);
+					}
 				}

 				CHANGE_PV_LIST_LOCK_TO_VM_PAGE(&lock, m);

best
Neel

> --
> Jean-S=E9bastien P=E9dron
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFgRE9G=Y-SPrjHXgAu3GwcjvbT0Cc7T6Tm7wNsjA=eLvhfe6Q>