Costly execution of SwapThrashingMonitor |
||||
Issue descriptionData from the UMA Sampling Profiler shows that memory::SwapThrashingMonitor::CheckSwapThrashingPressureAndRecordStatistics(), which was added in 64.0.3254.0, is consuming 6.4% of all non-idle execution cycles during regular Chrome execution on the browser process UI thread on 64-bit Chrome. This seems quite expensive, and likely to have negative consequences for power usage. Flame graph difference of 64.0.3254.0 vs. 64.0.3253.0: https://uma.googleplex.com/p/chrome/callstacks?sid=66e8ea94e6d03915993b8f3fc9fb376d
,
Nov 2 2017
It looks like most of the time gets spent in NtQuerySystemInformation
,
Nov 2 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8f55a147384647745bdde5d3b9f575d6a12a4ab7 commit 8f55a147384647745bdde5d3b9f575d6a12a4ab7 Author: Sebastien Marchand <sebmarchand@chromium.org> Date: Thu Nov 02 08:42:48 2017 Temporarily disable the SwapThrashingMonitor The call to NtQuerySystemInformation seems expensive (see crbug.com/780597), disabling this while I look at better alternatives. Bug: 780597, 771478 Change-Id: I3355c26695095498d4b459e8e19727be196dc129 TBR: jochen@chromium.org Reviewed-on: https://chromium-review.googlesource.com/749569 Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org> Reviewed-by: Kenichi Ishibashi <bashi@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Cr-Commit-Position: refs/heads/master@{#513427} [modify] https://crrev.com/8f55a147384647745bdde5d3b9f575d6a12a4ab7/chrome/browser/chrome_browser_main_win.cc [modify] https://crrev.com/8f55a147384647745bdde5d3b9f575d6a12a4ab7/chrome/browser/memory/swap_thrashing_monitor_delegate_win.cc
,
Nov 2 2017
,
Nov 14 2017
This is surprising and interesting. What was the sampling rate? I am collecting various tab discard stats on chromebooks. On preliminary experiments I am finding that the speed of a discard may be relatively low, which may imply that you don't need to poll very frequently.
,
Nov 14 2017
,
Nov 14 2017
I was sampling at 0.5Hz, the problem is that on Windows the only direct way to retrieve the hard page fault rate is by calling NtQuerySystemInformation, which retrieve a lot of information about ALL the processes running on the machine, which is really slow (and might require some processes synchronization). I don't think that lowering the sampling rate is the best approach here, it'll hide the issue in the UMA Sampling Profiler but getting this metric will still be expensive and the impact of this call could be even worse when the system enters into a thrashing state.
,
Nov 14 2017
Agreed, I didn't realize that the sampling rate was already this low.
,
Jan 5 2018
Bulk adding Performance-Browser label for bugs identified with the UMA Sampling Profiler.
,
Aug 8
+etienneb@ who was considering using NtQuerySystemInformation for a different reason. |
||||
►
Sign in to add a comment |
||||
Comment 1 by sebmarchand@chromium.org
, Nov 2 2017