Page MenuHomeFreeBSD

Remove some lingering page lock usages.
ClosedPublic

Authored by markj on Jan 20 2020, 1:32 PM.
Tags
None
Referenced Files
F139226478: D23279.id67045.diff
Tue, Dec 9, 4:57 PM
Unknown Object (File)
Sat, Nov 15, 5:43 AM
Unknown Object (File)
Sat, Nov 15, 12:57 AM
Unknown Object (File)
Fri, Nov 14, 4:47 AM
Unknown Object (File)
Oct 26 2025, 11:34 AM
Unknown Object (File)
Oct 22 2025, 4:48 AM
Unknown Object (File)
Oct 17 2025, 4:52 AM
Unknown Object (File)
Oct 17 2025, 4:51 AM
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.