Skip to content

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

Emerson Busson linux-block lkml 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 0 repliesNew
  2. v2 RFC posting 2/22 patches 0 repliesSuperseded
  3. v2 RFC posting 1/20 of 2 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 RFC2 patches0 repliesSuperseded

Changes in v3 from the cover letter

- 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.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2drivers/block/ramshared: add hardware-accelerated VRAM block driverdrivers/block/ramshared/Kconfig drivers/block/ramshared/Makefile drivers/block/ramshared/compat.h +5 more+908 -00 replies
2/2drivers/block: integrate ramshared driver into build systemdrivers/block/Kconfig drivers/block/Makefile+3 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

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

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

Following RFC v1 and RFC v2 discussions on [email protected], 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.