Page MenuHomeFreeBSD

Remove some lingering page lock usages.
ClosedPublic

Authored by markj on Jan 20 2020, 1:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Feb 4, 12:56 PM
Unknown Object (File)
Tue, Jan 28, 11:52 PM
Unknown Object (File)
Mon, Jan 27, 2:59 AM
Unknown Object (File)
Oct 24 2024, 1:49 AM
Unknown Object (File)
Oct 22 2024, 10:56 PM
Unknown Object (File)
Oct 18 2024, 12:12 PM
Unknown Object (File)
Oct 18 2024, 12:11 PM
Unknown Object (File)
Oct 18 2024, 12:11 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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj added reviewers: alc, kib, dougm, jeff.
kib added inline comments.
sys/vm/vm_page.c
2544 ↗(On Diff #67045)

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
2563 ↗(On Diff #67216)

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

2680 ↗(On Diff #67216)

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
2563 ↗(On Diff #67216)

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.