From nobody Wed Nov 13 19:35:46 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 4XpYRQ72HQz5cTyh; Wed, 13 Nov 2024 19:35:46 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XpYRQ5QCzz487C; Wed, 13 Nov 2024 19:35:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731526546; 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=3m0V1JiIvcN7E4ucrHopgPkwShCo8PoAVHCnvnZEliY=; b=byksGnCEu30bT44fbQKF0jCQTsDi1GePks0DkYnoIuiwfn6i/xdrlY+qNVENUmdcDZAtH0 i/YVDpPs8Nd1985zw7M8SqxMIzY/jVEiZLlbwH/3hy6bAkfH4Wksubh9AKxQj7S6fROa1w 9kb8TX3X8oDTeKKW2K+RxY2/bYKKLqklBTdENqRdehsNfG9Ku/Zf7TrduuSO8CblU9DYbP JzU5irz+/i2funDDpcfvAjooXMEqbO2PhN0fJX/vZ+V5kbnl95oTGc08vuTeyGUeaSZi2h lHThzuvYIf1PogXWxaMMFmo/mZg8pSsvbVIZ1Yp2EmR9/2mgRSYoIWWNFSzUUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731526546; 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=3m0V1JiIvcN7E4ucrHopgPkwShCo8PoAVHCnvnZEliY=; b=mfA2F8mC+u9dVyG4fD0jKoc1WcfXqnDJWRf5a1t2awEiZKt7skk2cm50V3LeLC8sa1K9WT kqgwgYWES7afvLMKQu69kPbOkHgcT8MDWK47e/KIYu916ADkhz4HUoyiLt8WnvGBKspu6u S7NcYPYFyWYVWPRMGmOQM8HeSpf7MKRPyAy0fSCgSzJOHdyPjRZbEI9Wmek6fyvVb9CafY /fZl3B9l5Y5M6ThrqM5/RBgVWyESQSe23CoxhdwMGdXNjFCOENv4HwMzVQYATQJ351D60R i6AvsNzVTYkRPS4vP6kZ9bdVWR5BelcNnqozrQr0MxOgkU2BkVHZ1PqFywGFgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731526546; a=rsa-sha256; cv=none; b=tdKb2JMQonydqAgSbmqWbZhGBXPwp2Uzq39Qyf0Nc7b7wuyQeDGgOVh5q2DAjJI5Fwg1Vb oaQYwvZolSq3Qncqm8pK0hRfGuFcNf7Tl5VxnLM0C27D1g/EJWTbZSbxILc5XE4HV+1yTk K+lZZk/fmoMW2wk1uz/9BRHNoCStUsFgVEktbpmJDwua29EDeKQz0NOnQK/cvZAocEezQS kYEGJ8JVE3NI1IwcUOxxeYkeCsECUiIglstLyqJwea1FBiYZ0bEzlC1XiRoEGUKXtp5R6Y lbO93ic455q1wO2ULRshpeP+AYePiFp97CsR5ABWhjEAqviz5h7gaTeiXMW9nw== 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 4XpYRQ51zPz174H; Wed, 13 Nov 2024 19:35:46 +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 4ADJZkje050782; Wed, 13 Nov 2024 19:35:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4ADJZkoa050779; Wed, 13 Nov 2024 19:35:46 GMT (envelope-from git) Date: Wed, 13 Nov 2024 19:35:46 GMT Message-Id: <202411131935.4ADJZkoa050779@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: 46f02c4282ff - main - SU+J: all writes to SU journal must be exempt from runningbufspace throttling 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/main X-Git-Reftype: branch X-Git-Commit: 46f02c4282ff76b66579c83be53ef441ea522536 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=46f02c4282ff76b66579c83be53ef441ea522536 commit 46f02c4282ff76b66579c83be53ef441ea522536 Author: Konstantin Belousov AuthorDate: 2024-11-12 06:29:23 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-13 19:35:03 +0000 SU+J: all writes to SU journal must be exempt from runningbufspace throttling regardless whether they come from the system thread or initiated from a normal thread helping the system. If we block waiting for other writes, that writes might not finish because our journal updates block that. Set TDP_NORUNNINGBUF around softdep_process_journal(). Note: Another solution might be to use bwrite() instead of bawrite() if the current thread is subject to the runningbufspace limit. The exempt approach is used to be same as the bufdaemon. PR: 282449 Noted and reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/ufs/ffs/ffs_softdep.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 97f50867b012..98ad4269b5f2 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -3630,6 +3630,7 @@ softdep_process_journal(struct mount *mp, int cnt; int off; int devbsize; + int savef; ump = VFSTOUFS(mp); if (ump->um_softdep == NULL || ump->um_softdep->sd_jblocks == NULL) @@ -3641,6 +3642,8 @@ softdep_process_journal(struct mount *mp, fs = ump->um_fs; jblocks = ump->softdep_jblocks; devbsize = ump->um_devvp->v_bufobj.bo_bsize; + savef = curthread_pflags_set(TDP_NORUNNINGBUF); + /* * We write anywhere between a disk block and fs block. The upper * bound is picked to prevent buffer cache fragmentation and limit @@ -3859,12 +3862,15 @@ softdep_process_journal(struct mount *mp, */ if (flags == 0 && jblocks->jb_suspended) { if (journal_unsuspend(ump)) - return; + goto out; FREE_LOCK(ump); VFS_SYNC(mp, MNT_NOWAIT); ffs_sbupdate(ump, MNT_WAIT, 0); ACQUIRE_LOCK(ump); } + +out: + curthread_pflags_restore(savef); } /*