Page MenuHomeFreeBSD

vm_map: use page iterators in pmap_enter
ClosedPublic

Authored by dougm on Apr 18 2025, 8:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 4, 2:31 AM
Unknown Object (File)
Fri, Oct 3, 11:52 AM
Unknown Object (File)
Fri, Oct 3, 4:31 AM
Unknown Object (File)
Sun, Sep 28, 10:46 PM
Unknown Object (File)
Wed, Sep 17, 8:26 AM
Unknown Object (File)
Tue, Sep 16, 1:27 AM
Unknown Object (File)
Mon, Sep 15, 6:15 PM
Unknown Object (File)
Sat, Sep 6, 6:27 AM
Subscribers

Details

Summary

Change vm_map_pmap_enter to use pctrie iterators to iterate over pages, rather than using TAILQ links.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

dougm requested review of this revision.Apr 18 2025, 8:24 PM
dougm created this revision.
sys/vm/vm_map.c
2739–2740

Why is this not vm_radix_iter_jump()?

sys/vm/vm_map.c
2739–2740

We don't need to examine the page 511 pages ahead. We need to add 511 here so that the next page we examine will be the one 512 pages ahead, after step() adds one more to the index value. We would have to examine at least a couple of pctrie nodes to get to the page 511 pages ahead that we wouldn't have to examine if we went directly to the page 512 pages ahead.

sys/vm/vm_map.c
2739–2740

Doesn't iter_jump() perform mostly the same: set up the new index and then look up the page at it?

Anyway, let me formulate my question in more generic way: the += mask op exposes the iterator implementation, which is unfortunate. Can we add some primitive to the set of iterator' ops, to be used there? I thought that the iter_jump() function is exactly what is needed, if you have more optimal proposal, I fully agree.

dougm retitled this revision from vm_map: replace TAILQ_NEXT with VM_RADIX_FORALL to vm_map: use page iterators in pmap_enter.
dougm edited the summary of this revision. (Show Details)

Avoid modifying pages.index.

This revision is now accepted and ready to land.Apr 18 2025, 11:35 PM
This revision was automatically updated to reflect the committed changes.