From nobody Sun Nov 10 22:35:27 2024 X-Original-To: fs@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 4XmnZ75lYcz5cNC2 for ; Sun, 10 Nov 2024 22:35:27 +0000 (UTC) (envelope-from bugzilla-noreply@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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XmnZ735vlz4nG8 for ; Sun, 10 Nov 2024 22:35:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731278127; 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: in-reply-to:in-reply-to:references:references; bh=BEz7mUuX403uc4awzp2VoK6iIvjJnQTVl0gsBwtWRgo=; b=iYKLKFjL1qB7Vkx7SF+y8zAo74jEWOky7cr7+uzaLgNan5e7VKeuDwSwZUpEEtNzuWTJ9A eAl/Yg0/W4UD7ksiNKp93QnccZEBiZeF+49RdgceGw54fuvWXzk6KFVxEw8QOf2OCpfByb YvibIlHKi8F26HvdxAmQYi986Lco+nsU1rtF8SOxukuNlOkKDY+wzIpFzyvvT/58Q6rl1N pxvdGCTqpK6rs46ZXY1jYsEX0ugpiQZHCzRPwqXzbw+yhO0HsdrQMOJ4oNOTxZMjd1U+Pc cPaaCmT+KQDOEqt5+tA4o2cuu3AmermPBpO64ois1X0GrdlVyz7tNe851dsOcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731278127; a=rsa-sha256; cv=none; b=YZi031GGU9Tt1cOpCYY2RIhJFKz+FWi8kkV/dePR5o6t9fF8evVQHRNtWnCHmbhUcYeSGw rHuKR/D7vIea5iNmL+j5fRiEICyxYtd/sXHIk5cxE4TpQ2vRYckZtEDab7iDt/DyDV5cmh StTLMq8wLuZ5LX/52b/JKuzXkPP1zEBoxooRy4IwHXzHwsAeZTlvlDm5X2Ttyu7dJwlmu2 1+g49pgB+U25ENOfu+lMFreEwmQFGKNK9Cb0g4SEKRlqXszM4MbT9I7CdfwVmu3rur6SNm ln/bpR6JwHq3vYkNfygAhRE+o+ZauNem5lnYNs/svud52lH0k++dzkhGMrgvdw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4XmnZ72hTVz11RX for ; Sun, 10 Nov 2024 22:35:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 4AAMZRlw097356 for ; Sun, 10 Nov 2024 22:35:27 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4AAMZRFW097355 for fs@FreeBSD.org; Sun, 10 Nov 2024 22:35:27 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: fs@FreeBSD.org Subject: [Bug 282449] UFS deadlock with install -S during freebsd-update Date: Sun, 10 Nov 2024 22:35:27 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: markj@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: fs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Filesystems List-Archive: https://lists.freebsd.org/archives/freebsd-fs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-fs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D282449 --- Comment #15 from Mark Johnston --- Looking at this again, I think the problem isn't with the general runningbufspace mechanism. There's a specific code path in the SU+J implementation where we can deadlock when hirunningspace is small. What happens is, we prepare to write a data buf, claim space for it in the runningbuf total, then call bufstrategy(), which in turn might dispatch jou= rnal I/O asynchronously, which can block on runningbufspace. Normally this happ= ens in the context of the softdep flusher, which is exempt from the runningbufs= pace limit, but it can happen in a user thread as well: _sleep+0x1f0 waitrunningbufspace+0x76 bufwrite+0x24a softdep_process_journal+0x728 softdep_disk_io_initiation+0x79b ffs_geom_strategy+0x1f0 ufs_strategy+0x83 bufstrategy+0x36 bufwrite+0x1da cluster_wbuild+0x722 cluster_write+0x12f ffs_write+0x41d When hirunningspace =3D=3D maxphys =3D=3D runningbufspace, this recursive b= ufwrite() call will block forever. I suspect this bawrite() call in softdep_process_journal() should be gated = on (curthread->td_pflags & TDP_NORUNNINGSPACE) !=3D 0. The softdep flusher wi= ll continue to issue async writes, but if a user thread is forced to flush jou= rnal records in order to initiate I/O, it'll do so synchronously. --=20 You are receiving this mail because: You are the assignee for the bug.=