From owner-freebsd-current@FreeBSD.ORG Sun Mar 29 02:17:34 2009 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A73E1065674; Sun, 29 Mar 2009 02:17:34 +0000 (UTC) (envelope-from ssouhlal@FreeBSD.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 2F9D98FC27; Sun, 29 Mar 2009 02:17:34 +0000 (UTC) (envelope-from ssouhlal@FreeBSD.org) Received: from [192.168.0.100] (c-67-188-86-214.hsd1.ca.comcast.net [67.188.86.214]) by elvis.mu.org (Postfix) with ESMTP id C181D1A3C1A; Sat, 28 Mar 2009 19:01:15 -0700 (PDT) In-Reply-To: <49CD1B3D.3030103@samsco.org> References: <11609492.9579.1238167614335.JavaMail.root@vms070.mailsrvcs.net> <49CD0405.1060704@samsco.org> <49CD1B3D.3030103@samsco.org> Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <04EDFED9-24B4-404C-96F7-2C96FBC300B4@FreeBSD.org> Content-Transfer-Encoding: 7bit From: Suleiman Souhlal Date: Sat, 28 Mar 2009 19:01:16 -0700 To: Scott Long X-Mailer: Apple Mail (2.753.1) Cc: Sergey Babkin , freebsd-hackers@FreeBSD.org, attilio@FreeBSD.org, phk@phk.freebsd.dk, freebsd-current@FreeBSD.org, Robert Watson , prashant.vaibhav@gmail.com Subject: Re: Improving the kernel/i386 timecounter performance (GSoC proposal) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 02:17:34 -0000 On Mar 27, 2009, at 11:30 AM, Scott Long wrote: > Robert Watson wrote: >> On Fri, 27 Mar 2009, Scott Long wrote: >>> I've been talking about this for years. All I need is help with >>> the VM magic to create the page on fork. I also want two pages, >>> one global for gettimeofday (and any other global data we can >>> think of) and one per-process for static data like getpid/getgid. >> FWIW, there are some variations in schemes across OS's -- one >> extreme is the Linux approach, which actually exports a mini >> shared library in ELF format on the shared page, providing >> implementations of various services (such as entering system >> calls), time stuff, etc. Less extreme are the shared pages >> offered on Mac OS X, etc. > > Yes, but I'd like to start somewhere, and considering that it's been > impossible in _5_ years to get the 30 minutes of Peter or JeffR or JHB > time to get the basic VM magic done, I'm keeping my expectations as > modest as possible. > You can find a proof-of-concept implementation for amd64 of a global page mapped in every process at http://people.freebsd.org/~ssouhlal/ testing/syspage-20090328.diff . It exports ticks to userland at VM_MIN_KERNEL_ADDRESS (0xfffffffe40000000). In order for this to work on architectures without a direct map, the page will need to be mapped a second time as read/write (you might want to have a vm_offset_t pmap_map_syspage(vm_page_t m) function that does the right thing for each architecture). Unfortunately, this trick probably won't work for per-process pages without more work, because we wouldn't be able to just insert the page in kernel_map. -- Suleiman