| 698 | } |
| 699 | |
| 700 | static void |
| 701 | extent_gdump_add(tsdn_t *tsdn, const extent_t *extent) { |
| 702 | cassert(config_prof); |
| 703 | /* prof_gdump() requirement. */ |
| 704 | witness_assert_depth_to_rank(tsdn_witness_tsdp_get(tsdn), |
| 705 | WITNESS_RANK_CORE, 0); |
| 706 | |
| 707 | if (opt_prof && extent_state_get(extent) == extent_state_active) { |
| 708 | size_t nadd = extent_size_get(extent) >> LG_PAGE; |
| 709 | size_t cur = atomic_fetch_add_zu(&curpages, nadd, |
| 710 | ATOMIC_RELAXED) + nadd; |
| 711 | size_t high = atomic_load_zu(&highpages, ATOMIC_RELAXED); |
| 712 | while (cur > high && !atomic_compare_exchange_weak_zu( |
| 713 | &highpages, &high, cur, ATOMIC_RELAXED, ATOMIC_RELAXED)) { |
| 714 | /* |
| 715 | * Don't refresh cur, because it may have decreased |
| 716 | * since this thread lost the highpages update race. |
| 717 | * Note that high is updated in case of CAS failure. |
| 718 | */ |
| 719 | } |
| 720 | if (cur > high && prof_gdump_get_unlocked()) { |
| 721 | prof_gdump(tsdn); |
| 722 | } |
| 723 | } |
| 724 | } |
| 725 | |
| 726 | static void |
| 727 | extent_gdump_sub(tsdn_t *tsdn, const extent_t *extent) { |
no test coverage detected