Refactor packed_git to prepare for sliding mmap windows.
The idea behind the sliding mmap window pack reader implementation is to have multiple mmap regions active against the same pack file, thereby allowing the process to mmap in only the active/hot sections of the pack and reduce overall virtual address space usage. To implement this we need to refactor the mmap related data (pack_base, pack_use_cnt) out of struct packed_git and move them into a new struct pack_window. We are refactoring the code to support a single struct pack_window per packfile, thereby emulating the prior behavior of mmap'ing the entire pack file. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
committed by
Junio C Hamano
parent
77ccc5bbd1
commit
c41ee586dc
13
cache.h
13
cache.h
@ -336,14 +336,21 @@ extern struct alternate_object_database {
|
||||
} *alt_odb_list;
|
||||
extern void prepare_alt_odb(void);
|
||||
|
||||
struct pack_window {
|
||||
struct pack_window *next;
|
||||
unsigned char *base;
|
||||
off_t offset;
|
||||
size_t len;
|
||||
unsigned int last_used;
|
||||
unsigned int inuse_cnt;
|
||||
};
|
||||
|
||||
extern struct packed_git {
|
||||
struct packed_git *next;
|
||||
unsigned long index_size;
|
||||
unsigned long pack_size;
|
||||
struct pack_window *windows;
|
||||
unsigned int *index_base;
|
||||
void *pack_base;
|
||||
unsigned int pack_last_used;
|
||||
unsigned int pack_use_cnt;
|
||||
int pack_local;
|
||||
unsigned char sha1[20];
|
||||
/* something like ".git/objects/pack/xxxxx.pack" */
|
||||
|
||||
Reference in New Issue
Block a user