git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/17] Sliding window mmap for packfiles.

From
Shawn O. Pearce <spearce@spearce.org>
Date
Dec 23, 2006, 07:33 UTC
Message-ID
<20061223073317.GA9837@spearce.org>

This 17 patch series implements my much discussed, but never produced (until now), 'mmap sliding window' for packfile data access.

The key idea behind this topic is to mmap large non-contiguous segments of a packfile rather than the entire file. If available virtual memory is getting low we unmap the least recently used packfile segment to free up address space for the currently needed segment.

This series also permits accessing packfiles up to 4 GiB in size, even on systems which permit only 2 GiB of virtual memory within a single process (e.g. Windows and some older UNIXes). Of course 4 GiB is still the upper limit on packfile size due to the current format of the index file.

This series is 'pu' ready, but it may be too early to bring it directly into 'next'.

Patch summary -------------

  1 - Replace unpack_entry_gently with unpack_entry.
  2 - Introduce new config option for mmap limit.
  3 - Refactor packed_git to prepare for sliding mmap windows.
  4 - Use off_t for index and pack file lengths.
  5 - Create read_or_die utility routine.
  6 - Refactor how we open pack files to prepare for multiple windows.
    Most of the above changes are incremental refactorings to help
    get the code in a state where we can start to implement and make
    use of the struct pack_window concept this series introduces.
  7 - Replace use_packed_git with window cursors.
  8 - Loop over pack_windows when inflating/accessing data.
  9 - Document why header parsing won't exceed a window.
 10 - Unmap individual windows rather than entire files.
 11 - Fully activate the sliding window pack access.
    These commits actually implement the core of the mmap sliding
    window implementation and the necessary garbage collection to
    support unmapping the least recently used window.
 12 - Load core configuration in git-verify-pack.
 13 - Ensure core.packedGitWindowSize cannot be less than 2 pages.
 14 - Improve error message when packfile mmap fails.
 15 - Support unmapping windows on 'temporary' packfiles.
    The above sequence of commits are bug fixes on top of the initial
    commits.  I did not fold these back into the earlier commits
    as I felt the bug fix commit messages provided useful details.
 16 - Create pack_report() as a debugging aid.
 17 - Test suite for sliding window mmap implementation.
    These provide debugging and testing tools.
Next: Junio C Hamano
Message 1 of 9 in “Sliding window mmap for packfiles.”
  1. 0/17 Sliding window mmap for packfiles.Shawn O. Pearce, Dec 23, 2006
  2. Junio C HamanoDec 23, 2006
  3. Shawn PearceDec 23, 2006
  4. Francis MoreauDec 24, 2006
  5. Shawn PearceDec 24, 2006
  6. Francis MoreauDec 24, 2006
  7. Shawn PearceDec 24, 2006
  8. Andy WhitcroftJan 2, 2007
  9. Linus TorvaldsDec 24, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.