On Thu, Jun 17, 2010 at 09:16:18PM -0700, Gregory P. Smith wrote:
> On Thu, May 6, 2010 at 9:38 AM, Lucas Meneghel Rodrigues 
> <[email protected]>wrote:
> 
> > I've recently saw a lot of failures on running checktest test
> > on virtual machines. Investigating further, it seems that running it
> > into VMs just makes a conceptual problem more likely to happen:
> > Since we're in userspace, the other thread that should read tsc can be
> > out of the of the cpu at the moment, so all measures will be very
> > different.
> >
> > This is indicated by the tsc roundtrip. In failed measures, they are all
> > quite big. So I am proposing this patch, that basically ignores
> > roundtrips that are twice as big as the threshold, or more. It makes the
> > test pass to me, in machines I would expect them to.
> >
> > Also, remove the -static constraint on tsc's Makefile, since it will
> > cause the compilation to fail in certain boxes.
> >
> > Signed-off-by: Glauber Costa <[email protected]>
> > Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
> > ---
> >  client/tests/tsc/src/Makefile   |    1 -
> >  client/tests/tsc/src/checktsc.c |    6 ++++++
> >  client/tests/tsc/tsc.py         |    2 +-
> >  3 files changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/client/tests/tsc/src/Makefile b/client/tests/tsc/src/Makefile
> > index 623bb61..c8843ba 100644
> > --- a/client/tests/tsc/src/Makefile
> > +++ b/client/tests/tsc/src/Makefile
> > @@ -1,6 +1,5 @@
> >  CC=            cc
> >  CFLAGS=                -O
> > -LDFLAGS=       --static
> >  LIBS=          -lpthread
> >
> >  PROGS=         checktsc
> > diff --git a/client/tests/tsc/src/checktsc.c
> > b/client/tests/tsc/src/checktsc.c
> > index f7fc879..74290ff 100644
> > --- a/client/tests/tsc/src/checktsc.c
> > +++ b/client/tests/tsc/src/checktsc.c
> > @@ -218,6 +218,12 @@ tsc_delta(int cpu_a, int cpu_b)
> >                wait_for_state(&slave, DONE);
> >                t1 = rdtsc();
> >
> > +               /* Ignore roundtrips bigger than 2 * treshold, as one of
> > the threads
> > +                * that reads TSC is likely out of the CPU in this case */
> > +               if ((t1 - t0) > 2 * threshold)
> > +                       continue;
> > +
> > +
> >                if ((t1 - t0) < (best_t1 - best_t0)) {
> >                        best_t0 = t0;
> >                        best_t1 = t1;
> > diff --git a/client/tests/tsc/tsc.py b/client/tests/tsc/tsc.py
> > index ef3c960..2bac609 100644
> >
> 
> FWIW, we are seeing new failures of TSC test due to this change on hardware
> and kernels where it did not fail in the past.
Can you give details about the failures you're seeing?

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to