• Luis Claudio R. Goncalves's avatar
    sched: Fix spurious system load spikes in /proc/loadavgrt · 6c24cddb
    Luis Claudio R. Goncalves authored
    Hello,
    
    The values in /proc/loadavgrt are sometimes the real load and sometimes
    garbage. As you can see in th tests below, it occurs from in 2.6.21.5-rt20
    to 2.6.23-rc2-rt2. The code for calc_load(), in kernel/timer.c has not
    changed much in -rt patches.
    
            [lclaudio@lab sandbox]$ ls /proc/loadavg*
            /proc/loadavg  /proc/loadavgrt
            [lclaudio@lab sandbox]$ uname -a
            Linux lab.casa 2.6.21-34.el5rt #1 SMP PREEMPT RT Thu Jul 12 15:26:48 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
            [lclaudio@lab sandbox]$ cat /proc/loadavg*
            4.57 4.90 4.16 3/146 23499
            0.44 0.98 1.78 0/146 23499
            ...
            [lclaudio@lab sandbox]$ cat /proc/loadavg*
            4.65 4.80 4.75 5/144 20720
            23896.04 -898421.23 383170.94 2/144 20720
    
            [root@neverland ~]# uname -a
            Linux neverland.casa 2.6.21.5-rt20 #2 SMP PREEMPT RT Fri Jul 1318:31:38 BRT 2007 i686 athlon i386 GNU/Linux
            [root@neverland ~]# cat /proc/loadavg*
            0.16 0.16 0.15 1/184 11240
            344.65 0.38 311.71 0/184 11240
    
            [williams@torg ~]$ uname -a
            Linux torg 2.6.23-rc2-rt2 #14 SMP PREEMPT RT Tue Aug 7 20:07:31 CDT 2007 x86_64 x86_64 x86_64 GNU/Linux
            [williams@torg ~]$ cat /proc/loadavg*
            0.88 0.76 0.57 1/257 7267
            122947.70 103790.53 -564712.87 0/257 7267
    
    ---------->
    
    Fixes spurious system load spikes observed in /proc/loadavgrt, as described in:
    
      Bug 253103: /proc/loadavgrt issues weird results
      https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=253103Signed-off-by: default avatarLuis Claudio R. Goncalves <lclaudio@uudg.org>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    6c24cddb
sched_rt.c 41.8 KB