BACKPORT: Add `--core-scheduling` flag gating interaction with PR_SCHED_CORE

On Android CI we observe performance regressions when crosvm takes
advantage of the PR_SCHED_CORE feature. We are somewhat oversubscribed
on CPUs, in some cases running a Cuttlefish Android VM with --cpus=4 and
an OpenWRT VM with --cpus=1 next to some other host processes on cloud
instances with 2 cores and 4 hyperthreads. In this case we would prefer
not to lose cpu time to the scheduler blocking off hyperthreads when
either VM claims complete cores to itself.

In this case we are intending to fall back to the default state of "all
processes trust each other", mentioned under "Trust model" on
https://www.kernel.org/doc/html/next/admin-guide/hw-vuln/core-scheduling.html

`--core-scheduling` defaults to true, so there is no behavioral
change for existing users.

Bug: b/280660768
Test: `crosvm start --core-scheduling=false` from Cuttlefish launcher script
Change-Id: Id154790c16b7d9f81aff1f189468959fb5fa7259
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4602908
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Cody Schuffelen <schuffelen@google.com>
Merged-In: Id154790c16b7d9f81aff1f189468959fb5fa7259
4 files changed
tree: 00728d1f178833841f27cbaf691b91edf0e478a9
  1. .cargo/
  2. .devcontainer/
  3. .github/
  4. aarch64/
  5. acpi_tables/
  6. arch/
  7. base/
  8. bin/
  9. bit_field/
  10. ci/
  11. common/
  12. cros_async/
  13. crosvm-fuzz/
  14. crosvm_control/
  15. crosvm_plugin/
  16. cuttlefish/
  17. devices/
  18. disk/
  19. docs/
  20. fuse/
  21. gpu_display/
  22. hypervisor/
  23. infra/
  24. integration_tests/
  25. io_uring/
  26. kernel_cmdline/
  27. kernel_loader/
  28. kvm/
  29. kvm_sys/
  30. libcras_stub/
  31. linux_input_sys/
  32. logo/
  33. media/
  34. net_sys/
  35. net_util/
  36. patches/
  37. power_monitor/
  38. protos/
  39. qcow_utils/
  40. resources/
  41. rutabaga_gfx/
  42. seccomp/
  43. serde_keyvalue/
  44. src/
  45. system_api_stub/
  46. tests/
  47. third_party/
  48. tools/
  49. tpm2/
  50. tpm2-sys/
  51. usb_sys/
  52. usb_util/
  53. vfio_sys/
  54. vhost/
  55. virtio_sys/
  56. vm_control/
  57. vm_memory/
  58. win_util/
  59. x86_64/
  60. .dockerignore
  61. .gitignore
  62. .rustfmt.toml
  63. all2android.sh
  64. Android.bp
  65. ARCHITECTURE.md
  66. Cargo.toml
  67. cargo2android.json
  68. cargo2android_defaults.bp
  69. cargo2android_module.bp
  70. CONTRIBUTING.md
  71. LICENSE
  72. METADATA
  73. navbar.md
  74. OWNERS
  75. OWNERS.android
  76. PREUPLOAD.cfg
  77. README.chromeos.md
  78. README.md
  79. run_c2a.sh
  80. run_tests
  81. rust-toolchain
  82. setup_cros_cargo.sh
  83. test_all
  84. TEST_MAPPING
  85. unblocked_terms.txt
README.md

crosvm - The Chrome OS Virtual Machine Monitor

crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the Chrome OS platform. Compared to QEMU, crosvm doesn’t emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as the virtio standard.

crosvm is currently used to run Linux/Android guests on Chrome OS devices.

Logo