- Timestamp:
- Mar 9, 2010 9:13:35 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c
r25427 r27194 59 59 && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28) 60 60 # error "RT_USE_LINUX_HRTIMER requires 2.6.28 or later, sorry." 61 #endif 62 63 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) 64 # define mod_timer_pinned mod_timer 61 65 #endif 62 66 … … 266 270 * @param u64Now The current timestamp (RTTimeNanoTS()). 267 271 * @param u64First The interval from u64Now to the first time the timer should fire. 268 */ 269 static void rtTimerLnxStartSubTimer(PRTTIMERLNXSUBTIMER pSubTimer, uint64_t u64Now, uint64_t u64First) 272 * @param fPinned true = timer pinned to a specific CPU, 273 * false = timer can migrate between CPUs 274 */ 275 static void rtTimerLnxStartSubTimer(PRTTIMERLNXSUBTIMER pSubTimer, uint64_t u64Now, uint64_t u64First, bool fPinned) 270 276 { 271 277 /* … … 286 292 unsigned long cJiffies = !u64First ? 0 : rtTimerLnxNanoToJiffies(u64First); 287 293 pSubTimer->ulNextJiffies = jiffies + cJiffies; 288 mod_timer(&pSubTimer->LnxTimer, pSubTimer->ulNextJiffies); 294 if (fPinned) 295 mod_timer_pinned(&pSubTimer->LnxTimer, pSubTimer->ulNextJiffies); 296 else 297 mod_timer(&pSubTimer->LnxTimer, pSubTimer->ulNextJiffies); 289 298 } 290 299 #endif … … 412 421 } 413 422 414 mod_timer(&pSubTimer->LnxTimer, pSubTimer->ulNextJiffies); 423 if (pTimer->fSpecificCpu || pTimer->fAllCpus) 424 mod_timer_pinned(&pSubTimer->LnxTimer, pSubTimer->ulNextJiffies); 425 else 426 mod_timer(&pSubTimer->LnxTimer, pSubTimer->ulNextJiffies); 415 427 #endif 416 428 … … 441 453 PRTTIMER pTimer = (PRTTIMER)pvUser1; 442 454 Assert(idCpu < pTimer->cCpus); 443 rtTimerLnxStartSubTimer(&pTimer->aSubTimers[idCpu], pArgs->u64Now, pArgs->u64First );455 rtTimerLnxStartSubTimer(&pTimer->aSubTimers[idCpu], pArgs->u64Now, pArgs->u64First, true /*fPinned*/); 444 456 } 445 457 … … 593 605 PRTTIMERLNXSUBTIMER pSubTimer = &pTimer->aSubTimers[idCpu]; 594 606 if (rtTimerLnxCmpXchgState(&pSubTimer->enmState, RTTIMERLNXSTATE_MP_STARTING, RTTIMERLNXSTATE_STOPPED)) 595 rtTimerLnxStartSubTimer(pSubTimer, pArgs->u64Now, pArgs->u64First );607 rtTimerLnxStartSubTimer(pSubTimer, pArgs->u64Now, pArgs->u64First, true /*fPinned*/); 596 608 } 597 609 … … 646 658 647 659 if (RTMpCpuId() == idCpu) 648 rtTimerLnxStartSubTimer(pSubTimer, Args.u64Now, Args.u64First );660 rtTimerLnxStartSubTimer(pSubTimer, Args.u64Now, Args.u64First, true /*fPinned*/); 649 661 else 650 662 { … … 694 706 PRTTIMERLINUXSTARTONCPUARGS pArgs = (PRTTIMERLINUXSTARTONCPUARGS)pvUser2; 695 707 PRTTIMER pTimer = (PRTTIMER)pvUser1; 696 rtTimerLnxStartSubTimer(&pTimer->aSubTimers[0], pArgs->u64Now, pArgs->u64First );708 rtTimerLnxStartSubTimer(&pTimer->aSubTimers[0], pArgs->u64Now, pArgs->u64First, true /*fPinned*/); 697 709 } 698 710 … … 728 740 ASMAtomicWriteBool(&pTimer->fSuspended, false); 729 741 if (!pTimer->fSpecificCpu) 730 rtTimerLnxStartSubTimer(&pTimer->aSubTimers[0], Args.u64Now, Args.u64First );742 rtTimerLnxStartSubTimer(&pTimer->aSubTimers[0], Args.u64Now, Args.u64First, false /*fPinned*/); 731 743 else 732 744 {
Note:
See TracChangeset
for help on using the changeset viewer.