Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Nov 2011 15:38:58 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-current@freebsd.org
Cc:        mdf@freebsd.org, "K. Macy" <kmacy@freebsd.org>, Alan Cox <alc@rice.edu>, Andriy Gapon <avg@freebsd.org>, Benjamin Kaduk <kaduk@mit.edu>, Kostik Belousov <kostikbel@gmail.com>, Penta Upa <bsdboot@gmail.com>
Subject:   Re: vm_page_t related KBI [Was: Re: panic at vm_page_wire with FreeBSD 9.0 Beta 3]
Message-ID:  <201111151538.58323.jhb@freebsd.org>
In-Reply-To: <20111106164204.GY50300@deviant.kiev.zoral.com.ua>
References:  <4EB40015.5040100@rice.edu> <CAMBSHm-Egy53818aKTpiPBA22RxqTAyQv0q8PsFUnPPDjt1cBQ@mail.gmail.com> <20111106164204.GY50300@deviant.kiev.zoral.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <kostikbel@gmail.com> 
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111151538.58323.jhb>