Commit bfd8c2a4 authored by Kuo-Hsin Yang's avatar Kuo-Hsin Yang Committed by Chromium LUCI CQ

CrOS: Remove ScopedAllowIO in SupportsPSI

Checking path existence in procfs is fast, it's not necessary to use
ScopedAllowIO.

Bug: 1166221
Change-Id: I60ec3f5865239ba426f3064ce5a05d6688320de8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2631807
Commit-Queue: Brian Geffon <bgeffon@chromium.org>
Reviewed-by: default avatarBrian Geffon <bgeffon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844105}
parent 17c2f862
...@@ -82,8 +82,8 @@ uint64_t GetReservedMemoryKB() { ...@@ -82,8 +82,8 @@ uint64_t GetReservedMemoryKB() {
} }
bool SupportsPSI() { bool SupportsPSI() {
static bool supports_psi = // Checking path existence in procfs is fast.
base::PathExists(base::FilePath("/proc/pressure/")); static bool supports_psi = access("/proc/pressure/", F_OK) == 0;
return supports_psi; return supports_psi;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment