git: c8c305ac071a - stable/12 - Fix inverse sleep logic in buf_daemon().

From: Alexander Motin <mav_at_FreeBSD.org>
Date: Sun, 23 Jan 2022 20:01:40 UTC
The branch stable/12 has been updated by mav:

URL: https://cgit.FreeBSD.org/src/commit/?id=c8c305ac071a660c34de274cc6fd6daae6a1642d

commit c8c305ac071a660c34de274cc6fd6daae6a1642d
Author:     Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2022-01-16 00:32:36 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
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.