The program shortage
The real shortage of page frames (docs/ARCHITECTURE.md, "The frame caches"). This program runs alone, on a machine of the test whose boot image has no desktop: the root service gives it nearly all of its pages.
The frame table becomes empty only when the unspent pages of all the budgets and the reserved pages are fewer than the frames in the stacks of the processors. Here the budget of this program holds nearly all of them. Four threads make memory objects until the budget pays no more, and write one byte in each page: each first use is a take that cannot fail. Near the end the frame table is empty while the stacks of the other processors hold frames: the take drains the stacks and succeeds. Then the program checks, with the exact difference of System_Report, that no frame is free anywhere that a budget can pay, that a Memory_Create fails with its error record, frees everything, and checks that the sums are those of the start. It stops the machine with the code 0.
| Fact | Value |
|---|---|
| Source | programs/shortage |
| Boot image | in the boot image; the image is not built, so its size is not known |
| Imports | none |
| Imported by | none |
Exports
| Export | What it does |
|---|---|
| entry() |
Read from the source of the module, as the build reads it to describe the exports (tools/kerneltool/describe.odin).
What the root service gives it
| What | Value | As the root service says |
|---|---|---|
| Grants | {} | Not named in grants_of: the grants of each other program. |
| Budget: pages, programs, threads | {pages = 2048, programs = 1, threads = 1} | Not named in things_of: the budget of each other program. |
Read from grants_of and things_of in programs/root/main.odin; budget_of in the same file adds the limits of processor time and of log records.
