Moe Charm (CI)
695aec8279
feat(Phase 1-2): Add atomic initialization wait mechanism (safety improvement)
Implements thread-safe atomic initialization tracking and a wait helper for
non-init threads to avoid libc fallback during the initialization window.
Changes:
- Convert g_initializing to _Atomic type for thread-safe access
- Add g_init_thread to identify which thread performs initialization
- Implement hak_init_wait_for_ready() helper with spin/yield mechanism
- Update hak_core_init.inc.h to use atomic operations
- Update hak_wrappers.inc.h to call wait helper instead of checking g_initializing
Results & Analysis:
- Performance: ±0% (21s → 21s, no measurable improvement)
- Safety: ✓ Prevents recursion in init window
- Investigation: Initialization overhead is <1% of total allocations
- Expected: 2-8% improvement
- Actual: 0% improvement (spin/yield overhead ≈ savings)
- libc overhead: 41% → 57% (relative increase, likely sampling variation)
Key Findings from Perf Analysis:
- getenv: 0% (maintained from Phase 1-1) ✓
- libc malloc/free: ~24.54% of cycles
- libc fragmentation (malloc_consolidate/unlink_chunk): ~16% of cycles
- Total libc overhead: ~41% (difficult to optimize without changing algorithm)
Next Phase Target:
- Phase 2: Investigate libc fragmentation (malloc_consolidate 9.33%, unlink_chunk 6.90%)
- Potential approaches: hakmem Mid/ACE allocator expansion, sh8bench pattern analysis
Recommendation: Keep Phase 1-2 for safety (no performance regression), proceed to Phase 2.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 16:44:27 +09:00
..
2025-11-09 18:55:50 +09:00
2025-11-09 18:55:50 +09:00
2025-11-07 01:27:04 +09:00
2025-11-30 05:12:32 +09:00
2025-11-30 05:12:32 +09:00
2025-11-20 07:32:30 +09:00
2025-12-01 16:37:59 +09:00
2025-11-13 01:45:30 +09:00
2025-11-29 07:57:49 +09:00
2025-12-01 16:37:59 +09:00
2025-11-13 01:45:30 +09:00
2025-11-29 09:04:32 +09:00
2025-12-01 16:05:55 +09:00
2025-12-01 13:47:23 +09:00
2025-11-30 15:27:53 +09:00
2025-12-01 16:37:59 +09:00
2025-11-07 01:27:04 +09:00
2025-12-01 16:37:59 +09:00
2025-11-07 01:27:04 +09:00
2025-11-21 23:00:24 +09:00
2025-11-26 12:33:49 +09:00
2025-12-01 16:37:59 +09:00
2025-11-20 07:32:30 +09:00
2025-12-01 16:37:59 +09:00
2025-11-07 01:27:04 +09:00
2025-12-01 22:06:10 +09:00
2025-12-01 16:37:59 +09:00
2025-11-17 02:47:58 +09:00
2025-11-15 22:08:51 +09:00
2025-11-27 03:41:07 +09:00
2025-11-16 07:51:37 +09:00
2025-11-26 17:12:41 +09:00
2025-12-01 23:43:44 +09:00
2025-12-02 16:44:27 +09:00
2025-11-07 01:27:04 +09:00
2025-12-01 16:05:55 +09:00
2025-11-07 01:27:04 +09:00
2025-12-02 16:44:27 +09:00
2025-11-20 07:32:30 +09:00
2025-12-01 16:37:59 +09:00
2025-11-12 02:45:00 +09:00
2025-11-28 16:08:44 +09:00
2025-12-01 16:37:59 +09:00
2025-11-07 01:27:04 +09:00
2025-11-29 14:39:07 +09:00
2025-11-17 02:47:58 +09:00
2025-11-17 02:47:58 +09:00
2025-11-17 02:47:58 +09:00
2025-12-01 22:06:10 +09:00
2025-12-01 22:06:10 +09:00
2025-11-06 21:54:12 +09:00
2025-11-06 21:54:12 +09:00
2025-11-06 21:54:12 +09:00
2025-11-07 01:27:04 +09:00
2025-11-07 01:27:04 +09:00
2025-11-07 01:27:04 +09:00
2025-11-07 01:27:04 +09:00
2025-11-07 01:27:04 +09:00
2025-11-06 21:54:12 +09:00
2025-11-20 07:32:30 +09:00
2025-12-01 16:37:59 +09:00
2025-11-13 01:45:30 +09:00
2025-11-13 06:50:20 +09:00
2025-11-28 13:42:39 +09:00
2025-12-01 16:37:59 +09:00
2025-11-22 03:30:47 +09:00
2025-11-30 07:16:50 +09:00
2025-11-30 07:16:50 +09:00
2025-11-30 10:48:50 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-30 07:16:50 +09:00
2025-11-30 07:16:50 +09:00
2025-11-28 14:11:37 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-28 14:11:37 +09:00
2025-11-17 05:29:08 +09:00
2025-12-01 16:37:59 +09:00
2025-11-16 05:48:59 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-22 02:46:57 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-30 07:16:50 +09:00
2025-11-30 07:16:50 +09:00
2025-11-28 13:42:39 +09:00
2025-11-26 12:33:49 +09:00
2025-11-12 02:45:00 +09:00
2025-11-29 08:44:29 +09:00
2025-11-30 11:06:44 +09:00
2025-12-02 16:16:51 +09:00
2025-12-02 16:16:51 +09:00
2025-11-29 11:58:37 +09:00
2025-11-29 17:58:42 +09:00
2025-11-29 11:58:37 +09:00
2025-11-30 10:48:50 +09:00
2025-11-30 10:48:50 +09:00
2025-11-29 07:57:49 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-28 13:42:39 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-28 13:42:39 +09:00
2025-12-01 16:37:59 +09:00
2025-12-01 13:47:23 +09:00
2025-11-22 06:50:38 +09:00
2025-11-17 02:47:58 +09:00
2025-12-01 16:37:59 +09:00
2025-11-17 02:47:58 +09:00
2025-12-02 16:16:51 +09:00
2025-12-02 16:16:51 +09:00