From owner-freebsd-arm@FreeBSD.ORG Mon Jul 6 18:36:29 2009 Return-Path: Delivered-To: freebsd-arm@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69AD41065672; Mon, 6 Jul 2009 18:36:29 +0000 (UTC) (envelope-from tinguely@casselton.net) Received: from casselton.net (casselton.net [63.165.140.2]) by mx1.freebsd.org (Postfix) with ESMTP id 267098FC0A; Mon, 6 Jul 2009 18:36:28 +0000 (UTC) (envelope-from tinguely@casselton.net) Received: from casselton.net (localhost [127.0.0.1]) by casselton.net (8.14.3/8.14.3) with ESMTP id n66IaS5p068049; Mon, 6 Jul 2009 13:36:28 -0500 (CDT) (envelope-from tinguely@casselton.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=casselton.net; s=ccnMail; t=1246905388; bh=XS5k2+K/04smeUgYKX1Nr3MPtodOota1z462PF6tucw=; h=Date:From:Message-Id:To:Subject:Cc:In-Reply-To; b=iZHyVRHm4KFaJboN9hs73r4aoYoiw8pWMEbOupFdkoWo7F0KwFyHhrVvmvimVhMU3 m3D2snGjGqDRxptTPrSLJfjEl9wDuGykBKaj0ub1p7e/7bBypYusv38+T9ZvKHob/m zD80Lnfp5jY80ZFwQO0V5qINgh5YFcTpaHf1CTKs= Received: (from tinguely@localhost) by casselton.net (8.14.3/8.14.2/Submit) id n66IaRSc068048; Mon, 6 Jul 2009 13:36:27 -0500 (CDT) (envelope-from tinguely) Date: Mon, 6 Jul 2009 13:36:27 -0500 (CDT) From: Mark Tinguely Message-Id: <200907061836.n66IaRSc068048@casselton.net> To: mih@semihalf.com, stas@FreeBSD.org In-Reply-To: <20090706134612.5cf860e4.stas@FreeBSD.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.2 (casselton.net [127.0.0.1]); Mon, 06 Jul 2009 13:36:28 -0500 (CDT) Cc: freebsd-arm@FreeBSD.org, tinguely@casselton.net Subject: Re: pmap problem in FreeBSD current X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 18:36:29 -0000 One quick observation: in pmap_nuke_pv(), lower if statement cleans out the pv_list when there is no other mapping besides the kernel mapping. If I remember correctly, this was put in at the last minute. we had to remove the kernel mapping because the page went back to the one of the queues and the kernel mapping caused a panic. When the kernel mapping is removed from the other-wise empty pv_list, the PG_WRITABLE is turned off like is done when the pv_entry list is normally emptied. But at this point, we know that there still is a kernel mapping and the pmap_enter() should have enabled the PG_WRITABLE flag because kernel mappings should be writable. In my opinion, that flag should be enabled. Does it make sense that we should leave the page modified bit or will it panic on the freeing of the page? if (pv != NULL && (pv->pv_flags & PVF_UNMAN) && TAILQ_NEXT(pv, pv_list) == NULL) { pg->md.pv_kva = pv->pv_va; /* a recursive pmap_nuke_pv */ TAILQ_REMOVE(&pg->md.pv_list, pv, pv_list); TAILQ_REMOVE(&pm->pm_pvlist, pv, pv_plist); if (pv->pv_flags & PVF_WIRED) --pm->pm_stats.wired_count; pg->md.pvh_attrs &= ~PVF_REF; - pg->md.pvh_attrs &= ~PVF_MOD; - vm_page_flag_clear(pg, PG_WRITEABLE); pmap_free_pv_entry(pv); }