Phase POOL-MID-DN-BATCH Step 5: Integrate deferred API into pool_free_v1
This commit is contained in:
@ -12,6 +12,7 @@
|
|||||||
#include "pool_config_box.h" // For hak_pool_v1_free_fastsplit_enabled, etc
|
#include "pool_config_box.h" // For hak_pool_v1_free_fastsplit_enabled, etc
|
||||||
#include "pool_stats_box.h" // For g_pool_v1_flat_stats
|
#include "pool_stats_box.h" // For g_pool_v1_flat_stats
|
||||||
#include "pool_mid_desc_cache_box.h" // For mid_desc_lookup_cached
|
#include "pool_mid_desc_cache_box.h" // For mid_desc_lookup_cached
|
||||||
|
#include "pool_mid_inuse_deferred_box.h" // For mid_inuse_dec_deferred
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdatomic.h>
|
#include <stdatomic.h>
|
||||||
@ -78,10 +79,10 @@ static inline void hak_pool_free_v1_fast_impl(void* raw, int class_idx, uintptr_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Common tail: sample counter + inuse dec
|
// Common tail: sample counter + inuse dec (deferred)
|
||||||
t_pool_rng ^= t_pool_rng << 13; t_pool_rng ^= t_pool_rng >> 17; t_pool_rng ^= t_pool_rng << 5;
|
t_pool_rng ^= t_pool_rng << 13; t_pool_rng ^= t_pool_rng >> 17; t_pool_rng ^= t_pool_rng << 5;
|
||||||
if ((t_pool_rng & ((1u<<g_count_sample_exp)-1u)) == 0u) g_pool.frees[class_idx]++;
|
if ((t_pool_rng & ((1u<<g_count_sample_exp)-1u)) == 0u) g_pool.frees[class_idx]++;
|
||||||
mid_page_inuse_dec_and_maybe_dn(raw);
|
mid_inuse_dec_deferred(raw);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@ -169,7 +170,7 @@ static inline void hak_pool_free_v1_slow_impl(void* ptr, size_t size, uintptr_t
|
|||||||
tail:
|
tail:
|
||||||
t_pool_rng ^= t_pool_rng << 13; t_pool_rng ^= t_pool_rng >> 17; t_pool_rng ^= t_pool_rng << 5;
|
t_pool_rng ^= t_pool_rng << 13; t_pool_rng ^= t_pool_rng >> 17; t_pool_rng ^= t_pool_rng << 5;
|
||||||
if ((t_pool_rng & ((1u<<g_count_sample_exp)-1u)) == 0u) g_pool.frees[class_idx]++;
|
if ((t_pool_rng & ((1u<<g_count_sample_exp)-1u)) == 0u) g_pool.frees[class_idx]++;
|
||||||
mid_page_inuse_dec_and_maybe_dn(raw);
|
mid_inuse_dec_deferred(raw);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user