TECHNOLOGY

Explain why a model mapping still reads the old file after replacement

In this article
THE QUICK TAKE

Compare mapped inode identity with the current pathname and use an explicit reload lifecycle instead of blaming page cache.

A weight file is atomically replaced at its usual pathname, yet an existing model worker continues reading the old revision. That can be correct file-object behavior rather than stale page cache. An existing mapping remains associated with the object it mapped; a pathname lookup performed later can resolve a different object.

Compare object identity

Record the process’s mapping device, inode and offset through authorized metadata. Compare them with the file currently resolved at the configured path in the same relevant mount view. A matching text pathname is insufficient. Preserve model revision and process identity as well, because an automatically replaced worker can make observations from different attempts appear contradictory.

Understand atomic replacement

The rename interface can replace a destination pathname atomically under its documented conditions. Existing open references are not retargeted by that name change. This supports publication without an interval of a missing destination, but it does not mutate every consumer’s already established reference. A newly opened file can therefore differ from the object an old worker still uses.

Keep mappings beyond descriptors

The original descriptor can be closed after a successful mmap without invalidating the mapping. An absent descriptor in the current fd listing does not prove the old object has stopped backing model memory. Use mapping evidence rather than searching only open handles. A deleted marker can be informative, but identity fields are stronger than a pathname string alone.

Distinguish truncation and cache

Replacing a path with another object differs from shortening the same mapped object in place. The latter can invalidate later accesses beyond the new end. Clearing caches does not retarget a mapping to a new inode and can disturb unrelated workloads. Diagnose the update contract instead of attempting global cache eviction as a model-revision switch.

Verify explicit reload behavior

With synthetic versioned files, hold one mapping across an atomic replacement and compare it with a fresh open. Then exercise the application’s documented reload or worker-replacement path. Acceptance means the served revision follows an explicit lifecycle. It does not prove artifact integrity, coordinated switching across every replica or safe reclamation before all old references have actually ended.

Primary references

Linux Atomic Path Replacement.

Linux mmap.

Process Memory Mappings.

Related reading: OS page cache and cold model loading: what to record; Updating an LLM on a GPU: testing a new version with a small rollout.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles