The entry locker
A module that the process locks starts several times, to load the kernel from several processes at one time (package modus:lockers). It works only on its own objects: another process never waits for it, unless the kernel makes it wait.
What it is for. The process locks needs load on the kernel from several processes whose kernel entries touch no common object: then a locker waits for another one only when a lock of the kernel makes it wait, and the waits that locks counts are the cost of the locks of the kernel. This process is that load.
What a reader sees. Nothing of its own: no window, no menu line. It runs while locks measures, and locks writes its counts.
How it works. locks starts it from the boot image with a locker slot of a shared board (lockers.Board). The locker waits on the word command of its slot, then runs the mode that the slot names until the time end of the command, or until the count limit of the command: Entries (one cheap kernel operation on its own object, as often as it can), Faults (pages on first use: create, map, write one byte in each page, unmap, close), or Large (create and close a memory object of 600 pages). It counts its operations and its kernel entries in its slot. In the stress case (lockers.ROLE_CHURN) it starts and stops processes with a peer instead.
Its grants: none of the root service. The board and its role come from locks.
locker module with an entry
- Hash
03b0f25ff1b851462049572ee7169914b910f57c32932a674f10e179968a2b6c- Size
36864 bytes- Exports
0- Imports
0- Imported by
0- License
- MIT
A module that the process locks starts several times, to load the kernel from several processes at one time (package modus:lockers)
| Fact | Value |
|---|---|
| Kind | Modules with an entry |
| Source | src/modules/demonstrations/locker |
| Boot image | yes: in the boot image, 36864 bytes in this build |
| Build settings | none: the defaults of the source |
| Imports | none |
| Imported by | none |
Neighbours
It imports no module, and no module imports it. The module graph shows it with the other modules that have no edge.
Exports
| Export | What it does |
|---|---|
entry() | runs the role that locks wrote in the context: the stress case (churn), or a locker slot of the board |
entry
entry()
entry runs the role that locks wrote in the context: the stress case (churn), or a locker slot of the board. A locker prepares the page tables of its range, tells locks that it is ready, then waits for each command and runs its mode until the next one. With no board or a slot number past the board, it stops with Failed.
- Form
- The entry of the module: one parameter, an address, fixed by the contract.
src/modules/demonstrations/locker/main.odin:122
Read from the source of the module, as the build reads it to describe the exports (tools/modustool/build/describe.odin).
What the root service gives it
| What | Value | As the root service says |
|---|---|---|
| Grants | none | A child of locks: its starter gives it its handles. |
| Other terms of its start grant set | none | |
| Budget that it asks for |
| No MODULE_BUDGET in its source: it asks for the least budget. |
The start grant set is read from start_grant_sets in src/modules/system/root/start_grant_sets.odin. The stated budget is read from the constant MODULE_BUDGET of the source of the module; the build adds the counted parts and writes the sum in the module (tools/modustool/build/budget_count.odin); the root service accepts it up to the largest budget of a process, and adds the limits of processor time and of log records (src/modules/system/root/budgets.odin).
Board type of the package lockers
Board :: struct {...}
The memory that locks shares with its lockers: one slot for each.
ROLE_CHURN constant of the package lockers
ROLE_CHURN :: 1
A locker of the stress case: it has no board.
