MCPcopy Create free account
hub / github.com/F-Stack/f-stack / extent_gdump_add

Function extent_gdump_add

app/redis-6.2.6/deps/jemalloc/src/extent.c:700–724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

698}
699
700static void
701extent_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
726static void
727extent_gdump_sub(tsdn_t *tsdn, const extent_t *extent) {

Callers 3

extent_register_implFunction · 0.85
extent_grow_retainedFunction · 0.85
extent_alloc_retainedFunction · 0.85

Calls 5

extent_state_getFunction · 0.85
extent_size_getFunction · 0.85
prof_gdump_get_unlockedFunction · 0.85
prof_gdumpFunction · 0.85

Tested by

no test coverage detected