Repository navigation
perf(malloc): advise huge pages for large MPool mappings - #32815
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Performance and root-cause evidenceThis change addresses the confirmed fragmented-backing cost of large native query Actual-allocator controlsAll controls use MO's real allocator with the same bytes and touch work. Each
The trial includes direct-compaction costs: 2,476 stalls/zero failures in the SF100 conclusion and slower-signal reviewThe full all22 screen observes Total wall -1.06%, total system CPU -5.21%, minor The original Q11 +1.49% wall and Q17 +1.17% median remain visible below. Q17's full-suite wall samples are main Software provenanceBoth measured service binaries were built from current main
All 22 queries and resource countersOne process per arm, one excluded cold Q1–Q22 suite and five profiled warm suites. Medians below; Total sums the per-query medians. Wall time includes GC and profiling. No fabricated GC subtraction or independent-process confidence claims. THP remains enabled, cache 16 GiB, application and spill thresholds 48 GiB. Spill/swap/OOM invalidate the configuration.
THP/compaction counters are host-wide supporting evidence. Minor-fault and CPU counters belong to the measured application. Go counters include common scrape/background work. Native allocation counters publish asynchronously and are retained raw; their per-query deltas are not exact. No globally exact application copy-byte counter exists. Compaction can copy kernel pages; do not describe this hint as eliminating all memory copies. main: warm window 427.843s, external cores 0.000, interrupt cores 0.544, whole-warm peak 30.852 GiB; suite totals [84.490246269, 78.69148378, 83.044915567, 80.261724821, 79.456732364]. GC-attributed instruction estimatesRaw hardware instructions remain in the preceding table. These are period-weighted stack-sampling estimates; generic allocation/copy functions are attributed to GC only when a GC-specific root appears in the stack. The Go 1.27 classifier includes its GC scanner and gcWork queue roots. No GC-subtracted wall time or exact foreground-counter claim is made.
All five raw warm wall times for every query
|
|
Queue requested — the merge queue status continues in this comment ↓. |
🛑 Queue command cancelledQueue requested — the merge queue status continues in this comment ↓. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 23e0e834c0ba3e73de299c1aadd0340e3883fec2
Assessment: approve
The optional hint preserves allocation sizes, zeroing, accounting, reuse and cleanup. Reported gains with fragmented memory justify the small addition within the existing allocator, without new state or configuration. No actionable defect remains.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Reviewed all four changed files, five discussion entries, linked issue #32813 and affected allocator, MPool and file-service consumers.
-
Reused successful frozen-head build, UT/coverage, ARM SCA and PROXY/PESSIMISTIC BVT statuses, plus attributed author reports of allocator/MPool tests and performance controls.
-
Source, formatting, discussion coverage and reported benchmark arithmetic audit passed: review-audit.json, review-audit.stdout.log and checks/1794835666277389301-2.json. Receipt reconciliation is retained in validation-manifest.json.
Limitations:
-
No fresh allocator or benchmark execution; raw author/CI artifacts were unavailable. Arithmetic checks do not independently reproduce performance.
-
Measurements use one host and THP configuration with profiled single-process query runs. Q11/Q17 timing uncertainty and counter-attribution limits remain; no population equivalence or umbrella acceptance completion is claimed. Pending, skipped and neutral checks are excluded from passes.
🛑 Pull request from fork cannot be queuedDetailsThis pull request comes from a fork, and Mergify needs the author's permission to update its branch. |
🚫 Left the queue · pull request dequeued1 h 45 min in the queue, with no time running CI. So far
Reason Pull request #32815 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
To get back in the queue
Merge conditions not met when it left the queue
Tick the box to put this pull request back in the merge queue (same as
2 merge conditions met
Times in UTC · dashboard · how the merge queue works |
|
@Mergifyio refresh Maintainer edits are enabled and verified through GitHub's REST API. Please reevaluate the existing queue rules. |
✅ Pull request refreshed |
|
mo-bot review · Commit: New discussion was assessed; the previous review remains unchanged. |
What type of PR is this?
Which issue(s) this PR fixes:
Related to #32813
What this PR does / why we need it:
Advise fresh Linux MPool mappings of at least 2 MiB with
MADV_HUGEPAGEbeforehanding the allocation to callers. Under
defer+madvise, this permits compactionfor large query buffers whose first touches would otherwise fall back to many
small-page faults when contiguous blocks are scarce.
Treat advice as optional and preserve successful allocation if the hint is
unavailable. Keep exact allocation sizes, zeroing, memory accounting, bounded
reuse and cleanup. Reused mappings retain their policy without another syscall.
Small allocations, the file-service cache allocator and Darwin retain their
existing behavior.
Validation
Focused SimpleCAllocator tests and the owning malloc/MPool packages pass,
including the 2 MiB boundary cases. Convention checks and configured static
checks for the changed package pass with repository-pinned tools.
Actual-allocator controls measure available and fragmented backing with serial and
32-worker first touches. The local SF100 disk comparison covers all 22 queries
with one process per arm, one excluded cold suite and five profiled warm suites,
using identical cache and memory thresholds with spilling and swap disallowed.
Per-query results, Q11 I/O tracing, binary/source provenance and measurement
limitations are posted in a separate comment. The full repository pre-push gate
is run with repository-pinned tools in the default CI build mode.