From nobody Tue Oct 15 15:05:39 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 4XScq82Ny3z5YYbv; Tue, 15 Oct 2024 15:05:40 +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 4XScq771gPz46XX; Tue, 15 Oct 2024 15:05:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729004740; 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=fLnBD65C4jnHoNm1TbAaLM2mH/MhEmq+h/UESa+Ps9o=; b=g7A8pDDiqniDu7eakZDWYRQnUjJ9ikzeWBN0ZlUrADvIjVz0rso2Yim78fo2JuFnGx8wqL bhyoSYMJEJvT+H0QvMen0pvahUYFlHTmiRGVXwB/El680D8mHakxFn9EyeWxn4kVsGFGbQ PMdRn7m/t+ARJAeDyYkJknPR/u5Tq5c7V3inH67MptBAY6VbxkvBkFE29nNu7PXLIy5ahq Fze9r/qQPUsNuV9I/YSH9x28b6/4P+9ueFe8A77aanD35/7AiCt7NSdwwnLXeDTgJTCZS4 XK/INB3cLHtBgh+AL9n3uSXMhVpVt+htWo3KKrM17cZRpWy0hS8ykrXxZMj63g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729004740; 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=fLnBD65C4jnHoNm1TbAaLM2mH/MhEmq+h/UESa+Ps9o=; b=C1JuBZWfAolQUtPBzmQLwsZtXv5I6Z3ziks94E0URhO9qF4t/LKXWODtesTxAntvE12Z4/ YLfRswsIorY2OBNhCAWh+a5j6AsJvwcApIuwU93bUvObRs0wxUNGgCkqGOmuR6CZ8CqEXe pFx1201rNq3xpXT7gT+uCBnQwBdB+21Z/3bM7NgIIAwdSFHhNSTvwkO/twbcRx0O5ZWhSk N/MjJV6JmzKQx/d6ZA+LU3YPDiJCzi7vj5V/A+wFpHRnlg8J+8LXhhFVC6MpGQSWTDyVL8 MtJAOzM4lKFME+q0wgCgIhnPExqtaknDLTahKzaFD75cpgwhTdiUwacrKfa6jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729004740; a=rsa-sha256; cv=none; b=KIydkRXigXhno0jXaQNtfIVKC7RBwuPtpDG1xUrU7mbTlHqGmmz/StoX5L4D8CjGC3VeJF 8Wwc+R0cSsgc6vuYAYLII9G1HicoTSaWG1dIx6l9yHP075GaU6Xhu5RIcxFtNL4GPKf0zZ sV8b03WqTFTBL2/h+4Ap8NKgXTJoGHcF6G/eaXUemKQjHgouNH31AuAYON+6ngCi5LROfX gzTwbbSjMRKgMosfznnLa/XnEm/Lt/RrwaU3gX/ITwXBhrO+lQRXz9e3JwjD3IFyO6hPJk sMXI7wLNJInQFYwiC0czXY427hhaeOVxA2/6O7RKdqalQHGh/dIrhIJWRdJWtQ== 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 4XScq76b0jzR8b; Tue, 15 Oct 2024 15:05:39 +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 49FF5du0089848; Tue, 15 Oct 2024 15:05:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49FF5d4l089845; Tue, 15 Oct 2024 15:05:39 GMT (envelope-from git) Date: Tue, 15 Oct 2024 15:05:39 GMT Message-Id: <202410151505.49FF5d4l089845@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 1e2317b3bf1b - stable/14 - shm_alloc(): cleanup 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1e2317b3bf1b33dd820d19cb2c1740818b176916 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1e2317b3bf1b33dd820d19cb2c1740818b176916 commit 1e2317b3bf1b33dd820d19cb2c1740818b176916 Author: Konstantin Belousov AuthorDate: 2024-10-08 17:43:38 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-15 14:50:17 +0000 shm_alloc(): cleanup (cherry picked from commit e578fd853a251c04d1eeb55c3aa499f8d0cb7480) --- sys/kern/uipc_shm.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index 8334d7eb3264..8a533428790a 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -944,24 +944,20 @@ shm_alloc(struct ucred *ucred, mode_t mode, bool largepage) shmfd->shm_gid = ucred->cr_gid; shmfd->shm_mode = mode; if (largepage) { - obj = shmfd->shm_object = phys_pager_allocate(NULL, - &shm_largepage_phys_ops, NULL, shmfd->shm_size, - VM_PROT_DEFAULT, 0, ucred); - VM_OBJECT_WLOCK(shmfd->shm_object); + obj = phys_pager_allocate(NULL, &shm_largepage_phys_ops, + NULL, shmfd->shm_size, VM_PROT_DEFAULT, 0, ucred); obj->un_pager.phys.phys_priv = shmfd; - vm_object_set_flag(obj, OBJ_POSIXSHM); - VM_OBJECT_WUNLOCK(shmfd->shm_object); shmfd->shm_lp_alloc_policy = SHM_LARGEPAGE_ALLOC_DEFAULT; } else { obj = vm_pager_allocate(shmfd_pager_type, NULL, shmfd->shm_size, VM_PROT_DEFAULT, 0, ucred); - VM_OBJECT_WLOCK(obj); obj->un_pager.swp.swp_priv = shmfd; - vm_object_set_flag(obj, OBJ_POSIXSHM); - VM_OBJECT_WUNLOCK(obj); - shmfd->shm_object = obj; } - KASSERT(shmfd->shm_object != NULL, ("shm_create: vm_pager_allocate")); + KASSERT(obj != NULL, ("shm_create: vm_pager_allocate")); + VM_OBJECT_WLOCK(obj); + vm_object_set_flag(obj, OBJ_POSIXSHM); + VM_OBJECT_WUNLOCK(obj); + shmfd->shm_object = obj; vfs_timestamp(&shmfd->shm_birthtime); shmfd->shm_atime = shmfd->shm_mtime = shmfd->shm_ctime = shmfd->shm_birthtime;