Page MenuHomeFreeBSD

Fix inverse sleep logic in buf_daemon()
ClosedPublic

Authored by mav on Jan 14 2022, 4:11 AM.
Tags
None
Referenced Files
F102930046: D33890.diff
Mon, Nov 18, 9:28 PM
Unknown Object (File)
Wed, Nov 13, 9:13 AM
Unknown Object (File)
Sep 26 2024, 11:56 PM
Unknown Object (File)
Sep 26 2024, 8:20 AM
Unknown Object (File)
Sep 25 2024, 3:39 PM
Unknown Object (File)
Sep 21 2024, 1:12 PM
Unknown Object (File)
Sep 9 2024, 2:50 AM
Unknown Object (File)
Aug 23 2024, 7:28 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.