Page MenuHomeFreeBSD

(vm object 4) Wrap valid accesses in inlines. Add missing busy acquires to protect valid.
Needs ReviewPublic

Authored by jeff on Tue, Sep 10, 8:11 PM.

Details

Reviewers
alc
kib
markj
dougm
Summary

This patch wraps canonically protected valid bit access in inlines and leaves those that have special protection without. It slightly expands the scope of busy to ensure that all valid manipulation is done with a busy lock. In the case of a shared busy lock we use atomic updates to the valid field as we do with dirty. The following guarantees exist after this:

valid is always set with busy held.
valid is always cleared with busy and the object lock held.
valid is reliably checked against zero with either object or busy.

The first clause should be clear. Before we may not have held the busy lock but it had been guaranteed that it was not otherwise held which is logically the same as holding it.

The second clause exists because some callers like vm_map_pmap_enter() want to enter valid pages without checking the busy state. Fortunately valid is only cleared on truncate and pageout so effectively the object lock requirement is rare.

Diff Detail

Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 26391
Build 24848: arc lint + arc unit

Event Timeline

jeff created this revision.Tue, Sep 10, 8:11 PM
jeff retitled this revision from Wrap valid accesses in inlines. Add missing busy acquires to protect valid. to (vm object 4) Wrap valid accesses in inlines. Add missing busy acquires to protect valid..Tue, Sep 10, 8:19 PM
jeff edited the summary of this revision. (Show Details)
jeff added reviewers: alc, kib, markj, dougm.
jeff added inline comments.Thu, Sep 19, 9:34 PM
sys/vm/vm_page.h
128

s/speculativey/speculative/

159

Need to clean up wording here.