diff --git a/src/snmalloc/mem/corealloc.h b/src/snmalloc/mem/corealloc.h index ca1cb3629..356a3bd12 100644 --- a/src/snmalloc/mem/corealloc.h +++ b/src/snmalloc/mem/corealloc.h @@ -321,7 +321,7 @@ namespace snmalloc #ifdef SNMALLOC_TRACING message<1024>( - "Slab {} is unused, Object sizeclass {}", + "Slab {} is unused, Object sizeclass {}", start_of_slab.unsafe_ptr(), sizeclass); #endif @@ -480,10 +480,6 @@ namespace snmalloc }; auto cb = [this, &need_post](freelist::HeadPtr msg) SNMALLOC_FAST_PATH_LAMBDA { -#ifdef SNMALLOC_TRACING - message<1024>("Handling remote"); -#endif - auto& entry = Config::Backend::template get_metaentry(snmalloc::address_cast(msg)); @@ -492,6 +488,10 @@ namespace snmalloc return true; }; +#ifdef SNMALLOC_TRACING + message<1024>("Handling remote queue before proceeding..."); +#endif + if constexpr (Config::Options.QueueHeadsAreTame) { /* diff --git a/src/snmalloc/mem/localalloc.h b/src/snmalloc/mem/localalloc.h index 75be56ecc..62191ad07 100644 --- a/src/snmalloc/mem/localalloc.h +++ b/src/snmalloc/mem/localalloc.h @@ -273,18 +273,18 @@ namespace snmalloc * In the second case we need to recheck if this is a remote deallocation, * as we might acquire the originating allocator. */ - SNMALLOC_SLOW_PATH void dealloc_remote_slow(capptr::Alloc p) + SNMALLOC_SLOW_PATH void + dealloc_remote_slow(const PagemapEntry& entry, capptr::Alloc p) { if (core_alloc != nullptr) { #ifdef SNMALLOC_TRACING message<1024>( - "Remote dealloc post {} ({})", + "Remote dealloc post {} ({}, {})", p.unsafe_ptr(), - alloc_size(p.unsafe_ptr())); + alloc_size(p.unsafe_ptr()), + address_cast(entry.get_slab_metadata())); #endif - const PagemapEntry& entry = - Config::Backend::template get_metaentry(address_cast(p)); local_cache.remote_dealloc_cache.template dealloc( entry.get_remote()->trunc_id(), p); post_remote_cache(); @@ -680,12 +680,15 @@ namespace snmalloc remote->trunc_id(), p_tame); # ifdef SNMALLOC_TRACING message<1024>( - "Remote dealloc fast {} ({})", p_raw, alloc_size(p_raw)); + "Remote dealloc fast {} ({}, {})", + p_raw, + alloc_size(p_raw), + address_cast(entry.get_slab_metadata())); # endif return; } - dealloc_remote_slow(p_tame); + dealloc_remote_slow(entry, p_tame); return; } diff --git a/src/snmalloc/mem/remotecache.h b/src/snmalloc/mem/remotecache.h index 96f5e0973..9bfc9159a 100644 --- a/src/snmalloc/mem/remotecache.h +++ b/src/snmalloc/mem/remotecache.h @@ -151,7 +151,7 @@ namespace snmalloc } } - // Reset capacity as we have empty everything + // Reset capacity as we have emptied everything capacity = REMOTE_CACHE; return sent_something; diff --git a/src/test/perf/contention/contention.cc b/src/test/perf/contention/contention.cc index e266f0491..2d84310e0 100644 --- a/src/test/perf/contention/contention.cc +++ b/src/test/perf/contention/contention.cc @@ -137,7 +137,7 @@ void test_tasks(size_t num_tasks, size_t count, size_t size) ParallelTest test(num_tasks); std::cout << "Task test, " << num_tasks << " threads, " << count - << " swaps per thread " << test.time() << "ticks" << std::endl; + << " swaps per thread " << test.time() << " ticks" << std::endl; for (size_t n = 0; n < swapsize; n++) {