• Venkatesh Pallipadi's avatar
    [PATCH] Platform SMIs and their interferance with tsc based delay calibration · 8a9e1b0f
    Venkatesh Pallipadi authored
    Issue:
    Current tsc based delay_calibration can result in significant errors in
    loops_per_jiffy count when the platform events like SMIs
    (System Management Interrupts that are non-maskable) are present. This could
    lead to potential kernel panic(). This issue is becoming more visible with 2.6
    kernel (as default HZ is 1000) and on platforms with higher SMI handling
    latencies. During the boot time, SMIs are mostly used by BIOS (for things
    like legacy keyboard emulation).
    
    Description:
    The psuedocode for current delay calibration with tsc based delay looks like
    (0) Estimate a value for loops_per_jiffy
    (1) While (loops_per_jiffy estimate is accurate enough)
    (2)   wait for jiffy transition (jiffy1)
    (3)   Note down current tsc (tsc1)
    (4)   loop until tsc becomes tsc1 + loops_per_jiffy
    (5)   check whether jiffy changed since jiffy1 or not and refine
    loops_per_jiffy estimate
    
    Consider the following cases
    Case 1:
    If SMIs happen between (2)...
    8a9e1b0f
calibrate.c 4.71 KB