Skip to content
  • Stephen Rothwell's avatar
    [POWERPC] Simplify stolen time calculation · cbcdb93d
    Stephen Rothwell authored
    
    
    In calculating stolen time, we were trying to actually account for time
    spent in the hypervisor.  We don't really have enough information to do
    that accurately, so don't try.  Instead, we now calculate stolen time as
    time that the current cpu thread is not actually dispatching instructions.
    On chips without a PURR, we cannot do this, so stolen time will always
    be zero.  On chips with a PURR, this is merely the difference between
    the elapsed PURR values and the elapsed TB values.
    
    This gives us much more sane vaules from tools such as mpstat, even if
    they are still a bit strange e.g. 2 busy threads on one cpu will both
    appear to have 50% user time and 50% stolen time while 1 busy thread on
    a cpu will look like 100% user on one of them and 100% idle on the other.
    
    Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
    Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
    cbcdb93d