Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Dec 2022 11:09:54 +0000
From:      "Alexander V. Chernikov" <melifaro@ipfw.ru>
To:        Mateusz Guzik <mjguzik@gmail.com>
Cc:        Zhenlei Huang <zlei.huang@gmail.com>, freebsd-jail@freebsd.org
Subject:   Re: Is it possible to employ epoch to simplify managing prison lifecycle
Message-ID:  <E608BF71-9B4E-49EF-86DE-AFBDF180C2CE@ipfw.ru>
In-Reply-To: <CAGudoHEncQfMXuG1UHrGRbaHchVfp2pC79mZvHNBUDh-XNhDFA@mail.gmail.com>
References:  <9BD54A54-A809-4D3E-BCBA-639E6C61FE37@FreeBSD.org> <CAGudoHHe8zo%2B7x4Myhotj60BJsASuV109Aj_Rkhg95RNVsTeaw@mail.gmail.com> <4E70D6D2-4E80-4AAD-BB3C-9295F586D1FF@ipfw.ru> <CAGudoHEncQfMXuG1UHrGRbaHchVfp2pC79mZvHNBUDh-XNhDFA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help


> On 23 Dec 2022, at 15:27, Mateusz Guzik <mjguzik@gmail.com> wrote:
>=20
> On 12/23/22, Alexander V. Chernikov <melifaro@ipfw.ru> wrote:
>>=20
>>=20
>>> On 16 Dec 2022, at 16:29, Mateusz Guzik <mjguzik@gmail.com> wrote:
>>>=20
>>> On 12/16/22, Zhenlei Huang <zlei.huang@gmail.com> wrote:
>>>> Hi,
>>>>=20
>>>> While hacking `sys/kern/kern_jail.c` I got lost.
>>>>=20
>>>> There're lots of ref / unref and flags to prevent visit invalid =
prison
>>>> while
>>>> concurrent modification is possible and some refs looks weird.
>>>>=20
>>>> Is it possible to employ epoch(9) to simplify managing of prison
>>>> lifecycle
>>>> ?
>>>>=20
>>>=20
>>> Some of the ref/unref cycles are probably avoidable to begin with, =
but
>>> ultimately the thing to do here is to employ per-cpu reference
>>> counting, if at all needed.
>>>=20
>>> I have a wip patch to provide such a mechanism, it may or may not =
land
>>> this month.
>> That would be nice. I=E2=80=99d love to convert nextops refcounting =
to that one.
>> Do you envision similar semantics as Linux percpu_ref? I mean, does =
one need
>> to explicitly mark =E2=80=9Cnot in active use=E2=80=9D stage?
>=20
> There *something* needed to disable per-cpu operation, otherwise how
> can you ever know if the count is 0, apart from going over all cpus
> every time, which defeats the point.
Ack, sounds reasonable. Happy to test the KPI once it=E2=80=99s =
available.
>=20
> More specifically, I have a on/off switch for said per-cpu op. This is
> modeled after what I did for counters in vfs, see vfs_ref et al.
>=20
> --=20
> Mateusz Guzik <mjguzik gmail.com>
>=20




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E608BF71-9B4E-49EF-86DE-AFBDF180C2CE>