svn commit: r252646 - head/sys/amd64/amd64

Neel Natu neelnatu at gmail.com
Mon Jul 22 21:22:31 UTC 2013


Hi Jean-Sebastien,

On Sun, Jul 21, 2013 at 1:05 AM, Jean-Sébastien Pédron
<dumbbell at freebsd.org> wrote:
> Le 20/07/2013 20:26, Neel Natu a écrit :
>
>> 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.
>
>
> Here's what was logged by your patch:
>
> va = 0x8007da000
> tpte = 0x80000000d2f834f7
> m->phys_addr = 0xd2eaf000
> m->valid = 0
> m->dirty= 0
> m->flags = 4, aflags = 0, oflags = 0
> panic: vm_page_dirty: page is invalid!
>
> So it corresponds to page m[175] in the superpage. I don't know if it helps
> but I checked the remaining pages: they all have '->valid = 0', except a few
> ones (265 to 267, 345, 361 to 363, 379 to 387 and 425 to 431 have '->valid =
> VM_PAGE_BITS_ALL').
>

Thanks a lot for that - it helped a lot!

Could you revert the debug patch earlier and apply the following patch
and give it a spin?

Index: pmap.c
===================================================================
--- pmap.c	(revision 253553)
+++ pmap.c	(working copy)
@@ -4400,7 +4400,7 @@
 	struct rwlock *lock;
 	int64_t bit;
 	uint64_t inuse, bitmask;
-	int allfree, field, freed, idx;
+	int allfree, field, freed, idx, superpage;
 	vm_paddr_t pa;

 	if (pmap != PCPU_GET(curpmap)) {
@@ -4427,12 +4427,15 @@
 				pte = pmap_pdpe_to_pde(pte, pv->pv_va);
 				tpte = *pte;
 				if ((tpte & (PG_PS | PG_V)) == PG_V) {
+					superpage = 0;
 					ptepde = tpte;
 					pte = (pt_entry_t *)PHYS_TO_DMAP(tpte &
 					    PG_FRAME);
 					pte = &pte[pmap_pte_index(pv->pv_va)];
 					tpte = *pte;
-				}
+				} else
+					superpage = 1;
+
 				if ((tpte & PG_V) == 0) {
 					panic("bad pte va %lx pte %lx",
 					    pv->pv_va, tpte);
@@ -4446,7 +4449,7 @@
 					continue;
 				}

-				if (tpte & PG_PS)
+				if (superpage)
 					pa = tpte & PG_PS_FRAME;
 				else
 					pa = tpte & PG_FRAME;
@@ -4468,7 +4471,7 @@
 				 * Update the vm_page_t clean/reference bits.
 				 */
 				if ((tpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) {
-					if ((tpte & PG_PS) != 0) {
+					if (superpage) {
 						for (mt = m; mt < &m[NBPDR / PAGE_SIZE]; mt++)
 							vm_page_dirty(mt);
 					} else
@@ -4479,7 +4482,7 @@

 				/* Mark free */
 				pc->pc_map[field] |= bitmask;
-				if ((tpte & PG_PS) != 0) {
+				if (superpage) {
 					pmap_resident_count_dec(pmap, NBPDR / PAGE_SIZE);
 					pvh = pa_to_pvh(tpte & PG_PS_FRAME);
 					TAILQ_REMOVE(&pvh->pv_list, pv, pv_next);

best
Neel

> --
> Jean-Sébastien Pédron


More information about the svn-src-head mailing list