Page MenuHomeFreeBSD

vm_fault: use iterator in populate()
ClosedPublic

Authored by dougm on Thu, Apr 24, 8:14 PM.
Tags
None
Referenced Files
F115727724: D50010.diff
Sun, Apr 27, 6:50 PM
Unknown Object (File)
Sat, Apr 26, 8:49 AM
Unknown Object (File)
Sat, Apr 26, 7:57 AM
Unknown Object (File)
Sat, Apr 26, 5:23 AM
Unknown Object (File)
Sat, Apr 26, 4:05 AM
Unknown Object (File)
Sat, Apr 26, 12:38 AM
Unknown Object (File)
Fri, Apr 25, 10:41 PM
Unknown Object (File)
Fri, Apr 25, 11:44 AM
Subscribers

Details

Summary

Use iterators instead of tailq_next pointers in vm_fault_populate().

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

dougm requested review of this revision.Thu, Apr 24, 8:14 PM
dougm created this revision.
This revision is now accepted and ready to land.Fri, Apr 25, 3:09 AM

BTW, is there a difference in performance between iter_stride(, 1) and iter_stride(, 512)? I suppose the stride 1 needs much less pctrie walking.
If yes, it might make sense to keep the m[npages - 1] walk step.

In D50010#1140572, @kib wrote:

BTW, is there a difference in performance between iter_stride(, 1) and iter_stride(, 512)? I suppose the stride 1 needs much less pctrie walking.
If yes, it might make sense to keep the m[npages - 1] walk step.

The time it takes to stride from x to y depends on the most significant bit where x and y differ, so a stride by 1 from 511 to 512 would take as long as a stride by 512 from 0 to 512. If x and y differ first in bit b, then we have to climb ceil(b/4) steps up the tree and ceil(b/4) steps down to get from the node that points to page x to the node that points to page y.

This revision was automatically updated to reflect the committed changes.
dougm added a reviewer: alc.

Drop the iterator entirely. The unlock/relocks mean we'd have to reset it before every use, so it's not worth anything. Just use lookups.

Reopening, so we can eliminate that TAILQ.

This revision is now accepted and ready to land.Fri, Apr 25, 6:57 AM
This revision was automatically updated to reflect the committed changes.