arXiv Science⌕ Search

arXiv · 2612.02487

Write, Return, Reserve: KV Memory for Multi-User CPU LLM Servers under a Memory Budget

Abstract

Memory limits how many requests a CPU language-model server can handle at once. llama.cpp commits its entire key-value (KV) cache before requests use it. Our kernel measurements identify start-up zero-filling and cache clearing as the cause. We adapt its multi-user server to commit pages on first write, return each finished request's pages to the kernel, and admit requests through an external proxy. The proxy reserves each request's maximum KV requirement, calculated from the model configuration, within a memory budget. In our tests, greedy output and perplexity match unmodified llama.cpp. For Qwen2.5-1.5B on identical requests with 16k context per slot and prompt caching disabled, unmodified llama.cpp uses 12.3 times as much peak memory. Across three sessions, we find no statistically detectable throughput difference (modified/unmodified ratio 0.996, 95% CI 0.92-1.08). Against unmodified llama.cpp running only the slots that fit and queueing other users, extra concurrency raises throughput 1.17-1.26x below CPU saturation. Once the CPU is saturated, throughput is similar. Requests start sooner, but each output token takes longer. We test 1-14B models on Intel and ARM. Of 199 outcomes predicted before testing, 179 match. We report every miss. Returning unused KV memory to the OS lets a CPU server handle more requests at once, but only improves throughput while the CPU has spare capacity.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Hariraam Kethisvarasuthan, Suresh Michael Peiris. 2026-11-27. Write, Return, Reserve: KV Memory for Multi-User CPU LLM Servers under a Memory Budget. https://arxiv.science/abs/2612.02487

Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite arXiv Science by Indiciae: BibTeX · RIS.

KEEP EXPLORING

Related papers

Quietus: Detecting False Finality in DMA Buffer Reclamation

Direct memory access (DMA) lets devices read and write memory independently of the CPU, so a driver can safely hand a buffer to a new owner only after every operation that can access that memory has finished. In practice, however, drivers often release or reuse buffers right after requesting a stop or observing a single completion event, which lets queued descriptors, asynchronous completion callbacks, or deferred bounce-buffer copybacks outlive that handoff and overwrite memory that now belongs to the new owner. We call this failure false finality, and catching it requires tracking operations across execution contexts while accounting for the actual retirement guarantees of the underlying DMA provider. We present QUIETUS, a framework that detects unsafe DMA buffer reclamation by checking authority-set finality, the requirement that no hardware or software operation from a buffer's previous use can still access it once a new owner takes over. We formalize this property in Lean and build a verified checker that analyzes reconstructed driver lifecycles using each DMA provider's retirement guarantees. The checker shows how each reported violation occurs within the model and establishes safe retirement only when every modeled path is safe. We applied QUIETUS to Linux and Zephyr and uncovered 32 machine-checked DMA lifecycle violations across 29 drivers, and reproduced representative violations on physical hardware and in kernel emulation, demonstrating writes into a new owner's memory on embedded hardware and use-after-free writes in Linux.

cs.OS↗

High-Efficient Deduplication for Cloud-Native AI Container Images

Container images are becoming increasingly large and frequently updated, particularly for AI/ML workloads, making storage consumption and startup latency major deployment challenges. On-demand loading reduces startup overhead by fetching only the data actually accessed, while cross-image deduplication reduces storage redundancy. However, existing deduplication approaches can interfere with on-demand loading by introducing runtime lookup overhead, fragmenting remote accesses, and amplifying data and metadata reads, thereby offsetting the benefits of deduplication. In this work, we present SLIDE, a cross image deduplication system for Nydus style container images. SLIDE clusters similar image regions, preserves locality during remote deduplication, and defers locality violating reuse until data are cached locally. It also uses per image reference bitmaps and paged blob metadata to avoid unnecessary prefetching and metadata reads. We implement SLIDE on Nydus and evaluate it across AI/ML images. Our results show that SLIDE substantially reduces both storage footprint and startup latency while preserving efficient on-demand loading.

cs.OS↗

Lightning-Speed Futexes

In the Linux kernel, the futex primitive lets one or several threads sleep until another thread wakes them up. Futexes can be used to implement barriers, in which a futex wake-all is used to release all waiting threads. A wake-all is performed serially: the waker first waits on the lock that protects the list of sleeping threads, behind the threads it is about to wake, then walks a list of threads to collect the threads, and finally wakes them one at a time. We propose an approach that improves the performance of all three steps. Our approach places an abort gate in front of the lock, an admission stage that allows the waker to abort, in constant time, the lock acquisitions queued ahead of it; the waker then detaches the full set of waiters in one step instead of collecting them one by one; and finally it parallelizes the wake-ups by recruiting each woken thread to wake further threads. We implement our approach in the futex subsystem of Linux 6.19. On six Intel, AMD, and ARM servers, our approach speeds up the barrier-intensive NAS kernels by 1.3$\times$ to 1.9$\times$ on geometric mean, depending on the input class, and 45 barrier-heavy applications by 2.1$\times$ on geometric mean, with peak speedups of 4.4$\times$ and 6.2$\times$.

cs.OS↗