From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 21:22:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 094AB964; Mon, 22 Jul 2013 21:22:31 +0000 (UTC) (envelope-from neelnatu@gmail.com) Received: from mail-ie0-x22c.google.com (mail-ie0-x22c.google.com [IPv6:2607:f8b0:4001:c03::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C06542592; Mon, 22 Jul 2013 21:22:30 +0000 (UTC) Received: by mail-ie0-f172.google.com with SMTP id 17so4227825iea.31 for ; Mon, 22 Jul 2013 14:22:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=k5QWXOCsYy/t8Txj4k2rX7RFdkn9OJ5c8QVSdy4oNmI=; b=K5thC2+8TuZf86I/g7p7IFtIAuEeahrT7F7GL7kccp82KisjSUN9fVvRwqvs+LyNMm WP4b6u5iNb79oaVFzU5k5XDlummu3dxJ1Mce2NcEn53Z/kIeJvamXg3Q9K4FJVyN0Qpy pmmPYLxHU1PEqxmKm2pdh6qjeBNKt4SJYiUmH0UcmYuyNBgyFBrN29NPmfF4dmPHMa/5 S4wPL2lJT95RSPQ1ANiOaYqcfCzNq4DA8Xf+ERow5yXYqpjZN8Mgsxnf/nLYB5ZM4pU3 upt4RW5v0VERqAGYxPEYrLfIHFAuCX1F1MtfQ20odmBdt0cZKYGsQmqtMkn61hprWOjq +j+g== MIME-Version: 1.0 X-Received: by 10.50.126.99 with SMTP id mx3mr20113282igb.48.1374528150338; Mon, 22 Jul 2013 14:22:30 -0700 (PDT) Received: by 10.42.151.74 with HTTP; Mon, 22 Jul 2013 14:22:30 -0700 (PDT) In-Reply-To: <51EB962E.3090405@FreeBSD.org> References: <201307032321.r63NLP3w059509@svn.freebsd.org> <51EABABD.8050906@FreeBSD.org> <51EB962E.3090405@FreeBSD.org> Date: Mon, 22 Jul 2013 14:22:30 -0700 Message-ID: Subject: Re: svn commit: r252646 - head/sys/amd64/amd64 From: Neel Natu To: =?ISO-8859-1?Q?Jean=2DS=E9bastien_P=E9dron?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, neel@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 21:22:31 -0000 Hi Jean-Sebastien, On Sun, Jul 21, 2013 at 1:05 AM, Jean-S=E9bastien P=E9dron wrote: > Le 20/07/2013 20:26, Neel Natu a =E9crit : > >> 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 =3D 0x8007da000 > tpte =3D 0x80000000d2f834f7 > m->phys_addr =3D 0xd2eaf000 > m->valid =3D 0 > m->dirty=3D 0 > m->flags =3D 4, aflags =3D 0, oflags =3D 0 > panic: vm_page_dirty: page is invalid! > > So it corresponds to page m[175] in the superpage. I don't know if it hel= ps > but I checked the remaining pages: they all have '->valid =3D 0', except = a few > ones (265 to 267, 345, 361 to 363, 379 to 387 and 425 to 431 have '->vali= d =3D > 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 =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 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 !=3D PCPU_GET(curpmap)) { @@ -4427,12 +4427,15 @@ pte =3D pmap_pdpe_to_pde(pte, pv->pv_va); tpte =3D *pte; if ((tpte & (PG_PS | PG_V)) =3D=3D PG_V) { + superpage =3D 0; ptepde =3D tpte; pte =3D (pt_entry_t *)PHYS_TO_DMAP(tpte & PG_FRAME); pte =3D &pte[pmap_pte_index(pv->pv_va)]; tpte =3D *pte; - } + } else + superpage =3D 1; + if ((tpte & PG_V) =3D=3D 0) { panic("bad pte va %lx pte %lx", pv->pv_va, tpte); @@ -4446,7 +4449,7 @@ continue; } - if (tpte & PG_PS) + if (superpage) pa =3D tpte & PG_PS_FRAME; else pa =3D tpte & PG_FRAME; @@ -4468,7 +4471,7 @@ * Update the vm_page_t clean/reference bits. */ if ((tpte & (PG_M | PG_RW)) =3D=3D (PG_M | PG_RW)) { - if ((tpte & PG_PS) !=3D 0) { + if (superpage) { for (mt =3D m; mt < &m[NBPDR / PAGE_SIZE]; mt++) vm_page_dirty(mt); } else @@ -4479,7 +4482,7 @@ /* Mark free */ pc->pc_map[field] |=3D bitmask; - if ((tpte & PG_PS) !=3D 0) { + if (superpage) { pmap_resident_count_dec(pmap, NBPDR / PAGE_SIZE); pvh =3D pa_to_pvh(tpte & PG_PS_FRAME); TAILQ_REMOVE(&pvh->pv_list, pv, pv_next); best Neel > -- > Jean-S=E9bastien P=E9dron