Changeset 87750 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Feb 13, 2021 3:37:09 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/TMAll.cpp
r87749 r87750 210 210 * Update the data. 211 211 * 212 * Note! Using ASMAtomicUoIncU32 instead of ASMAtomicIncU32 here to 213 * save a tiny bit of time here. Currently, the only user 214 * is tmR3CpuLoadTimer(), so nothing terribly important. 212 * Note! We're not using strict memory ordering here to speed things us. 213 * The data is in a single cache line and this thread is the only 214 * one writing to that line, so I cannot quite imagine why we would 215 * need any strict ordering here. 215 216 */ 216 217 uint64_t const cNsExecutingNew = pVCpu->tm.s.cNsExecuting + cNsExecutingDelta; 217 218 uint32_t uGen = ASMAtomicUoIncU32(&pVCpu->tm.s.uTimesGen); Assert(uGen & 1); 219 ASMCompilerBarrier(); 218 220 pVCpu->tm.s.fExecuting = false; 219 221 pVCpu->tm.s.cNsExecuting = cNsExecutingNew; 220 222 pVCpu->tm.s.cPeriodsExecuting++; 221 ASMAtomicWriteU32(&pVCpu->tm.s.uTimesGen, (uGen | 1) + 1); 223 ASMCompilerBarrier(); 224 ASMAtomicUoWriteU32(&pVCpu->tm.s.uTimesGen, (uGen | 1) + 1); 222 225 223 226 /* … … 309 312 uint64_t const cNsOtherNew = cNsTotalNew - pVCpu->tm.s.cNsExecuting - cNsHaltedNew; 310 313 311 uint32_t uGen = ASMAtomicIncU32(&pVCpu->tm.s.uTimesGen); Assert(uGen & 1); 314 uint32_t uGen = ASMAtomicUoIncU32(&pVCpu->tm.s.uTimesGen); Assert(uGen & 1); 315 ASMCompilerBarrier(); 312 316 pVCpu->tm.s.fHalting = false; 313 317 pVCpu->tm.s.fUpdateStats = false; 314 318 pVCpu->tm.s.cNsHalted = cNsHaltedNew; 315 319 pVCpu->tm.s.cPeriodsHalted++; 316 ASMAtomicWriteU32(&pVCpu->tm.s.uTimesGen, (uGen | 1) + 1); 320 ASMCompilerBarrier(); 321 ASMAtomicUoWriteU32(&pVCpu->tm.s.uTimesGen, (uGen | 1) + 1); 317 322 318 323 # if defined(VBOX_WITH_STATISTICS) || defined(VBOX_WITH_NS_ACCOUNTING_STATS)
Note:
See TracChangeset
for help on using the changeset viewer.