Page MenuHomeFreeBSD

Low hanging lock reduction based on semi-const flags.
ClosedPublic

Authored by jeff on Nov 27 2019, 3:42 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 10:23 AM
Unknown Object (File)
Mar 11 2024, 4:13 AM
Unknown Object (File)
Jan 18 2024, 9:24 AM
Unknown Object (File)
Dec 27 2023, 3:13 PM
Unknown Object (File)
Dec 22 2023, 9:54 PM
Unknown Object (File)
Oct 3 2023, 7:47 AM
Unknown Object (File)
Sep 16 2023, 11:44 PM
Unknown Object (File)
Sep 13 2023, 3:06 PM
Subscribers

Details

Summary

These are pretty minor changes. COLOR is never cleared after it is set. So we can check for it before acquiring and setting. I made a mistake in my ref patch that caused us to use a write ref for the final vnode ref which is not necessary and actually was a regression. The vm_map_pmap_enter() change realistically isn't likely to improve perf but it looks more tidy this way I think.

Diff Detail

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

Event Timeline

jeff added reviewers: kib, markj, alc, dougm.
jeff set the repository for this revision to rS FreeBSD src repository - subversion.
sys/vm/vm_map.c
2374 ↗(On Diff #64929)

Don't we formally need to recheck the object type here?

sys/vm/vm_object.c
582 ↗(On Diff #64929)

The indentation is wrong.

sys/vm/vm_map.c
2374 ↗(On Diff #64929)

It can only have become DEAD since we must have a valid reference.

sys/vm/vm_map.c
2542 ↗(On Diff #64929)

Isn't this a policy change? Now we are not accounting for swap space reserved for shared memory or tmpfs objects.

sys/vm/vm_map.c
2372 ↗(On Diff #64929)

I wonder if it makes sense to just return there, regardless of the locking changes. If the object was device/sg and now it is no longer, then it probably does not make sense do any page table prefilling at all.

2542 ↗(On Diff #64929)

I suspect that this would be more important e.g. for shared read-only mapping (weird case actually).

sys/vm/vm_object.c
531 ↗(On Diff #64929)

I think that this runlock can happen before umtx_shm_object_terminated().

sys/vm/vm_map.c
2542 ↗(On Diff #64929)

I think mark is right. And I may have made the same error in vm_map_copy_entry_anon().

Address review feedback. Correct a mistaken OBJ_ANON test.

This revision is now accepted and ready to land.Nov 28 2019, 7:51 PM
markj added inline comments.
sys/vm/vm_map.c
2374 ↗(On Diff #64929)

Perhaps add a comment in the block above, where we recheck object->type == OBJT_DEVICE || object->type == OBJT_SG.