New issue
Advanced search Search tips

Issue 848309 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

nyan: power_CPUFreq: No such file or directory: '/sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq'

Project Member Reported by tbroch@chromium.org, May 31 2018

Issue description

Seems there's a race between switching governors from interactive to userspace and then being able to read scaling_cur_freq which is also dependent on system load.

Lots of failures of this test on nyan_* platforms,

https://stainless.corp.google.com/search?view=list&first_date=2018-01-04&last_date=2018-05-31&suite=%5Epower%5C_build%24&test=%5Epower_CPUFreq%24&board=nyan_*&status=GOOD&status=FAIL&status=ERROR&status=ABORT&exclude_cts=true&exclude_not_run=false&exclude_non_release=true&exclude_au=true&exclude_acts=true&exclude_retried=true&exclude_non_production=false

Seems to fail roughly 5 times to every pass.

Have been able to repro manually on lab host by ssh'ing to device and then doing the following:

# load
while true ; do true ; sleep .1 ; done &

# test
cd /sys/devices/system/cpu
while true ; do 
  echo userspace > cpu0/cpufreq/scaling_governor
  cat cpu*/cpufreq/scaling_cur_freq
  date
  echo interactive > cpu0/cpufreq/scaling_governor
  sleep 1
done

If the output of 'test' is only one line than 'cat cpu1/cpufreq/scaling_cur_freq' has failed.  For example below is 2 failures in a row,

828000
Thu May 31 08:48:11 PDT 2018
696000
Thu May 31 08:48:13 PDT 2018


 
Traceback (most recent call last):
  File "/usr/local/autotest/common_lib/test.py", line 631, in _exec
    _call_test_function(self.execute, *p_args, **p_dargs)
  File "/usr/local/autotest/common_lib/test.py", line 837, in _call_test_function
    raise error.UnhandledTestFail(e)
UnhandledTestFail: Unhandled IOError: [Errno 2] No such file or directory: '/sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq'
Traceback (most recent call last):
  File "/usr/local/autotest/common_lib/test.py", line 831, in _call_test_function
    return func(*args, **dargs)
  File "/usr/local/autotest/common_lib/test.py", line 495, in execute
    dargs)
  File "/usr/local/autotest/common_lib/test.py", line 362, in _call_run_once_with_retry
    postprocess_profiled_run, args, dargs)
  File "/usr/local/autotest/common_lib/test.py", line 400, in _call_run_once
    self.run_once(*args, **dargs)
  File "/usr/local/autotest/tests/power_CPUFreq/power_CPUFreq.py", line 37, in run_once
    self.test_cores_in_series(dirs)
  File "/usr/local/autotest/tests/power_CPUFreq/power_CPUFreq.py", line 73, in test_cores_in_series
    cpu.set_frequency(freq)
  File "/usr/local/autotest/tests/power_CPUFreq/power_CPUFreq.py", line 192, in set_frequency
    if frequency >= self.get_current_frequency():
  File "/usr/local/autotest/tests/power_CPUFreq/power_CPUFreq.py", line 185, in get_current_frequency
    freq = int(self.__read_file('scaling_cur_freq'))
  File "/usr/local/autotest/tests/power_CPUFreq/power_CPUFreq.py", line 135, in __read_file
    f = open(path, 'r')
IOError: [Errno 2] No such file or directory: '/sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq'
Project Member

Comment 2 by bugdroid1@chromium.org, Jun 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/6655c3c1a7f4dabc344319b2831ea0516166ec2c

commit 6655c3c1a7f4dabc344319b2831ea0516166ec2c
Author: Todd Broch <tbroch@chromium.org>
Date: Fri Jun 08 06:33:06 2018

power_CPUFreq: cleanup style errors.

Used,
  pyformat -i --force_quote_type single -s 4 --binpack_named_arguments

to cleanup style issues.  Also cleaned up most of pylint issues.

BUG= chromium:848309 
TEST=power_CPUFreq

Change-Id: Ie19753812ef1d552addb001f5966dd44892f8dd2
Reviewed-on: https://chromium-review.googlesource.com/1085374
Commit-Ready: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Mengqi Guo <mqg@chromium.org>

[modify] https://crrev.com/6655c3c1a7f4dabc344319b2831ea0516166ec2c/client/site_tests/power_CPUFreq/power_CPUFreq.py

Project Member

Comment 3 by bugdroid1@chromium.org, Jun 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/5bda238a7ec1615f2be3f4085abde6b74ef53e02

commit 5bda238a7ec1615f2be3f4085abde6b74ef53e02
Author: Todd Broch <tbroch@chromium.org>
Date: Fri Jun 08 06:33:07 2018

power_CPUFreq: Add retry for set_frequency.

BUG= chromium:848309 
TEST=power_CPUFreq no longer fails sporadically on nyan devices

Change-Id: I805ab8551f4c22a76ab4ef762dac889ffd8ea553
Reviewed-on: https://chromium-review.googlesource.com/1085375
Commit-Ready: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Mengqi Guo <mqg@chromium.org>

[modify] https://crrev.com/5bda238a7ec1615f2be3f4085abde6b74ef53e02/client/site_tests/power_CPUFreq/power_CPUFreq.py

Owner: tbroch@chromium.org
Status: Fixed (was: Untriaged)

Sign in to add a comment