diff options
author | Alex Gorrod <alexg@wiredtiger.com> | 2013-01-10 12:23:32 +1100 |
---|---|---|
committer | Alex Gorrod <alexg@wiredtiger.com> | 2013-01-10 12:23:32 +1100 |
commit | b4e5d1ddf86e7151e20385d8e1ca47c07d2351ea (patch) | |
tree | 83263875e9e673072c3a5efcdf2874c4a964ccc2 /src | |
parent | 7915b622be063458a1360c14646f17f2577f0541 (diff) | |
download | mongo-b4e5d1ddf86e7151e20385d8e1ca47c07d2351ea.tar.gz |
Inline check for pages that need to be forced from cache.
Diffstat (limited to 'src')
-rw-r--r-- | src/btree/bt_evict.c | 3 | ||||
-rw-r--r-- | src/include/btree.i | 18 | ||||
-rw-r--r-- | src/support/hazard.c | 2 |
3 files changed, 11 insertions, 12 deletions
diff --git a/src/btree/bt_evict.c b/src/btree/bt_evict.c index 1c468ac97e9..83ac2588c78 100644 --- a/src/btree/bt_evict.c +++ b/src/btree/bt_evict.c @@ -167,9 +167,6 @@ __wt_evict_forced_page(WT_SESSION_IMPL *session, WT_PAGE *page) conn = S2C(session); cache = conn->cache; - if (!__wt_eviction_page_force_check(btree, page)) - return (0); - /* * Try to lock the page. If this succeeds, we're going to queue * it for forced eviction. We don't go right to the EVICT_FORCED diff --git a/src/include/btree.i b/src/include/btree.i index 6657d6075d4..e3ad36f7a99 100644 --- a/src/include/btree.i +++ b/src/include/btree.i @@ -17,18 +17,20 @@ __wt_page_is_modified(WT_PAGE *page) } /* - * __wt_eviction_page_force_check -- - * Return if a page should be a high priority for eviction. The method - * does not use a session handle, since it is called from the eviction - * sort routine, that does not have a session easily available. + * __wt_eviction_page_force -- + * Add a page for forced eviction if it matches the criteria. */ static inline int -__wt_eviction_page_force_check(WT_BTREE *btree, WT_PAGE *page) +__wt_eviction_page_force(WT_SESSION_IMPL *session, WT_PAGE *page) { - return (btree != NULL && !F_ISSET(btree, WT_BTREE_NO_EVICTION) && - __wt_page_is_modified(page) && + WT_BTREE *btree; + + btree = session->btree; + if (btree != NULL && __wt_page_is_modified(page) && page->type != WT_PAGE_ROW_INT && page->type != WT_PAGE_COL_INT && - page->memory_footprint > btree->maxmempage); + (page->memory_footprint > btree->maxmempage)) + return (__wt_evict_forced_page(session, page)); + return (0); } /* diff --git a/src/support/hazard.c b/src/support/hazard.c index 2a5b35d9c55..cfbb7d2b345 100644 --- a/src/support/hazard.c +++ b/src/support/hazard.c @@ -153,7 +153,7 @@ __wt_hazard_clear(WT_SESSION_IMPL *session, WT_PAGE *page) * Perform the check here since we want to do it when * we are about to release the hazard reference. */ - (void)__wt_evict_forced_page(session, page); + (void)__wt_eviction_page_force(session, page); /* * We don't publish the hazard pointer clear in the |