Commit c57e3e6b authored by Greg Kerr's avatar Greg Kerr Committed by Chromium LUCI CQ

Reland "CrOS: Enable Hyper-Threading by default if core scheduler is available."

This is a reland of d24c918a

Original change's description:
> CrOS: Enable Hyper-Threading by default if core scheduler is available.
>
> If the kernel supports core scheduling, Hyper-Threading is enabled by
> default. Users, admins and Finch may still override this setting.
>
> BUG=b:152605392
>
> Change-Id: Iffcec33455ec277ec6f79f03908d02015c7d1f6f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2209676
> Reviewed-by: James Cook <jamescook@chromium.org>
> Reviewed-by: Mattias Nissler <mnissler@chromium.org>
> Commit-Queue: Greg Kerr <kerrnel@chromium.org>
> Auto-Submit: Greg Kerr <kerrnel@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#774920}

Bug: b:152605392
Change-Id: I50590824454aa5d33267d0c6783b002c1925fe3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2584566Reviewed-by: default avatarGreg Kerr <kerrnel@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Auto-Submit: Joel Fernandes <joelaf@google.com>
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#835773}
parent b09f433f
...@@ -91,8 +91,10 @@ void SchedulerConfigurationManager::OnPrefChange() { ...@@ -91,8 +91,10 @@ void SchedulerConfigurationManager::OnPrefChange() {
// Next, if Finch isn't set, see if the command line passed in a default. // Next, if Finch isn't set, see if the command line passed in a default.
config_name = cmdline_default; config_name = cmdline_default;
} else { } else {
// If nothing is found, default to conservative. // If nothing is found, default to core isolation scheduling. Note that
config_name = debugd::scheduler_configuration::kConservativeScheduler; // only some kernels support core isolation. debugd checks for support and
// reverts to conservative if core isolation is unavailable.
config_name = debugd::scheduler_configuration::kCoreIsolationScheduler;
} }
// NB: Also send an update when the config gets reset to let the system pick // NB: Also send an update when the config gets reset to let the system pick
......
...@@ -117,7 +117,7 @@ TEST_F(SchedulerConfigurationManagerTest, ConfigChange) { ...@@ -117,7 +117,7 @@ TEST_F(SchedulerConfigurationManagerTest, ConfigChange) {
manager.AddObserver(this); manager.AddObserver(this);
task_environment_.RunUntilIdle(); task_environment_.RunUntilIdle();
EXPECT_EQ(debugd::scheduler_configuration::kConservativeScheduler, EXPECT_EQ(debugd::scheduler_configuration::kCoreIsolationScheduler,
debug_daemon_client_.scheduler_configuration_name()); debug_daemon_client_.scheduler_configuration_name());
EXPECT_EQ(1u, configuration_set_count_); EXPECT_EQ(1u, configuration_set_count_);
...@@ -144,7 +144,7 @@ TEST_F(SchedulerConfigurationManagerTest, ConfigChange) { ...@@ -144,7 +144,7 @@ TEST_F(SchedulerConfigurationManagerTest, ConfigChange) {
// Dropping the policy as well reverts to the default configuration. // Dropping the policy as well reverts to the default configuration.
local_state_.RemoveManagedPref(prefs::kSchedulerConfiguration); local_state_.RemoveManagedPref(prefs::kSchedulerConfiguration);
task_environment_.RunUntilIdle(); task_environment_.RunUntilIdle();
EXPECT_EQ(debugd::scheduler_configuration::kConservativeScheduler, EXPECT_EQ(debugd::scheduler_configuration::kCoreIsolationScheduler,
debug_daemon_client_.scheduler_configuration_name()); debug_daemon_client_.scheduler_configuration_name());
EXPECT_EQ(5u, configuration_set_count_); EXPECT_EQ(5u, configuration_set_count_);
} }
......
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