Page MenuHomeFreeBSD

Fix bugs related to recent fault changes
ClosedPublic

Authored by jeff on Jan 13 2020, 7:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 22 2024, 3:36 AM
Unknown Object (File)
Oct 6 2024, 1:57 AM
Unknown Object (File)
Oct 4 2024, 12:49 AM
Unknown Object (File)
Sep 26 2024, 6:08 PM
Unknown Object (File)
Sep 25 2024, 11:28 AM
Unknown Object (File)
Sep 23 2024, 8:31 AM
Unknown Object (File)
Sep 22 2024, 2:18 AM
Unknown Object (File)
Sep 22 2024, 12:55 AM
Subscribers

Details

Summary

This needs to go in before my collapse rewrite. The title may be slightly misleading in retrospect. This fixes the three-level shadow chain problem I described in my december emails "fault cow race" that becomes more pronounced after I weaken the protection of pip.

Stated as simply as I can, fault can copy a page from an arbitrarily deep level of nesting in the backing object chain while the collapse scan only prevents collapses of immediately adjacent objects in the chain. Before this patch, we simply look at the page count and page validity to determine if an object completely shadows its backing_object. Because we atomically swap the backing page and first_object page in pmap_enter() the backing_object page exists in pmap after the shadow check could return true.

Today this bug only triggers with deep chains. With my collapse patch it is possible with only a pair of objects because pip doesn't stop us from scanning the shadow chain.

To address this, I prevent scan_all_shadowed from returning true if the page in the backing_object is xbusy and I always do the full scan. Then, I added another page pointer to the fault state. This page is left xbusy until fault completes or is restarted. In this way we hold the original backing object page until the cow replacement is complete.

Long term I would like to make a shared busy lock type that allows us to do concurrent faults while preventing pageouts. This can't have the same semantics as shared busy which still permits page invalidation. For now I don't think the extra serialization and scans are particularly problematic. My entire object locking branch completes a parallel buildkernel on a 100 core machine in 1/10th the time of current.

Test Plan

This passes stress2 including my collapse test.

Diff Detail

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