lkml.org 
[lkml]   [2002]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC][PATCH] iowait statistics
Date
On 15 May 2002 13:15, you wrote:
> On Wed, 15 May 2002, Denis Vlasenko wrote:
> > It can be fixed for SMP:
> > * add spinlock
> > or
> > * add per_cpu_idle, account it too at timer/APIC int
> > and get rid of idle % calculations for /proc/stat
> >
> > As a user, I vote for glitchless statistics even if they
> > consume extra i++ cycle every timer int on every CPU.
>
> You have pointed out the problem, but since your fix is UP only and
> doesn't have the iowait stuff, I think more of same is needed. I don't
> recall seeing this with preempt, but I am not a top user unless I'm
> looking for problems.

I just wanted to inform Rik of this small problem. Since he's going
to fiddle with stats, he can fix this on the way.
BTW, the bug is easily triggered on SMP kernel, very hard to see
(but definitely happens) with UP, I bet you'll see it on preempt too.

Try these two scripts:

#!/bin/sh
# Prints dots until bad thing happens
# Prints old_idle_cnt -> new_idle_cnt then
prev=0
while true; do cat /proc/stat; done | \
grep -F 'cpu ' | \
cut -d ' ' -f 6 | \
while read next; do
echo -n .
diff=$(($next-$prev))
if test $diff -lt 0; then
echo "$prev -> $next"
fi
prev=$next
done

#!/bin/sh
# Prints cpu line from /proc/stat repeatedly
# When bad thing happens, flags it by '<<<'
prev=0
while true; do cat /proc/stat; done | \
grep -F 'cpu ' | \
while read line; do
next=`echo "$line" | cut -d ' ' -f 6`
diff=$(($next-$prev))
if test $diff -lt 0; then
echo "$line <<<"
else
echo "$line"
fi
prev=$next
done

--
vda
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:26    [W:0.073 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site