16 lines
1.1 KiB
Diff
16 lines
1.1 KiB
Diff
|
|
--- a/core/hakmem_tiny_refill_p0.inc.h
|
|||
|
|
+++ b/core/hakmem_tiny_refill_p0.inc.h
|
|||
|
|
@@ -99,9 +99,10 @@ static inline int sll_refill_batch_from_ss(int class_idx, int max_take) {
|
|||
|
|
uint32_t from_freelist = trc_pop_from_freelist(meta, want, &chain);
|
|||
|
|
if (from_freelist > 0) {
|
|||
|
|
trc_splice_to_sll(class_idx, &chain, &g_tls_sll_head[class_idx], &g_tls_sll_count[class_idx]);
|
|||
|
|
- // NOTE: from_freelist は既に used/active 計上済みのブロックの再循環。active 追加や
|
|||
|
|
- // nonempty_mask クリアは不要(クリアすると後続freeで立たない)。
|
|||
|
|
+ // FIX (2025-11-07): Blocks from freelist were decremented when freed (remote or local).
|
|||
|
|
+ // Must increment counter when moving back to allocation pool (TLS SLL).
|
|||
|
|
+ // Bug: Without this, counter underflows → false OOM → crash.
|
|||
|
|
+ ss_active_add(tls->ss, from_freelist);
|
|||
|
|
extern unsigned long long g_rf_freelist_items[];
|
|||
|
|
g_rf_freelist_items[class_idx] += from_freelist;
|
|||
|
|
total_taken += from_freelist;
|