From 4f5d0860d73591a9c75f99a12fa9fe5028ffbf11 Mon Sep 17 00:00:00 2001 From: Go Date: Wed, 30 Sep 2026 18:26:14 +0900 Subject: [PATCH] docs: limit shared arena backing to dev shm --- src/core/pinned.cu | 3 ++- src/program/generate.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/pinned.cu b/src/core/pinned.cu index 49bb5c47..b64eb52a 100644 --- a/src/core/pinned.cu +++ b/src/core/pinned.cu @@ -53,7 +53,8 @@ static_assert(sizeof(SharedArenaHeader) <= kSharedArenaHeaderBytes); // A 2 MB-aligned reservation. Large pages first, then the largest alignment the OS will give us for free. // A non-empty shared_file instead maps one file whose first 4 KiB identify the pack and whose remaining bytes -// are the resident arena. Keeping the header inside the same mapping also works for tmpfs and hugetlbfs. +// are the resident arena. This shared-file layout is intended for tmpfs (/dev/shm); hugetlbfs would need +// hugepage-aligned file size and arena offset rather than the 4 KiB header layout used here. void* reserve(uint64_t bytes, PageBacking& got, std::string& note, const std::string& shared_file, uint64_t shared_pack_hash, void*& mapping_base, uint64_t& mapping_bytes) { mapping_base = nullptr; diff --git a/src/program/generate.cpp b/src/program/generate.cpp index e75ac2c8..d811728b 100644 --- a/src/program/generate.cpp +++ b/src/program/generate.cpp @@ -438,7 +438,7 @@ void usage() { " The A/B arm: the mmap's rate depends on the OS page cache holding\n" " 34 GB, and measured 71.97 vs 34.78 ms/token cold vs warm.\n" " --shared-expert-arena FILE Linux: back the resident arena with one MAP_SHARED file.\n" - " Put this file on /dev/shm or hugetlbfs, not ordinary SSD storage.\n" + " Put this file on /dev/shm, not ordinary SSD storage.\n" " A small header binds an existing backing file to the same pack.\n" " --resident-cpu-experts with mmap and a static profile, keep CPU misses resident in ordinary RAM.\n" " Borrowed GPU-cache entries may read from mmap during prompt prefill.\n");