From nobody Sun Aug 14 14:51:54 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M5L2d5bWHz4ZGcR; Sun, 14 Aug 2022 14:51:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M5L2d4VDrz3Zkl; Sun, 14 Aug 2022 14:51:21 +0000 (UTC) (envelope-from kevans@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660488681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TPuM0qLogYOplrm+qum7bXnXDmrHI+U6zJbTmYtnLBw=; b=ZnOzYLnnp6XmEXGH/cNE2o+Hq5QayVr1xatrFLHVTvstaJNg1hHbyc5GlWP8wfSZjHgSdw OV5l0Xnd9M4li+70y1JFAyl5xyZ/Sn9KP8vHF/CVU3O35J+KFkAcUIY6nNQa3/lsoY8Kxs zqmVAp9YKpPBXiQiaF1XefC7GLrpgQUdUFiuKFhuMyG/IvmUe7bD5tvobsOcHsedef4q36 HxAb9fvPgAMMHBDEBzVY0Ylqq10tW/sp8KVLxBTl7ZKmXlr3BG65SY8nrSuexNHSt6wauL jQf2otHrOM6qQoziaXygDAGIGkgbVM2rEfG8P7Qxx3eWxtKHMPcNUYOnoNCU+A== Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4M5L2d3bWfz19Gw; Sun, 14 Aug 2022 14:51:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f172.google.com with SMTP id cb8so4022780qtb.0; Sun, 14 Aug 2022 07:51:21 -0700 (PDT) X-Gm-Message-State: ACgBeo1929G8oKk1cfRrPyUhJ0cP4ZlrXgHzu6f88o3PD8E00AbGl3hd aBjtUbPioEtpJJxebFJwda5TBG8A8WsWXlMHUYI= X-Google-Smtp-Source: AA6agR6YjsWhdz+2gnTJpuBopK02ZpyIp3sO7445qpl6rKdzAu2/mkTeC/OZOka5StJaCDomglkGQ7vIjEssWdg7RRU= X-Received: by 2002:a05:622a:1789:b0:327:2098:6218 with SMTP id s9-20020a05622a178900b0032720986218mr10735052qtk.22.1660488681125; Sun, 14 Aug 2022 07:51:21 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202208140922.27E9Mewk097766@gitrepo.freebsd.org> In-Reply-To: <202208140922.27E9Mewk097766@gitrepo.freebsd.org> From: Kyle Evans Date: Sun, 14 Aug 2022 07:51:54 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 9b967bd65de6 - main - domains: allow domains to be unloaded To: "Alexander V. Chernikov" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660488681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TPuM0qLogYOplrm+qum7bXnXDmrHI+U6zJbTmYtnLBw=; b=j7RQCGlMhSVvNoz3KqRkDylYJMh9IT+we3ZX79kn4WPdVNogQW9INDODzOv21hc7HMNzWc g0NkAjS4cOmvLMP/PhRAbo3xSOHZaISLkAkjLjZVa6bzjpL/DxKKGHnVfhqo+71H+EgQEV zGQM+ZIcFGkL/ULKzL1AJP9B+oxX3R/aumusqpu9p7sviyKoUvicsXOpw+mHs91pGPrdPa fxoqywrKzAAGwJK8CeB1mA/+oq2NaSB+MRUelMnckGSktst8D2azVoMdRmNACs4uEtm4// yGa4Di3XUqr0r180s+CNXQrQg6FmN7wohSwM4eaJIVCP2WKpqMQY/8R0wsc+gg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660488681; a=rsa-sha256; cv=none; b=LdolNj6VHGbE5PmfQnxg95Wgvx34nNpTZWt3vtLC8YpckZVSKON8Ny/7HepeHW+u0DRxkw 87z2kZPF/NfRQBERhUgiyaTYx/JRmZuiaDVmnWJOrZbe1p31sZ0rF31GwZGGcawp5NASlQ EgJDhkztlH9PQQNHB8IMh+U89fgs/bEvbZJuFsUj/LfNE7VzB4PVBkm8NFZG+VnO7srmnX gB7qmQ9YRXY9/uLME/aNtZSd7d/ehY0sdmIP8u/WmZO6FCyT5ZZwsLBtWDbSpXMnzHJ1Oc TEq5HYm0TFXzLuxXpuQU/iJ6OQ3835Z0NT3vmOjh1IJz4B7Dqvx+oNAcXS2rWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Sun, Aug 14, 2022 at 2:22 AM Alexander V. Chernikov wrote: > > The branch main has been updated by melifaro: > > URL: https://cgit.FreeBSD.org/src/commit/?id=9b967bd65de6647aed68a141dc34f9b223a2593c > > commit 9b967bd65de6647aed68a141dc34f9b223a2593c > Author: Alexander V. Chernikov > AuthorDate: 2022-08-12 13:36:53 +0000 > Commit: Alexander V. Chernikov > 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 = (struct domain *)data; > + > + if ((dp->dom_flags & DOMF_UNLOADABLE) == 0) > + return; > + > + mtx_lock(&dom_mtx); > + if (domains == dp) { > + domains = dp->dom_next; > + } else { > + struct domain *curr; > + for (curr = domains; curr != NULL; curr = curr->dom_next) { > + if (curr->dom_next == dp) { > + curr->dom_next = 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)