On Tue, 3 Jul 2018 20:12:27 -0300
Marcelo Tosatti <mtosatti(a)redhat.com> wrote:
On Tue, Jul 03, 2018 at 04:47:27PM -0400, Luiz Capitulino wrote:
> On Tue, 3 Jul 2018 11:32:51 -0300
> Marcelo Tosatti <mtosatti(a)redhat.com> wrote:
>
> > As noted in the bugzilla ticket
> >
> >
https://bugzilla.redhat.com/show_bug.cgi?id=1554851
> >
> > The QEMU I/O thread can interrupt the time measurement
> > of the timer. To avoid this problem, only
> > pin the vCPU thread.
>
> That approach looks good to me, and I could confirm that it does
> fix the BZ. However, applying the profile is failing for me:
>
> ./find-lapictscdeadline-optimal.sh: line 10: 1*100/ 0,2,4,6: division by 0 (error
token is ",2,4,6")
> could not find optimal latency'
> 2018-07-03 16:42:53,060 ERROR tuned.plugins.plugin_script: script
'/usr/lib/tuned/realtime-virtual-host/script.sh' returned error code: 1
> 2018-07-03 16:42:53,119 INFO tuned.daemon.daemon: static tuning from profile
'realtime-virtual-host' applied
>
> Also, there a few more details below.
>
> > Signed-off-by: Marcelo Tosatti <mtosatti(a)redhat.com>
> >
> > diff --git a/profiles/realtime-virtual-host/script.sh
b/profiles/realtime-virtual-host/script.sh
> > index e821bef..3708107 100755
> > --- a/profiles/realtime-virtual-host/script.sh
> > +++ b/profiles/realtime-virtual-host/script.sh
> > @@ -17,20 +17,38 @@ run_tsc_deadline_latency()
> >
> > for i in `seq 1000 500 7000`; do
> > echo $i > $KVM_LAPIC_FILE
> > - chrt -f 1 taskset -c $1 $QEMU -enable-kvm -device pc-testdev \
> > +
> > + port=9000
> > + for port in `seq 9000 1 1000`; do
> > + echo "test" | nc localhost $port
> > + R=$?
> > + if [ $R -eq 1 ]; then
> > + break
> > + fi
> > + done
>
> There's a race here. Between finding the port and starting QEMU a
> process may use the port, in which case QEMU will fail to start.
>
> One way of fixing this would be to use a unix socket in -chardev.
> And/or check taskset and wait for failure (which we probably should do
> anyways).
A UNIX socket is better indeed.
Will fix this and the problem reported above and repost.
Cool. Please take note of:
Bug 1590937 - Failed to set smp_affinity for IRQ
So, currently the real-time profiles are broken and will fail to apply.
The workaround I've been using is to drop the error check around
the defirqaffinity.py calls in script.sh.