Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Oct 2012 09:17:34 +0100
From:      Andre Oppermann <andre@freebsd.org>
To:        attilio@FreeBSD.org
Cc:        mdf@freebsd.org, src-committers@freebsd.org, John Baldwin <jhb@freebsd.org>, svn-src-user@freebsd.org, Jeff Roberson <jroberson@jroberson.net>, Bruce Evans <brde@optusnet.com.au>
Subject:   Re: svn commit: r241889 - in user/andre/tcp_workqueue/sys: arm/arm cddl/compat/opensolaris/kern cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/fs/zfs ddb dev/acpica dev/...
Message-ID:  <5090DE9E.5030301@freebsd.org>
In-Reply-To: <CAJ-FndC=v%2BLG=Ptm9Ohshg0n7dVsecddSQWn1KZxkUkap3bXRw@mail.gmail.com>
References:  <201210221418.q9MEINkr026751@svn.freebsd.org> <CAJ-FndAG-Qp%2B1aQvoL7YRj=R151Qe9_wNrUeOAaDsdYao_-zCQ@mail.gmail.com> <201210241414.30723.jhb@freebsd.org> <CAJ-FndAu6BGeMMbtFTLaSqy82mbhM9CVEyJ3Lb1WhAogJr59yA@mail.gmail.com> <CAJ-FndBqRpkBhCntd2aqwVYPu%2B2EHGeuXr5srLtrNNDK-ButxA@mail.gmail.com> <508965B3.2020705@freebsd.org> <CAJ-FndCMMH2Qy=rzzxagNVfgO9vF0xZY6B_vrnjmv_dXKNB5Dg@mail.gmail.com> <5089A913.2040603@freebsd.org> <CAJ-FndApwOo8xmZQyeqq0bGp8P13QWRqgmSDNg1_hbm7nrpOAQ@mail.gmail.com> <508A89EF.5070805@freebsd.org> <CAJ-FndC%2BujncG54_RMwKwdtvNCRJ2QojNuADWn59puwayCHs6A@mail.gmail.com> <CAJ-FndAhYk4R2AD3COmkOv3vYQganGXQKuO%2BkMQLaefTQSAejQ@mail.gmail.com> <CAJ-FndD40whTV=o1P8gMCaq9tKEtRg56xMKdjqnapVR6Awo7og@mail.gmail.com> <CAJ-FndDbi0bUoKsVcmDhKR25PsuB48bbekraSaeCT8oSzfsiQQ@mail.gmail.com> <CAJ-FndC4hXoT8bMM0Gg%2BSNY5HTGQZzUXtisN2GQk%2BDWHcij%2BnA@mail.gmail.com> <508F9C94.7080703@freebsd.org> <CAJ-FndC=v%2BLG=Ptm9Ohshg0n7dVsecddSQWn1KZxkUkap3bXRw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 30.10.2012 23:59, Attilio Rao wrote:
> On Tue, Oct 30, 2012 at 9:23 AM, Andre Oppermann <andre@freebsd.org> wrote:
>> On 30.10.2012 03:25, Attilio Rao wrote:
>>>
>>> On Tue, Oct 30, 2012 at 1:38 AM, Attilio Rao <attilio@freebsd.org> wrote:
>>>>
>>>> On Sun, Oct 28, 2012 at 5:42 PM, Attilio Rao <attilio@freebsd.org> wrote:
>>>
>>>
>>> [ trimm ]
>>>
>>>>>
>>>>> BTW, the mtx_sysuninit() introduction can be avoided by using this other
>>>>> trick:
>>>>> #define MTX_SYSINIT(name, mtx, desc, opts)
>>>>> \
>>>>>           static struct mtx_args name##_args = {
>>>>> \
>>>>>                   (mtx),
>>>>> \
>>>>>                   (desc),
>>>>> \
>>>>>                   (opts)
>>>>> \
>>>>>           };
>>>>> \
>>>>>           SYSINIT(name##_mtx_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE,
>>>>> \
>>>>>               mtx_sysinit, &name##_args);
>>>>> \
>>>>>           SYSUNINIT(name##_mtx_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE,
>>>>> \
>>>>>               _mtx_destroy, __DEVOLATILE(void *, &(mtx)->mtx_lock))
>>>>>
>>>>> I'm just not sure that I would like the use of __DEVOLATILE() even if
>>>>> it would help in this case when introducing MTX_SYSINIT_UNSHARE()
>>>>> because we will just need to reuse the same code.
>>>>>
>>>>> Also, the more I think about this the more I feel convinced that
>>>>> mtxlock2mtx() should be static in kern_mutex.c. I can simply add a
>>>>> note to _mutex.h as a reminder for it.
>>>>
>>>>
>>>> Here is the patch that does both things and the one I would like to
>>>> commit:
>>>> http://www.freebsd.org/~attilio/mtx_decoupled3.patch
>>>
>>>
>>> BTW, I've updated the patch in order to make use of __containerof()
>>> rather than the manual frobbing. I had no idea that this method was
>>> existing, many thanks to andre@ and mdf@ for signaling it.
>>> Please refresh the patch.
>>
>>
>> Thank you for the updated patch.  I have no objections to the patch,
>> though I'm not really qualified to have a final say on changes to the
>> mutex code.
>
> Jeff has replied privately to me saying that he would have preferred
> to see altogether also the implementation of padded mutexes along with
> the mtx decoupling interface.
> The following patch, does what expected:
> http://www.freebsd.org/~attilio/mtx_decoupled_padalign.patch
>
> I converted a bunch of locks and they work fine even with
> MTX_SYSINIT() with the small change contained in this patchset, so
> that doesn't require a separate KPI in the end.
>
> The patch is being tested right now and I will commit as soon as I
> will receive positive feedbacks.

Haven't tested it but to me looks good and fulfills my requirements. :)

-- 
Andre




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