Page MenuHomeFreeBSD

(vm object 6) Convert pmap_is_modified, pmap_remove_write, and pmap_clear_modify to expecting busy to be held by the caller now that all callers hold it.
ClosedPublic

Authored by jeff on Sep 10 2019, 8:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 9, 1:35 PM
Unknown Object (File)
Mon, Dec 9, 1:25 AM
Unknown Object (File)
Tue, Nov 26, 5:48 AM
Unknown Object (File)
Oct 17 2024, 8:15 AM
Unknown Object (File)
Oct 3 2024, 2:37 PM
Unknown Object (File)
Sep 30 2024, 11:34 AM
Unknown Object (File)
Sep 23 2024, 5:52 PM
Unknown Object (File)
Sep 13 2024, 4:17 PM

Details

Summary

Now that busy protects against new write mappings we can update the PGA_WRITEABLE usage. I found the old conditional somewhat awkward and relying the presence of busy rather than the absence makes this much more natural.

This is the final diff major diff in this patchset. The remainder simply make use of the new concurrency afforded by them.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26393
Build 24850: arc lint + arc unit

Event Timeline

jeff retitled this revision from Convert pmap_is_modified, pmap_remove_write, and pmap_clear_modify to expecting busy to be held by the caller now that all callers hold it. to (vm object 6) Convert pmap_is_modified, pmap_remove_write, and pmap_clear_modify to expecting busy to be held by the caller now that all callers hold it..Sep 10 2019, 8:26 PM
jeff edited the summary of this revision. (Show Details)
jeff edited reviewers, added: alc, kib, markj, dougm; removed: manu.

Is there any use of PGA_WRITEABLE flag left after the patch ? pmap_page_is_write_mapped() takes the pv lock, while PGA_WRITEABLE check is essentially free.

In D21596#474569, @kib wrote:

Is there any use of PGA_WRITEABLE flag left after the patch ? pmap_page_is_write_mapped() takes the pv lock, while PGA_WRITEABLE check is essentially free.

#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0)

This is the definition on every architecture I looked at. It could actually be MI. The lock is acquired only when setting it.

This revision is now accepted and ready to land.Sep 26 2019, 8:59 PM

I would prefer to avoid using pmap_page_is_write_mapped() in the pmap layer. Toggling PGA_WRITEABLE is still done using the lower-level vm_page_aflags_{set,clear}(), so we should either have corresponding pmap_* functions for doing that, or continue with the plain aflags accesses, or add a vm_page_aflags() accessor.