From b4e5d1ddf86e7151e20385d8e1ca47c07d2351ea Mon Sep 17 00:00:00 2001 From: Alex Gorrod Date: Thu, 10 Jan 2013 12:23:32 +1100 Subject: Inline check for pages that need to be forced from cache. --- src/btree/bt_evict.c | 3 --- src/include/btree.i | 18 ++++++++++-------- 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 -- cgit v1.2.1