public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
To: Jan Stancek <jstancek@redhat.com>, ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 3/4] cpu_hotplug: use hotplug/present cpus functions
Date: Wed, 29 Apr 2015 16:09:06 +0300	[thread overview]
Message-ID: <5540D7F2.5050601@oracle.com> (raw)
In-Reply-To: <c0241646d11b747c1fd00d583f350cc9d048ad5e.1430305546.git.jstancek@redhat.com>

On 04/29/2015 02:18 PM, Jan Stancek wrote:
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
>   testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh | 6 +++---
>   testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug02.sh | 2 +-
>   testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh | 4 ++--
>   testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug04.sh | 4 ++--
>   testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh | 2 +-
>   testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh | 2 +-
>   testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug07.sh | 2 +-
>   7 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
> index 52598a9..8ae1379 100755
> --- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
> +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
> @@ -111,7 +111,7 @@ LOOP_COUNT=1
>
>   tst_check_cmds perl
>
> -get_cpus_num
> +get_present_cpus_num
>   if [ $? -lt 2 ]; then
>   	tst_brkm TCONF "system doesn't have required CPU hotplug support"
>   fi
> @@ -148,7 +148,7 @@ do
>   	IRQ_START=$(cat /proc/interrupts)
>
>   	# Attempt to offline all CPUs
> -	for cpu in $( get_all_cpus ); do
> +	for cpu in $( get_hotplug_cpus ); do
>   		if [ "$cpu" = "cpu0" ]; then
>   			continue
>   		fi
> @@ -163,7 +163,7 @@ do
>   	done
>
>   	# Attempt to online all CPUs
> -	for cpu in $( get_all_cpus ); do
> +	for cpu in $( get_hotplug_cpus ); do
>   		if [ "$cpu" = "cpu0" ]; then
>   			continue
>   		fi

Given that now this loop runs over hotpluggable cpus, it seems there is 
no reason to treat cpu0 specially in cpuhotplug0{1, 3, 4}.sh.

Patch 4 in this series has a fix for cpuhotplug04.sh, but other 
occurrences are unfixed.



> diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug02.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug02.sh
> index 3b33720..c42cc1b 100755
> --- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug02.sh
> +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug02.sh
> @@ -54,7 +54,7 @@ done
>
>   LOOP_COUNT=1
>
> -get_cpus_num
> +get_present_cpus_num
>   if [ $? -lt 2 ]; then
>   	tst_brkm TCONF "system doesn't have required CPU hotplug support"
>   fi
> diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh
> index 817f066..5da4854 100755
> --- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh
> +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh
> @@ -63,7 +63,7 @@ done
>
>   LOOP_COUNT=1
>
> -get_cpus_num
> +get_present_cpus_num
>   if [ $? -lt 2 ]; then
>   	tst_brkm TCONF "system doesn't have required CPU hotplug support"
>   fi
> @@ -86,7 +86,7 @@ until [ $LOOP_COUNT -gt $HOTPLUG03_LOOPS ]; do
>   	number_of_cpus=0
>
>   	# Turns on all CPUs
> -	for i in $( get_all_cpus ); do
> +	for i in $( get_hotplug_cpus ); do
>               if [ "$i" = "cpu0" ]; then
>                   continue
>               fi

In general, get_hotplug_cpus should produce only a subset from 
get_all_cpus, so number_of_cpus below may be less that the total number 
of CPUs in the system.

But below in the code we have:

         # Start up a number of processes equal to twice the number of
         # CPUs we have.  This is to help ensure we've got enough processes
         # that at least one will migrate to the new CPU.  Store the PIDs
         # so we can kill them later.
         number_of_cpus=$((number_of_cpus*2))
         until [ $number_of_cpus -eq 0 ]; do
                 cpuhotplug_do_spin_loop > /dev/null 2>&1 &
                 echo $! >> /var/run/hotplug4_$$.pid
                 number_of_cpus=$((number_of_cpus-1))
         done

It seems that now we need to fork $(( $(get_present_cpus_num) * 2 )) 
processes.


> diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug04.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug04.sh
> index ea2723b..3e025da 100755
> --- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug04.sh
> +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug04.sh
> @@ -62,7 +62,7 @@ until [ $LOOP_COUNT -gt $HOTPLUG04_LOOPS ]; do
>   	cpustate=1
>
>   	# Online all the CPUs
> -	for i in $(get_all_cpus); do
> +	for i in $(get_hotplug_cpus); do
>   		if [ "$i" != "cpu0" ]; then
>   			if ! cpu_is_online $i; then
>   				if ! online_cpu $i; then
> @@ -79,7 +79,7 @@ until [ $LOOP_COUNT -gt $HOTPLUG04_LOOPS ]; do
>   	done
>
>   	# Now offline all the CPUs
> -	for i in $(get_all_cpus); do
> +	for i in $(get_hotplug_cpus); do
>   		if ! offline_cpu $i; then
>   			if [ "x$i" != "xcpu0" ]; then
>   				tst_resm TFAIL "Did not offline first CPU (offlined $i instead)"
> diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh
> index bb0e896..79f7e90 100755
> --- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh
> +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh
> @@ -54,7 +54,7 @@ LOOP_COUNT=1
>
>   tst_check_cmds sar
>
> -get_cpus_num
> +get_present_cpus_num
>   if [ $? -lt 2 ]; then
>   	tst_brkm TCONF "system doesn't have required CPU hotplug support"
>   fi
> diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
> index 2e48242..6710fad 100755
> --- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
> +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
> @@ -49,7 +49,7 @@ done
>
>   LOOP_COUNT=1
>
> -get_cpus_num
> +get_present_cpus_num
>   if [ $? -lt 2 ]; then
>   	tst_brkm TCONF "system doesn't have required CPU hotplug support"
>   fi
> diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug07.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug07.sh
> index 723f3de..7edb3a9 100755
> --- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug07.sh
> +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug07.sh
> @@ -55,7 +55,7 @@ done
>
>   LOOP_COUNT=1
>
> -get_cpus_num
> +get_present_cpus_num
>   if [ $? -lt 2 ]; then
>   	tst_brkm TCONF "system doesn't have required CPU hotplug support"
>   fi
>

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2015-04-29 13:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-29 11:17 [LTP] [PATCH 0/4 v2] (merged) cpuhotplug fixes Jan Stancek
2015-04-29 11:17 ` [LTP] [PATCH 1/4] cpuhotplug: use cpu states in cleanup Jan Stancek
2015-04-29 11:17 ` [LTP] [PATCH 2/4] cpu_hotplug: add get_hotplug_cpus, get_present_cpus Jan Stancek
2015-04-29 12:56   ` Stanislav Kholmanskikh
2015-04-29 11:18 ` [LTP] [PATCH 3/4] cpu_hotplug: use hotplug/present cpus functions Jan Stancek
2015-04-29 13:09   ` Stanislav Kholmanskikh [this message]
2015-04-29 14:41     ` Jan Stancek
2015-04-29 15:03       ` Stanislav Kholmanskikh
2015-04-29 11:18 ` [LTP] [PATCH 4/4] cpuhotplug04.sh: operate only with hotpluggable CPUs Jan Stancek
2015-04-29 13:11 ` [LTP] [PATCH 0/4 v2] (merged) cpuhotplug fixes Stanislav Kholmanskikh

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=5540D7F2.5050601@oracle.com \
    --to=stanislav.kholmanskikh@oracle.com \
    --cc=jstancek@redhat.com \
    --cc=ltp-list@lists.sourceforge.net \
    /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