From e6ad69e1dd7de6336e9521fad0259bc5be2ee8f2 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 7 Oct 2024 11:18:58 -0700 Subject: [PATCH] Remove `work_serializer_clears_time_cache` experiment (#37851) This was put in as a temporary kludge to carry us until `work_serializer_dispatch` was ready, however since #37637 this is a no-op for all known use cases (and I think it's time for `work_serializer_dispatch` to stick). Closes #37851 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37851 from ctiller:tc 8ae59415bda496143240b76be1a126436ecec397 PiperOrigin-RevId: 683255110 --- bazel/experiments.bzl | 1 - src/core/lib/experiments/experiments.cc | 24 ----------------------- src/core/lib/experiments/experiments.h | 11 ----------- src/core/lib/experiments/experiments.yaml | 6 ------ src/core/util/work_serializer.cc | 3 --- 5 files changed, 45 deletions(-) diff --git a/bazel/experiments.bzl b/bazel/experiments.bzl index 830d4a076d2..5ea1cd99f37 100644 --- a/bazel/experiments.bzl +++ b/bazel/experiments.bzl @@ -38,7 +38,6 @@ EXPERIMENT_ENABLES = { "time_caching_in_party": "time_caching_in_party", "trace_record_callops": "trace_record_callops", "unconstrained_max_quota_buffer_size": "unconstrained_max_quota_buffer_size", - "work_serializer_clears_time_cache": "work_serializer_clears_time_cache", "work_serializer_dispatch": "work_serializer_dispatch", } diff --git a/src/core/lib/experiments/experiments.cc b/src/core/lib/experiments/experiments.cc index 8464f0756a0..8c9675e0dd2 100644 --- a/src/core/lib/experiments/experiments.cc +++ b/src/core/lib/experiments/experiments.cc @@ -94,10 +94,6 @@ const char* const description_unconstrained_max_quota_buffer_size = "Discard the cap on the max free pool size for one memory allocator"; const char* const additional_constraints_unconstrained_max_quota_buffer_size = "{}"; -const char* const description_work_serializer_clears_time_cache = - "Have the work serializer clear the time cache when it dispatches work."; -const char* const additional_constraints_work_serializer_clears_time_cache = - "{}"; const char* const description_work_serializer_dispatch = "Have the work serializer dispatch work to event engine for every " "callback, instead of running things inline in the first thread that " @@ -159,10 +155,6 @@ const ExperimentMetadata g_experiment_metadata[] = { description_unconstrained_max_quota_buffer_size, additional_constraints_unconstrained_max_quota_buffer_size, nullptr, 0, false, true}, - {"work_serializer_clears_time_cache", - description_work_serializer_clears_time_cache, - additional_constraints_work_serializer_clears_time_cache, nullptr, 0, true, - true}, {"work_serializer_dispatch", description_work_serializer_dispatch, additional_constraints_work_serializer_dispatch, nullptr, 0, false, true}, }; @@ -243,10 +235,6 @@ const char* const description_unconstrained_max_quota_buffer_size = "Discard the cap on the max free pool size for one memory allocator"; const char* const additional_constraints_unconstrained_max_quota_buffer_size = "{}"; -const char* const description_work_serializer_clears_time_cache = - "Have the work serializer clear the time cache when it dispatches work."; -const char* const additional_constraints_work_serializer_clears_time_cache = - "{}"; const char* const description_work_serializer_dispatch = "Have the work serializer dispatch work to event engine for every " "callback, instead of running things inline in the first thread that " @@ -308,10 +296,6 @@ const ExperimentMetadata g_experiment_metadata[] = { description_unconstrained_max_quota_buffer_size, additional_constraints_unconstrained_max_quota_buffer_size, nullptr, 0, false, true}, - {"work_serializer_clears_time_cache", - description_work_serializer_clears_time_cache, - additional_constraints_work_serializer_clears_time_cache, nullptr, 0, true, - true}, {"work_serializer_dispatch", description_work_serializer_dispatch, additional_constraints_work_serializer_dispatch, nullptr, 0, false, true}, }; @@ -392,10 +376,6 @@ const char* const description_unconstrained_max_quota_buffer_size = "Discard the cap on the max free pool size for one memory allocator"; const char* const additional_constraints_unconstrained_max_quota_buffer_size = "{}"; -const char* const description_work_serializer_clears_time_cache = - "Have the work serializer clear the time cache when it dispatches work."; -const char* const additional_constraints_work_serializer_clears_time_cache = - "{}"; const char* const description_work_serializer_dispatch = "Have the work serializer dispatch work to event engine for every " "callback, instead of running things inline in the first thread that " @@ -457,10 +437,6 @@ const ExperimentMetadata g_experiment_metadata[] = { description_unconstrained_max_quota_buffer_size, additional_constraints_unconstrained_max_quota_buffer_size, nullptr, 0, false, true}, - {"work_serializer_clears_time_cache", - description_work_serializer_clears_time_cache, - additional_constraints_work_serializer_clears_time_cache, nullptr, 0, true, - true}, {"work_serializer_dispatch", description_work_serializer_dispatch, additional_constraints_work_serializer_dispatch, nullptr, 0, true, true}, }; diff --git a/src/core/lib/experiments/experiments.h b/src/core/lib/experiments/experiments.h index 8aa59e12f9b..afc86b9ce51 100644 --- a/src/core/lib/experiments/experiments.h +++ b/src/core/lib/experiments/experiments.h @@ -84,8 +84,6 @@ inline bool IsTimeCachingInPartyEnabled() { return true; } #define GRPC_EXPERIMENT_IS_INCLUDED_TRACE_RECORD_CALLOPS inline bool IsTraceRecordCallopsEnabled() { return true; } inline bool IsUnconstrainedMaxQuotaBufferSizeEnabled() { return false; } -#define GRPC_EXPERIMENT_IS_INCLUDED_WORK_SERIALIZER_CLEARS_TIME_CACHE -inline bool IsWorkSerializerClearsTimeCacheEnabled() { return true; } inline bool IsWorkSerializerDispatchEnabled() { return false; } #elif defined(GPR_WINDOWS) @@ -119,8 +117,6 @@ inline bool IsTimeCachingInPartyEnabled() { return true; } #define GRPC_EXPERIMENT_IS_INCLUDED_TRACE_RECORD_CALLOPS inline bool IsTraceRecordCallopsEnabled() { return true; } inline bool IsUnconstrainedMaxQuotaBufferSizeEnabled() { return false; } -#define GRPC_EXPERIMENT_IS_INCLUDED_WORK_SERIALIZER_CLEARS_TIME_CACHE -inline bool IsWorkSerializerClearsTimeCacheEnabled() { return true; } inline bool IsWorkSerializerDispatchEnabled() { return false; } #else @@ -153,8 +149,6 @@ inline bool IsTimeCachingInPartyEnabled() { return true; } #define GRPC_EXPERIMENT_IS_INCLUDED_TRACE_RECORD_CALLOPS inline bool IsTraceRecordCallopsEnabled() { return true; } inline bool IsUnconstrainedMaxQuotaBufferSizeEnabled() { return false; } -#define GRPC_EXPERIMENT_IS_INCLUDED_WORK_SERIALIZER_CLEARS_TIME_CACHE -inline bool IsWorkSerializerClearsTimeCacheEnabled() { return true; } #define GRPC_EXPERIMENT_IS_INCLUDED_WORK_SERIALIZER_DISPATCH inline bool IsWorkSerializerDispatchEnabled() { return true; } #endif @@ -182,7 +176,6 @@ enum ExperimentIds { kExperimentIdTimeCachingInParty, kExperimentIdTraceRecordCallops, kExperimentIdUnconstrainedMaxQuotaBufferSize, - kExperimentIdWorkSerializerClearsTimeCache, kExperimentIdWorkSerializerDispatch, kNumExperiments }; @@ -270,10 +263,6 @@ inline bool IsTraceRecordCallopsEnabled() { inline bool IsUnconstrainedMaxQuotaBufferSizeEnabled() { return IsExperimentEnabled(); } -#define GRPC_EXPERIMENT_IS_INCLUDED_WORK_SERIALIZER_CLEARS_TIME_CACHE -inline bool IsWorkSerializerClearsTimeCacheEnabled() { - return IsExperimentEnabled(); -} #define GRPC_EXPERIMENT_IS_INCLUDED_WORK_SERIALIZER_DISPATCH inline bool IsWorkSerializerDispatchEnabled() { return IsExperimentEnabled(); diff --git a/src/core/lib/experiments/experiments.yaml b/src/core/lib/experiments/experiments.yaml index ff4bf3869d4..a8f2105f7a5 100644 --- a/src/core/lib/experiments/experiments.yaml +++ b/src/core/lib/experiments/experiments.yaml @@ -165,12 +165,6 @@ expiry: 2024/09/09 owner: ctiller@google.com test_tags: [resource_quota_test] -- name: work_serializer_clears_time_cache - description: - Have the work serializer clear the time cache when it dispatches work. - expiry: 2024/10/01 - owner: ctiller@google.com - test_tags: [] - name: work_serializer_dispatch description: Have the work serializer dispatch work to event engine for every callback, diff --git a/src/core/util/work_serializer.cc b/src/core/util/work_serializer.cc index c9e0b1d9f45..38ee82303a2 100644 --- a/src/core/util/work_serializer.cc +++ b/src/core/util/work_serializer.cc @@ -243,9 +243,6 @@ void WorkSerializer::LegacyWorkSerializer::DrainQueueOwned() { } // There is at least one callback on the queue. Pop the callback from the // queue and execute it. - if (IsWorkSerializerClearsTimeCacheEnabled() && ExecCtx::Get() != nullptr) { - ExecCtx::Get()->InvalidateNow(); - } CallbackWrapper* cb_wrapper = nullptr; bool empty_unused; while ((cb_wrapper = reinterpret_cast(