• D
    MN10300: Prevent cnt32_to_63() from being preempted in sched_clock() · 3b950de9
    David Howells 提交于
    Prevent cnt32_to_63() from being preempted in sched_clock() because it may
    read its internal counter, get preempted, get delayed for more than the half
    period of the 'TSC' and then write the internal counter, thus corrupting it.
    
    Whilst some callers of sched_clock() have interrupts disabled or hold
    spinlocks, not all do, and so preemption must be held here.
    
    Note that sched_clock() is called from lockdep, but that shouldn't be a problem
    because although preempt_disable() calls into lockdep, lockdep has a recursion
    counter to deal with this.
    Signed-off-by: NDavid Howells <dhowells@redhat.com>
    3b950de9
time.c 4.2 KB