VirtualBox

Changeset 81069 in vbox


Ignore:
Timestamp:
Sep 28, 2019 8:41:09 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
133673
Message:

IPRT/timer-r0drv-linux.c: Guess we could schedule timers with the same jiffies value, maybe that's the trouble with the omni timer, some kind of smp skew. bugref:7636

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c

    r81061 r81069  
    795795            ulNextJiffies = pSubTimer->u.Std.ulNextJiffies + cJiffies;
    796796            pSubTimer->u.Std.ulNextJiffies = ulNextJiffies;
    797             if (time_after(ulNextJiffies, uCurJiffies))
     797            if (time_after_eq(ulNextJiffies, uCurJiffies))
    798798            { /* likely */ }
    799799            else
    800800            {
    801                 unsigned long  cJiffiesBehind = uCurJiffies - ulNextJiffies;
    802                 if (cJiffies >= 2)
    803                     ulNextJiffies = uCurJiffies + cJiffies / 2;
    804                 else
    805                     ulNextJiffies = uCurJiffies + 1;
     801                unsigned long cJiffiesBehind = uCurJiffies - ulNextJiffies;
     802                ulNextJiffies = uCurJiffies + cJiffies / 2;
    806803                if (cJiffiesBehind >= HZ / 4) /* Conside if we're lagging too far behind.  Screw the u64NextTS member. */
    807804                    pSubTimer->u.Std.ulNextJiffies = ulNextJiffies;
     
    813810            const uint64_t u64NanoTS = RTTimeSystemNanoTS();
    814811            const int64_t  cNsBehind = u64NanoTS - pSubTimer->u.Std.u64NextTS;
    815             if (cNsBehind < 0)
     812            if (cNsBehind <= 0)
    816813                ulNextJiffies = uCurJiffies + rtTimerLnxNanoToJiffies(pSubTimer->u.Std.u64NextTS - u64NanoTS);
    817814            else if (u64NanoInterval >= RT_NS_1SEC_64 * 2 / HZ)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette