llama.cpp icon indicating copy to clipboard operation
llama.cpp copied to clipboard

llama-mmap: use MAP_PRIVATE instead of MAP_SHARED

Open iehgit opened this issue 11 months ago • 1 comments

It is not intended to write data to the file for others to read.

iehgit avatar Feb 10 '25 20:02 iehgit

No, thats a terrible idea. MAP_PRIVATE requires the kernel to reserve space for the file in its overcommit total, as the kernel might need to find the ram/swap to store the entire file, if the process with the map decides to write to every page in the file. This change would thus break llamacpp in cases where there is overcommit/memory pressure

IMbackK avatar Feb 11 '25 00:02 IMbackK