[Bugfix][KV Connector] Only enforce disk block alignment for O_DIRECT (#55424)

Signed-off-by: Vincent <vincexxchan@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
mevince
2026-09-11 13:12:59 -07:00
committed by GitHub
co-authored by mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent cc5dd0a857
commit c1b69aa0d4
2 changed files with 63 additions and 3 deletions
+6 -3
View File
@@ -99,9 +99,12 @@ class DiskBackend:
t.stride(0) * t.element_size() for t in gpu_caches.values()
]
assert total_block_bytes % _ALIGNMENT == 0, (
f"total_block_bytes={total_block_bytes} not aligned to {_ALIGNMENT}"
)
# The stride alignment is an O_DIRECT kernel-DMA requirement; buffered
# I/O through the page cache has no alignment constraint.
if not use_page_cache:
assert total_block_bytes % _ALIGNMENT == 0, (
f"total_block_bytes={total_block_bytes} not aligned to {_ALIGNMENT}"
)
# Separate buffer pools for store and load threads
self._store_buffer_caches = {}