Page MenuHomeFreeBSD

Make dirty queues a per-domain property
ClosedPublic

Authored by jeff on Mar 15 2018, 7:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 21 2024, 6:42 AM
Unknown Object (File)
Sep 21 2024, 3:35 PM
Unknown Object (File)
Sep 21 2024, 1:24 PM
Unknown Object (File)
Sep 4 2024, 10:17 PM
Unknown Object (File)
Sep 4 2024, 4:40 PM
Unknown Object (File)
Sep 4 2024, 8:33 AM
Unknown Object (File)
Sep 3 2024, 12:28 PM
Unknown Object (File)
Sep 1 2024, 3:13 AM
Subscribers
None

Details

Summary

We found two bugs with recent buffer cache changes. Firstly, if all of the dirty buffers were on a single domain we still may not trip the limit to start buf_daemon. Secondly, softdep has an issue where it can hold thousands of locked bufs while waiting on a few delayed writes to happen. This second one is really hard to solve gracefully. For the first, we move all dirty queues and limits into per-domain structures while keeping a single buf daemon for now. This should also help with high bandwidth write situations. For the second, a comment and a bd_speedup() if we can't free clean buffers.

I also fixed per-domain sysctls by leaving the appearance of globals and doing the division before assignment to individual queues.

I added some significant debug info to show bufqueues which was quite enlightening and should continue to be so if we have other leaks.

I added a small optimization to bufspace_adjust() that reduces cache contention on the hot bufspace variable.

This has already gotten the thumbs up from pho.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

vfs_bio.c
104 ↗(On Diff #40329)

I had to move all of this or really scatter the function definitions. Sorry it makes the diff harder to read.

376 ↗(On Diff #40329)

Same technique as vm

1483 ↗(On Diff #40329)

I suppose if I made the bqempty per-domain we could simplify this whole function into an array lookup again. However, there is no concurrency value in making per-domain bqempty and it would complicate other code.

This revision is now accepted and ready to land.Mar 17 2018, 5:27 PM
This revision was automatically updated to reflect the committed changes.