A computer bus connects components through agreed communication paths and transfer rules. On a shared computer bus, a CPU and a DMA engine can both want the same path to computer memory: attaching another initiator does not create another independent path. Bus arbitration chooses who may start; bus ownership states who may use each resource; bus throughput measures the useful data delivered. This makes sharing a performance question as well as a correctness question.
The computer bus path identifying the destination or location of a bus transaction. An initiator supplies an address; decoding selects the intended target. Address width describes the available address encodings, whereas data bus width describes how many bits can be carried at once.[ref]
The computer bus path carrying payload. A write sends data from the initiator to the target; a read returns data from the target. Owning the request path does not mean driving the data bus in both directions.[ref]
Lecture 21: Buses and I and O. CS152 lecture 21, slide 24: initiator commands, data in either direction
The computer bus paths specifying operations and coordinating progress, including requests and acknowledgments. Some control travels from initiator to target and some returns. In the diagram, bus arbitration requests and grants are shown separately from transfer control to distinguish choosing an initiator from executing its bus transaction.[ref]
Lecture 21: Buses and I and O. CS152 lecture 21, slides 22 and 33–36: control signals, sequencing, request and grant
One requested operation and its completion, potentially including several payload transfers. A bus transaction identifies a target, specifies an operation and exchanges data or status. A CPU or DMA engine can initiate one; a target responds. The terms “master” and “slave” in older hardware documents refer to these initiator and target roles.[ref]
One clock period in a synchronous computer bus. A bus transaction can occupy several bus cycles. An asynchronous computer bus instead coordinates progress through acknowledgments, so a clock-based count requires an additional timing model.[ref]
Lecture 21: Buses and I and O. CS152 lecture 21, slides 32–33: synchronous and asynchronous sequencing
An extension while a bus transaction awaits readiness. A bus wait state spends time without completing the next payload transfer. In a blocking design it also postpones another initiator's access; completion and bus ownership changes must follow the protocol.[ref]
A group of related payload transfers, often to consecutive addresses, arranged under one transfer sequence. A bus burst can amortize setup and bus arbitration overhead; a longer period of exclusive bus ownership can also make another initiator wait longer. The exact overhead and permitted handover boundaries depend on the protocol.[ref]
Selecting among initiators requesting a shared resource. An arbiter grants permission before an initiator starts its bus transaction. Fixed priority can indefinitely postpone a lower-priority requester under continuing higher-priority demand. Rotating priority can provide starvation freedom when every owner releases the resource after bounded work. Neither policy alone determines bus throughput: waiting, setup and target readiness also matter.[ref]
Lecture 21: Buses and I and O. CS152 lecture 21, slides 35–36: reservation, priority and fairness
The permission to use a particular computer bus resource during a specified phase. A pending grant need not authorize immediate use. Arm's AMBA Specification, revision 2.0 (section 3.11.3, figures 3-15–3-17) makes address-path handover depend on completion, and delays data bus ownership relative to address bus ownership. Consequently, a single whole-bus transaction owner is a useful simple model, but does not describe every overlapping implementation.
Here, competition between pending initiators for the same shared computer bus resource. Correct bus arbitration converts this competition into waiting. Simultaneously driving incompatible values on the same electrical lines is a different, erroneous kind of bus contention; multiple pending requests need not cause it.
Useful payload completed per unit elapsed time, with the observation interval stated. A raw data bus rate counts available transfer capacity; achieved bus throughput also depends on setup, bus wait states, idle intervals and sharing. Bus contention can increase a requester's delay even when the aggregate bus throughput remains unchanged, as the shared-bus timing example shows.
Stipulated bus arbitration and payload timing for two competing bus bursts
. Details. PCI Express is a packet-based input-output interconnect built from point-to-point links. A PCI Express root complex connects the host system to a hierarchy of endpoints, optionally through PCI Express switches. Each link joins two ports, so the whole hierarchy need not share one electrical path.[ref]
PCI Express Base Specification, Revision 2.1. Section 1.3, PCI Express Fabric Topology and figure 1-2
A PCI Express lane contains a transmit differential signal pair and a receive differential signal pair, allowing traffic in both directions. Several PCI Express lanes can form one wider link.[ref] For example, independent endpoint links can carry traffic concurrently, but traffic from both endpoints that converges on one upstream link competes for its available capacity. A link's payload throughput depends on its width, signaling and protocol overhead. The distinction under shared buses and point-to-point links therefore matters when interpreting the familiar term computer bus.
A PCI Express endpoint is a device at which PCI Express transactions originate or terminate, rather than a port whose principal role is forwarding traffic between links. Storage controllers, network adapters and accelerators can expose endpoint functions. The host discovers their configuration information and assigns resources for communication.
For example, a device driver can configure an endpoint's addressable control region and then exchange commands with the device. The Linux endpoint framework distinguishes the endpoint controller from the function implemented over it and supplies operations for configuration headers, address windows and interrupts.[ref]
PCI Endpoint Framework in the Linux kernel documentation. §§9.1–9.2.1, controller/function distinction, write_header, set_bar and raise_irq
An endpoint is a role in the interconnect topology; one chip can expose several functions, and some controllers support either endpoint or root-complex operation.A PCI Express lane contains one transmit differential signal pair and one receive differential signal pair. Each pair carries a serial signal, and the separate transmit and receive paths permit traffic in both directions. Multiple lanes can form a wider PCI Express link.[ref]
PCI Express Interface in the AMD PG213 documentation. lane signals and lane-count configurations
For example, an x4 link groups four lanes. At the same per-lane signaling rate it has four times the raw one-direction capacity of an x1 link, before encoding and protocol overhead. A PCI Express lane is not one individual conductor, and a connector's physical size does not by itself establish the negotiated link width. Payload throughput depends on the actual width, rate, encoding and transaction traffic.
A PCI Express switch routes transactions between PCI Express links in a hierarchy. In a conventional single-root arrangement, an upstream port connects toward the root complex and downstream ports connect toward endpoints or further switches. Software sees logical bridge relationships that describe this structure.[ref]
For example, two devices can have separate downstream links while sharing one upstream link to the host. Their local links can operate independently, but simultaneous host-bound transfers compete for the upstream capacity. Adding ports does not manufacture unlimited host bandwidth. A PCI Express switch routes the interconnect's transactions; its role and addressing model differ from those of an Ethernet switch.
A PCI Express root complex connects a host's CPU and memory system to a PCI Express hierarchy. A PCI Express root port originates a downstream link from that complex; one root complex can expose several such ports. Endpoints may attach directly or through switches.[ref]
For example, an operating system discovers a device through the hierarchy and configures resources through which the host and device communicate. Device-initiated memory transfers also depend on the platform's address mappings and protection mechanisms. The root complex is the host-facing architectural component, while a switch distributes links within the hierarchy and a PCI Express lane is one unit of a link's physical signaling. Keeping those levels separate prevents confusing a port count with a CPU count or a guaranteed bandwidth.
A PCI Express root port is a port in a root complex that starts a PCI Express link leading toward downstream devices or a switch. The PCI Express root port is represented as a logical bridge in the hierarchy. It is distinct from the PCI Express endpoint that provides a device function.[ref]
The PCI Express Port Bus Driver Guide HOWTO. §2.2, root ports, switch ports and logical bridge structure
For example, a storage PCI Express endpoint can attach directly to one PCI Express root port, while another root port connects to a switch serving several devices. Port services such as error reporting, hot plugging or power management concern that hierarchy and its links. Requiring a root-port service driver is therefore a different task from writing the device driver for the storage endpoint.
Intel QuickPath Interconnect is a packet-based point-to-point interconnect designed for communication among CPUs and other system components. It includes a cache coherence protocol, allowing distributed memory caches and memory controllers to participate in a coherent memory system. Its layered design separates electrical transmission, reliable link transfer, routing and higher-level transactions.[ref]
For example, a CPU requesting a cache line may obtain the current data from another CPU's memory cache, coordinated by the cache coherence protocol. The Intel QuickPath Interconnect link layer uses credits representing available receiving buffers: transmission consumes credits, and freeing buffers returns them. This controls how much data the receiver must accept.[ref]
An Introduction to the Intel QuickPath Interconnect. Pages 13–16, Credit/Debit Scheme, Routing Layer and Protocol Agents
As with PCI Express, independent links can operate concurrently while traffic sharing a link or destination can contend. The shared buses and point-to-point links distinction prevents applying a single globally shared bus model to the entire interconnect.
// Destination: computer-science.bigb
Direct memory access transfers data between a device and computer memory without the CPU executing a copy instruction for each item. The CPU still sets up the operation and observes completion. DMA answers who moves the data; an interrupt answers how a need for attention is announced. A DMA transfer can therefore finish with interrupt-driven input-output or with polled input-output. [ref]
https://pages.cs.wisc.edu/~remzi/OSTEP/file-devices.pdf. Arpaci-Dusseau and Arpaci-Dusseau, OSTEP chapter 36, section 36.5: DMA
For a toy receive operation, the CPU arranges a four-byte DMA buffer and tells the device its DMA address, length and direction. The device writes the bytes
A, B, C, D into that DMA buffer. After completion and any required DMA buffer synchronization, the CPU can read those four bytes. There are four payload bytes, but no four-item CPU copy loop on the device-to-computer memory path. This is a schematic example, not an instruction to operate real hardware.The useful separation is that the CPU can perform other work while a larger transfer proceeds. The reasoning is a division of responsibilities: setup specifies the destination and extent once; the transfer engine advances through the payload; completion reports the result. The data still crosses an interconnect such as a computer bus, which must share access among competing initiators. Setup, mapping, synchronization and completion cost work, so DMA does not promise a speedup for every transfer size. [ref]
https://docs.kernel.org/core-api/dma-api.html. James E. J. Bottomley, Linux DMA API, parts Ic–Id: mapping costs, addressing constraints and transfer directions
Correctness also requires keeping the DMA buffer alive and coordinating its ownership until the device is finished. A DMA address need not equal a CPU virtual address or physical address. An IOMMU, when present and configured, translates device addresses and can restrict access to authorized computer memory; it is not the CPU's memory management unit. Operating-system process isolation through virtual memory alone does not establish those device-access restrictions. [ref]
https://docs.kernel.org/core-api/dma-api-howto.html. Linux kernel documentation, Dynamic DMA mapping Guide: CPU and DMA addresses
[ref]https://docs.kernel.org/driver-api/vfio.html. Linux kernel documentation, VFIO: IOMMU protection and device isolation
A region of computer memory prepared for DMA. In the four-byte receive example it is the payload destination, and must remain available until the transfer and required DMA buffer synchronization are complete.
An address supplied to a device for DMA, in the device's address system. The Linux kernel's mapping interface returns this separately from the CPU's virtual address; an IOMMU can translate it to a physical address. [ref]
https://docs.kernel.org/core-api/dma-api-howto.html. Linux kernel documentation, Dynamic DMA mapping Guide: CPU and DMA addresses
Coordinating CPU and device access to a DMA buffer, including any required memory cache maintenance and ordering. A completed device write must be made visible before the CPU consumes it. The Linux kernel distinguishes coherent mappings from streaming mappings needing synchronization at ownership changes; even coherent mappings can require ordering of writes. [ref]
https://docs.kernel.org/core-api/dma-api-howto.html. Linux kernel documentation, Dynamic DMA mapping Guide: types of DMA mappings and using streaming DMA mappings
[ref]https://docs.kernel.org/core-api/dma-api.html. James E. J. Bottomley, Linux DMA API, part Ia: coherent buffers and write ordering
Hardware translating device DMA addresses to physical addresses, with access restrictions used for device isolation. Availability, configuration and isolation boundaries depend on the platform; merely having an IOMMU does not establish complete isolation. [ref]
https://docs.kernel.org/driver-api/vfio.html. Linux kernel documentation, VFIO: IOMMUs, device topology and isolation groups
Articles by others on the same topic
There are currently no matching articles.


