Page MenuHomeFreeBSD

Always use atomic_fetchadd() when updating per-user accounting values.
ClosedPublic

Authored by jhb on Jan 4 2018, 7:30 PM.
Tags
None
Referenced Files
F107592937: D13768.diff
Thu, Jan 16, 8:53 AM
Unknown Object (File)
Mon, Dec 23, 11:07 PM
Unknown Object (File)
Nov 30 2024, 2:47 PM
Unknown Object (File)
Nov 28 2024, 9:47 PM
Unknown Object (File)
Nov 28 2024, 9:47 PM
Unknown Object (File)
Nov 28 2024, 9:46 PM
Unknown Object (File)
Nov 28 2024, 9:23 PM
Unknown Object (File)
Nov 21 2024, 6:17 AM
Subscribers

Details

Summary

This avoids re-reading a variable after it has been updated via an
atomic op. It is just a cosmetic cleanup as the read value was only
used to control a diagnostic printf that should rarely occur (if ever).

Test Plan
  • have had a variant of this patch around for several years and have booted amd64 and i386 VMs with it. OTOH, I have never seen this printf fire. It's been a low priority to ever get this reviewed but I noticed it today and figured might as well either get it in or discard it.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 14118
Build 14293: arc lint + arc unit

Event Timeline

kib added inline comments.
sys/kern/kern_resource.c
1397

You can write '} else if (new < 0) {' to reduce indent.

This revision is now accepted and ready to land.Jan 4 2018, 8:11 PM
This revision was automatically updated to reflect the committed changes.