From 860d934d71af96a48dae2256e8a96d7f1f49426b Mon Sep 17 00:00:00 2001 From: "Moe Charm (CI)" Date: Wed, 10 Dec 2025 18:03:28 +0900 Subject: [PATCH] Tune C7 v4 partial reuse for mixed perf --- core/smallobject_hotbox_v4.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/smallobject_hotbox_v4.c b/core/smallobject_hotbox_v4.c index 6f3ddd21..a2cf1c30 100644 --- a/core/smallobject_hotbox_v4.c +++ b/core/smallobject_hotbox_v4.c @@ -17,7 +17,7 @@ // TLS context static __thread small_heap_ctx_v4 g_ctx_v4; -#define V4_MAX_PARTIAL_PAGES 2 +#define V4_MAX_PARTIAL_PAGES 1 small_heap_ctx_v4* small_heap_ctx_v4_get(void) { return &g_ctx_v4; @@ -175,8 +175,12 @@ static small_page_v4* small_alloc_slow_v4(small_heap_ctx_v4* ctx, int class_idx) return cur; // usable current } if (cur && !cur->freelist) { - // current を full list に残しておき、free で戻す - v4_page_push_full(h, cur); + // current をいったん partial/full に退避(partial を優先) + if (h->partial_count < V4_MAX_PARTIAL_PAGES) { + v4_page_push_partial(h, cur); + } else { + v4_page_push_full(h, cur); + } h->current = NULL; }