From owner-svn-src-head@FreeBSD.ORG Sat Jul 20 18:26:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 317F772A; Sat, 20 Jul 2013 18:26:20 +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]) by mx1.freebsd.org (Postfix) with ESMTP id E9004F3E; Sat, 20 Jul 2013 18:26:19 +0000 (UTC) Received: by mail-ie0-f172.google.com with SMTP id 13so673640iea.31 for ; Sat, 20 Jul 2013 11:26:19 -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=v/iYkamH50RsqMlroDRu6BxEI9BlvNQIzzcbrIE4Ie8=; b=IseLvbzJZvPhurxJq75gytOXp5Dw6WMxAJScgPxswMmD8Z+xFg8sBD95+GA4iq6iwA t77rJcLz6qkODZQfV6zMDnk4N2CmfTdIFchbSrpar5XIK9mwHdrQrGKM0CiGwLz+YHjz 02y0emVINNErxAAJsm+BAtIQA8ANiVfEQhv5CgznFOWidSkr5FgbB1seYJW48m0pG5gM Q/nGaM8pJb5igRAg5bbLu1G7xgaDN+IP/jLn/r0OhDqtAQNDao0CogJvpOqMeg7qKDWd v6bQXExnbtqFS9B8ck4wZmGTffGCnwi1SGS9RiCOw8qMOqkuHfCxFg/q70HZPRwIRt5v xh2Q== MIME-Version: 1.0 X-Received: by 10.43.159.73 with SMTP id lx9mr14245781icc.59.1374344779690; Sat, 20 Jul 2013 11:26:19 -0700 (PDT) Received: by 10.42.151.74 with HTTP; Sat, 20 Jul 2013 11:26:19 -0700 (PDT) In-Reply-To: <51EABABD.8050906@FreeBSD.org> References: <201307032321.r63NLP3w059509@svn.freebsd.org> <51EABABD.8050906@FreeBSD.org> Date: Sat, 20 Jul 2013 11:26:19 -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: Sat, 20 Jul 2013 18:26:20 -0000 Hi Jean-Sebastien, On Sat, Jul 20, 2013 at 9:28 AM, Jean-S=E9bastien P=E9dron 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 >