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)
Dec 23 2023, 10:40 AM
Unknown Object (File)
Nov 19 2023, 2:42 AM
Unknown Object (File)
Nov 9 2023, 5:24 AM
Unknown Object (File)
Nov 6 2023, 4:13 AM
Unknown Object (File)
Nov 5 2023, 3:17 PM
Unknown Object (File)
Oct 31 2023, 9:02 AM
Unknown Object (File)
Oct 18 2023, 1:36 AM
Unknown Object (File)
Oct 8 2023, 4:20 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.