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.

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 OK
Unit
No Unit Test Coverage
Build Status
Buildable 26393
Build 24850: arc lint + arc unit

Event Timeline

jeff created this revision.Sep 10 2019, 8:24 PM
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.
kib added a comment.Sep 22 2019, 1:25 PM

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.

jeff added a comment.Sep 25 2019, 11:29 PM
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.

kib accepted this revision.Sep 26 2019, 8:59 PM
This revision is now accepted and ready to land.Sep 26 2019, 8:59 PM
markj accepted this revision.Sep 27 2019, 6:57 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.

jeff closed this revision.Oct 15 2019, 4:19 AM