Page MenuHomeFreeBSD

Remove page locking from pmap_mincore().
ClosedPublic

Authored by markj on Sep 27 2019, 4:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 19, 5:24 PM
Unknown Object (File)
Feb 23 2024, 1:04 PM
Unknown Object (File)
Jan 3 2024, 11:16 AM
Unknown Object (File)
Dec 5 2023, 8:45 PM
Unknown Object (File)
Nov 8 2023, 6:03 AM
Unknown Object (File)
Nov 4 2023, 5:18 PM
Unknown Object (File)
Oct 7 2023, 5:00 AM
Unknown Object (File)
Oct 3 2023, 9:26 PM

Details

Summary

It is useless in mincore(2)'s default mode of operation. If we are in
the non-default mode, re-look up the page in the pmap after acquiring
the page's object lock.

Sprinkle some style fixes in vm_map_mincore(). If the approach is
acceptable, I will convert the other implementations of pmap_mincore()
and remove vm_page_pa_tryrelock().

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26795
Build 25133: arc lint + arc unit

Event Timeline

Restore the original comment for the mincore_mapped case, I didn't
mean to rewrite it.

I think the approach of relying on the object lock is fine.

sys/vm/vm_mmap.c
883

Where does this loop terminate if m->object == object and not NULL ?

kern_proc_vmmap_resident() requires an update as well.

This revision is now accepted and ready to land.Sep 29 2019, 8:08 PM
  • Convert other pmaps.
  • Remove vm_page_pa_tryrelock().
  • Initialize pa = 0. Some platforms do not implement pmap_mincore().
This revision now requires review to proceed.Sep 30 2019, 1:32 AM
sys/vm/vm_mmap.c
798

Shouldn't this be:

end = round_page(addr0 + len);
sys/amd64/amd64/pmap.c
8407

This is redundant.

markj added inline comments.
sys/vm/vm_mmap.c
798

I think so.

883

I forgot to submit this comment apparently:

Sorry, I probably don't understand the question. The loop condition is m->object != object. object != NULL implies that object is write-locked, so if m->object == object the page identity cannot change.

  • Remove an unnecessary assignment in pmap_mincore().
  • Fix the calculation of end.
This revision was not accepted when it landed; it landed in state Needs Review.Oct 27 2019, 12:39 PM
This revision was automatically updated to reflect the committed changes.