[Fuego] [PATCH 07/15] ptsematest: fix unavailable cpu num of PARAMS

Qiu, Tingting qiutt at cn.fujitsu.com
Fri Nov 16 02:37:11 UTC 2018


Hi,Tim

> -----Original Message-----
> From: Tim.Bird at sony.com [mailto:Tim.Bird at sony.com]
> Sent: Friday, November 16, 2018 7:40 AM
> To: Qiu, Tingting/仇 婷婷; fuego at lists.linuxfoundation.org
> Subject: RE: [Fuego] [PATCH 07/15] ptsematest: fix unavailable cpu num of
> PARAMS
> 
> 
> 
> > -----Original Message-----
> > From: Qiu Tingting on Wednesday, November 14, 2018 8:26 PM
> >
> > Cmd ptsematest has -t num parameter.
> > When cpu num is not setted, default value is max num of cpu.
> > Maybe some of cpu is not working, so we should set the available cpu num.
> 
> Can you explain this more?  This change adjusts
> the code to have ptsematest use the number of cpus reported
> by /proc/cpuinfo.   This seems like it would be the maximum number of
> cpus on the system.

Referring to help information, we know that '-t' parameter means one thread per available processor.
So, it would be the maximum available number of cpus on the system.
ptsematest usage
===========================
-t       --threads         one thread per available processor
-t [NUM] --threads=NUM     number of threads:
                           without NUM, threads = max_cpus
                           without -t default = 1
===========================

By default, threads num is setted by sysconf(_SC_NPROCESSORS_CONF).
But, value of _SC_NPROCESSORS_CONF is maximum number of cpus on system, 
which include available processor and unavailable processor.
Then, there are some warning message in ptsematest's output, like:
===========================
WARNING: Could not set CPU affinity to CPU #2
WARNING: Could not set CPU affinity to CPU #2
WARNING: Could not set CPU affinity to CPU #3
WARNING: Could not set CPU affinity to CPU #3
...
===========================
And available processor number is got by /proc/cpuinfo before ptsematest cmd.
So,I think it's better to set available processor number by '-t [NUM]' parameter.

Regards,
Qiu Tingting
> 
> How would ptsematest use a different number of cpus?
> 
> >
> > Signed-off-by: Qiu Tingting <qiutt at cn.fujitsu.com>
> > ---
> >  engine/tests/Benchmark.ptsematest/fuego_test.sh | 2 +-
> >  engine/tests/Benchmark.ptsematest/spec.json     | 4 ++--
> >  2 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/engine/tests/Benchmark.ptsematest/fuego_test.sh
> > b/engine/tests/Benchmark.ptsematest/fuego_test.sh
> > index 5f3fb44..5f0633e 100755
> > --- a/engine/tests/Benchmark.ptsematest/fuego_test.sh
> > +++ b/engine/tests/Benchmark.ptsematest/fuego_test.sh
> > @@ -21,5 +21,5 @@ function test_run {
> >      # The number for getting the lines depends on the cpu number of target
> > machine.
> >      target_cpu_number=$(cmd "cat /proc/cpuinfo | grep processor | wc -l")
> >      getting_line_number=$(( $target_cpu_number + $target_cpu_number ))
> > -    report "cd $BOARD_TESTDIR/fuego.$TESTDIR; ./ptsematest
> > $BENCHMARK_PTSEMATEST_PARAMS | tail -$getting_line_number"
> > +    report "cd $BOARD_TESTDIR/fuego.$TESTDIR; ./ptsematest
> > $BENCHMARK_PTSEMATEST_PARAMS$target_cpu_number | tail -
> > $getting_line_number"
> >  }
> > diff --git a/engine/tests/Benchmark.ptsematest/spec.json
> > b/engine/tests/Benchmark.ptsematest/spec.json
> > index aa5d6ce..16bc9ee 100644
> > --- a/engine/tests/Benchmark.ptsematest/spec.json
> > +++ b/engine/tests/Benchmark.ptsematest/spec.json
> > @@ -2,13 +2,13 @@
> >      "testName": "Benchmark.ptsematest",
> >      "specs": {
> >          "default": {
> > -            "PARAMS": "-a -t -p99 -i100 -d25 -l100000"
> > +            "PARAMS": "-a -p99 -i100 -d25 -l100000 -t"
> >          },
> >          "latest": {
> >              "PER_JOB_BUILD": "true",
> >              "gitrepo":
> "https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git",
> >              "gitref": "unstable/devel/latest",
> > -            "PARAMS": "-a -t -p99 -i100 -d25 -l100000"
> > +            "PARAMS": "-a -p99 -i100 -d25 -l100000 -t"
> >          }
> >      }
> >  }
> > --
> > 2.7.4
> 
> Not applied yet.  Please explain more what's going on.
>  -- Tim
> 





More information about the Fuego mailing list