From ee9cc450d4242fcf3bb39eeb8dc3121ee46231d3 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Thu, 24 Aug 2023 12:37:02 +0300 Subject: [PATCH] logalloc: report increases of reserves The log-structured allocator maintains memory reserves to so that operations using log-strucutured allocator memory can have some working memory and can allocate. The reserves start small and are increased if allocation failures are encountered. Before starting an operation, the allocator first frees memory to satisfy the reserves. One problem is that if the reserves are set to a high value and we encounter a stall, then, first, we have no idea what value the reserves are set to, and second, we have no idea what operation caused the reserves to be increased. We fix this problem by promoting the log reports of reserve increases from DEBUG level to INFO level and by attaching a stack trace to those reports. This isn't optimal since the messages are used for debugging, not for informing the user about anything important for the operation of the node, but I see no other way to obtain the information. Ref #13930. Closes scylladb/scylladb#15153 --- utils/logalloc.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/logalloc.cc b/utils/logalloc.cc index 229dddd4df..b4317a6ea0 100644 --- a/utils/logalloc.cc +++ b/utils/logalloc.cc @@ -2924,10 +2924,10 @@ void allocating_section::on_alloc_failure(logalloc::region& r) { r.allocator().invalidate_references(); if (r.get_tracker().get_impl().segment_pool().allocation_failure_flag()) { _lsa_reserve *= 2; - llogger.debug("LSA allocation failure, increasing reserve in section {} to {} segments", fmt::ptr(this), _lsa_reserve); + llogger.info("LSA allocation failure, increasing reserve in section {} to {} segments; trace: {}", fmt::ptr(this), _lsa_reserve, current_backtrace()); } else { _std_reserve *= 2; - llogger.debug("Standard allocator failure, increasing head-room in section {} to {} [B]", fmt::ptr(this), _std_reserve); + llogger.info("Standard allocator failure, increasing head-room in section {} to {} [B]; trace: {}", fmt::ptr(this), _std_reserve, current_backtrace()); } reserve(r.get_tracker().get_impl()); }