Page MenuHomeFreeBSD

vm_object_split(): Handle orig_object type changes.
ClosedPublic

Authored by markj on Aug 28 2020, 7:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 10, 11:42 PM
Unknown Object (File)
Thu, Mar 7, 12:42 PM
Unknown Object (File)
Jan 16 2024, 12:06 PM
Unknown Object (File)
Jan 2 2024, 11:22 AM
Unknown Object (File)
Dec 31 2023, 8:21 PM
Unknown Object (File)
Dec 30 2023, 4:18 AM
Unknown Object (File)
Dec 26 2023, 8:01 PM
Unknown Object (File)
Dec 20 2023, 5:01 AM
Subscribers

Details

Summary

orig_object->type can change from DEFAULT to SWAP while
vm_object_split() is sleeping. In this case some pages in new_object
may be left unbusied, but vm_object_split() attempts to unbusy all of
them. Track the beginning of the busied range and take care to
unbusy only the pages observed while the source object is of type
OBJT_SWAP.

Diff Detail

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

Event Timeline

markj requested review of this revision.Aug 28 2020, 7:27 PM
markj created this revision.
markj added reviewers: alc, kib, dougm.
sys/vm/vm_object.c
1596 ↗(On Diff #76320)

Regardless of your patch, wouldn't we self-deadlock if this goto occurs and type is OBJT_SWAP ?

Assert that the original object does not get repopulated during sleeps.

Improve the assertion message.

This revision is now accepted and ready to land.Aug 28 2020, 9:33 PM
This revision now requires review to proceed.Aug 28 2020, 11:09 PM
sys/vm/vm_object.c
1635 ↗(On Diff #76331)

Why do you use "find least" instead of vm_page_lookup() or keeping a pointer to the first page that was left busy above? Using "find least" seems to imply that elsewhere in the kernel someone might be removing from the new object one of the pages left busy above.

markj marked an inline comment as done.

Maintain a pointer to the first busied page.

sys/vm/vm_object.c
1635 ↗(On Diff #76331)

I don't think there is any reason not to just maintain a pointer to the first busy page.

This revision is now accepted and ready to land.Aug 29 2020, 10:02 PM
sys/vm/vm_object.c
1559 ↗(On Diff #76357)

Shouldn't this be?

idx = 0;
markj marked an inline comment as done.

Fix the initialization of idx.

This revision now requires review to proceed.Aug 30 2020, 2:24 AM
This revision is now accepted and ready to land.Aug 30 2020, 2:38 AM
This revision was automatically updated to reflect the committed changes.