Page MenuHomeFreeBSD

Split active and inactive queue scans into separate functions.
ClosedPublic

Authored by markj on May 19 2018, 7:30 PM.
Tags
None
Referenced Files
F102668038: D15490.diff
Fri, Nov 15, 2:45 PM
Unknown Object (File)
Wed, Oct 23, 3:04 AM
Unknown Object (File)
Wed, Oct 23, 3:04 AM
Unknown Object (File)
Wed, Oct 23, 3:04 AM
Unknown Object (File)
Wed, Oct 23, 3:04 AM
Unknown Object (File)
Wed, Oct 23, 2:41 AM
Unknown Object (File)
Oct 11 2024, 5:42 AM
Unknown Object (File)
Sep 30 2024, 1:59 PM
Subscribers

Details

Summary

The aim here is to address a problem reported by avg, where we
erroneously pause() after a scan in a situation where we should really
be continuing to scan the active queue in order to address a shortfall
of inactive pages. Consider an application with a read-only mapping of a
file several times the size of RAM, which is accessing blocks in a
random order. Most of the system's pages will end up in the active
queue, and during memory shortages we will end up pause()ing for a
second at a time in between scans. The pause() is intended to provide
time for laundering to complete, and is incorrect in this scenario.
Having a separate subroutine for active queue scans makes it easier for
the control loop to determine if the active queue scan met its target.

The change should not have any functional impact. I think the use of the
"pass" parameter doesn't make much sense anymore, and is incorrect
anyway since it never gets reset to 0 in the current code. I will
address this in a separate commit.

Test Plan

So far I've only verified that we boot.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 16701
Build 16595: arc lint + arc unit

Event Timeline

markj added reviewers: alc, kib, jeff.
markj added a subscriber: avg.
This revision is now accepted and ready to land.May 19 2018, 8:49 PM
alc added inline comments.
sys/vm/vm_pageout.c
1120

I don't think that the meaning of "that they can eventually be reused" is clear.

1123

I don't think that this function needs to have "scan_" in its name.

1172–1173

This is, perhaps, unrelated to this particular change, but I point out that it's unclear what we are maintaining "consistency" with.

Also, I'm glad to see that our discussions last year about avoiding requeueing on the active queue have come to fruition.

1258–1259

I think there is a missing step in the explanation here. I suggest:

"However, during a page shortage, the inactive queue is necessarily small, and so dirty pages would only spend a trivial amount of time in the inactive queue. Therefore, we might as well place them directly in the laundry queue to reduce queueing overhead."

markj marked 3 inline comments as done.

Handle feedback.

This revision now requires review to proceed.May 22 2018, 10:29 PM
sys/vm/vm_pageout.c
1120

I'm not completely sure what I meant when I wrote that.

sys/vm/vm_pageout.c
1119

Duplicate "more".

This revision is now accepted and ready to land.May 24 2018, 2:43 AM
This revision was automatically updated to reflect the committed changes.