From nobody Sat Sep 03 01:29:22 2022 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 4MKHJ31DfLz4bwBJ; Sat, 3 Sep 2022 01:29:23 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MKHJ30nYbz3NBj; Sat, 3 Sep 2022 01:29:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662168563; 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=/xoByBy4AsfhV1/maj4mOqyUQHXOTaWSK/v5x9/X6lY=; b=Y78sDO/ak8hRLcdcYFKJw20y9b1cfHW9UXZtFzqtH0gVzl44/RgKblNVjRjBXwWgT/xVGX vghiR1iJCBgq+/ijGWkj+OEx6KYwrJrhuHzRRpdsXGeVYXcjGqpdW4W3oE2pVEApH2rcxx IvmGCCHcrQUr+UI+hDivTwNRP5/aeZqooqcTHBbpUiWK6qM1v3Gz2Ersaap3vM1uFXS8gl loDQ8BpPVtSb31IkTn1WtfH3mxVzzxJC+UphKh1uHCTR9+dZvy8d1e2VzhutKTI9sZgPcr FgFpTLNFpzPffnp9CMYuMW/FVCnUD5ziq61yedCXHKwK6EEcnW0NJ/hyQMZ0xQ== 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 4MKHJ2718Dz10PF; Sat, 3 Sep 2022 01:29:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2831TMT0002619; Sat, 3 Sep 2022 01:29:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2831TM32002618; Sat, 3 Sep 2022 01:29:22 GMT (envelope-from git) Date: Sat, 3 Sep 2022 01:29:22 GMT Message-Id: <202209030129.2831TM32002618@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: 31930b3a0dea - stable/13 - fork_norfproc(): unlock p1 before retrying 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 31930b3a0dead191adb008be6b2bce66804c91d8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662168563; 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=/xoByBy4AsfhV1/maj4mOqyUQHXOTaWSK/v5x9/X6lY=; b=FhksYdZ+hqIkM8+kTj0XlbrQ5awpR8uui8igGOMLweitWm9IOp8Om0oybnTv8iAeIx66Oq gsRjoX0qnE/tVv7txueslU9XhxUdF/CwQR+/FbG37TjaCt+NNiDEo8DLM0n5nVP4wPvbee Pgj7zc3VvVgYcvbbAhjSdcpRY0FYTT3u6vhD3BHpMJiujlsNaz/I5onhLbRSqdXR+YObgi iaPLx/j2k4mMy+vBdfXA7SPfCyB/FssMrMv8HY6Aw0HwdVGlPwl/hHalaBY+tgDf/ENorn 5ebyckaYMzELjLz/4/TxB1NuV95PPRZaTdH27s55afLb5y1PAwHLY+gMrY8iKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662168563; a=rsa-sha256; cv=none; b=UdiA+NCkC0fWDNNK6vHcq4BKTAEAqb1TE3vcOd5POcrjjFGVH6NMsLsH/iTGRrIm/nFJ4d 3TkAD9WxHHJj+Miawh3U2Ffv5/Fl1Gu4kmZZK+rF10vs36PzHEheZZmg5uN4ylYxuehY5s LPnjLKVDiAsvVH0LkfyFeXF2y48zrsH/qMByD/0da1SisltiuIsWN23LwQ1sX77D9TARmQ cJUqYINFa1ce2Ve1MHrtahaS7XvsMyOuGhpE098MfhSommcq496KNEZRovJR38euFkRmcA qKSzTvVNgRGlci1ydA/qVsS/xkNaWmzwBCKSOPGhWCHx8HRaaqv+B9wFaRh9fQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=31930b3a0dead191adb008be6b2bce66804c91d8 commit 31930b3a0dead191adb008be6b2bce66804c91d8 Author: Konstantin Belousov AuthorDate: 2022-08-10 17:03:31 +0000 Commit: Konstantin Belousov CommitDate: 2022-09-03 01:17:36 +0000 fork_norfproc(): unlock p1 before retrying (cherry picked from commit 5e9bba94bd7f6b61d6c9fcef239e963e55c1a87a) --- sys/kern/kern_fork.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 7cca7050c0ff..862e61bad207 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -322,13 +322,11 @@ again: if ((p1->p_flag & (P_HADTHREADS | P_SYSTEM)) == P_HADTHREADS && ((flags & (RFCFDG | RFFDG)) != 0 || (flags & RFMEM) == 0)) { PROC_LOCK(p1); - while (p1->p_singlethr > 0) { + if (p1->p_singlethr > 0) { error = msleep(&p1->p_singlethr, &p1->p_mtx, - PWAIT | PCATCH, "rfork1t", 0); - if (error != 0) { - PROC_UNLOCK(p1); + PWAIT | PCATCH | PDROP, "rfork1t", 0); + if (error != 0) return (ERESTART); - } goto again; } if (thread_single(p1, SINGLE_BOUNDARY)) {