Page MenuHomeFreeBSD

vm_page: Use atomic loads for cmpset loops
ClosedPublic

Authored by markj on Oct 4 2024, 3:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 3, 8:04 AM
Unknown Object (File)
Tue, Oct 15, 12:04 AM
Unknown Object (File)
Thu, Oct 10, 12:46 AM
Unknown Object (File)
Oct 7 2024, 8:52 PM
Unknown Object (File)
Oct 7 2024, 8:52 PM
Unknown Object (File)
Oct 5 2024, 5:25 AM
Unknown Object (File)
Oct 5 2024, 2:00 AM
Unknown Object (File)
Oct 4 2024, 10:14 PM
Subscribers

Details

Summary

Make sure that the compiler loads the initial value value only once.
Because atomic_fcmpset is used to load the value for subsequent
iterations, this is probably not needed, but we should not rely on that.

I verified that code generated for an amd64 GENERIC kernel does not
change.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Oct 4 2024, 3:31 PM
sys/vm/vm_page.c
5275

What about here?

sys/vm/vm_page.c
5275

I don't see any need to here, since the value is not used before it's passed to atomic_fcmpset. Or, in the last case in this function, it's loaded only once.

This revision was automatically updated to reflect the committed changes.