[BugFix][Core] free_blocks: restore prepend (LIFO) reuse order when prefix caching is off (#51482)

Signed-off-by: theminghuang <theminghuang@gmail.com> Signed-off-by: Ming Huang <mhhua@google.com>

Ming Huang committed Aug 10, 2026 at 20:56 UTC 07443bea29db509cfc84b060317c7077b343376a
1 file changed +1 -1
vllm/v1/core/block_pool.py
+1 -1
@@ -732,7 +732,7 @@ class BlockPool:
732 if block.ref_cnt == 0 and not block.is_null:
733 # When caching is disabled we always append for better
734 # GPU cache locality from reusing recently used blocks
735 - if block.block_hash is None and self.enable_caching:
735 + if block.block_hash is None or not self.enable_caching:
736 blocks_without_hash.append(block)
737 else:
738 blocks_with_hash.append(block)