Skip to contentSkip to conversation

drivers/block: add RamShared hardware-accelerated VRAM block driver

RFC PATCH Superseded emersonbusson 1 participant 1 message Sep 4 Block layer

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover drivers/block: add RamShared hardware-accelerated VRAM block driver

This patch series introduces the RamShared hardware-accelerated block driver (drivers/block/ramshared).

RamShared maps discrete GPU video memory (VRAM) apertures over direct PCIe DMA to provide an ultra-low latency, non-rotational block device with a synchronous .rw_page swapout path.

Key Design Highlights:
1. blk-mq multi-queue parallel request processing with atomic gendisk allocation.
2. Synchronous .rw_page fast-path in block_device_operations for zero-allocation swapout under direct memory reclaim pressure.
3. PCIe AER error handling with pci_error_handlers to contain link resets.
4. Comprehensive multi-kernel compatibility across 5.15 LTS through 6.18+.

v1 -> v2 changes:
- drivers/block/ramshared/queue.c: use check_shl_overflow() to prevent 64-bit integer overflow when shifting sector to byte offsets.
- drivers/block/ramshared/queue.c: enforce PCIe BAR0 boundary validation before memory-mapped I/O.
- drivers/block/ramshared/main.c: ensure pci_clear_master() is called during linear error unwinding in probe failure paths and device teardown.
- drivers/block/ramshared/main.c: clamp queue_depth module parameter within [1..4096].
- drivers/block/ramshared/ramshared.h: wrap function declarations to conform to 80-column kernel coding style.

Testing & Quality Gates:
- checkpatch.pl --strict: 0 errors, 0 checks.
- sparse semantic address-space analysis: PASS (__iomem verified).
- Multi-tier saturation benchmark: 9,160 MB swap holding 40 continuous cycles over 30 seconds with 0.00 ms access latency under WSL2/Hyper-V (EVD-0040).
- Memory stress battery: 9.09 GB/s PCIe reclaim throughput with 0.0% PSI stalls.