New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 741202 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Display %age-of-core, not %age-of-total, CPU usage in Task Manager

Project Member Reported by w...@chromium.org, Jul 11 2017

Issue description

Chrome Version: 61.0.3153.0
OS: Windows

Under Windows we show each process' CPU usage as a %age of the total available CPU this matches Windows' Task Manager behaviour), whereas on other platforms we show the %age of a core that the process is using. This is annoying because:

1. It makes it hard to spot when a process is saturating a core.
  - On other platforms, the process would show 100% (or more!) CPU usage.
  - To know the equivalent %age on Windows, you need to know the # of cores.
  - Big desktops can have ~50 cores, which means ~2% CPU usage corresponds to a saturated core!
2. It makes it hard to compare CPU usage across platforms.

(I believe we have a similar inconsistency with the Memory column, which shows the *resident* pages the process owns, rather than its total committed footprint; if we think the resident footprint is interesting to show, we could add a separate Working Set column)
 
Chrome on Windows displays private resident pages (private working set). At the time this was made to work this way this was consistent with other platforms, but they may have changed. Memory metrics are always a tradeoff. Private-committed memory will overestimate our footprint, whereas private-resident pages will (when under memory pressure) underestimate our footprint. Private-resident plus paged-out memory would be ideal but does not seem to be possible on Windows.

The memory column should *not* display shared pages. That would be my main request.

If we change task manager to show a percentage of a core then we should tweak the title to make this obvious. If we do that then I have no concerns. The extra precision and the more intuitive meaning and the consistency (across OSes and across different core counts) is highly desirable.


Comment 2 by w...@chromium.org, Aug 4 2017

Owner: w...@chromium.org
Status: Started (was: Untriaged)

Comment 3 by w...@chromium.org, Aug 28 2017

Labels: -M-62 M-63
Project Member

Comment 4 by bugdroid1@chromium.org, Sep 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4ae8f2924c42601192fff8e6b887c3c76a6d0483

commit 4ae8f2924c42601192fff8e6b887c3c76a6d0483
Author: Wez <wez@chromium.org>
Date: Mon Sep 11 20:52:03 2017

Remove platform-dependent ProcessMetrics::GetCPUUsage() API.

GetCPUUsage() returned different measures of CPU usage on Windows to
that used on other platforms. This required us to also have a
GetPlatformIndependentCPUUsage() API for call-sites that cared about
consistent metrics across platforms, such that only TaskManager used
the inconsistent API.

This CL makes the following changes:
- Update the TaskManager to use GetPlatformIndependentCPUUsage().
- Rename TaskManager::GetCPUUsage to GetPlatformIndependentCPUUsage.
  (Plus similar renaming for TaskGroups's CPU usage members.)
- Change the chrome.processes' API implementation of Process.cpu to
  report percentage-of-one-core usage rather than percentage-of-total.
  This was already the behaviour on non-Windows platforms, and was
  apparently the expectation of callers, in spite of the existing
  documentation stating otherwise.
- Update the documentation on the Process.cpu to make the meaning of
  the returned value more explicit.

Bug:  741202 
Change-Id: I313b56399df4f26cf995131793799e532e481942
Reviewed-on: https://chromium-review.googlesource.com/598750
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Reviewed-by: Nick Carter <nick@chromium.org>
Reviewed-by: Charlie Reis (slow) <creis@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501033}
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics.cc
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics.h
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics_freebsd.cc
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics_fuchsia.cc
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics_ios.cc
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics_linux.cc
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics_mac.cc
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics_openbsd.cc
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics_unittest.cc
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics_win.cc
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/chromeos/resource_reporter/resource_reporter.cc
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/chromeos/resource_reporter/resource_reporter_unittest.cc
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/extensions/api/processes/processes_api.cc
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/task_manager/sampling/task_group.cc
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/task_manager/sampling/task_group.h
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/task_manager/sampling/task_group_sampler.cc
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/task_manager/sampling/task_manager_impl.cc
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/task_manager/sampling/task_manager_impl.h
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/task_manager/task_manager_interface.h
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/task_manager/test_task_manager.cc
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/task_manager/test_task_manager.h
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/ui/task_manager/task_manager_table_model.cc
[modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/common/extensions/api/processes.idl

Project Member

Comment 5 by bugdroid1@chromium.org, Sep 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0a41b75286caf83656ae4c065fc9b9246247a6f7

commit 0a41b75286caf83656ae4c065fc9b9246247a6f7
Author: Wez <wez@chromium.org>
Date: Fri Sep 15 02:06:34 2017

Restore ProcessMetrics::GetPlatformIndependentCPUUsage to percentage.

While iterating on the CL to remove GetCPUUsage() and replace callers
with the platform-independent version, it was broken to return CPU usage
as a multiple-of-one-core, rather than percent-of-one-core.

This restores the value to the percent-based range.

Bug:  741202 
Change-Id: I4866f2748dbdab800421561d8fc849d88c73280f
Reviewed-on: https://chromium-review.googlesource.com/668098
Commit-Queue: Wez <wez@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502130}
[modify] https://crrev.com/0a41b75286caf83656ae4c065fc9b9246247a6f7/base/process/process_metrics_win.cc

Comment 6 by w...@chromium.org, Sep 15 2017

Cc: w...@chromium.org afakhry@chromium.org nasko@chromium.org
 Issue 117866  has been merged into this issue.

Comment 7 by w...@chromium.org, Sep 15 2017

Status: Fixed (was: Started)
I'm not seeing any sign of this change in canary. I just ran Sun Spider on my canary build (which I have confirmed was built today) and CPU usage peaked at about 1.6%. I would have expected something in the 40-100% range. This is on a 48-way machine where ~2% used to represent a fully loaded core, and it seems to still do that.

Comment 9 by w...@chromium.org, Sep 15 2017

Re #8: Sadly when the CL in #4 landed it change things to report number-of-cores used per-process, rather than percentage-of-core used, i.e. for a single-threaded process the range is 0..1.0 rather than 0..100.

On your lovely 48-core beast of a machine you'd be forgiven for thinking nothing changed since this would appear as a ~2x reduction in reported CPU usage relative to the percentage-of-total number. :P

Tonight's Canary should have the correct range; apologies for the confusion.

Sign in to add a comment