Re: vm_page_t related KBI [Was: Re: panic at vm_page_wire with FreeBSD 9.0 Beta 3]

From: Attilio Rao <attilio_at_freebsd.org>
Date: Tue, 15 Nov 2011 20:12:52 +0100
2011/11/15  <mdf_at_freebsd.org>:
> On Tue, Nov 15, 2011 at 10:15 AM, Attilio Rao <attilio_at_freebsd.org> wrote:
>> 2011/11/7 Kostik Belousov <kostikbel_at_gmail.com>:
>>> On Mon, Nov 07, 2011 at 11:45:38AM -0600, Alan Cox wrote:
>>>> Ok.  I'll offer one final suggestion.  Please consider an alternative
>>>> suffix to "func".  Perhaps, "kbi" or "KBI".  In other words, something
>>>> that hints at the function's reason for existing.
>>>
>>> Sure. Below is the extraction of only vm_page_lock() bits, together
>>> with the suggested rename. When Attilio provides the promised simplification
>>> of the mutex KPI, this can be reduced.
>>
>> My tentative patch is here:
>> http://www.freebsd.org/~attilio/mutexfileline.patch
>>
>> I need to make more compile testing later, but it already compiles
>> GENERIC + modules fine on HEAD.
>>
>> The patch provides a common entrypoint, option independent, for both
>> fast case and debug/compat case.
>> Additively, it almost entirely fixes the standard violation of the
>> reserved namespace, as you described (the notable exception being the
>> macro used in the fast path, that I want to fix as well, but in a
>> separate commit).
>>
>> Now the file/line couplet can be passed to the "_" suffix variant of
>> the flag functions.
>>
>> eadler_at_ reviewed the mutex.h comment.
>>
>> Please let me know what you think about it, as long as we agree on the
>> patch I'll commit it.
>
> Out of curiosity, why are function names explicitly spelled out in
> panic and log messages, instead of using %s and __func__?  I've seen
> this all around FreeBSD, and if there's no reason otherwise, I'd just
> as soon change to a version that doesn't need updating when the
> function names change.

I prefer the __func__ stuff as well but bde isn't in favor of it
because it is more difficult to grep for the message in that case.
I'm not sure I'd buy his point on this, honestly, but that is why.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
Received on Tue Nov 15 2011 - 18:12:55 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:20 UTC