Shared-bus timing example 2026-10-13
Consider a stipulated synchronous shared computer bus, rather than a timing claim about any named hardware protocol. Assume a 32-bit data bus, a 100 MHz clock, and one four-byte payload transfer per bus cycle during the data phase. Both initiators and request at time zero. has one four-transfer write bus burst and one two-transfer write bus burst, to an immediately ready target in computer memory. Each bus burst pays one bus cycle for bus arbitration and one for its starting address and command; subsequent addresses advance implicitly. The arbiter chooses first, owners finish their entire bus bursts, and no phases overlap. There are no bus wait states, retries, extra completion cycles, direction changes or intervening requests. Payload is counted when each data phase completes; the observation interval starts at the first bus arbitration cycle and ends at the last payload completion.
Figure 1.
Stipulated bus arbitration and payload timing for two competing bus bursts
. Details.
A bus cycle lasts
The timeline uses half-open intervals of bus cycles: has bus arbitration on , address and command on , and four payload transfers on . Then has bus arbitration on , address and command on , and two payload transfers on . Their final payload completions are at 60 ns and 100 ns respectively. waits 60 ns before its own selection cycle even though both requests arrived together.
The six payload transfers contain 24 bytes. Ten bus cycles take 100 ns, giving finite-interval bus throughput
where MB means bytes. The raw data bus rate is . Payload occupies of the interval. If this same pair repeats with no gaps, its long-run bus throughput equals the finite-interval value; isolated observations need not predict a later workload.
Reverse the bus arbitration order, keeping these assumptions. finishes after four bus cycles, at 40 ns; finishes at 100 ns. Aggregate bus throughput stays 240 MB/s, but 's request-to-completion time falls from 100 ns to 40 ns and 's rises from 60 ns to 100 ns. Scheduling changes who waits without changing the available payload capacity in this example.
For an independent perturbation, retain first and add two bus wait states before 's final payload transfer. The interval grows to 120 ns with the same 24 bytes, so bus throughput falls to 200 MB/s. For another workload, one initiator sends all six transfers in a single bus burst: the stipulated overhead is paid once, giving eight bus cycles, 80 ns and 300 MB/s. This latter comparison assumes one combined request is valid; combining different initiators' operations is not automatically permitted.
Shared file mapping 2026-10-14
With MAP_SHARED, updates are visible to other operating-system processes mapping the same region and are carried through to the backing file. With MAP_PRIVATE, updates instead stay private, and later backing file changes have unspecified visibility in that mapping.[ref]
In the toy model, both shared file mappings initially read backing bytes at file offsets 8229 and 8230. Both memory pages have been accessed, so their translations are installed. A shared store changes the common page cache contents and creates a dirty memory page eligible for page writeback. That change can be observed before it reaches persistent storage. Cooperating readers need synchronization to know when an update is ready; MAP_SHARED alone supplies no mutual exclusion or indivisible multi-field update.
Use the two-level address translation model and map exactly four resident virtual memory pages, numbered 0x12, 0x13, 0xa0, and 0xa1. Assign their data page frames to 0x07, 0x02, 0x05, and 0x06, respectively. Only two root indices occur: 1 and 10. Allocate exactly three table nodes: the root at 0x8000, the lower-level table for root index 1 at 0x9000, and the lower-level table for root index 10 at 0xa000. Root entries 1 and 10 reference those tables; all other root entries are absent. Lower-level entries 2 and 3 in the first table and entries 0 and 1 in the second table hold the four mappings; every other lower-level entry is absent. Use the read-only permissions already specified for virtual memory page 0x12; let the other three mappings permit user reads and writes, with no execution, and let both populated root entries permit user reads and writes.
Each root index covers 16 virtual memory pages, hence bytes of the address space. A compact table node occupies bytes. The three nodes therefore require bytes of table storage, including the root and all absent entry slots in the allocated nodes. A single-level array requires bytes for the same address space, saving bytes in the compact model. Four data page frames occupy another bytes; those contents are separate from table storage.
If instead the allocator dedicates a whole 256-byte page frame to every table node, the three nodes consume 768 bytes, leaving bytes unused within those allocations. The single-level table fills four such page frames and still consumes 1024 bytes. Thus this example saves 256 bytes of allocated table storage under that alternative policy. Neither accounting includes allocator metadata, operating-system process records, or translation lookaside buffer storage; data allocations are the same in both designs.
Figure 1.
All table nodes for four mapped pages, and the footprint change when the same four pages occupy four root regions
. Details.
Placement matters as well as mapping count. Four virtual memory pages 0x12, 0x42, 0x72, and 0xa2 require the root plus four lower-level tables: five nodes, 320 compact bytes, or 1280 bytes with a dedicated page frame per node. Only four data page frames are still required. Let be the number of distinct root indices represented by the mappings. With no retained empty lower-level tables, table storage is compact bytes or allocated bytes under the dedicated-page frame policy. Even an empty address space retains the root in this accounting, so costs 64 or 256 bytes.
For a fully populated address space, : 17 nodes cost 1088 compact bytes or 4352 allocated bytes. The single-level table remains 1024 bytes. Sparse allocation is therefore a conditional space benefit; scattered mappings, node allocation granularity, and the root's overhead can reverse it. Additional dependent lookups on a TLB miss also have a cost, but node counts alone establish no universal execution-time ordering.