lkml.org 
[lkml]   [2009]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] fix for sched_clock() when using jiffies

    Account for the initial offset to the jiffy count.
    ---
    kernel/sched_clock.c | 3 ++-
    1 files changed, 2 insertions(+), 1 deletions(-)

    diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c
    index a0b0852..a1567b1 100644
    --- a/kernel/sched_clock.c
    +++ b/kernel/sched_clock.c
    @@ -37,7 +37,8 @@
    */
    unsigned long long __attribute__((weak)) sched_clock(void)
    {
    - return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ);
    + return (unsigned long long)(jiffies - INITIAL_JIFFIES)
    + * (NSEC_PER_SEC / HZ);
    }

    static __read_mostly int sched_clock_running;
    --
    1.6.1.3


    \
     
     \ /
      Last update: 2009-05-08 16:13    [W:0.024 / U:31.972 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site