This also fixes a bug where not-last unbusy failed to post a release
fence.
Details
Details
- Reviewers
kib markj - Commits
- rGf6ffed44a8eb: vm: use atomic fetchadd in vm_page_sunbusy
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/vm/vm_page.c | ||
---|---|---|
981 | We should keep this assertion (and additionally verify that the page is not xbusy). |
Comment Actions
The 'lack' of the release fence for non-last sunbusy is intentional, it is only needed for the last unlock.
sys/vm/vm_page.c | ||
---|---|---|
981 | you want this asserted before or after (as in on the result of fetchadd). note there is already vm_page_assert_sbusied in there |
sys/vm/vm_page.c | ||
---|---|---|
981 | The assertion should be on the state returned by fetchadd. The existing assertion is looks sufficient, but it's racy and that can easily be fixed. |
sys/vm/vm_page.c | ||
---|---|---|
981 | something of this sort? x = atomic_fetchadd_int(&m->busy_lock, -VPB_ONE_SHARER); KASSERT(x != VPB_FREED, ("page %p is freed", m)); KASSERT(x != VPB_UNBUSIED && (x & VPB_BIT_SHARED) != 0, ("page %p not sbusied", m)); |
sys/vm/vm_page.c | ||
---|---|---|
981 | Looks right to me. |