diff options
author | Alex Gorrod <alexg@wiredtiger.com> | 2013-01-09 11:59:13 +1100 |
---|---|---|
committer | Alex Gorrod <alexg@wiredtiger.com> | 2013-01-09 11:59:13 +1100 |
commit | a1a8624bd9950cd87eb24f665e1fdbe25a86e828 (patch) | |
tree | 542866ddb075864a2c1acda2db411e28b4ebb2a5 | |
parent | 8765bec395bc9a7d345193e6f5e2ea475754df52 (diff) | |
download | mongo-a1a8624bd9950cd87eb24f665e1fdbe25a86e828.tar.gz |
Reorder an CAS operations to prioritize more likely code path.
-rw-r--r-- | src/btree/bt_evict.c | 6 | ||||
-rw-r--r-- | src/btree/rec_evict.c | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/btree/bt_evict.c b/src/btree/bt_evict.c index 204f08d7d01..48d7c7a8b32 100644 --- a/src/btree/bt_evict.c +++ b/src/btree/bt_evict.c @@ -1086,9 +1086,9 @@ __evict_get_page( * on, and having reconciliation be able to use a single * locked state simplifies that code. */ - if (!WT_ATOMIC_CAS( - ref->state, WT_REF_EVICT_FORCE, WT_REF_LOCKED) && - !WT_ATOMIC_CAS(ref->state, WT_REF_MEM, WT_REF_LOCKED)) + if (!WT_ATOMIC_CAS(ref->state, WT_REF_MEM, WT_REF_LOCKED) && + !WT_ATOMIC_CAS( + ref->state, WT_REF_EVICT_FORCE, WT_REF_LOCKED)) continue; /* diff --git a/src/btree/rec_evict.c b/src/btree/rec_evict.c index c158a20325c..d48f39e02ac 100644 --- a/src/btree/rec_evict.c +++ b/src/btree/rec_evict.c @@ -463,8 +463,7 @@ __rec_excl_clear(WT_SESSION_IMPL *session) if ((ref = session->excl[i]) == NULL) break; WT_ASSERT(session, - (ref->state == WT_REF_LOCKED || - ref->state == WT_REF_EVICT_FORCE) && ref->page != NULL); + ref->state == WT_REF_LOCKED && ref->page != NULL); ref->state = WT_REF_MEM; } } |