From: "Dan Magenheimer" <dan.magenheimer@oracle.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>,
Dave Winchell <dwinchell@virtualiron.com>,
Ben Guthro <bguthro@virtualiron.com>,
xen-devel <xen-devel@lists.xensource.com>
Subject: RE: Re: Isolation and time
Date: Mon, 30 Jun 2008 18:22:19 -0600 [thread overview]
Message-ID: <20080630182219859.00000003744@djm-pc> (raw)
In-Reply-To: <C479A171.19E22%keir.fraser@eu.citrix.com>
[-- Attachment #1: Type: text/plain, Size: 1227 bytes --]
> Yes, I reckon that could work pretty well.
>
> -- Keir
I'm pretty sure the attached script when run in
domain0 will generate an appropriately random CPU
load on every domain0 vcpu. For each vcpu, it
randomly eats CPU for a fraction of a second, then
sleeps for the same amount of time, then repeats.
Thus any timer-under-test domain should see
random unscheduled intervals which hopefully
occur at random fractions of its timer tick.
I'll probably use this for future timer testing,
so let me know if you see problems with this
approach.
Thanks,
Dan
P.S. May be dependent on RH-based dom0.
> -----Original Message-----
> From: Keir Fraser [mailto:keir.fraser@eu.citrix.com]
> Sent: Saturday, June 14, 2008 9:25 AM
>
> <dan.magenheimer@oracle.com> wrote:
>
> > That's what I thought. Sorry to belabour, but
> > that leads to one more question:
> >
> > If one were to put an appropriately random CPU-only load
> > on every processor on domain0 (assuming domain0 runs
> > on all physical processors), then this would presumably
> > be sufficient to exercise a domain-under-test's time
> > synchronization, correct?
>
> Yes, I reckon that could work pretty well.
>
> -- Keir
[-- Attachment #2: dom0busy.sh --]
[-- Type: text/plain, Size: 829 bytes --]
#!/bin/bash
# dom0busy - randomly busies all dom0 vcpus
# keeps cpu busy for a fraction of a second, then sleeps for the same; repeat
# run in domain0 as root, can be monitored in top
TMPFILE=`mktemp /tmp/dom0busy.XXX` || exit 1
(
cat <<'EOF'
#!/bin/bash
while true; do
RANDOM=$$$(date +%S)
r1=$RANDOM
r2=$RANDOM
let loops="($r1*$r2)%10000"
start=`date +%s.%N`
while [ $loops -gt 0 ]; do
let loops="$loops-1"
done
fin=`date +%s.%N`
elapsed=`echo "scale=3; $fin - $start" | bc -iq`
#echo sleeping for $elapsed sec
/bin/sleep $elapsed
done &
EOF
) > $TMPFILE
chmod +x $TMPFILE
ncpus=`xm list | grep Domain-0 | sed 's/ */ /g' | cut -f4 -d" "`
echo Busying $ncpus cpus
let ncpus="$ncpus-1"
while [ $ncpus -ge 0 ]; do
echo busying cpu $ncpus
taskset -c $ncpus $TMPFILE
let ncpus="$ncpus-1"
done
/bin/rm -rf $TMPFILE
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
prev parent reply other threads:[~2008-07-01 0:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <B99564216C25704085A82B41C46DD3427B060A@exchange.katana.local>
2008-06-13 17:53 ` Isolation and time Dan Magenheimer
2008-06-13 18:49 ` Kernel printk timestamps and walltime drift Roger Cruz
2008-06-13 19:47 ` Keir Fraser
2008-06-13 20:10 ` Roger Cruz
2008-06-13 20:31 ` Keir Fraser
2008-06-13 20:06 ` Dan Magenheimer
2008-06-13 21:05 ` Roger Cruz
2008-06-13 21:21 ` Dan Magenheimer
2008-06-13 21:36 ` Keir Fraser
2008-06-13 22:02 ` Roger Cruz
2008-06-13 22:09 ` Keir Fraser
2008-06-13 19:38 ` Isolation and time Keir Fraser
2008-06-14 2:20 ` Dan Magenheimer
2008-06-14 8:59 ` Keir Fraser
2008-06-14 15:16 ` Dan Magenheimer
2008-06-14 15:25 ` Keir Fraser
2008-07-01 0:22 ` Dan Magenheimer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080630182219859.00000003744@djm-pc \
--to=dan.magenheimer@oracle.com \
--cc=bguthro@virtualiron.com \
--cc=dwinchell@virtualiron.com \
--cc=keir.fraser@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.