Page MenuHomeFreeBSD

Fix inverse sleep logic in buf_daemon()
ClosedPublic

Authored by mav on Jan 14 2022, 4:11 AM.
Tags
None
Referenced Files
F80135730: D33890.diff
Thu, Mar 28, 9:55 AM
Unknown Object (File)
Feb 9 2024, 2:55 PM
Unknown Object (File)
Dec 23 2023, 1:27 AM
Unknown Object (File)
Dec 12 2023, 4:56 PM
Unknown Object (File)
Nov 24 2023, 11:52 PM
Unknown Object (File)
Sep 23 2023, 11:06 PM
Unknown Object (File)
Aug 29 2023, 10:07 PM
Unknown Object (File)
Jul 4 2023, 2:11 AM
Subscribers

Details

Summary

Before commit 3cec5c77d617 buf_daemon() went to longer 1s sleep if numdirtybuffers <= lodirtybuffers. After that commit new condition !BIT_EMPTY(BUF_DOMAINS, &bdlodirty) is 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.

Test Plan

With the patch I see buf_daemon() wake up rate on freshly booted system drops to one time per second.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

mav requested review of this revision.Jan 14 2022, 4:11 AM
mav retitled this revision from Inverse sleep logic in buf_daemon() to Fix inverse sleep logic in buf_daemon().Jan 14 2022, 4:33 AM
mav edited the summary of this revision. (Show Details)

Might be worth asking pho to run stress2 with the patch, to make sure that there is no other bugs uncovered by this.

This revision is now accepted and ready to land.Jan 14 2022, 8:47 AM

I ran a mix of random stress2 tests for 24 hours, without observing any problems.

This revision was automatically updated to reflect the committed changes.