From nobody Sun Jan 16 00:36:23 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 3DCCB196BC87; Sun, 16 Jan 2022 00:36:24 +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 4Jbx141CwMz4fjb; Sun, 16 Jan 2022 00:36:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642293384; 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=exyMKC2DjW8z30Bk7wxFlxpAFlBrC7QKMh/3CA1CN3U=; b=iFsDVvnSKmOLt40KeeNtPumYo5aW5N0XqJrnhe7ppCBAC5zeO6cZkMLPQPeHfbuiDiBWFm G0VGjh2JspfSkZRka3B8tsHVEHPV92BB0sViJaGAzmZrnxFz7A/R7sGVc41bH+vt1EM1VR NioEuEt6vnFh5YfLfgaW01o8VEeqJsk4oR4O00T+zQc0W0gyZPHGKvpEEq6y68NVfstjhL uKMCQ27uoD6lnTlmE1sNs5bzogbTqWlAanCVzTl7CUuItljzURp4Bm5ejFKbBuMVY8JxKC JKOx9hEM1h/PWJb0RjviYf0jdA5KJ4v74UKTmxMn1rrRmYYE+Xph10F1JTrG0Q== 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 09A2310DC7; Sun, 16 Jan 2022 00:36:24 +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 20G0aNCd028126; Sun, 16 Jan 2022 00:36:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20G0aNaE028125; Sun, 16 Jan 2022 00:36:23 GMT (envelope-from git) Date: Sun, 16 Jan 2022 00:36:23 GMT Message-Id: <202201160036.20G0aNaE028125@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: e76c0108990b - main - Fix inverse sleep logic in buf_daemon(). 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: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e76c0108990b52a25f548cba4c0f1b8db59c6b8b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642293384; 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=exyMKC2DjW8z30Bk7wxFlxpAFlBrC7QKMh/3CA1CN3U=; b=YK7l5g/RC/l5f0cY34p3aiXPYRrNXW/DoBrYrvffWuJc7ZJfSX2BcyCcvPASlyAMl5SPtB +agPOwMuI6NsK62y09DCoRdNuN9PmXIo91/T3khxQl9m99jfUH3Vj8xpQcgBu9uJDNsbCp h9GYF+O3r6LI+zGSqyq1IIX37GW1HJCXwjhAvEWp2wwBNHX3ZYuV65a1sDAjSplKtIgoKX 9pMBYOJ8EHo48i0EvioMFDgqBW5EE0ejeV+asqbewySGS6cy2k0TVzh5xJiLvrhtvuq3Wt wN4FaqQvBuhZblHhles6WYwzvAYSZBZ28sGQtnZRZLV4ubji8DuS+/WjvlygoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642293384; a=rsa-sha256; cv=none; b=BEmd1QI4qbIQlPPL968O61g+07N0aS4N1ncW4AiZa9r4swJzLwAG8EKRu5tp/fc9gkRQCK Nh4lwE8GX6f5G6nU+nwuxchOaXEIaRdFOUbbN7MfncEAXyP16RPNxrF7VRKXgBdtjoZMGL WMAkeMShlY2featnM+x6ruVRKvSHiHmZd/y/E1yaq9fzoaUX6uYYas4wz2NgFYOHn0oHtA 3SkLPzGhO7ymzhwLyG3d51jntuMS++09pWI2xkL2g2stFZMtOCza/x1lhmQubctIxR6PzM Gx6tk9ninbinaQiM25CNerGXtU49f2vMfGL2Ssk7x9IQqGSKlB9i19gIF7NrMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=e76c0108990b52a25f548cba4c0f1b8db59c6b8b commit e76c0108990b52a25f548cba4c0f1b8db59c6b8b Author: Alexander Motin AuthorDate: 2022-01-16 00:32:36 +0000 Commit: Alexander Motin CommitDate: 2022-01-16 00:32:36 +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 --- 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 acd16ecdf3fe..8e79943e3fee 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -3464,7 +3464,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.