[Fuego] [PATCH 12/15] svsematest: fix unavailable cpu num of PARAMS

Daniel Sangorrin daniel.sangorrin at toshiba.co.jp
Fri Nov 16 05:31:02 UTC 2018


Hi Qiu,

Please see my comments below.

> -----Original Message-----
> <fuego-bounces at lists.linuxfoundation.org> On Behalf Of Qiu Tingting
> Sent: Thursday, November 15, 2018 1:26 PM
> To: fuego at lists.linuxfoundation.org
> Subject: [Fuego] [PATCH 12/15] svsematest: fix unavailable cpu num of PARAMS
> 
> Cmd svsematest 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.
> 
> Signed-off-by: Qiu Tingting <qiutt at cn.fujitsu.com>
> ---
>  engine/tests/Benchmark.svsematest/fuego_test.sh | 2 +-
>  engine/tests/Benchmark.svsematest/spec.json     | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/engine/tests/Benchmark.svsematest/fuego_test.sh
> b/engine/tests/Benchmark.svsematest/fuego_test.sh
> index f2ebd18..2988cd4 100755
> --- a/engine/tests/Benchmark.svsematest/fuego_test.sh
> +++ b/engine/tests/Benchmark.svsematest/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")

This will not work if you have a "hole" in your cpus (E.g: if you have cpu 0,1,3 online, but cpu 2 offline)

>      getting_line_number=$(( $target_cpu_number + $target_cpu_number ))
> -    report "cd $BOARD_TESTDIR/fuego.$TESTDIR; ./svsematest
> $BENCHMARK_SVSEMATEST_PARAMS | tail -$getting_line_number"
> +    report "cd $BOARD_TESTDIR/fuego.$TESTDIR; ./svsematest
> $BENCHMARK_SVSEMATEST_PARAMS$target_cpu_number | tail
> -$getting_line_number"
>  }

The number of threads should be specified in the spec, not limited to the number of online cores. For example, I may want to run 200 threads on two cores. Instead, what you want to use is the -a (affinity) argument. Unfortunately, unlike cyclictest, it seems that in svsematest you can only specify a single cpu number instead of a cpu set.

> diff --git a/engine/tests/Benchmark.svsematest/spec.json
> b/engine/tests/Benchmark.svsematest/spec.json
> index 00e77c1..e814600 100644
> --- a/engine/tests/Benchmark.svsematest/spec.json
> +++ b/engine/tests/Benchmark.svsematest/spec.json
> @@ -2,13 +2,13 @@
>      "testName": "Benchmark.svsematest",
>      "specs": {
>          "default": {
> -            "PARAMS": "-a -t -p99 -i100 -d25 -l10000"
> +            "PARAMS": "-a -p99 -i100 -d25 -l10000 -t"

Putting the -t at the end is not a good idea.
If we really wanted to handle -t automatically, as you suggest, then you should put add -t directly inside fuego_test.sh.
# as I said though, what we want to modify is the affinity

By the way, you should think of values in spec.json files as common examples. You can override them with values specific to your board in two ways:
1) Specifying the value on your board definition file
BENCHMARK_SVSEMATEST_PARAMS="-a 1 -t -p99 -i100 -d25 -l1000"
Tim: I just tested it and prolog.sh is not overriding the variable, might be a regression!
Tim: it seems that ftc:get_specs still doesn't support spec files in fuego-ro/boards or absolute paths. Shall I fix that?
2) Using the option --dynamic-vars (ftc run-test --help)

Summarizing, I think there are mainly two things we can do:
 - Modify the spec for your board by setting the affinity (-a N) to a processor you know it's going to be online (you can do that in two ways as I said)
 - Patch the program to specify affinity as a set of cpus (as in cyclictest) and then calculate that affinity automatically by using /proc/cpuinfo (unless the user already had specified it on the spec).

Thanks
Daniel


>          },
>          "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 -l10000"
> +            "PARAMS": "-a -p99 -i100 -d25 -l10000 -t"
>          }
>      }
>  }
> --
> 2.7.4
> 
> 
> 
> _______________________________________________
> Fuego mailing list
> Fuego at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/fuego



More information about the Fuego mailing list