From nobody Fri Sep 20 19:34:34 2024 X-Original-To: freebsd-current@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 4X9Mz64462z5XGSP for ; Fri, 20 Sep 2024 19:34:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4X9Mz60mMnz4S7F for ; Fri, 20 Sep 2024 19:34:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 48KJYZHu052970; Fri, 20 Sep 2024 22:34:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 48KJYZHu052970 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 48KJYYc2052969; Fri, 20 Sep 2024 22:34:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 20 Sep 2024 22:34:34 +0300 From: Konstantin Belousov To: Yasuhiro Kimura Cc: freebsd-current@freebsd.org Subject: Re: eval: Pipe call failed: Cannot allocate memory Message-ID: References: <20240920.185920.1538575456943179013.yasu@FreeBSD.org> <20240921.040129.1802547990896804154.yasu@utahime.org> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240921.040129.1802547990896804154.yasu@utahime.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4X9Mz60mMnz4S7F X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Sat, Sep 21, 2024 at 04:01:29AM +0900, Yasuhiro Kimura wrote: > From: Konstantin Belousov > Subject: Re: eval: Pipe call failed: Cannot allocate memory > Date: Fri, 20 Sep 2024 14:37:09 +0300 > > > Did the poudriere run itself finished successfully? > > Yes, it finished successfully. > > > Can you show the output from 'sysctl kern.ipc | grep pipe' before and > > after the poudriere run? > > Before: > # sysctl kern.ipc | grep pipe ~ > kern.ipc.pipe_mindirect: 8192 > kern.ipc.pipebuf_reserv: 2 > kern.ipc.piperesizeallowed: 1 > kern.ipc.piperesizefail: 0 > kern.ipc.pipeallocfail: 0 > kern.ipc.pipefragretry: 0 > kern.ipc.pipekva: 778240 > kern.ipc.maxpipekva: 535846912 > > After: > # sysctl kern.ipc | grep pipe ~ > kern.ipc.pipe_mindirect: 8192 > kern.ipc.pipebuf_reserv: 2 > kern.ipc.piperesizeallowed: 1 > kern.ipc.piperesizefail: 0 > kern.ipc.pipeallocfail: 0 > kern.ipc.pipefragretry: 0 > kern.ipc.pipekva: 778240 > kern.ipc.maxpipekva: 535846912 Thanks. Can you please try the following on top of the latest kernel (there were 40769168a5ee227b96ea917 and d6074f73af5c813524022cf6) diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index d1a1d3ea3811..58723289af21 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -1510,6 +1510,18 @@ uifree(struct uidinfo *uip) if (uip->ui_vmsize != 0) printf("freeing uidinfo: uid = %d, swapuse = %lld\n", uip->ui_uid, (unsigned long long)uip->ui_vmsize); + if (uip->ui_ptscnt != 0) + printf("freeing uidinfo: uid = %d, ptscnt = %ld\n", + uip->ui_uid, uip->ui_ptscnt); + if (uip->ui_kqcnt != 0) + printf("freeing uidinfo: uid = %d, kqcnt = %ld\n", + uip->ui_uid, uip->ui_kqcnt); + if (uip->ui_umtxcnt != 0) + printf("freeing uidinfo: uid = %d, umtxcnt = %ld\n", + uip->ui_uid, uip->ui_umtxcnt); + if (uip->ui_pipecnt != 0) + printf("freeing uidinfo: uid = %d, pipecnt = %ld\n", + uip->ui_uid, uip->ui_pipecnt); free(uip, M_UIDINFO); } diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 2b81d08f7077..83d6f6cf48cf 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -581,7 +581,7 @@ pipespace_new(struct pipe *cpipe, int size) size = round_page(size); buffer = (caddr_t) vm_map_min(pipe_map); - if (!chgpipecnt(cpipe->pipe_pair->pp_owner->cr_ruidinfo, + if (!chgpipecnt(cpipe->pipe_pair->pp_owner->cr_uidinfo, size, lim_cur(curthread, RLIMIT_PIPEBUF))) { if (cpipe->pipe_buffer.buffer == NULL && size > SMALL_PIPE_SIZE) { @@ -595,7 +595,7 @@ pipespace_new(struct pipe *cpipe, int size) if (priv_check(curthread, PRIV_PIPEBUF) != 0 && maxpipekva / 100 * (100 - pipebuf_reserv) < amountpipekva + size) { vm_map_unlock(pipe_map); - chgpipecnt(cpipe->pipe_pair->pp_owner->cr_ruidinfo, -size, 0); + chgpipecnt(cpipe->pipe_pair->pp_owner->cr_uidinfo, -size, 0); if (cpipe->pipe_buffer.buffer == NULL && size > SMALL_PIPE_SIZE) { size = SMALL_PIPE_SIZE; @@ -608,7 +608,7 @@ pipespace_new(struct pipe *cpipe, int size) size, 0, VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); vm_map_unlock(pipe_map); if (error != KERN_SUCCESS) { - chgpipecnt(cpipe->pipe_pair->pp_owner->cr_ruidinfo, -size, 0); + chgpipecnt(cpipe->pipe_pair->pp_owner->cr_uidinfo, -size, 0); if (cpipe->pipe_buffer.buffer == NULL && size > SMALL_PIPE_SIZE) { size = SMALL_PIPE_SIZE;