From owner-freebsd-current@FreeBSD.ORG Tue Nov 15 20:39:00 2011 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 3AE341065744; Tue, 15 Nov 2011 20:39:00 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0E6D78FC17; Tue, 15 Nov 2011 20:39:00 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id B3C7246B32; Tue, 15 Nov 2011 15:38:59 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 57E878A051; Tue, 15 Nov 2011 15:38:59 -0500 (EST) From: John Baldwin To: freebsd-current@freebsd.org Date: Tue, 15 Nov 2011 15:38:58 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <4EB40015.5040100@rice.edu> <20111106164204.GY50300@deviant.kiev.zoral.com.ua> In-Reply-To: <20111106164204.GY50300@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201111151538.58323.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 15 Nov 2011 15:38:59 -0500 (EST) Cc: mdf@freebsd.org, "K. Macy" , Alan Cox , Andriy Gapon , Benjamin Kaduk , Kostik Belousov , Penta Upa Subject: Re: vm_page_t related KBI [Was: Re: panic at vm_page_wire with FreeBSD 9.0 Beta 3] 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: Tue, 15 Nov 2011 20:39:00 -0000 On Sunday, November 06, 2011 11:42:04 am Kostik Belousov wrote: > On Sun, Nov 06, 2011 at 07:22:51AM -0800, mdf@freebsd.org wrote: > > On Sun, Nov 6, 2011 at 4:43 AM, Kostik Belousov wrote: > > > Regarding the _vm_page_lock() vs. vm_page_lock_func(), the mutex.h has > > > a lot of violations in regard of the namespaces, IMO. The __* namespace > > > is reserved for the language implementation, so our freestanding program > > > (kernel) ignores the requirements of the C standard with the names like > > > __mtx_lock_spin(). Using the name _vm_page_lock() is valid, but makes > > > it not unreasonable for other developers to introduce reserved names. > > > So I decided to use the suffixes. vm_map.h locking is free of these > > > violations. > > > > I'm pretty sure that when the C standard says, "the implementation", > > they're referring to the compiler and OS it runs on. Which makes the > > FreeBSD kernel part of "the implementation", which is precisely why so > > many headers have defines that start with __ and then, if certain > > posix defines are set, also uses non-__ versions of the name. > > For libc providing parts, required by standard, you are right. > But our kernel is a freestanding program using a compiler, so in-kernel > uses of the reserved namespace is a violation. I don't buy that argument at all. We have a libc for the kernel, it's called libkern and we own that, too. We depend on using _ and __ prefixes all over the kernel and trying to change that now would be excessively gratuitous. -- John Baldwin