From nobody Fri Sep 20 19:01:57 2024 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 4X9MFN3cf1z5X6T7; Fri, 20 Sep 2024 19:02:00 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9MFM5cSHz4Lwb; Fri, 20 Sep 2024 19:01:59 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=quarantine) header.from=cschubert.com; spf=pass (mx1.freebsd.org: domain of cy.schubert@cschubert.com designates 3.97.99.32 as permitted sender) smtp.mailfrom=cy.schubert@cschubert.com Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTPS id re31siji69TOUritDsFuTX; Fri, 20 Sep 2024 19:01:59 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id ritBsDjmCKHV8ritCsESjX; Fri, 20 Sep 2024 19:01:59 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=XeEqz555 c=1 sm=1 tr=0 ts=66edc6a7 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=EaEq8P2WXUwA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=QUsjsP8uBRjmw93wkuwA:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 7AB52E7; Fri, 20 Sep 2024 12:01:57 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 79EE9A9; Fri, 20 Sep 2024 12:01:57 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: tuexen@freebsd.org, Konstantin Belousov , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 7672cbef2c1e - main - pipes: reserve configured percentage of buffers zone to superuser Comments: In-reply-to Cy Schubert message dated "Fri, 20 Sep 2024 11:56:25 -0700." 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=us-ascii Date: Fri, 20 Sep 2024 12:01:57 -0700 Message-Id: <20240920190157.79EE9A9@slippy.cwsent.com> X-CMAE-Envelope: MS4xfIMLMMj1OqLu97LnWfA75rdOXJIAdabUbNQZP9kYPpikq7fOMyQuSz4e7Di+qiAsfXojZODUnucgFi36z9useh7dlPu/sbp7kAv6yw/9qPNbXyBM/Id6 dE6OR9cZBLF2pS7/gtsPSm10OpZZOh59GR3P4nrDTBz4C+HF7jGXhtNqOdLZd2Nc6arpg/qW3ndT7REki2GA/YPA9JfDMSRxCOL8FYT/DzJNM/FCsh/9fD9T xcfk8NSkohKVvIb9mXTSK0P7uq4e63spjuiboQs6Fbh6nWH4lpujynlPLmuJThJt2WTgz6W+R/HySWdOt+z0cy8RBXgaZDyv2QXWo11f6is1JH0LQ6TH7oUx C0g4vthY X-Spamd-Result: default: False [-0.60 / 15.00]; THREAD_HIJACKING_FROM_INJECTOR(2.00)[]; FAKE_REPLY(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.997]; DMARC_POLICY_ALLOW(-0.50)[cschubert.com,quarantine]; MV_CASE(0.50)[]; RWL_MAILSPIKE_VERYGOOD(-0.20)[3.97.99.32:from]; R_SPF_ALLOW(-0.20)[+ip4:3.97.99.32/31:c]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.32:from]; RCVD_COUNT_THREE(0.00)[4]; REPLYTO_EQ_FROM(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; RCPT_COUNT_FIVE(0.00)[5]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org,dev-commits-src-all@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_NA(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com] X-Rspamd-Queue-Id: 4X9MFM5cSHz4Lwb X-Spamd-Bar: / Probably worse than rejected email. Seems the email was simply lost by postfix. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 Cy Schubert writes: > In message <0A45CDBA-14DF-423E-9A1F-74119AD5C808@freebsd.org>, > tuexen@freebsd.o > rg writes: > > After building a kernel including these changes, I see a lot of > > negative pipecnt for uid =3D 0 > > Installing world also fails due to pipe problems. > > Is this related to one of these changes? Any configuration change = > > needed? > > > > Best regards > > Michael > > > > I'm seeing the following from my postfix server. It was rejecting email > until I reverted this commit. > > Sep 20 11:00:44 cwfw postfix/proxymap[18650]: fatal: watchdog_create: pipe: > Cannot allocate memory > Sep 20 11:00:59 cwfw postfix/pickup[18651]: fatal: watchdog_create: pipe: > Cannot allocate memory > Sep 20 11:01:21 cwfw postfix/trivial-rewrite[18653]: fatal: > watchdog_create: pipe: Cannot allocate memory > Sep 20 11:01:45 cwfw postfix/proxymap[18654]: fatal: watchdog_create: pipe: > Cannot allocate memory > Sep 20 11:01:45 cwfw postfix/qmgr[18655]: fatal: watchdog_create: pipe: > Cannot allocate memory > Sep 20 11:01:58 cwfw kernel: negative pipecnt for uid = 1006 > Sep 20 11:01:58 cwfw syslogd: last message repeated 1 times > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > e^(i*pi)+1=0 > > > > > > On 20. Sep 2024, at 08:46, Konstantin Belousov = > > wrote: > > >=20 > > > The branch main has been updated by kib: > > >=20 > > > URL: = > > https://cgit.FreeBSD.org/src/commit/?id=3D7672cbef2c1e1267e42bb3aad6a6da93= > > 80f4347f > > >=20 > > > commit 7672cbef2c1e1267e42bb3aad6a6da9380f4347f > > > Author: Konstantin Belousov > > > AuthorDate: 2024-09-15 06:57:34 +0000 > > > Commit: Konstantin Belousov > > > CommitDate: 2024-09-20 06:46:07 +0000 > > >=20 > > > pipes: reserve configured percentage of buffers zone to superuser > > >=20 > > > Sponsored by: The FreeBSD Foundation > > > MFC after: 1 week > > > Differential revision: https://reviews.freebsd.org/D46619 > > > --- > > > sys/kern/sys_pipe.c | 23 +++++++++++++++++++++-- > > > 1 file changed, 21 insertions(+), 2 deletions(-) > > >=20 > > > diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c > > > index 7ee2b5c76da3..68b57708d653 100644 > > > --- a/sys/kern/sys_pipe.c > > > +++ b/sys/kern/sys_pipe.c > > > @@ -103,6 +103,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > #include > > > #include > > > #include > > > @@ -206,6 +207,7 @@ static int pipeallocfail; > > > static int piperesizefail; > > > static int piperesizeallowed =3D 1; > > > static long pipe_mindirect =3D PIPE_MINDIRECT; > > > +static int pipebuf_reserv =3D 2; > > >=20 > > > SYSCTL_LONG(_kern_ipc, OID_AUTO, maxpipekva, CTLFLAG_RDTUN | = > > CTLFLAG_NOFETCH, > > > &maxpipekva, 0, "Pipe KVA limit"); > > > @@ -219,6 +221,9 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, piperesizefail, = > > CTLFLAG_RD, > > > &piperesizefail, 0, "Pipe resize failures"); > > > SYSCTL_INT(_kern_ipc, OID_AUTO, piperesizeallowed, CTLFLAG_RW, > > > &piperesizeallowed, 0, "Pipe resizing allowed"); > > > +SYSCTL_INT(_kern_ipc, OID_AUTO, pipebuf_reserv, CTLFLAG_RW, > > > + &pipebuf_reserv, 0, > > > + "Superuser-reserved percentage of the pipe buffers space"); > > >=20 > > > static void pipeinit(void *dummy __unused); > > > static void pipeclose(struct pipe *cpipe); > > > @@ -586,8 +591,22 @@ retry: > > > return (ENOMEM); > > > } > > >=20 > > > - error =3D vm_map_find(pipe_map, NULL, 0, (vm_offset_t *)&buffer, = > > size, 0, > > > - VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); > > > + vm_map_lock(pipe_map); > > > + if (priv_check(curthread, PRIV_PIPEBUF) !=3D 0 && > > > + (vm_map_max(pipe_map) - vm_map_min(pipe_map)) * > > > + (100 - pipebuf_reserv) / 100 < pipe_map->size + size) { > > > + vm_map_unlock(pipe_map); > > > + if (cpipe->pipe_buffer.buffer =3D=3D NULL && > > > + size > SMALL_PIPE_SIZE) { > > > + size =3D SMALL_PIPE_SIZE; > > > + pipefragretry++; > > > + goto retry; > > > + } > > > + return (ENOMEM); > > > + } > > > + error =3D vm_map_find_locked(pipe_map, NULL, 0, (vm_offset_t = > > *)&buffer, > > > + size, 0, VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); > > > + vm_map_unlock(pipe_map); > > > if (error !=3D KERN_SUCCESS) { > > > chgpipecnt(cpipe->pipe_pair->pp_owner->cr_ruidinfo, -size, 0); > > > if (cpipe->pipe_buffer.buffer =3D=3D NULL && > > > >