[kernel][oom] Use "halt token" to coordinate concurrent reboots

This change fixes a bug where an already in progress OOM reboot could
be superseded by some other reboot operation (e.g. graceful reboot
via syscall or critical job termination).

Introduce the concept of a halt token that must be obtained prior to
halting the system.

Change existing non-panic code paths to acquire the halt token.

If a code path fails to acquire the token, it must sleep, spin, or
return depending on the context and resources (think locks) it holds.

Add TestOOMSignalBeforeCriticalProcess test.

Bug: 57008
Bug: 82229
Change-Id: I50e4d6b48897552e536fc2c239ffb173fd18c5a2
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/574141
Commit-Queue: Nick Maniscalco <maniscalco@google.com>
Reviewed-by: John Grossman <johngro@google.com>
Reviewed-by: Rasha Eqbal <rashaeqbal@google.com>
7 files changed
tree: f19941a081c4e1ac4458d1e5a7724626e8778f89
  1. boards/
  2. build/
  3. bundles/
  4. docs/
  5. examples/
  6. garnet/
  7. products/
  8. scripts/
  9. sdk/
  10. src/
  11. third_party/
  12. tools/
  13. zircon/
  14. .clang-format
  15. .clang-tidy
  16. .git-blame-ignore-revs
  17. .gitattributes
  18. .gitignore
  19. .gn
  20. .style.yapf
  21. AUTHORS
  22. BUILD.gn
  23. CODE_OF_CONDUCT.md
  24. CONTRIBUTING.md
  25. LICENSE
  26. OWNERS
  27. PATENTS
  28. README.md
  29. rustfmt.toml
README.md

Fuchsia

Pink + Purple == Fuchsia (a new operating system)

What is Fuchsia?

Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.

Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.

Read more about Fuchsia's principles.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.