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 8ae59415bd
PiperOrigin-RevId: 683255110
pull/37864/head
Craig Tiller 4 months ago committed by Copybara-Service
parent 64b7fce68c
commit e6ad69e1dd
  1. 1
      bazel/experiments.bzl
  2. 24
      src/core/lib/experiments/experiments.cc
  3. 11
      src/core/lib/experiments/experiments.h
  4. 6
      src/core/lib/experiments/experiments.yaml
  5. 3
      src/core/util/work_serializer.cc

@ -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",
}

@ -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},
};

@ -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<kExperimentIdUnconstrainedMaxQuotaBufferSize>();
}
#define GRPC_EXPERIMENT_IS_INCLUDED_WORK_SERIALIZER_CLEARS_TIME_CACHE
inline bool IsWorkSerializerClearsTimeCacheEnabled() {
return IsExperimentEnabled<kExperimentIdWorkSerializerClearsTimeCache>();
}
#define GRPC_EXPERIMENT_IS_INCLUDED_WORK_SERIALIZER_DISPATCH
inline bool IsWorkSerializerDispatchEnabled() {
return IsExperimentEnabled<kExperimentIdWorkSerializerDispatch>();

@ -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,

@ -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<CallbackWrapper*>(

Loading…
Cancel
Save