| # Copyright 2020 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/suspend/config.gni") |
| import("//build/zbi/kernel_cmdline.gni") |
| |
| # This serves as an anchor point. By expressing a dependency on |
| # //boards/kernel_cmdline, build arguments declared in this file |
| # are brought into scope. |
| group("kernel_cmdline") { |
| } |
| |
| kernel_cmdline("serial-legacy") { |
| args = [ "kernel.serial=legacy" ] |
| deps = [ "//build/validate:non_production_tag" ] |
| } |
| |
| kernel_cmdline("disable-blobfs-compression") { |
| args = [ "blobfs.write-compression-algorithm=UNCOMPRESSED" ] |
| deps = [ "//build/validate:non_production_tag" ] |
| } |
| |
| kernel_cmdline("enable-suspend") { |
| args = [ |
| "kernel.enable_suspend=true", |
| |
| # Force ticks_get to use the syscall where we can apply an offset to ensure continuity of the |
| # monotonic clock over suspend and resume. This has a significant time cost and is only |
| # intended as a temporary measure to enable testing of suspend as it is introduced. |
| "vdso.ticks_get_force_syscall=true", |
| ] |
| deps = [ "//build/validate:non_production_tag" ] |
| } |
| |
| # This group is defined in this way so that it can be included in the board before the |
| # `enable_suspend` flag is set as a build argument by developers. |
| group("enable-suspend-from-board") { |
| if (enable_suspend) { |
| deps = [ ":enable-suspend" ] |
| } |
| } |
| |
| # This collects settings not specific to any particular machine that are |
| # recommended to minimize unintended effects on timing data. Note that this |
| # does not (as yet) include settings that may reduce overall performance, which |
| # x64-reduced-perf-variation (below) does (see x64-reduced-perf-variation.gni). |
| group("reduced-perf-variation") { |
| deps = [ |
| ":disable-page-scanner", |
| ":quiet-early-boot", |
| ] |
| } |
| |
| # This collects settings not specific to any particular machine that are |
| # recommended to make the system's performance highly representative of a |
| # production setup. |
| group("perf-realistic") { |
| deps = [ ":quiet-early-boot" ] |
| } |
| |
| kernel_cmdline("quiet-early-boot") { |
| args = [ |
| # Disable serial console printing during early boot, a phase during which |
| # UART communication is single-threaded and synchronous. In production, |
| # the serial console will be disabled, and so early boot benchmarks that |
| # include this work is sensibly avoided. |
| "kernel.phys.verbose=false", |
| ] |
| } |
| |
| kernel_cmdline("disable-page-scanner") { |
| args = [ |
| # Disable page scanning in all its forms. Page scanning is intended to |
| # provide a memory benefit to final systems, but the operation of the |
| # scanner and its unpredictable de-duplication or eviction of memory in use |
| # by benchmarks could cause noticeable variation. |
| "kernel.page-scanner.start-at-boot=false", |
| "kernel.page-scanner.zero-page-scans-per-second=0", |
| "kernel.page-scanner.enable-eviction=false", |
| ] |
| } |
| |
| kernel_cmdline("x64-reduced-perf-variation") { |
| deps = [ ":reduced-perf-variation" ] |
| args = [ |
| # Disable Intel Turbo Boost. Turbo Boost provides a significant speed-up to |
| # many workloads, but — because CPU frequencies vary based on previous work, |
| # work in other cores, system temperature, etc — makes performance of systems |
| # less predictable. We prefer stability in our performance comparison |
| # benchmarks. |
| "kernel.x86.turbo=false", |
| |
| # Set the Intel HWP performance profile to be "stable", trying to keep the |
| # CPU clock rate stable. With turbo boost disabled, this has only a small |
| # effect, but helps ensure that wake ups from idle are fixed. |
| "kernel.x86.hwp_policy=stable-performance", |
| |
| # Disable hyper-threading. Hyper-threading reduces predictability of |
| # benchmarks, because the performance of a thread is significantly affected |
| # by other threads on the core. |
| "kernel.smp.ht=false", |
| |
| # Disable spectre mitigations. Spectre mitigations have significant |
| # performance impact, but are currently only carried out on a subset of the |
| # NUC fleet. This means that different devices have significantly different |
| # performance characteristics, meaning that benchmark results vary |
| # significantly based on the device running it. |
| # |
| # TODO(https://fxbug.dev/42108327): Ideally, we should load microcode during Zircon boot, |
| # which should bring all devices to the same patch level, removing the |
| # performance differences when spectre mitigations are in place. |
| "kernel.x86.disable_spec_mitigations=true", |
| ] |
| } |
| |
| kernel_cmdline("gce") { |
| args = [ "kernel.serial=legacy" ] |
| } |
| |
| kernel_cmdline("as370") { |
| args = [ "kernel.bypass-debuglog=true" ] |
| } |