linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org, linux-api@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	"Paul E . McKenney" <paulmck@linux.vnet.ibm.com>,
	Boqun Feng <boqun.feng@gmail.com>,
	Andy Lutomirski <luto@amacapital.net>,
	Dave Watson <davejwatson@fb.com>, Paul Turner <pjt@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Russell King <linux@arm.linux.org.uk>,
	Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>,
	Andi Kleen <andi@firstfloor.org>, Chris Lameter <cl@linux.com>,
	Ben Maurer <bmaurer@fb.com>, Steven Rostedt <rostedt@goodmis.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>
Subject: Re: [PATCH for 5.1 3/3] rseq/selftests: Adapt number of threads to the number of detected cpus
Date: Fri, 19 Apr 2019 12:38:47 +0200	[thread overview]
Message-ID: <20190419103847.GA111210@gmail.com> (raw)
In-Reply-To: <20190305194755.2602-4-mathieu.desnoyers@efficios.com>


* Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:

> On smaller systems, running a test with 200 threads can take a long
> time on machines with smaller number of CPUs.
> 
> Detect the number of online cpus at test runtime, and multiply that
> by 6 to have 6 rseq threads per cpu preempting each other.
> 
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> Cc: Shuah Khan <shuah@kernel.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Joel Fernandes <joelaf@google.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Dave Watson <davejwatson@fb.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Andi Kleen <andi@firstfloor.org>
> Cc: linux-kselftest@vger.kernel.org
> Cc: "H . Peter Anvin" <hpa@zytor.com>
> Cc: Chris Lameter <cl@linux.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Michael Kerrisk <mtk.manpages@gmail.com>
> Cc: "Paul E . McKenney" <paulmck@linux.vnet.ibm.com>
> Cc: Paul Turner <pjt@google.com>
> Cc: Boqun Feng <boqun.feng@gmail.com>
> Cc: Josh Triplett <josh@joshtriplett.org>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Ben Maurer <bmaurer@fb.com>
> Cc: Andy Lutomirski <luto@amacapital.net>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> ---
>  tools/testing/selftests/rseq/run_param_test.sh | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/rseq/run_param_test.sh b/tools/testing/selftests/rseq/run_param_test.sh
> index 3acd6d75ff9f..e426304fd4a0 100755
> --- a/tools/testing/selftests/rseq/run_param_test.sh
> +++ b/tools/testing/selftests/rseq/run_param_test.sh
> @@ -1,6 +1,8 @@
>  #!/bin/bash
>  # SPDX-License-Identifier: GPL-2.0+ or MIT
>  
> +NR_CPUS=`grep '^processor' /proc/cpuinfo | wc -l`
> +
>  EXTRA_ARGS=${@}
>  
>  OLDIFS="$IFS"
> @@ -28,15 +30,16 @@ IFS="$OLDIFS"
>  
>  REPS=1000
>  SLOW_REPS=100
> +NR_THREADS=$((6*${NR_CPUS}))
>  
>  function do_tests()
>  {
>  	local i=0
>  	while [ "$i" -lt "${#TEST_LIST[@]}" ]; do
>  		echo "Running test ${TEST_NAME[$i]}"
> -		./param_test ${TEST_LIST[$i]} -r ${REPS} ${@} ${EXTRA_ARGS} || exit 1
> +		./param_test ${TEST_LIST[$i]} -r ${REPS} -t ${NR_THREADS} ${@} ${EXTRA_ARGS} || exit 1
>  		echo "Running compare-twice test ${TEST_NAME[$i]}"
> -		./param_test_compare_twice ${TEST_LIST[$i]} -r ${REPS} ${@} ${EXTRA_ARGS} || exit 1
> +		./param_test_compare_twice ${TEST_LIST[$i]} -r ${REPS} -t ${NR_THREADS} ${@} ${EXTRA_ARGS} || exit 1
>  		let "i++"
>  	done
>  }

BTW., when trying to build the rseq self-tests I get this build failure:

  dagon:~/tip/tools/testing/selftests/rseq> make
  gcc -O2 -Wall -g -I./ -I../../../../usr/include/ -L./ -Wl,-rpath=./ -shared -fPIC rseq.c -lpthread -o /home/mingo/tip/tools/testing/selftests/rseq/librseq.so
  gcc -O2 -Wall -g -I./ -I../../../../usr/include/ -L./ -Wl,-rpath=./ basic_test.c -lpthread -lrseq -o /home/mingo/tip/tools/testing/selftests/rseq/basic_test
  gcc -O2 -Wall -g -I./ -I../../../../usr/include/ -L./ -Wl,-rpath=./ basic_percpu_ops_test.c -lpthread -lrseq -o /home/mingo/tip/tools/testing/selftests/rseq/basic_percpu_ops_test
  /usr/bin/ld: /tmp/ccuHTWnZ.o: in function `rseq_cmpeqv_storev':
  /home/mingo/tip/tools/testing/selftests/rseq/./rseq-x86.h:84: undefined reference to `.L8'
  /usr/bin/ld: /home/mingo/tip/tools/testing/selftests/rseq/./rseq-x86.h:84: undefined reference to `.L49'
  /usr/bin/ld: /tmp/ccuHTWnZ.o: in function `rseq_cmpnev_storeoffp_load':
  /home/mingo/tip/tools/testing/selftests/rseq/./rseq-x86.h:141: undefined reference to `.L57'
  /usr/bin/ld: /tmp/ccuHTWnZ.o:(__rseq_failure+0x8): undefined reference to `.L8'
  /usr/bin/ld: /tmp/ccuHTWnZ.o:(__rseq_failure+0x14): undefined reference to `.L49'
  /usr/bin/ld: /tmp/ccuHTWnZ.o:(__rseq_failure+0x20): undefined reference to `.L55'
  collect2: error: ld returned 1 exit status
  make: *** [Makefile:22: /home/mingo/tip/tools/testing/selftests/rseq/basic_percpu_ops_test] Error 1

Is this a known problem, or do I miss something from my build environment 
perhaps? Vanilla 64-bit Ubuntu 18.10 (Cosmic).

Thanks,

	Ingo

  reply	other threads:[~2019-04-19 10:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-05 19:47 [PATCH for 5.1 0/3] Restartable Sequences updates for 5.1 Mathieu Desnoyers
2019-03-05 19:47 ` [PATCH for 5.1 1/3] rseq: cleanup: Reflect removal of event counter in comments Mathieu Desnoyers
2019-03-05 19:47 ` [PATCH for 5.1 2/3] rseq: cleanup: remove rseq_len from task_struct Mathieu Desnoyers
2019-03-05 19:47 ` [PATCH for 5.1 3/3] rseq/selftests: Adapt number of threads to the number of detected cpus Mathieu Desnoyers
2019-04-19 10:38   ` Ingo Molnar [this message]
2019-04-19 12:41     ` Mathieu Desnoyers
2019-04-19 12:55       ` Mathieu Desnoyers
2019-04-19 13:42         ` Mathieu Desnoyers
2019-04-19 13:48           ` Mathieu Desnoyers
2019-04-19 14:17             ` shuah
2019-04-19 14:40               ` Mathieu Desnoyers
2019-04-19 18:57                 ` shuah
2019-04-19 20:59                   ` Mathieu Desnoyers
2019-04-19 21:03                     ` shuah
2019-03-05 20:18 ` [PATCH for 5.1 0/3] Restartable Sequences updates for 5.1 Mathieu Desnoyers
2019-03-05 21:58   ` Peter Zijlstra
2019-03-05 22:32     ` Mathieu Desnoyers
2019-03-06  8:21       ` Peter Zijlstra
2019-03-06  8:30       ` Peter Zijlstra
2019-03-06 17:00         ` Mathieu Desnoyers
2019-03-05 21:49 ` Peter Zijlstra
2019-04-19 10:41 ` Ingo Molnar
2019-04-19 12:42   ` Mathieu Desnoyers

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=20190419103847.GA111210@gmail.com \
    --to=mingo@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=bmaurer@fb.com \
    --cc=boqun.feng@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=cl@linux.com \
    --cc=davejwatson@fb.com \
    --cc=hpa@zytor.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=luto@amacapital.net \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=will.deacon@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).