Skip backtrace in lsa-timing logs for preemptible reclaim

Preemptible reclaim is only done from the background reclaimer,
so backtrace is not useful. It's also normal that it takes a long time.
Skip the backtrace when reclaim is preemptible to reduce log noise.

Fixes the issue where background reclaim was printing unnecessary
backtraces in lsa-timing logs when operations took longer than the
stall detection threshold.

Closes: #27692

Co-authored-by: tgrabiec <283695+tgrabiec@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-16 12:59:10 +00:00
committed by Avi Kivity
parent e304d912b4
commit 288d4b49e9

View File

@@ -1547,8 +1547,8 @@ void reclaim_timer::report() const noexcept {
auto time_level = _stall_detected ? log_level::warn : log_level::debug;
auto info_level = _stall_detected ? log_level::info : log_level::debug;
auto MiB = 1024*1024;
auto msg_extra = extra_msg_when_stall_detected(_stall_detected,
_stall_detected ? current_backtrace() : saved_backtrace{});
auto msg_extra = extra_msg_when_stall_detected(_stall_detected && !_preemptible,
(_stall_detected && !_preemptible) ? current_backtrace() : saved_backtrace{});
timing_logger.log(time_level, "{} took {} us, trying to release {:.3f} MiB {}preemptibly, reserve: {{goal: {}, max: {}}}{}",
_name, (_duration + 500ns) / 1us, (float)_memory_to_release / MiB, _preemptible ? "" : "non-",