Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2151)

Issue 426303002: Fix race condition in CpuInfoProvider::QueryCpuTimePerProcessor (Closed)

Created:
6 years, 4 months ago by Justin Chuang
Modified:
6 years, 4 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org, vpagar
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Fix race condition in CpuInfoProvider::QueryCpuTimePerProcessor BUG=chrome-os-partner:30607 TESTED=Manual tested on the platform of crosbug.com/p/30607 try with $ echo -n performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor $ echo -n interactive > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=288304

Patch Set 1 #

Patch Set 2 : #

Total comments: 6

Patch Set 3 : Add comments and logging #

Total comments: 8

Patch Set 4 : Modify comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -2 lines) Patch
M chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc View 1 2 3 1 chunk +16 lines, -2 lines 0 comments Download

Messages

Total messages: 24 (0 generated)
Justin Chuang
There is already a chrome-os-partner issue, do I need to create another chromium issue for ...
6 years, 4 months ago (2014-07-30 16:46:49 UTC) #1
Justin Chuang
On 2014/07/30 16:46:49, Justin Chuang wrote: > There is already a chrome-os-partner issue, do I ...
6 years, 4 months ago (2014-07-31 04:18:31 UTC) #2
Pawel Osciak
Would it we safer to use http://www.gnu.org/software/libc/manual/html_node/Processor-Resources.html instead of /proc/cpuinfo?
6 years, 4 months ago (2014-07-31 08:36:05 UTC) #3
Justin Chuang
On 2014/07/31 08:36:05, Pawel Osciak wrote: > Would it we safer to use > http://www.gnu.org/software/libc/manual/html_node/Processor-Resources.html ...
6 years, 4 months ago (2014-07-31 08:44:39 UTC) #4
Pawel Osciak
Adding a random sample of OWNERS. PTAL, thank you.
6 years, 4 months ago (2014-08-04 00:22:05 UTC) #5
Pawel Osciak
https://chromiumcodereview.appspot.com/426303002/diff/20001/chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc File chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc (right): https://chromiumcodereview.appspot.com/426303002/diff/20001/chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc#newcode40 chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc:40: // Cope with kernel race condition when /proc/stat does ...
6 years, 4 months ago (2014-08-04 00:55:22 UTC) #6
Justin Chuang
https://codereview.chromium.org/426303002/diff/20001/chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc File chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc (right): https://codereview.chromium.org/426303002/diff/20001/chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc#newcode40 chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc:40: // Cope with kernel race condition when /proc/stat does ...
6 years, 4 months ago (2014-08-04 08:12:04 UTC) #7
Justin Chuang
With this script: set -e while true; do STAT_COUNT=$(cat /proc/stat | egrep -e '^cpu[0-9]' | ...
6 years, 4 months ago (2014-08-04 08:18:09 UTC) #8
Pawel Osciak
https://chromiumcodereview.appspot.com/426303002/diff/40001/chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc File chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc (right): https://chromiumcodereview.appspot.com/426303002/diff/40001/chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc#newcode45 chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc:45: // processors, it is treated as an intermittent problem ...
6 years, 4 months ago (2014-08-04 09:22:55 UTC) #9
Justin Chuang
https://codereview.chromium.org/426303002/diff/40001/chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc File chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc (right): https://codereview.chromium.org/426303002/diff/40001/chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc#newcode51 chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc:51: if (i == infos->size()) { On 2014/08/04 09:22:54, Pawel ...
6 years, 4 months ago (2014-08-04 09:37:23 UTC) #10
Justin Chuang
https://codereview.chromium.org/426303002/diff/40001/chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc File chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc (right): https://codereview.chromium.org/426303002/diff/40001/chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc#newcode45 chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc:45: // processors, it is treated as an intermittent problem ...
6 years, 4 months ago (2014-08-04 11:55:02 UTC) #11
Pawel Osciak
lgtm as a patch, but deferring to owners if it's ok to do this wrt. ...
6 years, 4 months ago (2014-08-05 07:48:16 UTC) #12
Justin Chuang
Any update? We have an Chrome crash issue on nyan platform. Want to fix it ...
6 years, 4 months ago (2014-08-07 02:25:38 UTC) #13
Lei Zhang
Please just pick an OWNER or two at most, rather than adding a bunch of ...
6 years, 4 months ago (2014-08-07 06:14:14 UTC) #14
Lei Zhang
Please just pick an OWNER or two at most, rather than adding a bunch of ...
6 years, 4 months ago (2014-08-07 06:14:14 UTC) #15
Lei Zhang
lgtm https://codereview.chromium.org/426303002/diff/40001/chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc File chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc (right): https://codereview.chromium.org/426303002/diff/40001/chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc#newcode40 chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc:40: // Due to a race condition in the ...
6 years, 4 months ago (2014-08-07 06:19:37 UTC) #16
Justin Chuang
On 2014/08/07 06:19:37, Lei Zhang wrote: > lgtm > > https://codereview.chromium.org/426303002/diff/40001/chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc > File chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc > ...
6 years, 4 months ago (2014-08-07 07:29:38 UTC) #17
Justin Chuang
Ok. I see why it happens so frequently. CpuInfoProvider uses SysInfo::NumberOfProcessors() int SysInfo::NumberOfProcessors() { return ...
6 years, 4 months ago (2014-08-07 14:47:14 UTC) #18
Justin Chuang
This implies another problem: The code passes cached value of online cpu count to Blink ...
6 years, 4 months ago (2014-08-07 15:54:04 UTC) #19
Lei Zhang
On 2014/08/07 15:54:04, Justin Chuang wrote: > This implies another problem: > > The code ...
6 years, 4 months ago (2014-08-07 16:30:28 UTC) #20
Justin Chuang
The CQ bit was checked by jchuang@chromium.org
6 years, 4 months ago (2014-08-08 02:45:28 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jchuang@chromium.org/426303002/60001
6 years, 4 months ago (2014-08-08 02:48:48 UTC) #22
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_dbg_triggered_tests on tryserver.chromium.linux ...
6 years, 4 months ago (2014-08-08 05:31:42 UTC) #23
commit-bot: I haz the power
6 years, 4 months ago (2014-08-08 10:19:17 UTC) #24
Message was sent while issue was closed.
Change committed as 288304

Powered by Google App Engine
This is Rietveld 408576698