From 682a6a20f224c73eb02d9a28609bc4d10ded31fe Mon Sep 17 00:00:00 2001 From: Sears Russell Date: Fri, 4 Nov 2011 20:45:55 +0000 Subject: [PATCH] move asyncForce outside of conditional to better bound number of dirty pages in os cache --- src/stasis/dirtyPageTable.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/stasis/dirtyPageTable.c b/src/stasis/dirtyPageTable.c index 902f045..c8a2463 100644 --- a/src/stasis/dirtyPageTable.c +++ b/src/stasis/dirtyPageTable.c @@ -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