1 a0d146ed 2005-07-12 devnull #include "stdinc.h"
2 a0d146ed 2005-07-12 devnull #include "dat.h"
3 a0d146ed 2005-07-12 devnull #include "fns.h"
5 7a400ee9 2007-09-25 rsc int icacheprefetch = 1;
7 a0d146ed 2005-07-12 devnull typedef struct ICache ICache;
8 7a400ee9 2007-09-25 rsc typedef struct IHash IHash;
9 7a400ee9 2007-09-25 rsc typedef struct ISum ISum;
11 a0d146ed 2005-07-12 devnull struct ICache
14 a0d146ed 2005-07-12 devnull Rendez full;
16 7a400ee9 2007-09-25 rsc IEntry *entries;
17 7a400ee9 2007-09-25 rsc int nentries;
20 dce4cbab 2008-07-31 rsc * gcc 4.3 inlines the pushfirst loop in initicache,
21 dce4cbab 2008-07-31 rsc * but the inliner incorrectly deduces that
22 dce4cbab 2008-07-31 rsc * icache.free.next has a constant value
23 dce4cbab 2008-07-31 rsc * throughout the loop. (In fact, pushfirst
24 dce4cbab 2008-07-31 rsc * assigns to it as ie->prev->next.)
25 dce4cbab 2008-07-31 rsc * Marking it volatile should avoid this bug.
26 dce4cbab 2008-07-31 rsc * The speed of linked list operations is dwarfed
27 dce4cbab 2008-07-31 rsc * by the disk i/o anyway.
29 dce4cbab 2008-07-31 rsc volatile IEntry free;
31 7a400ee9 2007-09-25 rsc IEntry clean;
32 7a400ee9 2007-09-25 rsc IEntry dirty;
33 a0d146ed 2005-07-12 devnull u32int maxdirty;
34 7a400ee9 2007-09-25 rsc u32int ndirty;
39 7a400ee9 2007-09-25 rsc IHash *shash;
40 7a400ee9 2007-09-25 rsc IEntry *sentries;
41 7a400ee9 2007-09-25 rsc int nsentries;
44 a0d146ed 2005-07-12 devnull static ICache icache;
47 7a400ee9 2007-09-25 rsc * Hash table of IEntries
54 7a400ee9 2007-09-25 rsc IEntry **table;
57 7a400ee9 2007-09-25 rsc static IHash*
58 7a400ee9 2007-09-25 rsc mkihash(int size1)
66 7a400ee9 2007-09-25 rsc while(size < size1){
71 7a400ee9 2007-09-25 rsc ih = vtmallocz(sizeof(IHash)+size*sizeof(ih->table[0]));
72 7a400ee9 2007-09-25 rsc ih->table = (IEntry**)(ih+1);
73 7a400ee9 2007-09-25 rsc ih->bits = bits;
74 7a400ee9 2007-09-25 rsc ih->size = size;
78 7a400ee9 2007-09-25 rsc static IEntry*
79 7a400ee9 2007-09-25 rsc ihashlookup(IHash *ih, u8int score[VtScoreSize], int type)
84 7a400ee9 2007-09-25 rsc h = hashbits(score, ih->bits);
85 7a400ee9 2007-09-25 rsc for(ie=ih->table[h]; ie; ie=ie->nexthash)
86 7a400ee9 2007-09-25 rsc if((type == -1 || type == ie->ia.type) && scorecmp(score, ie->score) == 0)
91 a0d146ed 2005-07-12 devnull static void
92 7a400ee9 2007-09-25 rsc ihashdelete(IHash *ih, IEntry *ie, char *what)
97 7a400ee9 2007-09-25 rsc h = hashbits(ie->score, ih->bits);
98 7a400ee9 2007-09-25 rsc for(l=&ih->table[h]; *l; l=&(*l)->nexthash)
99 7a400ee9 2007-09-25 rsc if(*l == ie){
100 7a400ee9 2007-09-25 rsc *l = ie->nexthash;
103 7a400ee9 2007-09-25 rsc fprint(2, "warning: %s %V not found in ihashdelete\n", what, ie->score);
107 7a400ee9 2007-09-25 rsc ihashinsert(IHash *ih, IEntry *ie)
109 a0d146ed 2005-07-12 devnull u32int h;
111 7a400ee9 2007-09-25 rsc h = hashbits(ie->score, ih->bits);
112 7a400ee9 2007-09-25 rsc ie->nexthash = ih->table[h];
113 7a400ee9 2007-09-25 rsc ih->table[h] = ie;
118 7a400ee9 2007-09-25 rsc * IEntry lists.
121 7a400ee9 2007-09-25 rsc static IEntry*
122 7a400ee9 2007-09-25 rsc popout(IEntry *ie)
124 7a400ee9 2007-09-25 rsc if(ie->prev == nil && ie->next == nil)
126 7a400ee9 2007-09-25 rsc ie->prev->next = ie->next;
127 7a400ee9 2007-09-25 rsc ie->next->prev = ie->prev;
128 7a400ee9 2007-09-25 rsc ie->next = nil;
129 7a400ee9 2007-09-25 rsc ie->prev = nil;
133 7a400ee9 2007-09-25 rsc static IEntry*
134 0e430b25 2008-08-07 rsc poplast(volatile IEntry *list)
136 7a400ee9 2007-09-25 rsc if(list->prev == list)
138 7a400ee9 2007-09-25 rsc return popout(list->prev);
141 7a400ee9 2007-09-25 rsc static IEntry*
142 0e430b25 2008-08-07 rsc pushfirst(volatile IEntry *list, IEntry *ie)
145 0e430b25 2008-08-07 rsc ie->prev = (IEntry*)list;
146 7a400ee9 2007-09-25 rsc ie->next = list->next;
147 7a400ee9 2007-09-25 rsc ie->prev->next = ie;
148 7a400ee9 2007-09-25 rsc ie->next->prev = ie;
153 7a400ee9 2007-09-25 rsc * Arena summary cache.
158 7a400ee9 2007-09-25 rsc IEntry *entries;
159 7a400ee9 2007-09-25 rsc int nentries;
161 7a400ee9 2007-09-25 rsc u64int addr;
162 7a400ee9 2007-09-25 rsc u64int limit;
163 7a400ee9 2007-09-25 rsc Arena *arena;
167 7a400ee9 2007-09-25 rsc static ISum*
168 7a400ee9 2007-09-25 rsc scachelookup(u64int addr)
173 7a400ee9 2007-09-25 rsc for(i=0; i<icache.nsum; i++){
174 7a400ee9 2007-09-25 rsc s = icache.sum[i];
175 7a400ee9 2007-09-25 rsc if(s->addr <= addr && addr < s->limit){
177 7a400ee9 2007-09-25 rsc memmove(icache.sum+1, icache.sum, i*sizeof icache.sum[0]);
178 7a400ee9 2007-09-25 rsc icache.sum[0] = s;
187 7a400ee9 2007-09-25 rsc sumclear(ISum *s)
191 7a400ee9 2007-09-25 rsc for(i=0; i<s->nentries; i++)
192 7a400ee9 2007-09-25 rsc ihashdelete(icache.shash, &s->entries[i], "scache");
193 7a400ee9 2007-09-25 rsc s->nentries = 0;
194 7a400ee9 2007-09-25 rsc s->loaded = 0;
195 7a400ee9 2007-09-25 rsc s->addr = 0;
196 7a400ee9 2007-09-25 rsc s->limit = 0;
197 7a400ee9 2007-09-25 rsc s->arena = nil;
201 7a400ee9 2007-09-25 rsc static ISum*
202 7a400ee9 2007-09-25 rsc scacheevict(void)
207 7a400ee9 2007-09-25 rsc for(i=icache.nsum-1; i>=0; i--){
208 7a400ee9 2007-09-25 rsc s = icache.sum[i];
209 7a400ee9 2007-09-25 rsc if(canqlock(&s->lock)){
211 7a400ee9 2007-09-25 rsc memmove(icache.sum+1, icache.sum, i*sizeof icache.sum[0]);
212 7a400ee9 2007-09-25 rsc icache.sum[0] = s;
214 7a400ee9 2007-09-25 rsc sumclear(s);
222 7a400ee9 2007-09-25 rsc scachehit(u64int addr)
224 7a400ee9 2007-09-25 rsc scachelookup(addr); /* for move-to-front */
228 7a400ee9 2007-09-25 rsc scachesetup(ISum *s, u64int addr)
230 7a400ee9 2007-09-25 rsc u64int addr0, limit;
233 7a400ee9 2007-09-25 rsc s->arena = amapitoag(mainindex, addr, &addr0, &limit, &g);
234 7a400ee9 2007-09-25 rsc s->addr = addr0;
235 7a400ee9 2007-09-25 rsc s->limit = limit;
240 7a400ee9 2007-09-25 rsc scacheload(ISum *s)
244 7a400ee9 2007-09-25 rsc s->loaded = 1;
245 7a400ee9 2007-09-25 rsc n = asumload(s->arena, s->g, s->entries, ArenaCIGSize);
247 7a400ee9 2007-09-25 rsc * n can be less then ArenaCIGSize, either if the clump group
248 7a400ee9 2007-09-25 rsc * is the last in the arena and is only partially filled, or if there
249 7a400ee9 2007-09-25 rsc * are corrupt clumps in the group -- those are not returned.
251 7a400ee9 2007-09-25 rsc for(i=0; i<n; i++){
252 7a400ee9 2007-09-25 rsc s->entries[i].ia.addr += s->addr;
253 7a400ee9 2007-09-25 rsc ihashinsert(icache.shash, &s->entries[i]);
255 7a400ee9 2007-09-25 rsc //fprint(2, "%T scacheload %s %d - %d entries\n", s->arena->name, s->g, n);
256 7a400ee9 2007-09-25 rsc addstat(StatScachePrefetch, n);
257 7a400ee9 2007-09-25 rsc s->nentries = n;
260 7a400ee9 2007-09-25 rsc static ISum*
261 7a400ee9 2007-09-25 rsc scachemiss(u64int addr)
265 54dd92be 2008-01-30 rsc if(!icacheprefetch)
267 7a400ee9 2007-09-25 rsc s = scachelookup(addr);
268 7a400ee9 2007-09-25 rsc if(s == nil){
269 7a400ee9 2007-09-25 rsc /* first time: make an entry in the cache but don't populate it yet */
270 7a400ee9 2007-09-25 rsc s = scacheevict();
271 7a400ee9 2007-09-25 rsc if(s == nil)
273 7a400ee9 2007-09-25 rsc scachesetup(s, addr);
274 7a400ee9 2007-09-25 rsc qunlock(&s->lock);
278 7a400ee9 2007-09-25 rsc /* second time: load from disk */
279 7a400ee9 2007-09-25 rsc qlock(&s->lock);
280 7a400ee9 2007-09-25 rsc if(s->loaded || !icacheprefetch){
281 7a400ee9 2007-09-25 rsc qunlock(&s->lock);
285 7a400ee9 2007-09-25 rsc return s; /* locked */
289 7a400ee9 2007-09-25 rsc * Index cache.
293 7a400ee9 2007-09-25 rsc initicache(u32int mem0)
296 7a400ee9 2007-09-25 rsc int i, entries, scache;
298 7a400ee9 2007-09-25 rsc icache.full.l = &icache.lock;
301 7a400ee9 2007-09-25 rsc entries = mem / (sizeof(IEntry)+sizeof(IEntry*));
302 7a400ee9 2007-09-25 rsc scache = (entries/8) / ArenaCIGSize;
303 7a400ee9 2007-09-25 rsc entries -= entries/8;
304 7a400ee9 2007-09-25 rsc if(scache < 4)
306 7a400ee9 2007-09-25 rsc if(scache > 16)
307 7a400ee9 2007-09-25 rsc scache = 16;
308 7a400ee9 2007-09-25 rsc if(entries < 1000)
309 7a400ee9 2007-09-25 rsc entries = 1000;
310 7a400ee9 2007-09-25 rsc fprint(2, "icache %,d bytes = %,d entries; %d scache\n", mem0, entries, scache);
312 7a400ee9 2007-09-25 rsc icache.clean.prev = icache.clean.next = &icache.clean;
313 7a400ee9 2007-09-25 rsc icache.dirty.prev = icache.dirty.next = &icache.dirty;
314 0e430b25 2008-08-07 rsc icache.free.prev = icache.free.next = (IEntry*)&icache.free;
316 7a400ee9 2007-09-25 rsc icache.hash = mkihash(entries);
317 7a400ee9 2007-09-25 rsc icache.nentries = entries;
318 7a400ee9 2007-09-25 rsc setstat(StatIcacheSize, entries);
319 7a400ee9 2007-09-25 rsc icache.entries = vtmallocz(entries*sizeof icache.entries[0]);
320 7a400ee9 2007-09-25 rsc icache.maxdirty = entries / 2;
321 7a400ee9 2007-09-25 rsc for(i=0; i<entries; i++)
322 7a400ee9 2007-09-25 rsc pushfirst(&icache.free, &icache.entries[i]);
324 7a400ee9 2007-09-25 rsc icache.nsum = scache;
325 7a400ee9 2007-09-25 rsc icache.sum = vtmallocz(scache*sizeof icache.sum[0]);
326 7a400ee9 2007-09-25 rsc icache.sum[0] = vtmallocz(scache*sizeof icache.sum[0][0]);
327 7a400ee9 2007-09-25 rsc icache.nsentries = scache * ArenaCIGSize;
328 7a400ee9 2007-09-25 rsc icache.sentries = vtmallocz(scache*ArenaCIGSize*sizeof icache.sentries[0]);
329 7a400ee9 2007-09-25 rsc icache.shash = mkihash(scache*ArenaCIGSize);
330 7a400ee9 2007-09-25 rsc for(i=0; i<scache; i++){
331 7a400ee9 2007-09-25 rsc icache.sum[i] = icache.sum[0] + i;
332 7a400ee9 2007-09-25 rsc icache.sum[i]->entries = icache.sentries + i*ArenaCIGSize;
337 7a400ee9 2007-09-25 rsc static IEntry*
338 7a400ee9 2007-09-25 rsc evictlru(void)
342 7a400ee9 2007-09-25 rsc ie = poplast(&icache.clean);
343 7a400ee9 2007-09-25 rsc if(ie == nil)
345 7a400ee9 2007-09-25 rsc ihashdelete(icache.hash, ie, "evictlru");
350 7a400ee9 2007-09-25 rsc icacheinsert(u8int score[VtScoreSize], IAddr *ia, int state)
354 7a400ee9 2007-09-25 rsc if((ie = poplast(&icache.free)) == nil && (ie = evictlru()) == nil){
355 7a400ee9 2007-09-25 rsc addstat(StatIcacheStall, 1);
356 7a400ee9 2007-09-25 rsc while((ie = poplast(&icache.free)) == nil && (ie = evictlru()) == nil){
357 7a400ee9 2007-09-25 rsc // Could safely return here if state == IEClean.
358 7a400ee9 2007-09-25 rsc // But if state == IEDirty, have to wait to make
359 7a400ee9 2007-09-25 rsc // sure we don't lose an index write.
360 7a400ee9 2007-09-25 rsc // Let's wait all the time.
361 7a400ee9 2007-09-25 rsc flushdcache();
362 7a400ee9 2007-09-25 rsc kickicache();
363 7a400ee9 2007-09-25 rsc rsleep(&icache.full);
365 7a400ee9 2007-09-25 rsc addstat(StatIcacheStall, -1);
368 7a400ee9 2007-09-25 rsc memmove(ie->score, score, VtScoreSize);
369 7a400ee9 2007-09-25 rsc ie->state = state;
370 7a400ee9 2007-09-25 rsc ie->ia = *ia;
371 7a400ee9 2007-09-25 rsc if(state == IEClean){
372 7a400ee9 2007-09-25 rsc addstat(StatIcachePrefetch, 1);
373 7a400ee9 2007-09-25 rsc pushfirst(&icache.clean, ie);
375 7a400ee9 2007-09-25 rsc addstat(StatIcacheWrite, 1);
376 7a400ee9 2007-09-25 rsc assert(state == IEDirty);
377 7a400ee9 2007-09-25 rsc icache.ndirty++;
378 7a400ee9 2007-09-25 rsc setstat(StatIcacheDirty, icache.ndirty);
379 7a400ee9 2007-09-25 rsc delaykickicache();
380 7a400ee9 2007-09-25 rsc pushfirst(&icache.dirty, ie);
382 7a400ee9 2007-09-25 rsc ihashinsert(icache.hash, ie);
386 7a400ee9 2007-09-25 rsc icachelookup(u8int score[VtScoreSize], int type, IAddr *ia)
390 7a400ee9 2007-09-25 rsc qlock(&icache.lock);
391 7a400ee9 2007-09-25 rsc addstat(StatIcacheLookup, 1);
392 7a400ee9 2007-09-25 rsc if((ie = ihashlookup(icache.hash, score, type)) != nil){
393 7a400ee9 2007-09-25 rsc *ia = ie->ia;
394 7a400ee9 2007-09-25 rsc if(ie->state == IEClean)
395 7a400ee9 2007-09-25 rsc pushfirst(&icache.clean, ie);
396 7a400ee9 2007-09-25 rsc addstat(StatIcacheHit, 1);
397 7a400ee9 2007-09-25 rsc qunlock(&icache.lock);
401 7a400ee9 2007-09-25 rsc if((ie = ihashlookup(icache.shash, score, type)) != nil){
402 7a400ee9 2007-09-25 rsc *ia = ie->ia;
403 7a400ee9 2007-09-25 rsc icacheinsert(score, &ie->ia, IEClean);
404 7a400ee9 2007-09-25 rsc scachehit(ie->ia.addr);
405 7a400ee9 2007-09-25 rsc addstat(StatScacheHit, 1);
406 7a400ee9 2007-09-25 rsc qunlock(&icache.lock);
409 7a400ee9 2007-09-25 rsc addstat(StatIcacheMiss, 1);
410 a0d146ed 2005-07-12 devnull qunlock(&icache.lock);
416 45ac814c 2007-10-29 rsc insertscore(u8int score[VtScoreSize], IAddr *ia, int state, AState *as)
418 7a400ee9 2007-09-25 rsc ISum *toload;
420 7a400ee9 2007-09-25 rsc qlock(&icache.lock);
421 7a400ee9 2007-09-25 rsc icacheinsert(score, ia, state);
422 7a400ee9 2007-09-25 rsc if(state == IEClean)
423 7a400ee9 2007-09-25 rsc toload = scachemiss(ia->addr);
425 7a400ee9 2007-09-25 rsc assert(state == IEDirty);
426 7a400ee9 2007-09-25 rsc toload = nil;
427 45ac814c 2007-10-29 rsc if(as == nil)
428 45ac814c 2007-10-29 rsc fprint(2, "%T insertscore IEDirty without as; called from %lux\n", getcallerpc(&score));
430 45ac814c 2007-10-29 rsc if(icache.as.aa > as->aa)
431 45ac814c 2007-10-29 rsc fprint(2, "%T insertscore: aa moving backward: %#llux -> %#llux\n", icache.as.aa, as->aa);
432 45ac814c 2007-10-29 rsc icache.as = *as;
435 7a400ee9 2007-09-25 rsc qunlock(&icache.lock);
437 7a400ee9 2007-09-25 rsc scacheload(toload);
438 7a400ee9 2007-09-25 rsc qunlock(&toload->lock);
441 7a400ee9 2007-09-25 rsc if(icache.ndirty >= icache.maxdirty)
442 a0d146ed 2005-07-12 devnull kickicache();
445 a0d146ed 2005-07-12 devnull * It's okay not to do this under icache.lock.
446 a0d146ed 2005-07-12 devnull * Calling insertscore only happens when we hold
447 a0d146ed 2005-07-12 devnull * the lump, meaning any searches for this block
448 a0d146ed 2005-07-12 devnull * will hit in the lump cache until after we return.
450 7a400ee9 2007-09-25 rsc if(state == IEDirty)
451 7a400ee9 2007-09-25 rsc markbloomfilter(mainindex->bloom, score);
453 a0d146ed 2005-07-12 devnull return 0;
457 54dd92be 2008-01-30 rsc lookupscore(u8int score[VtScoreSize], int type, IAddr *ia)
459 54dd92be 2008-01-30 rsc int ms, ret;
462 54dd92be 2008-01-30 rsc if(icachelookup(score, type, ia) >= 0){
463 54dd92be 2008-01-30 rsc addstat(StatIcacheRead, 1);
467 54dd92be 2008-01-30 rsc ms = msec();
468 7a400ee9 2007-09-25 rsc addstat(StatIcacheFill, 1);
469 7a400ee9 2007-09-25 rsc if(loadientry(mainindex, score, type, &d) < 0)
473 54dd92be 2008-01-30 rsc insertscore(score, &d.ia, IEClean, nil);
476 54dd92be 2008-01-30 rsc addstat2(StatIcacheRead, 1, StatIcacheReadTime, msec() - ms);
481 7a400ee9 2007-09-25 rsc hashbits(u8int *sc, int bits)
485 7a400ee9 2007-09-25 rsc v = (sc[0] << 24) | (sc[1] << 16) | (sc[2] << 8) | sc[3];
486 7a400ee9 2007-09-25 rsc if(bits < 32)
487 7a400ee9 2007-09-25 rsc v >>= (32 - bits);
492 7a400ee9 2007-09-25 rsc icachedirtyfrac(void)
494 7a400ee9 2007-09-25 rsc return (vlong)icache.ndirty*IcacheFrac / icache.nentries;
498 7a400ee9 2007-09-25 rsc * Return a singly-linked list of dirty index entries.
499 7a400ee9 2007-09-25 rsc * with 32-bit hash numbers between lo and hi
500 7a400ee9 2007-09-25 rsc * and address < limit.
503 a0d146ed 2005-07-12 devnull icachedirty(u32int lo, u32int hi, u64int limit)
505 a0d146ed 2005-07-12 devnull u32int h;
506 a0d146ed 2005-07-12 devnull IEntry *ie, *dirty;
508 a0d146ed 2005-07-12 devnull dirty = nil;
509 a0d146ed 2005-07-12 devnull trace(TraceProc, "icachedirty enter");
510 a0d146ed 2005-07-12 devnull qlock(&icache.lock);
511 7a400ee9 2007-09-25 rsc for(ie = icache.dirty.next; ie != &icache.dirty; ie=ie->next){
512 9f8a101a 2008-04-16 rsc if(ie->state == IEDirty && ie->ia.addr <= limit){
513 a0d146ed 2005-07-12 devnull h = hashbits(ie->score, 32);
514 a0d146ed 2005-07-12 devnull if(lo <= h && h <= hi){
515 a0d146ed 2005-07-12 devnull ie->nextdirty = dirty;
516 a0d146ed 2005-07-12 devnull dirty = ie;
520 a0d146ed 2005-07-12 devnull qunlock(&icache.lock);
521 a0d146ed 2005-07-12 devnull trace(TraceProc, "icachedirty exit");
522 a0d146ed 2005-07-12 devnull if(dirty == nil)
523 a0d146ed 2005-07-12 devnull flushdcache();
524 a0d146ed 2005-07-12 devnull return dirty;
528 45ac814c 2007-10-29 rsc icachestate(void)
532 45ac814c 2007-10-29 rsc qlock(&icache.lock);
533 45ac814c 2007-10-29 rsc as = icache.as;
534 45ac814c 2007-10-29 rsc qunlock(&icache.lock);
539 7a400ee9 2007-09-25 rsc * The singly-linked non-circular list of index entries ie
540 7a400ee9 2007-09-25 rsc * has been written to disk. Move them to the clean list.
543 a0d146ed 2005-07-12 devnull icacheclean(IEntry *ie)
545 7a400ee9 2007-09-25 rsc IEntry *next;
547 7a400ee9 2007-09-25 rsc trace(TraceProc, "icacheclean enter");
548 a0d146ed 2005-07-12 devnull qlock(&icache.lock);
549 7a400ee9 2007-09-25 rsc for(; ie; ie=next){
550 7a400ee9 2007-09-25 rsc assert(ie->state == IEDirty);
551 7a400ee9 2007-09-25 rsc next = ie->nextdirty;
552 7a400ee9 2007-09-25 rsc ie->nextdirty = nil;
553 7a400ee9 2007-09-25 rsc popout(ie); /* from icache.dirty */
554 a0d146ed 2005-07-12 devnull icache.ndirty--;
555 7a400ee9 2007-09-25 rsc ie->state = IEClean;
556 7a400ee9 2007-09-25 rsc pushfirst(&icache.clean, ie);
558 a0d146ed 2005-07-12 devnull setstat(StatIcacheDirty, icache.ndirty);
559 a0d146ed 2005-07-12 devnull rwakeupall(&icache.full);
560 a0d146ed 2005-07-12 devnull qunlock(&icache.lock);
561 7a400ee9 2007-09-25 rsc trace(TraceProc, "icacheclean exit");
565 28b49df3 2006-07-18 devnull emptyicache(void)
571 28b49df3 2006-07-18 devnull qlock(&icache.lock);
572 7a400ee9 2007-09-25 rsc while((ie = evictlru()) != nil)
573 7a400ee9 2007-09-25 rsc pushfirst(&icache.free, ie);
574 7a400ee9 2007-09-25 rsc for(i=0; i<icache.nsum; i++){
575 7a400ee9 2007-09-25 rsc s = icache.sum[i];
576 7a400ee9 2007-09-25 rsc qlock(&s->lock);
577 7a400ee9 2007-09-25 rsc sumclear(s);
578 7a400ee9 2007-09-25 rsc qunlock(&s->lock);
580 28b49df3 2006-07-18 devnull qunlock(&icache.lock);