logalloc: use namespace-scope seastar::idle_cpu_handler and related rather than reactor scope
This allows us to drop a #include <reactor.hh>, reducing compile time. Several translation units that lost access to required declarations are updated with the required includes (this can be an include of reactor.hh itself, in case the translation unit that lost it got it indirectly via logalloc.hh) Ref #1.
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "utils/disk-error-handler.hh"
|
||||
#include "seastarx.hh"
|
||||
#include <seastar/core/sleep.hh>
|
||||
#include <seastar/core/reactor.hh>
|
||||
|
||||
namespace db {
|
||||
namespace hints {
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
#include <seastar/util/gcc6-concepts.hh>
|
||||
#include <seastar/core/thread.hh>
|
||||
#include <seastar/core/file.hh>
|
||||
#include "db/timeout_clock.hh"
|
||||
|
||||
#include <deque>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "locator/ec2_snitch.hh"
|
||||
#include <seastar/core/reactor.hh>
|
||||
|
||||
namespace locator {
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
*/
|
||||
|
||||
#include <seastar/net/dns.hh>
|
||||
#include <seastar/core/seastar.hh>
|
||||
#include "locator/gce_snitch.hh"
|
||||
|
||||
namespace locator {
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "database.hh"
|
||||
#include "test/perf/perf.hh"
|
||||
#include <seastar/core/app-template.hh>
|
||||
#include <seastar/core/reactor.hh>
|
||||
|
||||
static atomic_cell make_atomic_cell(data_type dt, bytes value) {
|
||||
return atomic_cell::make_live(*dt, 0, value);
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <seastar/core/sstring.hh>
|
||||
#include <seastar/core/thread.hh>
|
||||
#include <seastar/core/weak_ptr.hh>
|
||||
#include <seastar/core/reactor.hh>
|
||||
|
||||
#include "utils/managed_bytes.hh"
|
||||
#include "utils/extremum_tracking.hh"
|
||||
|
||||
@@ -381,7 +381,7 @@ public:
|
||||
void register_region(region::impl*);
|
||||
void unregister_region(region::impl*) noexcept;
|
||||
size_t reclaim(size_t bytes);
|
||||
reactor::idle_cpu_handler_result compact_on_idle(reactor::work_waiting_on_reactor check_for_work);
|
||||
idle_cpu_handler_result compact_on_idle(work_waiting_on_reactor check_for_work);
|
||||
// Releases whole segments back to the segment pool.
|
||||
// After the call, if there is enough evictable memory, the amount of free segments in the pool
|
||||
// will be at least reserve_segments + div_ceil(bytes, segment::size).
|
||||
@@ -418,7 +418,7 @@ size_t tracker::reclaim(size_t bytes) {
|
||||
return _impl->reclaim(bytes);
|
||||
}
|
||||
|
||||
reactor::idle_cpu_handler_result tracker::compact_on_idle(reactor::work_waiting_on_reactor check_for_work) {
|
||||
idle_cpu_handler_result tracker::compact_on_idle(work_waiting_on_reactor check_for_work) {
|
||||
return _impl->compact_on_idle(check_for_work);
|
||||
}
|
||||
|
||||
@@ -1875,13 +1875,13 @@ struct reclaim_timer {
|
||||
}
|
||||
};
|
||||
|
||||
reactor::idle_cpu_handler_result tracker::impl::compact_on_idle(reactor::work_waiting_on_reactor check_for_work) {
|
||||
idle_cpu_handler_result tracker::impl::compact_on_idle(work_waiting_on_reactor check_for_work) {
|
||||
if (!_reclaiming_enabled) {
|
||||
return reactor::idle_cpu_handler_result::no_more_work;
|
||||
return idle_cpu_handler_result::no_more_work;
|
||||
}
|
||||
reclaiming_lock rl(*this);
|
||||
if (_regions.empty()) {
|
||||
return reactor::idle_cpu_handler_result::no_more_work;
|
||||
return idle_cpu_handler_result::no_more_work;
|
||||
}
|
||||
segment_pool::reservation_goal open_emergency_pool(shard_segment_pool, 0);
|
||||
|
||||
@@ -1899,14 +1899,14 @@ reactor::idle_cpu_handler_result tracker::impl::compact_on_idle(reactor::work_wa
|
||||
region::impl* r = _regions.back();
|
||||
|
||||
if (!r->is_idle_compactible()) {
|
||||
return reactor::idle_cpu_handler_result::no_more_work;
|
||||
return idle_cpu_handler_result::no_more_work;
|
||||
}
|
||||
|
||||
r->compact();
|
||||
|
||||
boost::range::push_heap(_regions, cmp);
|
||||
}
|
||||
return reactor::idle_cpu_handler_result::interrupted_by_higher_priority_task;
|
||||
return idle_cpu_handler_result::interrupted_by_higher_priority_task;
|
||||
}
|
||||
|
||||
size_t tracker::impl::reclaim(size_t memory_to_release) {
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
|
||||
#include <memory>
|
||||
#include <seastar/core/memory.hh>
|
||||
#include <seastar/core/reactor.hh>
|
||||
#include <seastar/core/idle_cpu_handler.hh>
|
||||
#include <seastar/core/condition-variable.hh>
|
||||
#include <seastar/core/smp.hh>
|
||||
#include <seastar/core/shared_ptr.hh>
|
||||
#include <seastar/core/shared_future.hh>
|
||||
#include <seastar/core/gate.hh>
|
||||
@@ -464,7 +466,7 @@ public:
|
||||
|
||||
// Compacts one segment at a time from sparsest segment to least sparse until work_waiting_on_reactor returns true
|
||||
// or there are no more segments to compact.
|
||||
reactor::idle_cpu_handler_result compact_on_idle(reactor::work_waiting_on_reactor);
|
||||
idle_cpu_handler_result compact_on_idle(work_waiting_on_reactor);
|
||||
|
||||
// Compacts as much as possible. Very expensive, mainly for testing.
|
||||
// Guarantees that every live object from reclaimable regions will be moved.
|
||||
|
||||
Reference in New Issue
Block a user