From nobody Sun Jan 23 20:01:40 2022 X-Original-To: dev-commits-src-branches@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 8D34519840AC; Sun, 23 Jan 2022 20:01:41 +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 4JhkXP08PSz4bqL; Sun, 23 Jan 2022 20:01:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642968101; 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=9BnzBWzifRO6yoGY4Dl2rNRcv82dm2iYkF4sqTNC0W0=; b=FRgi8N5EyQ8mduja9jXwj8rhuUWojiVn5yPJwtz28br/kiuHty+AsdFvGqhg1kl0ZJY/6v tAUS9yeClaIvhHlvYyMOqyR/xd/e4VEdavjah3ZN/ZBgov0EYEhrS9Uu1xaXa+2yhVlm6j Zdtgh40GV0N7G1FosiPPVlWEA1ILK+yVlDCmeiKxvusMUDLRQ1hYowJZYT5NjyJEovnreD P5CSnBB7bSXUnGtJ7BZLDkt651mcTDk05W6ZXpcxOTqAcbs/rUODh7td2WHq3dB45N2p7Z 97kds/MTF27lwysu157lI7vYz1p+fmVwDmQzgXx9A5xldhctKYALKgxXy/jurA== 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 A4D4FB0C; Sun, 23 Jan 2022 20:01:40 +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 20NK1eM5076599; Sun, 23 Jan 2022 20:01:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20NK1ej8076598; Sun, 23 Jan 2022 20:01:40 GMT (envelope-from git) Date: Sun, 23 Jan 2022 20:01:40 GMT Message-Id: <202201232001.20NK1ej8076598@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: c8c305ac071a - stable/12 - Fix inverse sleep logic in buf_daemon(). List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c8c305ac071a660c34de274cc6fd6daae6a1642d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642968101; 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=9BnzBWzifRO6yoGY4Dl2rNRcv82dm2iYkF4sqTNC0W0=; b=kxpB0LAF/cD5/yiFKJuKtgIz9HrfiLbnxLeh/Jgev9tXR8yhCnBKIB8LK9bvHJ030OForI 1b4hvHPbdvwWioyhoBfUHtdh4NKL+JuXYsiG7WOkfKUV6y/wzM9ywr2Ol6p2B2kmiJiF7u yz+e7eio6Hs8nqU41drWUvZCRXKM8C4kExal7jgr64+QjrK70HFfa4EHxPANga+pqX72Ll HlSsYwm+oGgrO/GIQbgoF4xWHM7dnPhHmxh7ZIsEVH37FxknAzKBzi1Nr46sikNjxcKKpO S+bnZ4NlaAB52Z2Xf2R2nY/oF0JiJELsEvXwimQL8kblnB4XNxQ9QSqtbTAK0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642968101; a=rsa-sha256; cv=none; b=S6gp3jT8MfKqOhoOlVDxOxZ3fMPseZ32vxbMxEipjtHjhiYeqs0jcmUKj731eqY6VVFzDi ubKsddZKRdrB5+5pDA5PTzaFLv/F3KWMqPFRyLlW4yFHq6aRNcH0ZFVFbRLX0CrGzrW3ni 2X1x0Kxi7SQ/Kw5DRKYWXNfoXSJv7/LWypnPBekq1KXdJIgNkpGo4uqgmLFybQ2Ngd8Ge0 wV1dIYcWrCDIKQUQtew7fNk1rvW749M3ymlqY4Uq5HRMuBKhhnGFkeo3h2dSR9HMlY13PA hpbeUUT5TqmNpZolLG5VO+SsGToFT7h28hub9ayapd/QC327uOFYDZLHWJCr6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=c8c305ac071a660c34de274cc6fd6daae6a1642d commit c8c305ac071a660c34de274cc6fd6daae6a1642d Author: Alexander Motin AuthorDate: 2022-01-16 00:32:36 +0000 Commit: Alexander Motin CommitDate: 2022-01-23 20:01:27 +0000 Fix inverse sleep logic in buf_daemon(). Before commit 3cec5c77d617 buf_daemon() went to longer 1s sleep if numdirtybuffers <= lodirtybuffers. After that commit new condition !BIT_EMPTY(BUF_DOMAINS, &bdlodirty) got opposite -- true when one or more more domains is above lodirtybuffers. As result, on freshly booted system with no dirty buffers buf_daemon() wakes up 10 times per second and probably only 1 time per second when there is actual work to do. MFC after: 1 week Reviewed by: kib, markj Tested by: pho Differential revision: https://reviews.freebsd.org/D33890 (cherry picked from commit e76c0108990b52a25f548cba4c0f1b8db59c6b8b) --- sys/kern/vfs_bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index e1fb76ac6d35..f2b8f0b0ba1d 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -3394,7 +3394,7 @@ buf_daemon() * to avoid endless loops on unlockable buffers. */ mtx_lock(&bdlock); - if (!BIT_EMPTY(BUF_DOMAINS, &bdlodirty)) { + if (BIT_EMPTY(BUF_DOMAINS, &bdlodirty)) { /* * We reached our low water mark, reset the * request and sleep until we are needed again.