From nobody Wed Sep 3 09:46:00 2025 X-Original-To: dev-commits-src-main@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 4cGyRH4tf5z65qFl; Wed, 03 Sep 2025 09:46:03 +0000 (UTC) (envelope-from kp@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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cGyRH4Mr0z3JpR; Wed, 03 Sep 2025 09:46:03 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1756892763; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zBpGdT8T/WJUzGVeyKPmWj0yl7BSiLlyy95IW2CRknI=; b=XtSIlHup/oTewy4RB3wNm80OxFS05SMfwe/9mYut7q1mfohWglicvhFlAcPWozzDZkEJ2g F9ThmOJ95E0uahIdwiX/ESePjteaLvSOmO4TUmHOXz0/AJY26moz1nUSgkEMKVr0aUAQDA JmWwLtfYf5IrCc32boO1UXi6pq2pVvistW7cG5XXKds+kGRJpdJ+ehFf7QvYWW7UkXPbhP s01MNBdQND0SRRg30rBncnXqsjev8zzZ7Sqwg82PJjGD8zBEcE0VU0PddyjVMP/0qJRd8+ WJ77nbPKiotvcBP0hLOt52Zf45StBThvc+sVZxKCmrkvfvpPBng5uROru1TiIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1756892763; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zBpGdT8T/WJUzGVeyKPmWj0yl7BSiLlyy95IW2CRknI=; b=kWAyXN6qFf9iQ7QG689/n5GVyBo0zIAyEFLQh7r3dILcXsX8lEuGLno1JmhAxrEzrR8R7K rZKeO3Z7/C9+IqPQsYRSSrUdiFbQqTw6oKB3OXnrLq0ZKPbjEG5HSKXWsAMEgqdIcBsCue 1SPjpDBclqmr9ysRaxY8z/OAZViX8DvSNci4nTxOR1RiIMdBXjI632kwIen3n+wleChxpp Y9lDcg2lXfAbpODnP5EOmnNofFAJfe+L9q0IbHHOM9vps24TAteAMDOehbrDAoLEFD7vWl +EZ7UW9/wucZhY1o3ll9RjxnHLQV5tjXonPTaJBaj3hn23aIDqtvMTdLj9mSEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1756892763; a=rsa-sha256; cv=none; b=o9i5BR016Uauvxz9icnA7z4Wh1Ed03MJGK8R0dXiCFbTNr2nDwpxvkJ6eKmi89RrEO/H5G OC9SZuSJczGNGtaiR6UodAZtDIgukMrW0Kz0TAH+83JDHNNcZBO9QGeyK/1Qce3jDnrcSf HDCFWbnz3trEnRN+6nJy5NgnKE3zbzbDbyP33L0do4DYoIALe8PNKB31GFaiph2cuHTtOx ozpXcfel6Sg6VdD2HetveAQYxr6LWTeQSF3QU1FbSsxa4kJ9N8d91YKLkcxcsZik38D7Aw 3niaia5zrdvBdFWzX8CDMdlPiCh7EzNZtfp81IZV0rEcbeSBZ85wM0eVDId1MA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (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 (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R11" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4cGyRH2mPWz140W; Wed, 03 Sep 2025 09:46:03 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 815094529F; Wed, 03 Sep 2025 11:46:01 +0200 (CEST) From: Kristof Provost To: Gleb Smirnoff Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: ddd39152743a - main - pf: Introduce M_PF type for pf(4) related memory allocations. Date: Wed, 03 Sep 2025 11:46:00 +0200 X-Mailer: MailMate (2.0r6272) Message-ID: <85886BF4-570F-4F4A-8FE4-3B064C8E8D20@FreeBSD.org> In-Reply-To: References: <202509022110.582LAr4f036441@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; markup=markdown Content-Transfer-Encoding: quoted-printable On 3 Sep 2025, at 6:39, Gleb Smirnoff wrote: > On Tue, Sep 02, 2025 at 09:10:53PM +0000, Kristof Provost wrote: > K> The branch main has been updated by kp: > K> > K> URL: https://cgit.FreeBSD.org/src/commit/?id=3Dddd39152743abc3cff05e= 7475c0ce48aa303956a > K> > K> commit ddd39152743abc3cff05e7475c0ce48aa303956a > K> Author: Kristof Provost > K> AuthorDate: 2025-08-18 12:19:40 +0000 > K> Commit: Kristof Provost > K> CommitDate: 2025-09-02 21:10:20 +0000 > K> > K> pf: Introduce M_PF type for pf(4) related memory allocations. > K> > K> Currently used M_TEMP and M_IFADDR types are unreasonable for th= at purpose. > K> This dedicated statistics simplify the future pf(4) unlocking wo= rk by decreasing > K> search area of possible memory leaks. > > IMHO, going away from M_TEMP to something else for allocations that las= t for > duration of a syscall is a regression rather than an improvement. > I can see the argument, however, I think there are sufficient reasons for= it anyway. The first is that not all of these allocations are correctly M_TEMP anywa= y. It was used to allocate struct pf_krule_global for example (as well as= anchors). The second is that this indeed revealed memory leaks (since fixed) that w= e wouldn=E2=80=99t have been aware of otherwise (and that does also apply= to allocations that are temporary). See 44cc3b2731914f94851c0e468a5fa07c= 5f6ca006 for that one. And finally, the usual argument of diff reduction with OpenBSD. Although = to be fair, it=E2=80=99s not exactly hard to change the malloc type when = porting patches, but it is yet another opportunity to mess something up. Best regards, Kristof