From 8ca9093d7dd0cf0f34f85b685a5cc31cdf34bbfe Mon Sep 17 00:00:00 2001 From: Baptiste Rajaut Date: Mon, 19 Oct 2026 17:36:53 +0200 Subject: [PATCH] fix: print a NUMA slice as not verified when all its move_pages batches failed --- src/core/expert_source.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/core/expert_source.cpp b/src/core/expert_source.cpp index 608bd0f0..537671a9 100644 --- a/src/core/expert_source.cpp +++ b/src/core/expert_source.cpp @@ -695,11 +695,15 @@ struct NumaComplementPlacement { } double share[2]; for (int k = 0; k < 2; ++k) share[k] = sampled[k] > 0 ? 100.0 * (double) on_node[k] / (double) sampled[k] : 0.0; - std::fprintf(stderr, "FileExpertSource: NUMA placement: node %d %.2f GiB (%.1f %% of its slices), node %d %.2f GiB " - "(%.1f %% of its slices); free before: %s; after the drop: %s; pages taken and page-locked in %.1f s since the placement started\n", - nodes[0], share[0] / 100.0 * (double) slice_bytes[0] / 1073741824.0, share[0], nodes[1], - share[1] / 100.0 * (double) slice_bytes[1] / 1073741824.0, share[1], free_text(free_before).c_str(), - free_text(free_after).c_str(), secs); + char what[2][96]; // a slice whose move_pages batches all failed has no share to print + for (int k = 0; k < 2; ++k) { + if (batches[k] > 0 && failed[k] == batches[k]) std::snprintf(what[k], sizeof what[k], "not verified"); + else std::snprintf(what[k], sizeof what[k], "%.2f GiB (%.1f %% of its slices)", + share[k] / 100.0 * (double) slice_bytes[k] / 1073741824.0, share[k]); + } + std::fprintf(stderr, "FileExpertSource: NUMA placement: node %d %s, node %d %s; free before: %s; after the drop: %s; " + "pages taken and page-locked in %.1f s since the placement started\n", + nodes[0], what[0], nodes[1], what[1], free_text(free_before).c_str(), free_text(free_after).c_str(), secs); if (got < bytes) std::fprintf(stderr, "FileExpertSource: WARNING: NUMA placement FAILED: the paced loop stopped at %.2f of %.2f " "GiB (%s); the rest is first-touched by unpinned copy threads (memory not placed on its node: the split runs with remote reads)\n",