cache-coherency-switching: failed on TC2

Bug #1084581 reported by Naresh Kamboju
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro big.LITTLE
Fix Released
Undecided
David Zinman

Bug Description

I have ported core-test suite on TC2 and started executing tests on it.
while executing the test i have noticed that test cache-coherency-switching failed and i re-run the test test passed again.

steps to reproduce:
root@android:/ # run_stress_switcher_tests.sh -t 3

Linux kernel Version:
 Linux version 3.7.0-rc6-00524-g56f946e (vishal@ubuntu) (gcc version 4.4.7 (Ubuntu/Linaro 4.4.7-1ubuntu2) ) #60 SMP Thu Nov 29 10:56:37 IST 2012

complete log can be found here:
https://pastebin.linaro.org/1152/

i have pasted log here:

root@android:/ # run_stress_switcher_tests.sh -t 3

Number of CPUs successfully brought up during boot = 2

Running cache-coherency-switching ..

Switching to big mode if not already in.
Running /system/bin/boot-a15.sh -c 0
cpu0 is big

Starting bigLITTLE random switcher in the background
spawning thread(s) on specified cpu(s)

Running stressapptest -M 16 --cc_test -s 10
***bl-agitator***
CPU count: 2
CPU0: big freq 2400000 LITTLE freq 350000
CPU1: big freq 2400000 LITTLE freq 350000
Random switcher seed 100 limit 1000
cpu1 scaling_setspeed target 350000 current 2400000... FAIL
error on iteration 4 period 396
Time elapsed: 0:00:04.055
cache-coherency test finished successfully

Kill bigLITTLE switcher BL_AGITATOR_PID 1214
PID_BL_CHECK=
bigLITTLE switcher not running. Report Error!!
cache-coherency-switching : FAIL

Summary ..
Total Tests = 1
Tests Passed = 0
Tests Failed = 1
root@android:/ # run_stress_switcher_tests.sh -t 3

Number of CPUs successfully brought up during boot = 2

Running cache-coherency-switching ..

Switching to big mode if not already in.
Running /system/bin/boot-a15.sh -c 0
cpu0 is big

Starting bigLITTLE random switcher in the background
spawning thread(s) on specified cpu(s)

Running stressapptest -M 16 --cc_test -s 10
***bl-agitator***
CPU count: 2
CPU0: big freq 2400000 LITTLE freq 350000
CPU1: big freq 2400000 LITTLE freq 350000
Random switcher seed 100 limit 1000
[ 48.920776] warning: `zygote' uses 32-bit capabilities (legacy support in use)
cache-coherency test finished successfully

Kill bigLITTLE switcher BL_AGITATOR_PID 1286
PID_BL_CHECK= 1286
sending SIGTERM BL_AGITATOR_PID 1286
Time elapsed: 0:00:10.063
Terminated because of SIG 15
cache-coherency-switching : PASS

Summary ..
Total Tests = 1
Tests Passed = 1
Tests Failed = 0

Tags: qa-services
Changed in linaro-big-little-system:
assignee: nobody → Naresh Kamboju (naresh-kamboju)
Revision history for this message
Naresh Kamboju (naresh-kamboju) wrote :

As per the investigation we have found that we need to add delay between write on to set_speed and read from cur_speed.
As a experimental purpose I have compiled kernel with CONFIG_ARM_BL_CPUFREQ=y and disabled CONFIG_ARM_VEXPRESS_BL_CPUFREQ=y.

bl-agitator has been modified as below and All Test PASSED.

--- a/bl-agitator/bl-agitator.c
+++ b/bl-agitator/bl-agitator.c
@@ -302,6 +302,7 @@ static int bl_set_frequency(struct bl_properties blp, char *frequency)

        sysfs_write_file(blp.cpuid, "scaling_setspeed", line, sizeof(line));
        /* TODO: consider cpuinfo_transition_latency before checking */
+ usleep(10000);
        sysfs_read_file(blp.cpuid, "cpuinfo_cur_freq", curr, sizeof(curr));
        curr_freq = strtoul(curr, NULL, 0);

Revision history for this message
Naresh Kamboju (naresh-kamboju) wrote :

i have noticed that having usleep(10000) works well with CONFIG_ARM_BL_CPUFREQ=y.
but not with CONFIG_ARM_VEXPRESS_BL_CPUFREQ=y. still I am investigating this issue.

Revision history for this message
Naresh Kamboju (naresh-kamboju) wrote :

I would like to conclude this issue from QA,

cache-coherency-switching test case has failed on latest TC2 kernel and I was asked us to add delay 50ms, which is the expected delay to be added between writing on to scaling_setspeed and reading the same values from cpuinfo_cur_freq.

[1]At delay 50ms test failed. so I have added delay 1 sec and still test case failed. From QA side add more delay to test case is not accepted. where as after adding 50ms delay test PASS with kernel config CONFIG_ARM_BL_CPUFREQ and FAILED with CONFIG_ARM_VEXPRESS_BL_CPUFREQ.

I request Kernel developers should take this case in to consideration and reduce the latency.

I have done experiments with delay vs kernel configs. the details can be found in below speadsheet.
https://docs.google.com/a/linaro.org/spreadsheet/ccc?key=0Ai9ggMs8bsGJdGlKZW1JTERJTFk5TDRGdnR4RHQwTHc#gid=0

Kernel Config Target cpuinfo_max_freq cpuinfo_min_freq cpuinfo_transition_latency without-sleep usleep 1000 usleep 50000 usleep 100000 usleep 1000000 usleep 1000000
CONFIG_ARM_VEXPRESS_BL_CPUFREQ TC2 2400000 350000 1000000 FAILED FAILED FAIL FAIL FAIL FAIL
CONFIG_ARM_BL_CPUFREQ TC2 1000000 100000 1 FAILED FAILED PASS PASS PASS PASS

[1]
commit 1a1995d2c83f79dcda130441db3a89e591185b94
Author: Naresh Kamboju <email address hidden>
Date: Sat Dec 8 00:54:51 2012 +0530

    we considered cpuinfo_transition_latency and added delay
    between writing on to scaling_setspeed and
    reading the same values from cpuinfo_cur_freq.
    the reasonable amount of delay added is usleep(50000).i.e. 50ms

    Signed-off-by: Naresh Kamboju <email address hidden>

diff --git a/bl-agitator/bl-agitator.c b/bl-agitator/bl-agitator.c
index 4936ad1..992c2d0 100644
--- a/bl-agitator/bl-agitator.c
+++ b/bl-agitator/bl-agitator.c
@@ -302,7 +302,7 @@ static int bl_set_frequency(struct bl_properties blp, char *

        sysfs_write_file(blp.cpuid, "scaling_setspeed", line, sizeof(line));
        /* DONE: consider cpuinfo_transition_latency before checking */
- usleep(10000);
+ usleep(50000);
        sysfs_read_file(blp.cpuid, "cpuinfo_cur_freq", curr, sizeof(curr));
        curr_freq = strtoul(curr, NULL, 0);

-Naresh Kamboju

Changed in linaro-big-little-system:
assignee: Naresh Kamboju (naresh-kamboju) → David Zinman (dzinman)
Revision history for this message
Naresh Kamboju (naresh-kamboju) wrote :

From the latest build this test passed.

test log:
-----------
Running cache-coherency-switching ..

Switching to big mode if not already in.
Running /system/bin/boot-a15.sh -c 0
cpu0 is big

Starting bigLITTLE random switcher in the background
spawning thread(s) on specified cpu(s)

Running stressapptest -M 16 --cc_test -s 10
***bl-agitator***
CPU count: 2
CPU0: big freq 2400000 LITTLE freq 350000
CPU1: big freq 2400000 LITTLE freq 350000
Random switcher seed 100 limit 1000
cache-coherency test finished successfully

Kill bigLITTLE switcher BL_AGITATOR_PID 3885
PID_BL_CHECK= 3885
sending SIGTERM BL_AGITATOR_PID 3885
Time elapsed: 0:00:10.1000
Terminated because of SIG 15
cache-coherency-switching : PASS

Linux Kernel:
Linux version 3.7.0-00637-gc747017 (jenkins-build@ip-10-147-141-109) (gcc version 4.7.3 20121205 (prerelease) (Linaro GCC 4.7-2012.11-1~dev) ) #1 SMP Thu Dec 13 22:15:40 UTC 2012

build:
https://snapshots.linaro.org/android/~linaro-android-restricted/vexpress-tc2-isw-jb-gcc47-armlt-stable-open-linaro-android-12.12-iks-release/2/target/product/vexpress/

full log is available at :
https://pastebin.linaro.org/1312/

-Naresh Kamboju

Changed in linaro-big-little-system:
status: New → Fix Committed
David Zinman (dzinman)
Changed in linaro-big-little-system:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.