From owner-cvs-all Sat Jan 9 06:43:57 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA05155 for cvs-all-outgoing; Sat, 9 Jan 1999 06:43:57 -0800 (PST) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from helios.dnttm.ru (dnttm-gw.rssi.ru [193.232.0.205]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA05147; Sat, 9 Jan 1999 06:43:49 -0800 (PST) (envelope-from dima@tejblum.dnttm.rssi.ru) Received: (from uucp@localhost) by helios.dnttm.ru (8.9.1/8.9.1/IP-3) with UUCP id RAA12781; Sat, 9 Jan 1999 17:30:50 +0300 Received: from tejblum.dnttm.rssi.ru (localhost [127.0.0.1]) by tejblum.dnttm.rssi.ru (8.9.1/8.9.1) with ESMTP id RAA00524; Sat, 9 Jan 1999 17:30:03 +0300 (MSK) (envelope-from dima@tejblum.dnttm.rssi.ru) Message-Id: <199901091430.RAA00524@tejblum.dnttm.rssi.ru> X-Mailer: exmh version 2.0gamma 1/27/96 To: Stephen McKay cc: Dmitrij Tejblum , cvs-committers@FreeBSD.ORG Subject: Re: cvs commit: src/sys/i386/i386 pmap.c In-reply-to: Your message of "Sat, 09 Jan 1999 23:59:13 +1000." <199901091359.XAA22824@nymph.dtir.qld.gov.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 09 Jan 1999 17:30:03 +0300 From: Dmitrij Tejblum Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk Stephen McKay wrote: > On Thursday, 7th January 1999, Dmitrij Tejblum wrote: > > >dt 1999/01/07 14:15:52 PST > > > > Modified files: > > sys/i386/i386 pmap.c > > Log: > > Make pmap_ts_referenced check more than 1 pv_entry. (One should be carefull > > when move elements to the tail of a list in a loop...) > > > > Revision Changes Path > > 1.216 +5 -5 src/sys/i386/i386/pmap.c > > So it's now a big NOP instead of executing the loop once. Ahh! That is because I made the patch month or two ago, and "simplified" it before commit, when already forgot it ;-/ My original patch appears to be more correct: (btw, I run it on 4 production servers all the time, and didn't notice degradation...) --- pmap.c Sat Dec 12 12:58:24 1998 +++ pmap.c Sat Dec 12 13:38:40 1998 @@ -3205,7 +3205,7 @@ int pmap_ts_referenced(vm_offset_t pa) { - register pv_entry_t pv; + register pv_entry_t pv, pvf, pvn; pv_table_t *ppv; unsigned *pte; int s; @@ -3226,9 +3226,11 @@ /* * Not found, check current mappings returning immediately if found. */ - for (pv = TAILQ_FIRST(&ppv->pv_list); - pv; - pv = TAILQ_NEXT(pv, pv_list)) { + pvf = 0; + for (pv = TAILQ_FIRST(&ppv->pv_list); pv && pv != pvf; pv = pvn) { + if (!pvf) + pvf = pv; + pvn = TAILQ_NEXT(pv, pv_list); TAILQ_REMOVE(&ppv->pv_list, pv, pv_list); /* Thanks for pointiong it out! > There's no need for all that removing and inserting anyway. Zap it and > the bugs will depart for other dark parts of the code. Well, I think since the code was added in March 1998 or so as an optimization, it should make some sense, right? Dima To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message