# saibontha18-hub/nbio-enhanced-atomics-repro architecture

> Architecture diagram of the GitHub repository saibontha18-hub/nbio-enhanced-atomics-repro, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/saibontha18-hub/nbio-enhanced-atomics-repro
- Repository: https://github.com/saibontha18-hub/nbio-enhanced-atomics-repro

## Overview

This repository is a Linux DMA/IOVA corruption reproducer, not a fix. The main workflow loads a kernel module that allocates and maps pages, reports when DMA addresses exceed 32 bits, and releases mappings on unload. In parallel, an optional read-only NVMe stress script increases allocation churn; a separate checker looks for the kernel quirk’s log signature. The module’s implementation is excerpted; script behavior and their relationships are based on README documentation.

Main entry points: [`iova_stress/iova_stress.c`](https://github.com/saibontha18-hub/nbio-enhanced-atomics-repro/blob/main/iova_stress/iova_stress.c) (DMA mapping stress), [`nvme_stress.sh`](https://github.com/saibontha18-hub/nbio-enhanced-atomics-repro/blob/main/nvme_stress.sh) (NVMe I/O stress), [`check_quirk.sh`](https://github.com/saibontha18-hub/nbio-enhanced-atomics-repro/blob/main/check_quirk.sh) (Quirk signature check)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_reproducer["IOVA Reproducer"]
  node_module_setup["Module setup<br/>[iova_stress.c]"]
  node_dma_mapping["DMA mapping stress<br/>[iova_stress.c]"]
  node_mapping_report["Exhaustion report<br/>[iova_stress.c]"]
  node_mapping_cleanup["Mapping cleanup<br/>[iova_stress.c]"]
end

subgraph group_pressure["Storage Pressure"]
  node_nvme_runner["NVMe I/O stress<br/>[nvme_stress.sh]"]
end

subgraph group_diagnostics["Quirk Diagnostics"]
  node_quirk_check["Quirk signature check<br/>[check_quirk.sh]"]
end

node_operator(("Test operator"))
node_dma_api["Linux DMA API"]
node_storage["NVMe storage"]
node_kernel_log["Kernel log"]

node_operator -->|"loads module"| node_module_setup
node_module_setup -->|"starts mappings"| node_dma_mapping
node_dma_mapping -->|"maps pages"| node_dma_api
node_dma_mapping -->|"reports addresses"| node_mapping_report
node_operator -->|"runs in parallel"| node_nvme_runner
node_nvme_runner -->|"reads under pressure"| node_storage
node_operator -->|"runs checker"| node_quirk_check
node_quirk_check -->|"checks signature"| node_kernel_log
node_operator -->|"unloads module"| node_mapping_cleanup
node_mapping_cleanup -->|"unmaps pages"| node_dma_api

click node_module_setup "https://github.com/saibontha18-hub/nbio-enhanced-atomics-repro/blob/main/iova_stress/iova_stress.c"
click node_dma_mapping "https://github.com/saibontha18-hub/nbio-enhanced-atomics-repro/blob/main/iova_stress/iova_stress.c"
click node_mapping_report "https://github.com/saibontha18-hub/nbio-enhanced-atomics-repro/blob/main/iova_stress/iova_stress.c"
click node_mapping_cleanup "https://github.com/saibontha18-hub/nbio-enhanced-atomics-repro/blob/main/iova_stress/iova_stress.c"
click node_nvme_runner "https://github.com/saibontha18-hub/nbio-enhanced-atomics-repro/blob/main/nvme_stress.sh"
click node_quirk_check "https://github.com/saibontha18-hub/nbio-enhanced-atomics-repro/blob/main/check_quirk.sh"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_module_setup,node_dma_mapping,node_mapping_report,node_mapping_cleanup toneBlue
class node_nvme_runner,node_storage toneAmber
class node_quirk_check,node_dma_api toneMint
class node_operator,node_kernel_log toneIndigo
```

## Components

### IOVA Reproducer

- [Module setup](https://github.com/saibontha18-hub/nbio-enhanced-atomics-repro/blob/main/iova_stress/iova_stress.c): `iova_stress/iova_stress.c`
- [DMA mapping stress](https://github.com/saibontha18-hub/nbio-enhanced-atomics-repro/blob/main/iova_stress/iova_stress.c): `iova_stress/iova_stress.c`
- [Exhaustion report](https://github.com/saibontha18-hub/nbio-enhanced-atomics-repro/blob/main/iova_stress/iova_stress.c): `iova_stress/iova_stress.c`
- [Mapping cleanup](https://github.com/saibontha18-hub/nbio-enhanced-atomics-repro/blob/main/iova_stress/iova_stress.c): `iova_stress/iova_stress.c`

### Storage Pressure

- [NVMe I/O stress](https://github.com/saibontha18-hub/nbio-enhanced-atomics-repro/blob/main/nvme_stress.sh): `nvme_stress.sh`

### Quirk Diagnostics

- [Quirk signature check](https://github.com/saibontha18-hub/nbio-enhanced-atomics-repro/blob/main/check_quirk.sh): `check_quirk.sh`

### Other components

- **Test operator**
- **Linux DMA API**
- **NVMe storage**
- **Kernel log**

## Connections

- Test operator → Module setup: loads module (evidence: `README.md`)
- Module setup → DMA mapping stress: starts mappings (evidence: `iova_stress/iova_stress.c`)
- DMA mapping stress → Linux DMA API: maps pages (evidence: `iova_stress/iova_stress.c`)
- DMA mapping stress → Exhaustion report: reports addresses (evidence: `iova_stress/iova_stress.c`)
- Test operator → NVMe I/O stress: runs in parallel (evidence: `README.md`)
- NVMe I/O stress → NVMe storage: reads under pressure (evidence: `README.md`)
- Test operator → Quirk signature check: runs checker (evidence: `README.md`)
- Quirk signature check → Kernel log: checks signature (evidence: `README.md`)
- Test operator → Mapping cleanup: unloads module (evidence: `README.md`)
- Mapping cleanup → Linux DMA API: unmaps pages (evidence: `iova_stress/iova_stress.c`)
