Date: Sun, 14 Aug 2022 17:50:01 -0700 From: Kyle Evans <kevans@freebsd.org> To: "Alexander V. Chernikov" <melifaro@ipfw.ru> Cc: "Alexander V. Chernikov" <melifaro@freebsd.org>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 9b967bd65de6 - main - domains: allow domains to be unloaded Message-ID: <CACNAnaGSfoKXT0a61NWpCTDM%2B0d6U2rt0VcR27GVPi73=P%2B=-Q@mail.gmail.com> In-Reply-To: <C47B4A85-2A43-45EB-85E5-1FC48CC3EF08@ipfw.ru> References: <202208140922.27E9Mewk097766@gitrepo.freebsd.org> <CACNAnaGUc-c8ohwT4mNVvHmBeCG14NTLQW4AP7bJXfsSMdaBvA@mail.gmail.com> <C47B4A85-2A43-45EB-85E5-1FC48CC3EF08@ipfw.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Aug 14, 2022 at 8:20 AM Alexander V. Chernikov <melifaro@ipfw.ru> w= rote: > > > > > On 14 Aug 2022, at 15:51, Kyle Evans <kevans@FreeBSD.org> wrote: > > > > On Sun, Aug 14, 2022 at 2:22 AM Alexander V. Chernikov > > <melifaro@freebsd.org> wrote: > >> > >> The branch main has been updated by melifaro: > >> > >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D9b967bd65de6647aed68a14= 1dc34f9b223a2593c > >> > >> commit 9b967bd65de6647aed68a141dc34f9b223a2593c > >> Author: Alexander V. Chernikov <melifaro@FreeBSD.org> > >> AuthorDate: 2022-08-12 13:36:53 +0000 > >> Commit: Alexander V. Chernikov <melifaro@FreeBSD.org> > >> CommitDate: 2022-08-14 09:22:33 +0000 > >> > >> domains: allow domains to be unloaded > >> > >> Add domain_remove() SYSUNINT callback that removes the domain > >> from the domain list if it has DOMF_UNLOADABLE flag set. > >> This change is required to support netlink ( D36002 ). > >> > >> Reviewed by: glebius > >> Differential Revision: https://reviews.freebsd.org/D36173 > >> --- > >> sys/kern/uipc_domain.c | 23 +++++++++++++++++++++++ > >> sys/sys/domain.h | 4 ++++ > >> 2 files changed, 27 insertions(+) > >> > >> diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c > >> index c70b3150cbf0..2cae08be089a 100644 > >> --- a/sys/kern/uipc_domain.c > >> +++ b/sys/kern/uipc_domain.c > >> @@ -239,6 +239,29 @@ domain_add(void *data) > >> mtx_unlock(&dom_mtx); > >> } > >> > >> +void > >> +domain_remove(void *data) > >> +{ > >> + struct domain *dp =3D (struct domain *)data; > >> + > >> + if ((dp->dom_flags & DOMF_UNLOADABLE) =3D=3D 0) > >> + return; > >> + > >> + mtx_lock(&dom_mtx); > >> + if (domains =3D=3D dp) { > >> + domains =3D dp->dom_next; > >> + } else { > >> + struct domain *curr; > >> + for (curr =3D domains; curr !=3D NULL; curr =3D curr->= dom_next) { > >> + if (curr->dom_next =3D=3D dp) { > >> + curr->dom_next =3D dp->dom_next; > >> + break; > >> + } > >> + } > >> + } > >> + mtx_unlock(&dom_mtx); > >> +} > >> + > >> /* ARGSUSED*/ > >> static void > >> domaininit(void *dummy) > > > > While it's not important for the one domain you care about, this > > should likely also check if any contained protocols have > > pr_fasttimo/pr_slowtimo and purge them from the appropriate list, just > > to be technically correct. (Or at least assert under INVARIANTS that > > they do not) > That=E2=80=99s a good point! > I should have provided more context in the commit message. > There is some ongoing work glebius@ is doing in the domain space. > Specifically, there are plans to remove this callbacks in the near future= - https://reviews.freebsd.org/D36163 stack provides more reasoning and imp= lementation details. > Additionally, the KPI may be a bit fluid and may change in the near/mid-t= erm future - that=E2=80=99s why the minimal working version was committed. > Aha, disregard then. Thanks! :-)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaGSfoKXT0a61NWpCTDM%2B0d6U2rt0VcR27GVPi73=P%2B=-Q>