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: Sun, 20 Nov 2011 17:37:33 +0100
2011/11/18 Attilio Rao <attilio_at_freebsd.org>:
> 2011/11/18 Attilio Rao <attilio_at_freebsd.org>:
>> 2011/11/18 Kostik Belousov <kostikbel_at_gmail.com>:
>>> On Fri, Nov 18, 2011 at 11:40:28AM +0100, Attilio Rao wrote:
>>>> 2011/11/16 Kostik Belousov <kostikbel_at_gmail.com>:
>>>> > On Tue, Nov 15, 2011 at 07:15:01PM +0100, Attilio Rao 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.
>>>> > Yes, this is exactly KPI that I would use when available for the
>>>> > vm_page_lock() patch.
>>>> >
>>>> >>
>>>> >> 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.
>>>> > But I also agree with John that imposing large churn due to the elimination
>>>> > of the '__' prefix is too late now. At least it will make the change
>>>> > non-MFCable. Besides, we already lived with the names for 10+ years.
>>>> >
>>>> > I will be happy to have the part of the patch that exports the mtx_XXX_(mtx,
>>>> > file, line) defines which can be used without taking care of LOCK_DEBUG
>>>> > or MUTEX_NOINLINE in the consumer code.
>>>>
>>>> Ok, this patch should just add the compat stub:
>>>> http://www.freebsd.org/~attilio/mutexfileline2.patch
>>> Am I right that I would use mtx_lock_(mtx, file, line) etc ?
>>> If yes, I am fine with it.
>>
>> Yes that is correct.
>>
>> However, I'm a bit confused on one aspect: would you mind using
>> _mtx_lock_flags() instead?
>> If you don't mind the "underscore namespace violation" I think I can
>> make a much smaller patch against HEAD for it.
>>
>> Otherwise, the one now posted should be ok.
>
> After thinking more about it, I think that is basically the shorter
> version I can came up with.
>
> Please consider:
> http://www.freebsd.org/~attilio/mutexfileline2.patch

This is now committed as r227758,227759, you can update your patch now.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
Received on Sun Nov 20 2011 - 15:37:36 UTC

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