[PATCH v3 0/2] drivers/block: add RamShared hardware-accelerated VRAM block driver

From: Emerson Busson

Date: Thu Sep 17 2026 - 21:40:12 EST


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

Following RFC v1 and RFC v2 discussions on linux-block@xxxxxxxxxxxxxxx,
this series promotes RamShared to formal PATCH v3 submission with
hardened IOCTL boundary controls, 64-bit DMA masks, linear error
unwinding, and empirical multi-tier stress qualification.

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+ and mainline 7.0+ (Ubuntu 24.04 LTS HWE stack).

v2 -> v3 changes:
- drivers/block/ramshared/control.c: add dedicated IOCTL control
operations with strict user-input validation and bounds checking.
- drivers/block/ramshared/main.c: enforce 64-bit DMA mask with
dma_set_mask_and_coherent() during PCI device initialization.
- drivers/block/ramshared/main.c: add safe linear error unwinding with
pci_clear_master() and cleanup on add_disk() failure.
- drivers/block/ramshared/queue.c: map internal driver status codes
cleanly to blk_status_t semantic Linux block layer errors.
- drivers/block/ramshared/compat.h: add set_capacity_and_notify()
cross-kernel compatibility shim for modern kernel block layers.
- drivers/block/ramshared/Makefile: link control.o into driver object.
- Promote from RFC to formal PATCH v3 for upstream consideration.

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,840 MB swap holding continuous
dirty page write cycles under PCIe Direct DMA with 0.00 ms access
latency and PASS_ZERO_PANIC stability verdict.
- Memory stress battery: sustained 11.61 GB/s PCIe reclaim throughput
with 0.0% PSI stalls and 0 kernel OOM kills.

Signed-off-by: Emerson Busson <emersonbusson@xxxxxxxxx>