From nobody Fri Sep 20 14:03:54 2024 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 4X9DdQ6BzYz5XK4g; Fri, 20 Sep 2024 14:03:54 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9DdQ4ZzVz49ch; Fri, 20 Sep 2024 14:03:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726841034; 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=RlnFKpev3Ra+pgE4lmwed20Fb7HQZW1pKo621rZEruk=; b=INlnQat3LfZLCVagtbxe6HwVHGcTtTTFm07FFJu6pId7K62XU8GItBfmZpi6Fj/GvGUVSf Em9RF34ji/NRnBhzQDPcjmglu7Z+0dxXwqrP7vUX8G7yG6/bV95ppWc339/7cZHAfuql5H 14F1s3ERi9NABGtm9L91KMH2Pc6GJynfWgaWPn525A3Ci7Cft1ZT3NKMF1ia9NspLV52Hq kyhoiuvpenz/ynN7q3kSzMwlvFT59ZJNfKu5mLrVuXhvZhS4oA5Ls3m3NWA+MstHV9PQ+o lMi5wigySl8iQh1rOB9l5qpAw0yDakxUsK0651r2KINAMXuIgDis0CvI5CRUZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726841034; a=rsa-sha256; cv=none; b=uW5NQ0pr6sSQ6YCJ7rTRJrJkbyoUfFvSjwSrVg7Q4w9FVlK4fxs4iPgGnVW89YLXt73RKd xXsy+lY6iH2sEUYqDaoLlwm/Hc4xzkbTvZ7BO1MDghfH7CaBh4/XsOxS6i/RWc6Gf48CvH BVCxmcuUCYvSuzdNrd7tacb6zb/un+KlXCgEppyShR8pV6Q+5Vc6AKI1S1NwvEuQU/nVQb zJG/fh6lZG1y03jxUPV/com6tyCKYwcZ0hWKDbTrvXYj3RKQbdEnF56XpfaWdJ38sbW3q0 JWn671xBiaBLnZ7Kh4Two+dnmcnIB+tyNtFgTbaPAiTzyVv0o4dU2KQG/nm9Jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726841034; 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=RlnFKpev3Ra+pgE4lmwed20Fb7HQZW1pKo621rZEruk=; b=V8z2R126cPllrjCV67cVUPB7Bw6zgCnwRg1buDOxOiLpsDjH0lITj81Zdj5/FVtUhpOPvs jZFsskWGYGhTyPEQd519Xkrsj2JqAVgqWCKqIkqaXrYaU06mBNcqr+AlVGmoZZ/GSF1Spy HNuUr5afm3NdpQRVBF5+rz8y0/JlOWe3Pvfksgq08B5CfdVbJ7mZICyLPt9mhmXfaLFPl2 N+NRgK6EQFlQAH+nn4M5QI4cHNQJfs8i94Y6wXCbkxB7GvzyDEZ1FCYnq1UB0st+Sd3wVD EJ5skvFrbRBf2DgNorF2qIXtxq5ZXdzC2sd2EMOmVPJSnhdmprdO73YmAZDN3g== 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 4X9DdQ4C0TzsrT; Fri, 20 Sep 2024 14:03:54 +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 48KE3suK061223; Fri, 20 Sep 2024 14:03:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KE3sXb061220; Fri, 20 Sep 2024 14:03:54 GMT (envelope-from git) Date: Fri, 20 Sep 2024 14:03:54 GMT Message-Id: <202409201403.48KE3sXb061220@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: d6074f73af5c - main - pipe: use pipe subsystem KVA counter instead of pipe_map size 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 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6074f73af5c813524022cf6ee7dab9c4cbe44be Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d6074f73af5c813524022cf6ee7dab9c4cbe44be commit d6074f73af5c813524022cf6ee7dab9c4cbe44be Author: Konstantin Belousov AuthorDate: 2024-09-20 11:59:19 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-20 14:03:45 +0000 pipe: use pipe subsystem KVA counter instead of pipe_map size to calculate the superuser-reserved amount of the pipe space Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/kern/sys_pipe.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 68b57708d653..ab045c718e75 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -592,9 +592,8 @@ retry: } vm_map_lock(pipe_map); - if (priv_check(curthread, PRIV_PIPEBUF) != 0 && - (vm_map_max(pipe_map) - vm_map_min(pipe_map)) * - (100 - pipebuf_reserv) / 100 < pipe_map->size + size) { + if (priv_check(curthread, PRIV_PIPEBUF) != 0 && maxpipekva / 100 * + (100 - pipebuf_reserv) < amountpipekva + size) { vm_map_unlock(pipe_map); if (cpipe->pipe_buffer.buffer == NULL && size > SMALL_PIPE_SIZE) {