From owner-cvs-all@FreeBSD.ORG Mon Nov 1 19:31:20 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 C2EBE16A56C for ; Mon, 1 Nov 2004 19:31:18 +0000 (GMT) Received: from mail4.speakeasy.net (mail4.speakeasy.net [216.254.0.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5DA6543D1D for ; Mon, 1 Nov 2004 19:31:17 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 6299 invoked from network); 1 Nov 2004 19:31:17 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 1 Nov 2004 19:31:16 -0000 Received: from [10.50.41.235] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id iA1JV42Q061830; Mon, 1 Nov 2004 14:31:13 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Mike Silbersack Date: Mon, 1 Nov 2004 14:34:28 -0500 User-Agent: KMail/1.6.2 References: <200410291910.i9TJAlNf089795@repoman.freebsd.org> <200410291549.17355.jhb@FreeBSD.org> <20041029174131.A6530@odysseus.silby.com> In-Reply-To: <20041029174131.A6530@odysseus.silby.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200411011434.28141.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx 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: Mon, 01 Nov 2004 19:31:20 -0000 On Friday 29 October 2004 06:51 pm, Mike Silbersack wrote: > On Fri, 29 Oct 2004, John Baldwin wrote: > > On Friday 29 October 2004 03:10 pm, Alan Cox wrote: > >> 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. > > > > -- > > John Baldwin <>< http://www.FreeBSD.org/~jhb/ > > I think we really need some sort of light-weight critical_enter that > simply assures you that you won't get rescheduled to another CPU, but > gives no guarantees beyond that. That's very easy, it's just critical_enter/exit() without the cpu_critical_*(). As mentioned in the SMP "design doc", the cpu_critical_*() are only needed for spin mutexes that are used in both top-half and bottom-half code (where ithreads are top-half, but "fast" interrupts and the code that schedules ithreads are bottom-half). I've thought about shoving cpu_critical_*() off into another API that spin mutexes would use, but that not all critical sections would use, this would give us critical sections that don't block interrupts, but just block preempting. For idle page zeroing though, I'm not sure we really want to use even a cheap critical section since it would still defer an ithread from running, and ithreads are more important than idle page zeroing. Note that you can easily pin the current thread to its current CPU via sched_pin/unpin() and that that works across preemptions. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org