< prev index next >

src/hotspot/share/gc/z/zPageCache.cpp

Print this page




 313   const uint64_t expires = _last_commit + ZUncommitDelay;
 314   if (expires > now) {
 315     // Delay uncommit, set next timeout
 316     *timeout = expires - now;
 317     return 0;
 318   }
 319 
 320   if (requested == 0) {
 321     // Nothing to flush, set next timeout
 322     *timeout = ZUncommitDelay;
 323     return 0;
 324   }
 325 
 326   ZPageCacheFlushForUncommitClosure cl(requested, now, timeout);
 327   flush(&cl, to);
 328 
 329   return cl._flushed;
 330 }
 331 
 332 void ZPageCache::set_last_commit() {
 333   _last_commit = os::elapsedTime();
 334 }
 335 
 336 void ZPageCache::pages_do(ZPageClosure* cl) const {
 337   // Small
 338   ZPerNUMAConstIterator<ZList<ZPage> > iter_numa(&_small);
 339   for (const ZList<ZPage>* list; iter_numa.next(&list);) {
 340     ZListIterator<ZPage> iter_small(list);
 341     for (ZPage* page; iter_small.next(&page);) {
 342       cl->do_page(page);
 343     }
 344   }
 345 
 346   // Medium
 347   ZListIterator<ZPage> iter_medium(&_medium);
 348   for (ZPage* page; iter_medium.next(&page);) {
 349     cl->do_page(page);
 350   }
 351 
 352   // Large
 353   ZListIterator<ZPage> iter_large(&_large);


 313   const uint64_t expires = _last_commit + ZUncommitDelay;
 314   if (expires > now) {
 315     // Delay uncommit, set next timeout
 316     *timeout = expires - now;
 317     return 0;
 318   }
 319 
 320   if (requested == 0) {
 321     // Nothing to flush, set next timeout
 322     *timeout = ZUncommitDelay;
 323     return 0;
 324   }
 325 
 326   ZPageCacheFlushForUncommitClosure cl(requested, now, timeout);
 327   flush(&cl, to);
 328 
 329   return cl._flushed;
 330 }
 331 
 332 void ZPageCache::set_last_commit() {
 333   _last_commit = ceil(os::elapsedTime());
 334 }
 335 
 336 void ZPageCache::pages_do(ZPageClosure* cl) const {
 337   // Small
 338   ZPerNUMAConstIterator<ZList<ZPage> > iter_numa(&_small);
 339   for (const ZList<ZPage>* list; iter_numa.next(&list);) {
 340     ZListIterator<ZPage> iter_small(list);
 341     for (ZPage* page; iter_small.next(&page);) {
 342       cl->do_page(page);
 343     }
 344   }
 345 
 346   // Medium
 347   ZListIterator<ZPage> iter_medium(&_medium);
 348   for (ZPage* page; iter_medium.next(&page);) {
 349     cl->do_page(page);
 350   }
 351 
 352   // Large
 353   ZListIterator<ZPage> iter_large(&_large);
< prev index next >