Pass hotplug_cpu_start=0 to make check like these examples below:
sudo make -C cpuhotplug hotplug_cpu_start=0 check sudo make hotplug_cpu_start=0 check
to enable cpuhotplug to run on cpu0 to N.
The hotplug_cpu_start variable will take the default value of 1 if no value is passed so cpuhotplug will run on cpu1 to N.
This fixes bug #49: https://bugs.linaro.org/show_bug.cgi?id=49
Signed-off-by: Lisa Nguyen lisa.nguyen@linaro.org --- Makefile | 4 +++- cpuhotplug/Makefile | 2 +- cpuhotplug/cpuhotplug_02.sh | 2 +- cpuhotplug/cpuhotplug_03.sh | 2 +- cpuhotplug/cpuhotplug_04.sh | 2 +- cpuhotplug/cpuhotplug_05.sh | 2 +- cpuhotplug/cpuhotplug_06.sh | 2 +- cpuhotplug/cpuhotplug_07.sh | 2 +- cpuhotplug/cpuhotplug_08.sh | 6 +++++- 9 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile index 731619d..24bbd59 100644 --- a/Makefile +++ b/Makefile @@ -22,13 +22,15 @@ # - initial API and implementation #
+hotplug_cpu_start?=1 + all: @(cd utils; $(MAKE))
check: @(cd utils; $(MAKE) check) @(cd cpufreq; $(MAKE) check) - @(cd cpuhotplug; $(MAKE) check) + @(cd cpuhotplug; $(MAKE) hotplug_cpu_start=${hotplug_cpu_start} check) @(cd cpuidle; $(MAKE) check) # @(cd suspend; $(MAKE) check) @(cd thermal; $(MAKE) check) diff --git a/cpuhotplug/Makefile b/cpuhotplug/Makefile index df0b8f4..a6670c3 100644 --- a/cpuhotplug/Makefile +++ b/cpuhotplug/Makefile @@ -21,5 +21,5 @@ # Daniel Lezcano daniel.lezcano@linaro.org (IBM Corporation) # - initial API and implementation # - +export hotplug_cpu_start?=1 include ../Test.mk diff --git a/cpuhotplug/cpuhotplug_02.sh b/cpuhotplug/cpuhotplug_02.sh index 3157307..3f678b9 100755 --- a/cpuhotplug/cpuhotplug_02.sh +++ b/cpuhotplug/cpuhotplug_02.sh @@ -33,7 +33,7 @@ check_state() { local state= shift 1
- if [ "$cpu" == "cpu0" ]; then + if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then return 0 fi
diff --git a/cpuhotplug/cpuhotplug_03.sh b/cpuhotplug/cpuhotplug_03.sh index 13a0ce9..57ff40e 100755 --- a/cpuhotplug/cpuhotplug_03.sh +++ b/cpuhotplug/cpuhotplug_03.sh @@ -33,7 +33,7 @@ check_affinity_fails() { local dirpath=$CPU_PATH/$1 local ret=
- if [ "$cpu" == "cpu0" ]; then + if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then return 0 fi
diff --git a/cpuhotplug/cpuhotplug_04.sh b/cpuhotplug/cpuhotplug_04.sh index 394a512..9c08fba 100755 --- a/cpuhotplug/cpuhotplug_04.sh +++ b/cpuhotplug/cpuhotplug_04.sh @@ -36,7 +36,7 @@ check_task_migrate() { local pid= local ret=
- if [ "$cpu" == "cpu0" ]; then + if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then return 0 fi
diff --git a/cpuhotplug/cpuhotplug_05.sh b/cpuhotplug/cpuhotplug_05.sh index a8eb312..f5eb994 100755 --- a/cpuhotplug/cpuhotplug_05.sh +++ b/cpuhotplug/cpuhotplug_05.sh @@ -32,7 +32,7 @@ check_procinfo() { local cpuid=${cpu:3} local ret=
- if [ "$cpu" == "cpu0" ]; then + if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then return 0 fi
diff --git a/cpuhotplug/cpuhotplug_06.sh b/cpuhotplug/cpuhotplug_06.sh index 347906d..93fbadd 100755 --- a/cpuhotplug/cpuhotplug_06.sh +++ b/cpuhotplug/cpuhotplug_06.sh @@ -32,7 +32,7 @@ check_procinfo() { local cpuid=${cpu:3} local ret=
- if [ "$cpu" == "cpu0" ]; then + if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then return 0 fi
diff --git a/cpuhotplug/cpuhotplug_07.sh b/cpuhotplug/cpuhotplug_07.sh index eaeba77..2457891 100755 --- a/cpuhotplug/cpuhotplug_07.sh +++ b/cpuhotplug/cpuhotplug_07.sh @@ -34,7 +34,7 @@ check_notification() { local pid= local ret=
- if [ "$cpu" == "cpu0" ]; then + if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then return 0 fi
diff --git a/cpuhotplug/cpuhotplug_08.sh b/cpuhotplug/cpuhotplug_08.sh index 9e2c355..52e1fc2 100755 --- a/cpuhotplug/cpuhotplug_08.sh +++ b/cpuhotplug/cpuhotplug_08.sh @@ -28,7 +28,11 @@ source ../include/functions.sh
function randomize() { - echo $[ ( $RANDOM % $1 ) + 1 ] + if [ $hotplug_cpu_start -ne 0 ]; then + echo $[ ( $RANDOM % $1 ) + 1 ] + else + echo $[ ( $RANDOM % $1 ) ] + fi }
random_stress() {
hi Lisa,
Can we have this in way like, mask for cpuhotplug. I believe out of cpu0-N one will be permanent. We can pass it like cpu_hotplug_mask=cpuX and skip hotplugging that specific cpu only.
On Wednesday 25 June 2014 09:48 AM, Lisa Nguyen wrote:
Pass hotplug_cpu_start=0 to make check like these examples below:
sudo make -C cpuhotplug hotplug_cpu_start=0 check sudo make hotplug_cpu_start=0 check
to enable cpuhotplug to run on cpu0 to N.
The hotplug_cpu_start variable will take the default value of 1 if no value is passed so cpuhotplug will run on cpu1 to N.
This fixes bug #49: https://bugs.linaro.org/show_bug.cgi?id=49
Signed-off-by: Lisa Nguyen lisa.nguyen@linaro.org
Makefile | 4 +++- cpuhotplug/Makefile | 2 +- cpuhotplug/cpuhotplug_02.sh | 2 +- cpuhotplug/cpuhotplug_03.sh | 2 +- cpuhotplug/cpuhotplug_04.sh | 2 +- cpuhotplug/cpuhotplug_05.sh | 2 +- cpuhotplug/cpuhotplug_06.sh | 2 +- cpuhotplug/cpuhotplug_07.sh | 2 +- cpuhotplug/cpuhotplug_08.sh | 6 +++++- 9 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile index 731619d..24bbd59 100644 --- a/Makefile +++ b/Makefile @@ -22,13 +22,15 @@ # - initial API and implementation # +hotplug_cpu_start?=1
- all: @(cd utils; $(MAKE))
check: @(cd utils; $(MAKE) check) @(cd cpufreq; $(MAKE) check)
- @(cd cpuhotplug; $(MAKE) check)
- @(cd cpuhotplug; $(MAKE) hotplug_cpu_start=${hotplug_cpu_start} check) @(cd cpuidle; $(MAKE) check) # @(cd suspend; $(MAKE) check) @(cd thermal; $(MAKE) check)
diff --git a/cpuhotplug/Makefile b/cpuhotplug/Makefile index df0b8f4..a6670c3 100644 --- a/cpuhotplug/Makefile +++ b/cpuhotplug/Makefile @@ -21,5 +21,5 @@ # Daniel Lezcano daniel.lezcano@linaro.org (IBM Corporation) # - initial API and implementation #
+export hotplug_cpu_start?=1 include ../Test.mk diff --git a/cpuhotplug/cpuhotplug_02.sh b/cpuhotplug/cpuhotplug_02.sh index 3157307..3f678b9 100755 --- a/cpuhotplug/cpuhotplug_02.sh +++ b/cpuhotplug/cpuhotplug_02.sh @@ -33,7 +33,7 @@ check_state() { local state= shift 1
- if [ "$cpu" == "cpu0" ]; then
- if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then return 0 fi
diff --git a/cpuhotplug/cpuhotplug_03.sh b/cpuhotplug/cpuhotplug_03.sh index 13a0ce9..57ff40e 100755 --- a/cpuhotplug/cpuhotplug_03.sh +++ b/cpuhotplug/cpuhotplug_03.sh @@ -33,7 +33,7 @@ check_affinity_fails() { local dirpath=$CPU_PATH/$1 local ret=
- if [ "$cpu" == "cpu0" ]; then
- if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then return 0 fi
diff --git a/cpuhotplug/cpuhotplug_04.sh b/cpuhotplug/cpuhotplug_04.sh index 394a512..9c08fba 100755 --- a/cpuhotplug/cpuhotplug_04.sh +++ b/cpuhotplug/cpuhotplug_04.sh @@ -36,7 +36,7 @@ check_task_migrate() { local pid= local ret=
- if [ "$cpu" == "cpu0" ]; then
- if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then return 0 fi
diff --git a/cpuhotplug/cpuhotplug_05.sh b/cpuhotplug/cpuhotplug_05.sh index a8eb312..f5eb994 100755 --- a/cpuhotplug/cpuhotplug_05.sh +++ b/cpuhotplug/cpuhotplug_05.sh @@ -32,7 +32,7 @@ check_procinfo() { local cpuid=${cpu:3} local ret=
- if [ "$cpu" == "cpu0" ]; then
- if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then return 0 fi
diff --git a/cpuhotplug/cpuhotplug_06.sh b/cpuhotplug/cpuhotplug_06.sh index 347906d..93fbadd 100755 --- a/cpuhotplug/cpuhotplug_06.sh +++ b/cpuhotplug/cpuhotplug_06.sh @@ -32,7 +32,7 @@ check_procinfo() { local cpuid=${cpu:3} local ret=
- if [ "$cpu" == "cpu0" ]; then
- if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then return 0 fi
diff --git a/cpuhotplug/cpuhotplug_07.sh b/cpuhotplug/cpuhotplug_07.sh index eaeba77..2457891 100755 --- a/cpuhotplug/cpuhotplug_07.sh +++ b/cpuhotplug/cpuhotplug_07.sh @@ -34,7 +34,7 @@ check_notification() { local pid= local ret=
- if [ "$cpu" == "cpu0" ]; then
- if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then return 0 fi
diff --git a/cpuhotplug/cpuhotplug_08.sh b/cpuhotplug/cpuhotplug_08.sh index 9e2c355..52e1fc2 100755 --- a/cpuhotplug/cpuhotplug_08.sh +++ b/cpuhotplug/cpuhotplug_08.sh @@ -28,7 +28,11 @@ source ../include/functions.sh function randomize() {
- echo $[ ( $RANDOM % $1 ) + 1 ]
- if [ $hotplug_cpu_start -ne 0 ]; then
- echo $[ ( $RANDOM % $1 ) + 1 ]
- else
- echo $[ ( $RANDOM % $1 ) ]
- fi }
random_stress() {
On 25 June 2014 15:39, Sanjay Singh Rawat sanjay.rawat@linaro.org wrote:
hi Lisa,
Can we have this in way like, mask for cpuhotplug. I believe out of cpu0-N one will be permanent. We can pass it like cpu_hotplug_mask=cpuX
Sanjay, Do you mean that one CPU will not be tested always? I don't think this assumption is correct. You only need to make sure you don't unplug all CPUs at the same time. IMHO all CPUs should be checked if user wishes to do so.
milosz
On Wednesday 25 June 2014 08:13 PM, Milosz Wasilewski wrote:
On 25 June 2014 15:39, Sanjay Singh Rawat sanjay.rawat@linaro.org wrote:
hi Lisa,
Can we have this in way like, mask for cpuhotplug. I believe out of cpu0-N one will be permanent. We can pass it like cpu_hotplug_mask=cpuX
Sanjay, Do you mean that one CPU will not be tested always? I don't think this assumption is correct. You only need to make sure you don't unplug all CPUs at the same time. IMHO all CPUs should be checked if user wishes to do so.
Milosz,
Yes i meant that. Hmm, i think i am missing the understanding here. So now all cpu are hotpluggable?
milosz
On Wed, Jun 25, 2014 at 8:21 PM, Sanjay Singh Rawat sanjay.rawat@linaro.org wrote:
Milosz,
Yes i meant that. Hmm, i think i am missing the understanding here. So now all cpu are hotpluggable?
Technically any cpu can be hotpluggable. But you need to have atleast one plugged in at anytime else there won't be a kernel left ;)
But some platforms had constraints preventing cpu0 from being hotplugged, hence the initial constraint in the scripts. We now want to allow cpu0 to be hotplugged as well so that we can test platforms where such a constraint no longer exists.
On Wednesday 25 June 2014 08:38 PM, Amit Kucheria wrote:
On Wed, Jun 25, 2014 at 8:21 PM, Sanjay Singh Rawat sanjay.rawat@linaro.org wrote:
Milosz,
Yes i meant that. Hmm, i think i am missing the understanding here. So now all cpu are hotpluggable?
Technically any cpu can be hotpluggable. But you need to have atleast one plugged in at anytime else there won't be a kernel left ;)
But some platforms had constraints preventing cpu0 from being
this was the doubt, thanks for the clarification Amit
hotplugged, hence the initial constraint in the scripts. We now want to allow cpu0 to be hotplugged as well so that we can test platforms where such a constraint no longer exists.
On Wed, Jun 25, 2014 at 9:48 AM, Lisa Nguyen lisa.nguyen@linaro.org wrote:
Pass hotplug_cpu_start=0 to make check like these examples below:
sudo make -C cpuhotplug hotplug_cpu_start=0 check sudo make hotplug_cpu_start=0 check
to enable cpuhotplug to run on cpu0 to N.
This description doesn't match the behaviour of the scripts below i.e. It isn't behaving as the start cpu for all the hotplug tests. The current implementation only checks that if the hotplug_cpu_start is non-zero it allows hotplugging on all cpus.
So please rename the variable to hotplug_allow_cpu0 with a boolean (0/1 or yes/no) behaviour.
The hotplug_cpu_start variable will take the default value of 1 if no value is passed so cpuhotplug will run on cpu1 to N.
This fixes bug #49: https://bugs.linaro.org/show_bug.cgi?id=49
Signed-off-by: Lisa Nguyen lisa.nguyen@linaro.org
Makefile | 4 +++- cpuhotplug/Makefile | 2 +- cpuhotplug/cpuhotplug_02.sh | 2 +- cpuhotplug/cpuhotplug_03.sh | 2 +- cpuhotplug/cpuhotplug_04.sh | 2 +- cpuhotplug/cpuhotplug_05.sh | 2 +- cpuhotplug/cpuhotplug_06.sh | 2 +- cpuhotplug/cpuhotplug_07.sh | 2 +- cpuhotplug/cpuhotplug_08.sh | 6 +++++- 9 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile index 731619d..24bbd59 100644 --- a/Makefile +++ b/Makefile @@ -22,13 +22,15 @@ # - initial API and implementation #
+hotplug_cpu_start?=1
If the semantics are changed as described above, this will become
hotplug_allow_cpu0?=0
all: @(cd utils; $(MAKE))
check: @(cd utils; $(MAKE) check) @(cd cpufreq; $(MAKE) check)
@(cd cpuhotplug; $(MAKE) check)
@(cd cpuhotplug; $(MAKE) hotplug_cpu_start=${hotplug_cpu_start} check) @(cd cpuidle; $(MAKE) check)
# @(cd suspend; $(MAKE) check) @(cd thermal; $(MAKE) check) diff --git a/cpuhotplug/Makefile b/cpuhotplug/Makefile index df0b8f4..a6670c3 100644 --- a/cpuhotplug/Makefile +++ b/cpuhotplug/Makefile @@ -21,5 +21,5 @@ # Daniel Lezcano daniel.lezcano@linaro.org (IBM Corporation) # - initial API and implementation #
+export hotplug_cpu_start?=1 include ../Test.mk diff --git a/cpuhotplug/cpuhotplug_02.sh b/cpuhotplug/cpuhotplug_02.sh index 3157307..3f678b9 100755 --- a/cpuhotplug/cpuhotplug_02.sh +++ b/cpuhotplug/cpuhotplug_02.sh @@ -33,7 +33,7 @@ check_state() { local state= shift 1
- if [ "$cpu" == "cpu0" ]; then
- if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then
and this becomes
+ if [[ "$cpu" == "cpu0" && $hotplug_allow_cpu0 -eq 0 ]]; then
And while you're at it, can you please consolidate this check into a small library function so we don't have to change it 8 different scripts in the future?
return 0 fi
diff --git a/cpuhotplug/cpuhotplug_03.sh b/cpuhotplug/cpuhotplug_03.sh index 13a0ce9..57ff40e 100755 --- a/cpuhotplug/cpuhotplug_03.sh +++ b/cpuhotplug/cpuhotplug_03.sh @@ -33,7 +33,7 @@ check_affinity_fails() { local dirpath=$CPU_PATH/$1 local ret=
- if [ "$cpu" == "cpu0" ]; then
- if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then return 0 fi
diff --git a/cpuhotplug/cpuhotplug_04.sh b/cpuhotplug/cpuhotplug_04.sh index 394a512..9c08fba 100755 --- a/cpuhotplug/cpuhotplug_04.sh +++ b/cpuhotplug/cpuhotplug_04.sh @@ -36,7 +36,7 @@ check_task_migrate() { local pid= local ret=
- if [ "$cpu" == "cpu0" ]; then
- if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then return 0 fi
diff --git a/cpuhotplug/cpuhotplug_05.sh b/cpuhotplug/cpuhotplug_05.sh index a8eb312..f5eb994 100755 --- a/cpuhotplug/cpuhotplug_05.sh +++ b/cpuhotplug/cpuhotplug_05.sh @@ -32,7 +32,7 @@ check_procinfo() { local cpuid=${cpu:3} local ret=
- if [ "$cpu" == "cpu0" ]; then
- if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then return 0 fi
diff --git a/cpuhotplug/cpuhotplug_06.sh b/cpuhotplug/cpuhotplug_06.sh index 347906d..93fbadd 100755 --- a/cpuhotplug/cpuhotplug_06.sh +++ b/cpuhotplug/cpuhotplug_06.sh @@ -32,7 +32,7 @@ check_procinfo() { local cpuid=${cpu:3} local ret=
- if [ "$cpu" == "cpu0" ]; then
- if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then return 0 fi
diff --git a/cpuhotplug/cpuhotplug_07.sh b/cpuhotplug/cpuhotplug_07.sh index eaeba77..2457891 100755 --- a/cpuhotplug/cpuhotplug_07.sh +++ b/cpuhotplug/cpuhotplug_07.sh @@ -34,7 +34,7 @@ check_notification() { local pid= local ret=
- if [ "$cpu" == "cpu0" ]; then
- if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then return 0 fi
diff --git a/cpuhotplug/cpuhotplug_08.sh b/cpuhotplug/cpuhotplug_08.sh index 9e2c355..52e1fc2 100755 --- a/cpuhotplug/cpuhotplug_08.sh +++ b/cpuhotplug/cpuhotplug_08.sh @@ -28,7 +28,11 @@ source ../include/functions.sh
function randomize() {
- echo $[ ( $RANDOM % $1 ) + 1 ]
- if [ $hotplug_cpu_start -ne 0 ]; then
echo $[ ( $RANDOM % $1 ) + 1 ]
- else
echo $[ ( $RANDOM % $1 ) ]
- fi
}
random_stress() {
1.7.9.5