Page MenuHomeFreeBSD

Ignore object->handle for OBJ_ANON objects.
ClosedPublic

Authored by kib on Nov 20 2019, 7:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 31 2024, 9:14 AM
Unknown Object (File)
Jan 9 2024, 12:57 PM
Unknown Object (File)
Dec 21 2023, 10:44 PM
Unknown Object (File)
Dec 20 2023, 5:16 AM
Unknown Object (File)
Oct 31 2023, 8:19 AM
Unknown Object (File)
Sep 6 2023, 4:06 AM
Unknown Object (File)
Sep 3 2023, 1:25 AM
Unknown Object (File)
Sep 3 2023, 1:23 AM
Subscribers

Details

Summary

Note that the change in vm_object_collapse() is arguably a correctness fix. We must not collapse into content-identity carrying objects.

[This is a preparational commit, the plan is to use handle for OBJ_ANON to point to the end of the shadow chain].

Diff Detail

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

Event Timeline

sys/vm/vm_object.c
571 ↗(On Diff #64640)

This could be an assert that it is an ANON object. Non-anon should never have a shadow_count now.

603 ↗(On Diff #64640)

I'm a little confused at some of the dead checks in the shadow chains. I don't know where they are possible and where they are not. I suspect some code may be unnecessarily checking and handling them. a vnode may become dead but another anon with a ref should not right?

1752 ↗(On Diff #64640)

Here again, can this actually become dead now that we limit to anon objects?

kib marked an inline comment as done.Nov 20 2019, 8:56 PM
kib added inline comments.
sys/vm/vm_object.c
603 ↗(On Diff #64640)

Object collapse creates dead anon objects with refcount > 0.

sys/vm/vm_object.c
603 ↗(On Diff #64640)

But it should only do so when ref_count == 1. Which means if we hold the object with the final ref it can't disappear out from under us?

shadow_count > 0 implies OBJ_ANON.

sys/vm/vm_object.c
603 ↗(On Diff #64640)

Definitely it cannot disappear, but I am not sure that collapse cannot run in parallel while we temporary unlock the object, the case when this code is run is not when the last ref was deallocated, it is pre-last.

jeff added inline comments.
sys/vm/vm_object.c
603 ↗(On Diff #64640)

I see now that we drop locks in collapse scan and that could possibly expose OBJ_DEAD in some cases.

This revision is now accepted and ready to land.Nov 20 2019, 10:44 PM

I ran the full stress2 test set without finding any problems.

This revision was automatically updated to reflect the committed changes.