Page MenuHomeFreeBSD

Opportunistically update the page's dirty field in pmap_ts_referenced().
ClosedPublic

Authored by alc on Aug 31 2016, 4:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 6 2025, 2:11 AM
Unknown Object (File)
Feb 22 2025, 12:46 AM
Unknown Object (File)
Feb 21 2025, 10:42 PM
Unknown Object (File)
Feb 21 2025, 10:05 PM
Unknown Object (File)
Feb 21 2025, 7:47 PM
Unknown Object (File)
Jan 29 2025, 5:29 PM
Unknown Object (File)
Nov 14 2024, 7:25 PM
Unknown Object (File)
Oct 28 2024, 9:26 AM
Subscribers
None

Details

Summary

This change has us opportunistically updating the page's dirty field in pmap_ts_referenced(). I think that the comments explain the benefits.

This won't eliminate pmap_is_modified() calls when the page is not mapped for write access, but those cases are handled efficiently by pmap_is_modified() using the PGA_WRITEABLE flag. Only writeable pages that have not been written to will bear the full cost of pmap_is_modified().

This is a work in progress. I've only written the amd64 implementation as a demonstration.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

alc retitled this revision from to Opportunistically update the page's dirty field in pmap_ts_referenced()..
alc updated this object.
alc edited the test plan for this revision. (Show Details)
alc added reviewers: kib, markj.

Here is some data from the debug counters.

debug.counter_yes: 59075
debug.counter_no: 246172

These values come after 3 and a fraction iterations of a parallel "buildworld" on a machine configured with 3GB memory.

markj edited edge metadata.
markj added inline comments.
amd64/amd64/pmap.c
5901

Is there a reason these assignments are in the loop bodies rather than being lifted to the top of the function?

This revision is now accepted and ready to land.Aug 31 2016, 6:16 PM
alc marked an inline comment as done.Aug 31 2016, 6:25 PM
alc added inline comments.
amd64/amd64/pmap.c
5901

Yes, they could change from one pmap to the next. Specifically, on Intel processors, we could have both EPT and regular format page tables.

kib edited edge metadata.
alc marked 2 inline comments as done.Aug 31 2016, 9:50 PM

Since this is an optimization, I don't need to change the pmap implementations all at once, so I will likely commit this change in a few hours.

This revision was automatically updated to reflect the committed changes.