From owner-svn-src-all@FreeBSD.ORG Thu Jun 12 16:47:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9B05F9F; Thu, 12 Jun 2014 16:47:01 +0000 (UTC) Received: from pp1.rice.edu (proofpoint1.mail.rice.edu [128.42.201.100]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0A1A2038; Thu, 12 Jun 2014 16:47:01 +0000 (UTC) Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.14.5/8.14.5) with SMTP id s5CGkblm030652; Thu, 12 Jun 2014 11:46:54 -0500 Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by pp1.rice.edu with ESMTP id 1megfvrqnk-1; Thu, 12 Jun 2014 11:46:53 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id 463C1460221; Thu, 12 Jun 2014 11:46:53 -0500 (CDT) Message-ID: <5399D97C.5090608@rice.edu> Date: Thu, 12 Jun 2014 11:46:52 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: John-Mark Gurney , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r267408 - head/sys/arm/arm References: <201406121631.s5CGVFm4033297@svn.freebsd.org> In-Reply-To: <201406121631.s5CGVFm4033297@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 kscore.compositescore=0 circleOfTrustscore=0 compositescore=0.713890987064109 urlsuspect_oldscore=0.713890987064109 suspectscore=4 recipient_domain_to_sender_totalscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=1 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=0 rbsscore=0.713890987064109 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1406120195 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 16:47:02 -0000 On 06/12/2014 11:31, John-Mark Gurney wrote: > Author: jmg > Date: Thu Jun 12 16:31:15 2014 > New Revision: 267408 > URL: http://svnweb.freebsd.org/changeset/base/267408 > > Log: > clear the write bit... This allows my AVILA board to survive a > portsnap extract, where previously it would panic.. clearly someone > who knows pmap should optimize this code per alc's comment... > > Submitted by: alc > MFC after: probably Yes, 10.x definitely needs this change. I'm less certain about 9.x, but it's not going to break anything if you do commit it to 9.x. > Modified: > head/sys/arm/arm/pmap.c > > Modified: head/sys/arm/arm/pmap.c > ============================================================================== > --- head/sys/arm/arm/pmap.c Thu Jun 12 16:26:26 2014 (r267407) > +++ head/sys/arm/arm/pmap.c Thu Jun 12 16:31:15 2014 (r267408) > @@ -3034,7 +3034,14 @@ pmap_remove_all(vm_page_t m) > if (TAILQ_EMPTY(&m->md.pv_list)) > return; > rw_wlock(&pvh_global_lock); > - pmap_remove_write(m); > + > + /* > + * XXX This call shouldn't exist. Iterating over the PV list twice, > + * once in pmap_clearbit() and again below, is both unnecessary and > + * inefficient. The below code should itself write back the cache > + * entry before it destroys the mapping. > + */ > + pmap_clearbit(m, PVF_WRITE); > curpm = vmspace_pmap(curproc->p_vmspace); > while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { > if (flush == FALSE && (pv->pv_pmap == curpm || > @@ -3043,7 +3050,7 @@ pmap_remove_all(vm_page_t m) > > PMAP_LOCK(pv->pv_pmap); > /* > - * Cached contents were written-back in pmap_remove_write(), > + * Cached contents were written-back in pmap_clearbit(), > * but we still have to invalidate the cache entry to make > * sure stale data are not retrieved when another page will be > * mapped under this virtual address. > >