Page MenuHomeFreeBSD

amd64: replace tailq pointers with iterators
ClosedPublic

Authored by dougm on Sun, Apr 20, 5:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 25, 12:54 PM
Unknown Object (File)
Fri, Apr 25, 10:35 AM
Unknown Object (File)
Fri, Apr 25, 4:01 AM
Unknown Object (File)
Fri, Apr 25, 1:08 AM
Unknown Object (File)
Fri, Apr 25, 1:02 AM
Unknown Object (File)
Wed, Apr 23, 3:02 PM
Unknown Object (File)
Wed, Apr 23, 7:03 AM
Unknown Object (File)
Tue, Apr 22, 5:27 AM
Subscribers

Details

Summary

Change architecture-specific code to use iterators rather than tailq pointers.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dougm requested review of this revision.Sun, Apr 20, 5:45 AM
dougm created this revision.
This revision is now accepted and ready to land.Sun, Apr 20, 12:34 PM
sys/amd64/amd64/pmap.c
7711

Why can't we just assign m = m_start?

7942

The vm_object_populate() call above guarantees that the object has resident pages for pindices [pindex, pindex+size). I don't think we can have p == NULL here.

7944

Why is it ok to drop the physical address check?

sys/amd64/amd64/pmap.c
7711

That won't set pages.index to m_start->pindex, so iter_step() and iter_jump() will be adding to an incorrect or uninitialized value to update the index value.

7944

Because line 7940 is
p = vm_radix_iter_next(&pages);
and not
p = vm_radix_iter_step(&pages);

The latter would be equivalent to "p = TAILQ_NEXT(p, listq). The former gets the page with the next address, and gets NULL if there is no such page.

sys/amd64/amd64/pmap.c
7944

Contiguity in the pindex space doesn't imply contiguity in the physical address space. The vm_object_populate() call ensures that a page is resident at all pindices in the range, so the old code could have equivalently used vm_page_next().

Drop null check. Restore physical address check.

This revision now requires review to proceed.Sun, Apr 20, 8:19 PM
This revision is now accepted and ready to land.Sun, Apr 20, 11:25 PM
This revision was automatically updated to reflect the committed changes.