From nobody Sun Aug 10 05:24:43 2025 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 4c05mq6QbBz63pHW; Sun, 10 Aug 2025 05:24:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c05mq5nHGz3Jch; Sun, 10 Aug 2025 05:24:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754803483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XPrIcd30+0g1FHnfp1v5Mj8Qi6k4iUu9JnawO6ZtJ/8=; b=fltJFj0YUCH/WahyS2M42btK+TVaurddAFucvWF+VZKpIvGOJyRxRd89yzOMSQ+S9aQuoJ Dm/7kLFfZYBoN81Hy2QAdkmxNsExIsPWjFzkwJw+dXq1lPCBUNGs1UN04e5yU/YXUR8P4x WFfNb95QxoefZAs631kD8g1CHA3LgxQx3hFA5glWlkwj7JDQsDctGxJCbSi35KJcbKagpY rFfl5GBncrIUDBz1QCqE0yUihRGMHe86ELXDN0uV3aQab33awQlrbxHmMhW8xdLCLeZuDG R65NhXoM8L2K4lwidUdwtuVx1j0kpouwBYAbNn8ET6//FGCTdyNcgcSRjaWx0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754803483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XPrIcd30+0g1FHnfp1v5Mj8Qi6k4iUu9JnawO6ZtJ/8=; b=oxgLVp5A0IwJsdiF3B7+QZ2My9XSJgfBiwF0G78sDQoN5G/mB3esrxuRB/63sQa81Bk802 ICpwINkdbA8yRhlAu329ofOx2rdAbT0y2nmf3u5JphUW5net12OSPr7PB86vOYt63ZgUHL 4c9thgJm++qp7H+FCF8t+Uy0MfF8l7kqQhdLeQVQFph2tka8MOm/wTeXiN7p5dROHTRkYs E48HpkzQArlUL6bgPnk4ezgCriwkpt7FdobZ8/Z7ntYM1r7uBCxB9OcxDwlb4wVp5VB7ZV NDW9JuVloJeiAAwNK4bel46+pKk7/SXM4mkbvdr7UQZldHBb9S0MyTlmV/BMZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754803483; a=rsa-sha256; cv=none; b=RHAmR/P9Fiw+RSDKzPBIvi0v7gJEXkdEFIZ9+ETwdqRUgwto1B2vjIhNZanGaTZkiQ8lS9 pAg7pgSiSKsaHd48byTupjY/Ualx0BaIhMb3Xc0V5F4ViEs85du/hbnJzv1lf9H1SrN79p x8YwukTmlDzPl+/WA00iyCTXOwn/zmNt85/qdK8amd4y4Pjy5il3BNPx/odVqPFdlpthcL p94sVwdmbM8WIM/mueMPy/bYFF7ROHSZtD8Hz2H7xMQNFcXqC5jHY5Ab8dnlbirnr+OboN uXF3KPpZcOiiL1kmvYT0rLhxMpSIcf4FDHPcWeWjCEGDMFB2S3w7E+GArzsE+Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4c05mq55FGzt4N; Sun, 10 Aug 2025 05:24:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57A5Oh4o020507; Sun, 10 Aug 2025 05:24:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57A5Oh0W020504; Sun, 10 Aug 2025 05:24:43 GMT (envelope-from git) Date: Sun, 10 Aug 2025 05:24:43 GMT Message-Id: <202508100524.57A5Oh0W020504@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: bad971197256 - stable/14 - Revert "ipfilter: Avoid allocating a new ipf token when not needed" 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bad971197256729a12c067f1e1f5f7e73dd6098e Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=bad971197256729a12c067f1e1f5f7e73dd6098e commit bad971197256729a12c067f1e1f5f7e73dd6098e Author: Cy Schubert AuthorDate: 2025-07-07 16:50:27 +0000 Commit: Cy Schubert CommitDate: 2025-08-10 05:23:57 +0000 Revert "ipfilter: Avoid allocating a new ipf token when not needed" malloc() outside of a write lock will reduce potential contention. MFC after: 3 days This reverts commit 7f5e3b9fa3d159b7f061b4d01a767cbe5d0527f3. (cherry picked from commit cf9b6857545371ab5becc6a785c62bc844cb2f94) --- sys/netpfil/ipfilter/netinet/fil.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/fil.c b/sys/netpfil/ipfilter/netinet/fil.c index 76fde8622498..18ef46e25805 100644 --- a/sys/netpfil/ipfilter/netinet/fil.c +++ b/sys/netpfil/ipfilter/netinet/fil.c @@ -7459,6 +7459,10 @@ ipf_token_find(ipf_main_softc_t *softc, int type, int uid, void *ptr) { ipftoken_t *it, *new; + KMALLOC(new, ipftoken_t *); + if (new != NULL) + bzero((char *)new, sizeof(*new)); + WRITE_ENTER(&softc->ipf_tokens); for (it = softc->ipf_token_head; it != NULL; it = it->ipt_next) { if ((ptr == it->ipt_ctx) && (type == it->ipt_type) && @@ -7467,10 +7471,6 @@ ipf_token_find(ipf_main_softc_t *softc, int type, int uid, void *ptr) } if (it == NULL) { - KMALLOC(new, ipftoken_t *); - if (new != NULL) - bzero((char *)new, sizeof(*new)); - it = new; new = NULL; if (it == NULL) { @@ -7482,6 +7482,11 @@ ipf_token_find(ipf_main_softc_t *softc, int type, int uid, void *ptr) it->ipt_type = type; it->ipt_ref = 1; } else { + if (new != NULL) { + KFREE(new); + new = NULL; + } + if (it->ipt_complete > 0) it = NULL; else