From owner-freebsd-arch@FreeBSD.ORG Thu Jun 7 16:07:30 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 10FAA1065675; Thu, 7 Jun 2012 16:07:30 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id D9AFC8FC21; Thu, 7 Jun 2012 16:07:29 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3FDE7B95E; Thu, 7 Jun 2012 12:07:29 -0400 (EDT) From: John Baldwin To: freebsd-arch@freebsd.org Date: Thu, 7 Jun 2012 09:56:02 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p13; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201206070956.03129.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 07 Jun 2012 12:07:29 -0400 (EDT) Cc: Attilio Rao , alc@freebsd.org, Giovanni Trematerra , Konstantin Belousov , Alexander Kabaev Subject: Re: [RFC] Kernel shared variables X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 16:07:30 -0000 On Friday, June 01, 2012 1:53:15 pm Giovanni Trematerra wrote: > Hello, > I'd like to discuss a way to provide a mechanism to share some read-only > data between kernel and user space programs avoiding syscall overhead, > implementing some them, such as gettimeofday(3) and time(3) as ordinary > user space routine. > > The patch at > http://www.trematerra.net/patches/ksvar_experimental.patch I realize this thread descended a bit, and I do still think that Konstantin's patch is probably the right way forward for gettimeofday(). However, have you thought at all about a per-process page? There was another fork in this thread that dealt with per-process data such as getpid() (for which it does seem there are real-world uses). I realize the KSVAR stuff might not easily be adjusted to working with a per-process page (though Jeff did do something interesting with having a template page defined by DPCPU that was then copied for each CPU). It would also seem that for things like getpid(), getppid(), and getuid() it might be best to go the vdso route. Is that something you would be interested in working on? -- John Baldwin