From owner-cvs-all@FreeBSD.ORG Fri Oct 29 21:18:29 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A401F16A4CE; Fri, 29 Oct 2004 21:18:29 +0000 (GMT) Received: from cs.rice.edu (cs.rice.edu [128.42.1.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F34743D39; Fri, 29 Oct 2004 21:18:29 +0000 (GMT) (envelope-from alc@cs.rice.edu) Received: from localhost (calypso.cs.rice.edu [128.42.1.127]) by cs.rice.edu (Postfix) with ESMTP id 0658E4AA06; Fri, 29 Oct 2004 16:18:29 -0500 (CDT) Received: from cs.rice.edu ([128.42.1.30]) by localhost (calypso.cs.rice.edu [128.42.1.127]) (amavisd-new, port 10024) with LMTP id 18083-01-41; Fri, 29 Oct 2004 16:18:28 -0500 (CDT) Received: by cs.rice.edu (Postfix, from userid 19572) id 97A1F4A9F3; Fri, 29 Oct 2004 16:18:28 -0500 (CDT) Date: Fri, 29 Oct 2004 16:18:27 -0500 From: Alan Cox To: John Baldwin Message-ID: <20041029211827.GE16680@cs.rice.edu> References: <200410291910.i9TJAlNf089795@repoman.freebsd.org> <200410291549.17355.jhb@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200410291549.17355.jhb@FreeBSD.org> User-Agent: Mutt/1.4.2i X-Virus-Scanned: by amavis-20030616-p7 at cs.rice.edu cc: Alan Cox cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/i386/i386 pmap.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2004 21:18:30 -0000 On Fri, Oct 29, 2004 at 03:49:17PM -0400, John Baldwin wrote: > On Friday 29 October 2004 03:10 pm, Alan Cox wrote: > > alc 2004-10-29 19:10:47 UTC > > > > FreeBSD src repository > > > > Modified files: > > sys/i386/i386 pmap.c > > Log: > > Implement per-CPU SYSMAPs, i.e., CADDR* and CMAP*, to reduce lock > > contention within pmap_zero_page() and pmap_copy_page(). > > Cool. One note: I think you have to move the sched_pin before the lookup in > the sysmaps_pcpu[] table so you don't migrate to another CPU if you get an > interrupt after you've locked the sysmap. I'm curious if can get rid of the > sysmaps lock altogether actually. It might require a critical section to do > so though, and zero'ing page(s) is probably too long to defer interrupts. > If an interrupt and migration occurs, it could result in contention for the lock but not a correctness problem. However, what you suggest does have the virtue of making the code more obviously correctness. As far as using a critical section, how long is too long for deferring interrupts? I measured the cost of pmap_zero_page() at ~5400 cycles on a 400MHz FSB Xeon. The cost of pmap_copy_page() is much higher, but I don't recall what it is. Alan