remove special write path in deinit. (instead, attempt to avoid random I/O on shutdown)
This commit is contained in:
parent
a0f9a7bc81
commit
0f2b2ff200
1 changed files with 6 additions and 1 deletions
|
@ -396,6 +396,9 @@ static void bhBufDeinit() {
|
||||||
pthread_cond_signal(&needFree); // Wake up the writeback thread so it will exit.
|
pthread_cond_signal(&needFree); // Wake up the writeback thread so it will exit.
|
||||||
pthread_join(worker, 0);
|
pthread_join(worker, 0);
|
||||||
|
|
||||||
|
// XXX flush range should return an error number, which we would check. (Right now, it aborts...)
|
||||||
|
stasis_dirty_page_table_flush_range(stasis_runtime_dirty_page_table(), 0, 0);
|
||||||
|
|
||||||
struct LH_ENTRY(list) iter;
|
struct LH_ENTRY(list) iter;
|
||||||
const struct LH_ENTRY(pair_t) * next;
|
const struct LH_ENTRY(pair_t) * next;
|
||||||
LH_ENTRY(openlist)(cachedPages, &iter);
|
LH_ENTRY(openlist)(cachedPages, &iter);
|
||||||
|
@ -403,7 +406,9 @@ static void bhBufDeinit() {
|
||||||
Page * p = next->value;
|
Page * p = next->value;
|
||||||
assertunlocked(p->rwlatch);
|
assertunlocked(p->rwlatch);
|
||||||
assert(0 == *pagePinCountPtr(p));
|
assert(0 == *pagePinCountPtr(p));
|
||||||
page_handle->write(page_handle, p);
|
readlock(p->rwlatch,0);
|
||||||
|
assert(!stasis_dirty_page_table_is_dirty(stasis_runtime_dirty_page_table(), p));
|
||||||
|
unlock(p->rwlatch);
|
||||||
stasis_page_cleanup(p); // normally called by writeBackOnePage()
|
stasis_page_cleanup(p); // normally called by writeBackOnePage()
|
||||||
}
|
}
|
||||||
LH_ENTRY(closelist)(&iter);
|
LH_ENTRY(closelist)(&iter);
|
||||||
|
|
Loading…
Reference in a new issue