move asyncForce outside of conditional to better bound number of dirty pages in os cache

This commit is contained in:
Sears Russell 2011-11-04 20:45:55 +00:00
parent e081793f32
commit 682a6a20f2

View file

@ -209,11 +209,13 @@ int stasis_dirty_page_table_flush_with_target(stasis_dirty_page_table_t * dirtyP
}
DEBUG("Forcing %lld pages B\n", buffered);
buffered = 0;
dirtyPages->bufferManager->asyncForcePages(dirtyPages->bufferManager, 0);
}
dirtyPages->bufferManager->asyncForcePages(dirtyPages->bufferManager, 0);
pthread_mutex_lock(&dirtyPages->mutex);
dpt_entry * e = ((dpt_entry*)rbmin(tree));
DEBUG("Finished elevator sweep.\n");
if (!all_flushed &&
targetLsn < LSN_T_MAX &&
ATOMIC_READ_32(0, &dirtyPages->count) > 0 &&
@ -226,6 +228,8 @@ int stasis_dirty_page_table_flush_with_target(stasis_dirty_page_table_t * dirtyP
int res = gettimeofday(&tv, 0);
assert(res == 0);
printf("Warning; going into slow fallback path in dirtyPageTable\n");
// We expect previously pinned pages to be unpinned and flushed within
// 100 milliseconds. If there aren't then we had race condition and the
// pinning thread sampled p->needFlush before we set it to 1. This