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)
Jan 14 2024, 5:20 AM
Unknown Object (File)
Sep 19 2023, 11:38 AM
Unknown Object (File)
Sep 6 2023, 9:22 AM
Unknown Object (File)
Sep 6 2023, 9:21 AM
Unknown Object (File)
Sep 1 2023, 7:51 AM
Unknown Object (File)
Jul 14 2023, 5:33 AM
Unknown Object (File)
Jun 26 2023, 11:15 PM
Unknown Object (File)
Jun 15 2023, 7:19 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.