| 741 | } |
| 742 | |
| 743 | static void |
| 744 | extent_gdump_add(tsdn_t *tsdn, const extent_t *extent) { |
| 745 | cassert(config_prof); |
| 746 | /* prof_gdump() requirement. */ |
| 747 | witness_assert_depth_to_rank(tsdn_witness_tsdp_get(tsdn), |
| 748 | WITNESS_RANK_CORE, 0); |
| 749 | |
| 750 | if (opt_prof && extent_state_get(extent) == extent_state_active) { |
| 751 | size_t nadd = extent_size_get(extent) >> LG_PAGE; |
| 752 | size_t cur = atomic_fetch_add_zu(&curpages, nadd, |
| 753 | ATOMIC_RELAXED) + nadd; |
| 754 | size_t high = atomic_load_zu(&highpages, ATOMIC_RELAXED); |
| 755 | while (cur > high && !atomic_compare_exchange_weak_zu( |
| 756 | &highpages, &high, cur, ATOMIC_RELAXED, ATOMIC_RELAXED)) { |
| 757 | /* |
| 758 | * Don't refresh cur, because it may have decreased |
| 759 | * since this thread lost the highpages update race. |
| 760 | * Note that high is updated in case of CAS failure. |
| 761 | */ |
| 762 | } |
| 763 | if (cur > high && prof_gdump_get_unlocked()) { |
| 764 | prof_gdump(tsdn); |
| 765 | } |
| 766 | } |
| 767 | } |
| 768 | |
| 769 | static void |
| 770 | extent_gdump_sub(tsdn_t *tsdn, const extent_t *extent) { |
no test coverage detected