diff options
| author | Russ Cox <rsc@swtch.com> | 2007-09-25 09:47:31 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@swtch.com> | 2007-09-25 09:47:31 -0400 |
| commit | 7a400ee957a0815287af806e18ef90dd18b47f82 (patch) | |
| tree | 023076fb829f630384f2f394eb9577a81fdca59e /src/cmd/venti/srv/dat.h | |
| parent | 25a4e89fa907ed5a5f5d84eccfb66180007d9c68 (diff) | |
| download | plan9port-7a400ee957a0815287af806e18ef90dd18b47f82.tar.gz plan9port-7a400ee957a0815287af806e18ef90dd18b47f82.zip | |
venti: new icache
Diffstat (limited to 'src/cmd/venti/srv/dat.h')
| -rw-r--r-- | src/cmd/venti/srv/dat.h | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/src/cmd/venti/srv/dat.h b/src/cmd/venti/srv/dat.h index 07be62f4..e0a9e18a 100644 --- a/src/cmd/venti/srv/dat.h +++ b/src/cmd/venti/srv/dat.h @@ -3,6 +3,7 @@ typedef struct AMap AMap; typedef struct AMapN AMapN; typedef struct Arena Arena; typedef struct AState AState; +typedef struct ArenaCIG ArenaCIG; typedef struct ArenaHead ArenaHead; typedef struct ArenaPart ArenaPart; typedef struct ArenaTail ArenaTail; @@ -28,8 +29,10 @@ typedef struct ZBlock ZBlock; typedef struct Round Round; typedef struct Bloom Bloom; -#define TWID32 ((u32int)~(u32int)0) -#define TWID64 ((u64int)~(u64int)0) +#pragma incomplete IEStream + +#define TWID32 ((u32int)~(u32int)0) +#define TWID64 ((u64int)~(u64int)0) #define TWID8 ((u8int)~(u8int)0) enum @@ -44,7 +47,6 @@ enum IndexBase = 1024*1024, /* initial address to use in an index */ MaxIo = 64*1024, /* max size of a single read or write operation */ ICacheBits = 16, /* default bits for indexing icache */ - ICacheDepth = 4, /* default depth of an icache hash chain */ MaxAMap = 2*1024, /* max. allowed arenas in an address mapping; must be < 32*1024 */ /* @@ -147,6 +149,8 @@ enum DirtyArenaCib, DirtyArenaTrailer, DirtyMax, + + ArenaCIGSize = 10*1024, // about 0.5 MB worth of IEntry. VentiZZZZZZZZ }; @@ -371,6 +375,14 @@ struct Arena u32int ctime; /* first time a block was written */ u32int wtime; /* last time a block was written */ u32int clumpmagic; + + ArenaCIG *cig; + int ncig; +}; + +struct ArenaCIG +{ + u64int offset; // from arena base }; /* @@ -505,14 +517,20 @@ struct IAddr */ struct IEntry { - u8int score[VtScoreSize]; - IEntry *next; /* next in hash chain */ - IEntry *nextdirty; /* next in dirty chain */ - u32int wtime; /* last write time */ - u16int train; /* relative train containing the most recent ref; 0 if no ref, 1 if in same car */ - u8int rac; /* read ahead count */ - u8int dirty; /* is dirty */ - IAddr ia; + /* on disk data - 32 bytes*/ + u8int score[VtScoreSize]; + IAddr ia; + + IEntry *nexthash; + IEntry *nextdirty; + IEntry *next; + IEntry *prev; + u8int state; +}; +enum { + IEClean = 0, + IEDirty = 1, + IESummary = 2, }; /* @@ -607,6 +625,9 @@ enum StatIcacheFlush, StatIcacheStall, StatIcacheReadTime, + StatIcacheLookup, + StatScacheHit, + StatScachePrefetch, StatBloomHit, StatBloomMiss, @@ -628,6 +649,9 @@ enum StatSumRead, StatSumReadBytes, + + StatCigLoad, + StatCigLoadTime, NStat }; |
