Page MenuHomeFreeBSD

Remove some lingering page lock usages.
ClosedPublic

Authored by markj on Jan 20 2020, 1:32 PM.
Tags
None
Referenced Files
F157509719: D23279.id67216.diff
Fri, May 22, 5:30 AM
F157464969: D23279.id67216.diff
Thu, May 21, 6:30 PM
Unknown Object (File)
Wed, May 20, 10:04 PM
Unknown Object (File)
Wed, May 20, 10:03 PM
Unknown Object (File)
Wed, May 20, 9:24 PM
Unknown Object (File)
Wed, May 20, 9:24 PM
Unknown Object (File)
Wed, May 20, 10:33 AM
Unknown Object (File)
Tue, May 19, 7:16 PM
Subscribers

Details

Summary

I neglected to remove vm_page_change_lock(), which still had a couple of
consumers in the contig reclaim code.

Fix object locking. The page lock no longer protects the page's
<object, pindex> tuple as of r352110. Instead we must unconditionally
acquire the object lock and validate the page's object pointer.

Remove an unnecessary second check for page wirings in
vm_page_scan_contig(). Both checks are racy so it doesn't really make
sense to repeat them. Races are handled properly in
vm_page_reclaim_run().

Test Plan

Peter tested the patch.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 28786
Build 26795: arc lint + arc unit

Event Timeline

markj added reviewers: alc, kib, dougm, jeff.
kib added inline comments.
sys/vm/vm_page.c
2544

Why don't you relock the right object, instead of giving up ?

This revision is now accepted and ready to land.Jan 20 2020, 4:00 PM

Retry in vm_page_scan_contig() if the object pointer changed.

This revision now requires review to proceed.Jan 23 2020, 5:11 PM
sys/vm/vm_page.c
2559

I didn't notice this before. What happened to the wired check?

2676

If you trybusy first you can be sure the object is either identical or NULL. I am likely to make this change eventually.

sys/vm/vm_page.c
2559

There were two wired checks in this function, I removed one. There is no purpose to having two checks, since there's nothing preventing a wiring from appearing after this function returns and before the reclamation begins. vm_page_reclaim_contig() handles such races.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 1 2020, 6:24 PM
This revision was automatically updated to reflect the committed changes.