Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jun 2026 18:01:50 +0000
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: a6497594d666 - stable/15 - fork: Drop an uneeded PHOLD/PRELE pair
Message-ID:  <6a303e0e.1f649.3bc8ecaf@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/15 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=a6497594d66608d6fe344af8a726af62d6217377

commit a6497594d66608d6fe344af8a726af62d6217377
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-06-06 12:52:15 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-06-15 16:00:04 +0000

    fork: Drop an uneeded PHOLD/PRELE pair
    
    Support for swapping out kernel stacks was removed, so the PHOLD has no
    purpose.  (And even before that, it's not clear why a swapout here would
    have been problematic.)
    
    Reviewed by:    kib
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D57486
    
    (cherry picked from commit 1ee4b5fd824aa93f9a20df6bd5dad50c7e32fe05)
---
 sys/kern/kern_fork.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 558a231ed61d..3de2a6224834 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -674,11 +674,6 @@ do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread *
 
 	callout_init_mtx(&p2->p_itcallout, &p2->p_mtx, 0);
 
-	/*
-	 * This begins the section where we must prevent the parent
-	 * from being swapped.
-	 */
-	_PHOLD(p1);
 	PROC_UNLOCK(p1);
 
 	/*
@@ -785,10 +780,6 @@ do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread *
 	 */
 	knote_fork(p1->p_klist, p2->p_pid);
 
-	/*
-	 * Now can be swapped.
-	 */
-	_PRELE(p1);
 	PROC_UNLOCK(p1);
 	SDT_PROBE3(proc, , , create, p2, p1, fr->fr_flags);
 


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a303e0e.1f649.3bc8ecaf>