From 766cd6b5736200a2d76abb5f0b3cf2357733d752 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 21 Mar 2022 10:27:52 -0700 Subject: [PATCH] Remove epollex poller (#29160) * start delete * remove build.gn... again * remove more * Automated change: Fix sanity tests * fixes Co-authored-by: ctiller --- BUILD | 5 - CMakeLists.txt | 63 - Makefile | 4 - bazel/grpc_build_system.bzl | 2 +- build_autogenerated.yaml | 22 - build_handwritten.yaml | 8 - config.m4 | 2 - config.w32 | 2 - doc/core/grpc-polling-engines.md | 28 +- doc/environment_variables.md | 2 - gRPC-C++.podspec | 6 - gRPC-Core.podspec | 8 - grpc.gemspec | 5 - grpc.gyp | 4 - package.xml | 5 - src/core/lib/debug/stats_data.cc | 6 - src/core/lib/debug/stats_data.h | 34 +- src/core/lib/debug/stats_data.yaml | 6 - src/core/lib/debug/stats_data_bq_schema.sql | 2 - src/core/lib/iomgr/ev_epollex_linux.cc | 1657 ------------ src/core/lib/iomgr/ev_epollex_linux.h | 30 - src/core/lib/iomgr/ev_posix.cc | 13 +- .../lib/iomgr/is_epollexclusive_available.cc | 119 - .../lib/iomgr/is_epollexclusive_available.h | 36 - src/core/lib/iomgr/port.h | 2 - src/core/lib/iomgr/sys_epoll_wrapper.h | 30 - src/python/grpcio/grpc_core_dependencies.py | 2 - test/build/check_epollexclusive.c | 23 - test/core/end2end/generate_tests.bzl | 2 +- test/core/iomgr/BUILD | 12 - test/core/iomgr/ev_epollex_linux_test.cc | 115 - .../clang_tidy_all_the_things.sh | 1 + tools/doxygen/Doxyfile.c++.internal | 5 - tools/doxygen/Doxyfile.core.internal | 5 - tools/run_tests/generated/tests.json | 22 - tools/run_tests/helper_scripts/build_cxx.sh | 2 +- .../performance/massage_qps_stats.py | 9 - .../performance/scenario_result_schema.json | 2328 ++++++++--------- tools/run_tests/run_tests.py | 22 +- 39 files changed, 1181 insertions(+), 3468 deletions(-) delete mode 100644 src/core/lib/iomgr/ev_epollex_linux.cc delete mode 100644 src/core/lib/iomgr/ev_epollex_linux.h delete mode 100644 src/core/lib/iomgr/is_epollexclusive_available.cc delete mode 100644 src/core/lib/iomgr/is_epollexclusive_available.h delete mode 100644 src/core/lib/iomgr/sys_epoll_wrapper.h delete mode 100644 test/build/check_epollexclusive.c delete mode 100644 test/core/iomgr/ev_epollex_linux_test.cc diff --git a/BUILD b/BUILD index a62b6d6e87c..a27da2ec4d1 100644 --- a/BUILD +++ b/BUILD @@ -1905,7 +1905,6 @@ grpc_cc_library( "src/core/lib/iomgr/error_cfstream.cc", "src/core/lib/iomgr/ev_apple.cc", "src/core/lib/iomgr/ev_epoll1_linux.cc", - "src/core/lib/iomgr/ev_epollex_linux.cc", "src/core/lib/iomgr/ev_poll_posix.cc", "src/core/lib/iomgr/ev_posix.cc", "src/core/lib/iomgr/ev_windows.cc", @@ -1924,7 +1923,6 @@ grpc_cc_library( "src/core/lib/iomgr/iomgr_posix.cc", "src/core/lib/iomgr/iomgr_posix_cfstream.cc", "src/core/lib/iomgr/iomgr_windows.cc", - "src/core/lib/iomgr/is_epollexclusive_available.cc", "src/core/lib/iomgr/load_file.cc", "src/core/lib/iomgr/lockfree_event.cc", "src/core/lib/iomgr/polling_entity.cc", @@ -2046,7 +2044,6 @@ grpc_cc_library( "src/core/lib/iomgr/error_cfstream.h", "src/core/lib/iomgr/ev_apple.h", "src/core/lib/iomgr/ev_epoll1_linux.h", - "src/core/lib/iomgr/ev_epollex_linux.h", "src/core/lib/iomgr/ev_poll_posix.h", "src/core/lib/iomgr/ev_posix.h", "src/core/lib/iomgr/executor/mpmcqueue.h", @@ -2056,7 +2053,6 @@ grpc_cc_library( "src/core/lib/iomgr/internal_errqueue.h", "src/core/lib/iomgr/iocp_windows.h", "src/core/lib/iomgr/iomgr.h", - "src/core/lib/iomgr/is_epollexclusive_available.h", "src/core/lib/iomgr/load_file.h", "src/core/lib/iomgr/lockfree_event.h", "src/core/lib/iomgr/nameser.h", @@ -2077,7 +2073,6 @@ grpc_cc_library( "src/core/lib/iomgr/socket_mutator.h", "src/core/lib/iomgr/socket_utils_posix.h", "src/core/lib/iomgr/socket_windows.h", - "src/core/lib/iomgr/sys_epoll_wrapper.h", "src/core/lib/iomgr/tcp_client.h", "src/core/lib/iomgr/tcp_client_posix.h", "src/core/lib/iomgr/tcp_posix.h", diff --git a/CMakeLists.txt b/CMakeLists.txt index 683a6b8c091..ca5471ce3c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -417,7 +417,6 @@ add_custom_target(plugins add_custom_target(tools_c DEPENDS - check_epollexclusive ) add_custom_target(tools_cxx @@ -653,9 +652,6 @@ if(gRPC_BUILD_TESTS) endif() add_dependencies(buildtests_c endpoint_pair_test) add_dependencies(buildtests_c env_test) - if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) - add_dependencies(buildtests_c ev_epollex_linux_test) - endif() add_dependencies(buildtests_c fake_resolver_test) add_dependencies(buildtests_c fake_transport_security_test) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) @@ -1881,7 +1877,6 @@ add_library(grpc src/core/lib/iomgr/error_cfstream.cc src/core/lib/iomgr/ev_apple.cc src/core/lib/iomgr/ev_epoll1_linux.cc - src/core/lib/iomgr/ev_epollex_linux.cc src/core/lib/iomgr/ev_poll_posix.cc src/core/lib/iomgr/ev_posix.cc src/core/lib/iomgr/ev_windows.cc @@ -1911,7 +1906,6 @@ add_library(grpc src/core/lib/iomgr/iomgr_posix.cc src/core/lib/iomgr/iomgr_posix_cfstream.cc src/core/lib/iomgr/iomgr_windows.cc - src/core/lib/iomgr/is_epollexclusive_available.cc src/core/lib/iomgr/load_file.cc src/core/lib/iomgr/lockfree_event.cc src/core/lib/iomgr/polling_entity.cc @@ -2527,7 +2521,6 @@ add_library(grpc_unsecure src/core/lib/iomgr/error_cfstream.cc src/core/lib/iomgr/ev_apple.cc src/core/lib/iomgr/ev_epoll1_linux.cc - src/core/lib/iomgr/ev_epollex_linux.cc src/core/lib/iomgr/ev_poll_posix.cc src/core/lib/iomgr/ev_posix.cc src/core/lib/iomgr/ev_windows.cc @@ -2557,7 +2550,6 @@ add_library(grpc_unsecure src/core/lib/iomgr/iomgr_posix.cc src/core/lib/iomgr/iomgr_posix_cfstream.cc src/core/lib/iomgr/iomgr_windows.cc - src/core/lib/iomgr/is_epollexclusive_available.cc src/core/lib/iomgr/load_file.cc src/core/lib/iomgr/lockfree_event.cc src/core/lib/iomgr/polling_entity.cc @@ -4018,32 +4010,6 @@ endif() -add_executable(check_epollexclusive - test/build/check_epollexclusive.c -) - -target_include_directories(check_epollexclusive - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} - ${_gRPC_RE2_INCLUDE_DIR} - ${_gRPC_SSL_INCLUDE_DIR} - ${_gRPC_UPB_GENERATED_DIR} - ${_gRPC_UPB_GRPC_GENERATED_DIR} - ${_gRPC_UPB_INCLUDE_DIR} - ${_gRPC_XXHASH_INCLUDE_DIR} - ${_gRPC_ZLIB_INCLUDE_DIR} -) - -target_link_libraries(check_epollexclusive - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc - gpr -) - - - add_executable(gen_hpack_tables tools/codegen/core/gen_hpack_tables.cc ) @@ -5124,35 +5090,6 @@ target_link_libraries(env_test ) -endif() -if(gRPC_BUILD_TESTS) -if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) - - add_executable(ev_epollex_linux_test - test/core/iomgr/ev_epollex_linux_test.cc - ) - - target_include_directories(ev_epollex_linux_test - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} - ${_gRPC_RE2_INCLUDE_DIR} - ${_gRPC_SSL_INCLUDE_DIR} - ${_gRPC_UPB_GENERATED_DIR} - ${_gRPC_UPB_GRPC_GENERATED_DIR} - ${_gRPC_UPB_INCLUDE_DIR} - ${_gRPC_XXHASH_INCLUDE_DIR} - ${_gRPC_ZLIB_INCLUDE_DIR} - ) - - target_link_libraries(ev_epollex_linux_test - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc_test_util - ) - - -endif() endif() if(gRPC_BUILD_TESTS) diff --git a/Makefile b/Makefile index a21d94fcd76..9e8c78fb5b3 100644 --- a/Makefile +++ b/Makefile @@ -1466,7 +1466,6 @@ LIBGRPC_SRC = \ src/core/lib/iomgr/error_cfstream.cc \ src/core/lib/iomgr/ev_apple.cc \ src/core/lib/iomgr/ev_epoll1_linux.cc \ - src/core/lib/iomgr/ev_epollex_linux.cc \ src/core/lib/iomgr/ev_poll_posix.cc \ src/core/lib/iomgr/ev_posix.cc \ src/core/lib/iomgr/ev_windows.cc \ @@ -1496,7 +1495,6 @@ LIBGRPC_SRC = \ src/core/lib/iomgr/iomgr_posix.cc \ src/core/lib/iomgr/iomgr_posix_cfstream.cc \ src/core/lib/iomgr/iomgr_windows.cc \ - src/core/lib/iomgr/is_epollexclusive_available.cc \ src/core/lib/iomgr/load_file.cc \ src/core/lib/iomgr/lockfree_event.cc \ src/core/lib/iomgr/polling_entity.cc \ @@ -1961,7 +1959,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/iomgr/error_cfstream.cc \ src/core/lib/iomgr/ev_apple.cc \ src/core/lib/iomgr/ev_epoll1_linux.cc \ - src/core/lib/iomgr/ev_epollex_linux.cc \ src/core/lib/iomgr/ev_poll_posix.cc \ src/core/lib/iomgr/ev_posix.cc \ src/core/lib/iomgr/ev_windows.cc \ @@ -1991,7 +1988,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/iomgr/iomgr_posix.cc \ src/core/lib/iomgr/iomgr_posix_cfstream.cc \ src/core/lib/iomgr/iomgr_windows.cc \ - src/core/lib/iomgr/is_epollexclusive_available.cc \ src/core/lib/iomgr/load_file.cc \ src/core/lib/iomgr/lockfree_event.cc \ src/core/lib/iomgr/polling_entity.cc \ diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl index ba03a0aae25..c68fa7fbb8e 100644 --- a/bazel/grpc_build_system.bzl +++ b/bazel/grpc_build_system.bzl @@ -34,7 +34,7 @@ load("@build_bazel_rules_apple//apple:ios.bzl", "ios_unit_test") load("@build_bazel_rules_apple//apple/testing/default_runner:ios_test_runner.bzl", "ios_test_runner") # The set of pollers to test against if a test exercises polling -POLLERS = ["epollex", "epoll1", "poll"] +POLLERS = ["epoll1", "poll"] def if_not_windows(a): return select({ diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 696c15f8fe9..b7992335411 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -754,7 +754,6 @@ libs: - src/core/lib/iomgr/error_internal.h - src/core/lib/iomgr/ev_apple.h - src/core/lib/iomgr/ev_epoll1_linux.h - - src/core/lib/iomgr/ev_epollex_linux.h - src/core/lib/iomgr/ev_poll_posix.h - src/core/lib/iomgr/ev_posix.h - src/core/lib/iomgr/event_engine/closure.h @@ -773,7 +772,6 @@ libs: - src/core/lib/iomgr/iocp_windows.h - src/core/lib/iomgr/iomgr.h - src/core/lib/iomgr/iomgr_internal.h - - src/core/lib/iomgr/is_epollexclusive_available.h - src/core/lib/iomgr/load_file.h - src/core/lib/iomgr/lockfree_event.h - src/core/lib/iomgr/nameser.h @@ -797,7 +795,6 @@ libs: - src/core/lib/iomgr/socket_utils.h - src/core/lib/iomgr/socket_utils_posix.h - src/core/lib/iomgr/socket_windows.h - - src/core/lib/iomgr/sys_epoll_wrapper.h - src/core/lib/iomgr/tcp_client.h - src/core/lib/iomgr/tcp_client_posix.h - src/core/lib/iomgr/tcp_posix.h @@ -1412,7 +1409,6 @@ libs: - src/core/lib/iomgr/error_cfstream.cc - src/core/lib/iomgr/ev_apple.cc - src/core/lib/iomgr/ev_epoll1_linux.cc - - src/core/lib/iomgr/ev_epollex_linux.cc - src/core/lib/iomgr/ev_poll_posix.cc - src/core/lib/iomgr/ev_posix.cc - src/core/lib/iomgr/ev_windows.cc @@ -1442,7 +1438,6 @@ libs: - src/core/lib/iomgr/iomgr_posix.cc - src/core/lib/iomgr/iomgr_posix_cfstream.cc - src/core/lib/iomgr/iomgr_windows.cc - - src/core/lib/iomgr/is_epollexclusive_available.cc - src/core/lib/iomgr/load_file.cc - src/core/lib/iomgr/lockfree_event.cc - src/core/lib/iomgr/polling_entity.cc @@ -1935,7 +1930,6 @@ libs: - src/core/lib/iomgr/error_internal.h - src/core/lib/iomgr/ev_apple.h - src/core/lib/iomgr/ev_epoll1_linux.h - - src/core/lib/iomgr/ev_epollex_linux.h - src/core/lib/iomgr/ev_poll_posix.h - src/core/lib/iomgr/ev_posix.h - src/core/lib/iomgr/event_engine/closure.h @@ -1954,7 +1948,6 @@ libs: - src/core/lib/iomgr/iocp_windows.h - src/core/lib/iomgr/iomgr.h - src/core/lib/iomgr/iomgr_internal.h - - src/core/lib/iomgr/is_epollexclusive_available.h - src/core/lib/iomgr/load_file.h - src/core/lib/iomgr/lockfree_event.h - src/core/lib/iomgr/nameser.h @@ -1978,7 +1971,6 @@ libs: - src/core/lib/iomgr/socket_utils.h - src/core/lib/iomgr/socket_utils_posix.h - src/core/lib/iomgr/socket_windows.h - - src/core/lib/iomgr/sys_epoll_wrapper.h - src/core/lib/iomgr/tcp_client.h - src/core/lib/iomgr/tcp_client_posix.h - src/core/lib/iomgr/tcp_posix.h @@ -2249,7 +2241,6 @@ libs: - src/core/lib/iomgr/error_cfstream.cc - src/core/lib/iomgr/ev_apple.cc - src/core/lib/iomgr/ev_epoll1_linux.cc - - src/core/lib/iomgr/ev_epollex_linux.cc - src/core/lib/iomgr/ev_poll_posix.cc - src/core/lib/iomgr/ev_posix.cc - src/core/lib/iomgr/ev_windows.cc @@ -2279,7 +2270,6 @@ libs: - src/core/lib/iomgr/iomgr_posix.cc - src/core/lib/iomgr/iomgr_posix_cfstream.cc - src/core/lib/iomgr/iomgr_windows.cc - - src/core/lib/iomgr/is_epollexclusive_available.cc - src/core/lib/iomgr/load_file.cc - src/core/lib/iomgr/lockfree_event.cc - src/core/lib/iomgr/polling_entity.cc @@ -3490,18 +3480,6 @@ targets: deps: - grpc_test_util uses_polling: false -- name: ev_epollex_linux_test - build: test - language: c - headers: [] - src: - - test/core/iomgr/ev_epollex_linux_test.cc - deps: - - grpc_test_util - platforms: - - linux - - posix - - mac - name: fake_resolver_test build: test language: c diff --git a/build_handwritten.yaml b/build_handwritten.yaml index 7ef38e7935b..4be4dc1efa1 100644 --- a/build_handwritten.yaml +++ b/build_handwritten.yaml @@ -18,14 +18,6 @@ settings: protobuf_version: 3.19.4 version: 1.46.0-dev targets: -- name: check_epollexclusive - build: tool - language: c - src: - - test/build/check_epollexclusive.c - deps: - - grpc - - gpr - name: gen_hpack_tables build: tool language: c++ diff --git a/config.m4 b/config.m4 index fca3d6c8680..aa1a9f3aae4 100644 --- a/config.m4 +++ b/config.m4 @@ -526,7 +526,6 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/iomgr/error_cfstream.cc \ src/core/lib/iomgr/ev_apple.cc \ src/core/lib/iomgr/ev_epoll1_linux.cc \ - src/core/lib/iomgr/ev_epollex_linux.cc \ src/core/lib/iomgr/ev_poll_posix.cc \ src/core/lib/iomgr/ev_posix.cc \ src/core/lib/iomgr/ev_windows.cc \ @@ -556,7 +555,6 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/iomgr/iomgr_posix.cc \ src/core/lib/iomgr/iomgr_posix_cfstream.cc \ src/core/lib/iomgr/iomgr_windows.cc \ - src/core/lib/iomgr/is_epollexclusive_available.cc \ src/core/lib/iomgr/load_file.cc \ src/core/lib/iomgr/lockfree_event.cc \ src/core/lib/iomgr/polling_entity.cc \ diff --git a/config.w32 b/config.w32 index 05a623c7683..dfc72f7db81 100644 --- a/config.w32 +++ b/config.w32 @@ -492,7 +492,6 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\iomgr\\error_cfstream.cc " + "src\\core\\lib\\iomgr\\ev_apple.cc " + "src\\core\\lib\\iomgr\\ev_epoll1_linux.cc " + - "src\\core\\lib\\iomgr\\ev_epollex_linux.cc " + "src\\core\\lib\\iomgr\\ev_poll_posix.cc " + "src\\core\\lib\\iomgr\\ev_posix.cc " + "src\\core\\lib\\iomgr\\ev_windows.cc " + @@ -522,7 +521,6 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\iomgr\\iomgr_posix.cc " + "src\\core\\lib\\iomgr\\iomgr_posix_cfstream.cc " + "src\\core\\lib\\iomgr\\iomgr_windows.cc " + - "src\\core\\lib\\iomgr\\is_epollexclusive_available.cc " + "src\\core\\lib\\iomgr\\load_file.cc " + "src\\core\\lib\\iomgr\\lockfree_event.cc " + "src\\core\\lib\\iomgr\\polling_entity.cc " + diff --git a/doc/core/grpc-polling-engines.md b/doc/core/grpc-polling-engines.md index b7e36624da1..0a15e3312bb 100644 --- a/doc/core/grpc-polling-engines.md +++ b/doc/core/grpc-polling-engines.md @@ -20,8 +20,7 @@ There are multiple polling engine implementations depending on the OS and the OS - Linux: - - **`epollex`** (default but requires kernel version >= 4.5), - - `epoll1` (If `epollex` is not available and glibc version >= 2.9) + - `epoll1` (If glibc version >= 2.9) - `poll` (If kernel does not have epoll support) - Mac: **`poll`** (default) - Windows: (no name) @@ -120,33 +119,12 @@ Code at `src/core/lib/iomgr/ev_epoll1_posix.cc` - See [`begin_worker()`](https://github.com/grpc/grpc/blob/v1.15.1/src/core/lib/iomgr/ev_epoll1_linux.cc#L729) function to see how a designated poller is chosen. Similarly [`end_worker()`](https://github.com/grpc/grpc/blob/v1.15.1/src/core/lib/iomgr/ev_epoll1_linux.cc#L916) function is called by the worker that was just out of `epoll_wait()` and will have to choose a new designated poller) -### epollex - -![image](../images/grpc-epollex.png) - -Code at `src/core/lib/iomgr/ev_epollex_posix.cc` - -- FDs are added to multiple epollsets with EPOLLEXCLUSIVE flag. This prevents multiple worker threads from waking up from polling whenever the fd is readable/writable - -- A few observations: - - - If multiple pollsets are pointing to the same `Pollable`, then the `pollable` MUST be either empty or of type `PO_FD` (i.e single-fd) - - A multi-pollable has one-and-only-one incoming link from a pollset - - The same FD can be in multiple `Pollable`s (even if one of the `Pollable`s is of type PO_FD) - - There cannot be two `Pollable`s of type PO_FD for the same fd - -- Why do we need `Pollable` of type PO_FD and PO_EMPTY ? - - The main reason is the Sync client API - - We create one new completion queue per call. If we didn’t have PO_EMPTY and PO_FD type pollables, then every call on a given channel will effectively have to create a `Pollable` and hence an epollset. This is because every completion queue automatically creates a pollset and the channel fd will have to be put in that pollset. This clearly requires an epollset to put that fd. Creating an epollset per call (even if we delete the epollset once the call is completed) would mean a lot of sys calls to create/delete epoll fds. This is clearly not a good idea. - - With these new types of `Pollable`s, all pollsets (corresponding to the new per-call completion queue) will initially point to PO_EMPTY global epollset. Then once the channel fd is added to the pollset, the pollset will point to the `Pollable` of type PO_FD containing just that fd (i.e it will reuse the existing `Pollable`). This way, the epoll fd creation/deletion churn is avoided. - - ### Other polling engine implementations (poll and windows polling engine) - **poll** polling engine: gRPC's `poll` polling engine is quite complicated. It uses the `poll()` function to do the polling (and hence it is for platforms like osx where epoll is not available) - The implementation is further complicated by the fact that poll() is level triggered (just keep this in mind in case you wonder why the code at `src/core/lib/iomgr/ev_poll_posix.cc` is written a certain/seemingly complicated way :)) - **Polling engine on Windows**: Windows polling engine looks nothing like other polling engines - - Unlike the grpc polling engines for Unix systems (epollex, epoll1 and poll) Windows endpoint implementation and polling engine implementations are very closely tied together + - Unlike the grpc polling engines for Unix systems (epoll1 and poll) Windows endpoint implementation and polling engine implementations are very closely tied together - Windows endpoint read/write API implementations use the Windows IO API which require specifying an [I/O completion port](https://docs.microsoft.com/en-us/windows/desktop/fileio/i-o-completion-ports) - - In Windows polling engine’s grpc_pollset_work() implementation, ONE of the threads is chosen to wait on the I/O completion port while other threads wait on a condition variable (much like the turnstile polling in epollex/epoll1) + - In Windows polling engine’s grpc_pollset_work() implementation, ONE of the threads is chosen to wait on the I/O completion port while other threads wait on a condition variable (much like the turnstile polling in epoll1) diff --git a/doc/environment_variables.md b/doc/environment_variables.md index 66315191ebd..ebf4f9aa45c 100644 --- a/doc/environment_variables.md +++ b/doc/environment_variables.md @@ -106,8 +106,6 @@ some configuration as environment variables that can be set. - call_combiner - traces call combiner state - closure - tracks closure creation, scheduling, and completion - fd_trace - traces fd create(), shutdown() and close() calls for channel fds. - Also traces epoll fd create()/close() calls in epollex polling engine - traces epoll-fd creation/close calls for epollex polling engine - pending_tags - traces still-in-progress tags on completion queues - polling - traces the selected polling engine - polling_api - traces the api calls to polling engine diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 44ca71950ab..083a2998934 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -721,7 +721,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/error_internal.h', 'src/core/lib/iomgr/ev_apple.h', 'src/core/lib/iomgr/ev_epoll1_linux.h', - 'src/core/lib/iomgr/ev_epollex_linux.h', 'src/core/lib/iomgr/ev_poll_posix.h', 'src/core/lib/iomgr/ev_posix.h', 'src/core/lib/iomgr/event_engine/closure.h', @@ -740,7 +739,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/iocp_windows.h', 'src/core/lib/iomgr/iomgr.h', 'src/core/lib/iomgr/iomgr_internal.h', - 'src/core/lib/iomgr/is_epollexclusive_available.h', 'src/core/lib/iomgr/load_file.h', 'src/core/lib/iomgr/lockfree_event.h', 'src/core/lib/iomgr/nameser.h', @@ -764,7 +762,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/socket_utils.h', 'src/core/lib/iomgr/socket_utils_posix.h', 'src/core/lib/iomgr/socket_windows.h', - 'src/core/lib/iomgr/sys_epoll_wrapper.h', 'src/core/lib/iomgr/tcp_client.h', 'src/core/lib/iomgr/tcp_client_posix.h', 'src/core/lib/iomgr/tcp_posix.h', @@ -1529,7 +1526,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/error_internal.h', 'src/core/lib/iomgr/ev_apple.h', 'src/core/lib/iomgr/ev_epoll1_linux.h', - 'src/core/lib/iomgr/ev_epollex_linux.h', 'src/core/lib/iomgr/ev_poll_posix.h', 'src/core/lib/iomgr/ev_posix.h', 'src/core/lib/iomgr/event_engine/closure.h', @@ -1548,7 +1544,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/iocp_windows.h', 'src/core/lib/iomgr/iomgr.h', 'src/core/lib/iomgr/iomgr_internal.h', - 'src/core/lib/iomgr/is_epollexclusive_available.h', 'src/core/lib/iomgr/load_file.h', 'src/core/lib/iomgr/lockfree_event.h', 'src/core/lib/iomgr/nameser.h', @@ -1572,7 +1567,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/socket_utils.h', 'src/core/lib/iomgr/socket_utils_posix.h', 'src/core/lib/iomgr/socket_windows.h', - 'src/core/lib/iomgr/sys_epoll_wrapper.h', 'src/core/lib/iomgr/tcp_client.h', 'src/core/lib/iomgr/tcp_client_posix.h', 'src/core/lib/iomgr/tcp_posix.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 31f545ac16e..1b106b25d7e 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -1146,8 +1146,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/ev_apple.h', 'src/core/lib/iomgr/ev_epoll1_linux.cc', 'src/core/lib/iomgr/ev_epoll1_linux.h', - 'src/core/lib/iomgr/ev_epollex_linux.cc', - 'src/core/lib/iomgr/ev_epollex_linux.h', 'src/core/lib/iomgr/ev_poll_posix.cc', 'src/core/lib/iomgr/ev_poll_posix.h', 'src/core/lib/iomgr/ev_posix.cc', @@ -1195,8 +1193,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/iomgr_posix.cc', 'src/core/lib/iomgr/iomgr_posix_cfstream.cc', 'src/core/lib/iomgr/iomgr_windows.cc', - 'src/core/lib/iomgr/is_epollexclusive_available.cc', - 'src/core/lib/iomgr/is_epollexclusive_available.h', 'src/core/lib/iomgr/load_file.cc', 'src/core/lib/iomgr/load_file.h', 'src/core/lib/iomgr/lockfree_event.cc', @@ -1238,7 +1234,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/socket_utils_windows.cc', 'src/core/lib/iomgr/socket_windows.cc', 'src/core/lib/iomgr/socket_windows.h', - 'src/core/lib/iomgr/sys_epoll_wrapper.h', 'src/core/lib/iomgr/tcp_client.cc', 'src/core/lib/iomgr/tcp_client.h', 'src/core/lib/iomgr/tcp_client_cfstream.cc', @@ -2129,7 +2124,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/error_internal.h', 'src/core/lib/iomgr/ev_apple.h', 'src/core/lib/iomgr/ev_epoll1_linux.h', - 'src/core/lib/iomgr/ev_epollex_linux.h', 'src/core/lib/iomgr/ev_poll_posix.h', 'src/core/lib/iomgr/ev_posix.h', 'src/core/lib/iomgr/event_engine/closure.h', @@ -2148,7 +2142,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/iocp_windows.h', 'src/core/lib/iomgr/iomgr.h', 'src/core/lib/iomgr/iomgr_internal.h', - 'src/core/lib/iomgr/is_epollexclusive_available.h', 'src/core/lib/iomgr/load_file.h', 'src/core/lib/iomgr/lockfree_event.h', 'src/core/lib/iomgr/nameser.h', @@ -2172,7 +2165,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/socket_utils.h', 'src/core/lib/iomgr/socket_utils_posix.h', 'src/core/lib/iomgr/socket_windows.h', - 'src/core/lib/iomgr/sys_epoll_wrapper.h', 'src/core/lib/iomgr/tcp_client.h', 'src/core/lib/iomgr/tcp_client_posix.h', 'src/core/lib/iomgr/tcp_posix.h', diff --git a/grpc.gemspec b/grpc.gemspec index dba96700158..8a56c3841a0 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -1065,8 +1065,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/iomgr/ev_apple.h ) s.files += %w( src/core/lib/iomgr/ev_epoll1_linux.cc ) s.files += %w( src/core/lib/iomgr/ev_epoll1_linux.h ) - s.files += %w( src/core/lib/iomgr/ev_epollex_linux.cc ) - s.files += %w( src/core/lib/iomgr/ev_epollex_linux.h ) s.files += %w( src/core/lib/iomgr/ev_poll_posix.cc ) s.files += %w( src/core/lib/iomgr/ev_poll_posix.h ) s.files += %w( src/core/lib/iomgr/ev_posix.cc ) @@ -1114,8 +1112,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/iomgr/iomgr_posix.cc ) s.files += %w( src/core/lib/iomgr/iomgr_posix_cfstream.cc ) s.files += %w( src/core/lib/iomgr/iomgr_windows.cc ) - s.files += %w( src/core/lib/iomgr/is_epollexclusive_available.cc ) - s.files += %w( src/core/lib/iomgr/is_epollexclusive_available.h ) s.files += %w( src/core/lib/iomgr/load_file.cc ) s.files += %w( src/core/lib/iomgr/load_file.h ) s.files += %w( src/core/lib/iomgr/lockfree_event.cc ) @@ -1157,7 +1153,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/iomgr/socket_utils_windows.cc ) s.files += %w( src/core/lib/iomgr/socket_windows.cc ) s.files += %w( src/core/lib/iomgr/socket_windows.h ) - s.files += %w( src/core/lib/iomgr/sys_epoll_wrapper.h ) s.files += %w( src/core/lib/iomgr/tcp_client.cc ) s.files += %w( src/core/lib/iomgr/tcp_client.h ) s.files += %w( src/core/lib/iomgr/tcp_client_cfstream.cc ) diff --git a/grpc.gyp b/grpc.gyp index c536ec2d543..ca719c20de5 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -814,7 +814,6 @@ 'src/core/lib/iomgr/error_cfstream.cc', 'src/core/lib/iomgr/ev_apple.cc', 'src/core/lib/iomgr/ev_epoll1_linux.cc', - 'src/core/lib/iomgr/ev_epollex_linux.cc', 'src/core/lib/iomgr/ev_poll_posix.cc', 'src/core/lib/iomgr/ev_posix.cc', 'src/core/lib/iomgr/ev_windows.cc', @@ -844,7 +843,6 @@ 'src/core/lib/iomgr/iomgr_posix.cc', 'src/core/lib/iomgr/iomgr_posix_cfstream.cc', 'src/core/lib/iomgr/iomgr_windows.cc', - 'src/core/lib/iomgr/is_epollexclusive_available.cc', 'src/core/lib/iomgr/load_file.cc', 'src/core/lib/iomgr/lockfree_event.cc', 'src/core/lib/iomgr/polling_entity.cc', @@ -1280,7 +1278,6 @@ 'src/core/lib/iomgr/error_cfstream.cc', 'src/core/lib/iomgr/ev_apple.cc', 'src/core/lib/iomgr/ev_epoll1_linux.cc', - 'src/core/lib/iomgr/ev_epollex_linux.cc', 'src/core/lib/iomgr/ev_poll_posix.cc', 'src/core/lib/iomgr/ev_posix.cc', 'src/core/lib/iomgr/ev_windows.cc', @@ -1310,7 +1307,6 @@ 'src/core/lib/iomgr/iomgr_posix.cc', 'src/core/lib/iomgr/iomgr_posix_cfstream.cc', 'src/core/lib/iomgr/iomgr_windows.cc', - 'src/core/lib/iomgr/is_epollexclusive_available.cc', 'src/core/lib/iomgr/load_file.cc', 'src/core/lib/iomgr/lockfree_event.cc', 'src/core/lib/iomgr/polling_entity.cc', diff --git a/package.xml b/package.xml index 153b2c3097b..f7c2e8ff347 100644 --- a/package.xml +++ b/package.xml @@ -1045,8 +1045,6 @@ - - @@ -1094,8 +1092,6 @@ - - @@ -1137,7 +1133,6 @@ - diff --git a/src/core/lib/debug/stats_data.cc b/src/core/lib/debug/stats_data.cc index 21e27f2b7ff..1ffe8a83f13 100644 --- a/src/core/lib/debug/stats_data.cc +++ b/src/core/lib/debug/stats_data.cc @@ -41,8 +41,6 @@ const char* grpc_stats_counter_name[GRPC_STATS_COUNTER_COUNT] = { "pollset_kick_wakeup_fd", "pollset_kick_wakeup_cv", "pollset_kick_own_thread", - "syscall_epoll_ctl", - "pollset_fd_cache_hits", "histogram_slow_lookups", "syscall_write", "syscall_read", @@ -147,9 +145,6 @@ const char* grpc_stats_counter_doc[GRPC_STATS_COUNTER_COUNT] = { "polling wakeup (only valid for epoll1 right now)", "How many times could a polling wakeup be satisfied by keeping the waking " "thread awake? (only valid for epoll1 right now)", - "Number of epoll_ctl calls made (only valid for epollex right now)", - "Number of epoll_ctl calls skipped because the fd was cached as already " - "being added. (only valid for epollex right now)", "Number of times histogram increments went through the slow (binary " "search) path", "Number of write syscalls (or equivalent - eg sendmsg) made by this " @@ -281,7 +276,6 @@ const char* grpc_stats_histogram_doc[GRPC_STATS_HISTOGRAM_COUNT] = { "Number of streams whose payload was written per TCP write", "Number of streams terminated per TCP write", "Number of flow control updates written per TCP write", - // NOLINTNEXTLINE(bugprone-suspicious-missing-comma) "How many completion queues were checked looking for a CQ that had " "requested the incoming call", }; diff --git a/src/core/lib/debug/stats_data.h b/src/core/lib/debug/stats_data.h index 61c3d103f48..41eb8efb695 100644 --- a/src/core/lib/debug/stats_data.h +++ b/src/core/lib/debug/stats_data.h @@ -42,8 +42,6 @@ typedef enum { GRPC_STATS_COUNTER_POLLSET_KICK_WAKEUP_FD, GRPC_STATS_COUNTER_POLLSET_KICK_WAKEUP_CV, GRPC_STATS_COUNTER_POLLSET_KICK_OWN_THREAD, - GRPC_STATS_COUNTER_SYSCALL_EPOLL_CTL, - GRPC_STATS_COUNTER_POLLSET_FD_CACHE_HITS, GRPC_STATS_COUNTER_HISTOGRAM_SLOW_LOOKUPS, GRPC_STATS_COUNTER_SYSCALL_WRITE, GRPC_STATS_COUNTER_SYSCALL_READ, @@ -206,10 +204,6 @@ typedef enum { GRPC_STATS_INC_COUNTER(GRPC_STATS_COUNTER_POLLSET_KICK_WAKEUP_CV) #define GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD() \ GRPC_STATS_INC_COUNTER(GRPC_STATS_COUNTER_POLLSET_KICK_OWN_THREAD) -#define GRPC_STATS_INC_SYSCALL_EPOLL_CTL() \ - GRPC_STATS_INC_COUNTER(GRPC_STATS_COUNTER_SYSCALL_EPOLL_CTL) -#define GRPC_STATS_INC_POLLSET_FD_CACHE_HITS() \ - GRPC_STATS_INC_COUNTER(GRPC_STATS_COUNTER_POLLSET_FD_CACHE_HITS) #define GRPC_STATS_INC_HISTOGRAM_SLOW_LOOKUPS() \ GRPC_STATS_INC_COUNTER(GRPC_STATS_COUNTER_HISTOGRAM_SLOW_LOOKUPS) #define GRPC_STATS_INC_SYSCALL_WRITE() \ @@ -398,43 +392,43 @@ typedef enum { GRPC_STATS_INC_COUNTER(GRPC_STATS_COUNTER_CQ_EV_QUEUE_TRANSIENT_POP_FAILURES) #define GRPC_STATS_INC_CALL_INITIAL_SIZE(value) \ grpc_stats_inc_call_initial_size((int)(value)) -void grpc_stats_inc_call_initial_size(int value); +void grpc_stats_inc_call_initial_size(int x); #define GRPC_STATS_INC_POLL_EVENTS_RETURNED(value) \ grpc_stats_inc_poll_events_returned((int)(value)) -void grpc_stats_inc_poll_events_returned(int value); +void grpc_stats_inc_poll_events_returned(int x); #define GRPC_STATS_INC_TCP_WRITE_SIZE(value) \ grpc_stats_inc_tcp_write_size((int)(value)) -void grpc_stats_inc_tcp_write_size(int value); +void grpc_stats_inc_tcp_write_size(int x); #define GRPC_STATS_INC_TCP_WRITE_IOV_SIZE(value) \ grpc_stats_inc_tcp_write_iov_size((int)(value)) -void grpc_stats_inc_tcp_write_iov_size(int value); +void grpc_stats_inc_tcp_write_iov_size(int x); #define GRPC_STATS_INC_TCP_READ_SIZE(value) \ grpc_stats_inc_tcp_read_size((int)(value)) -void grpc_stats_inc_tcp_read_size(int value); +void grpc_stats_inc_tcp_read_size(int x); #define GRPC_STATS_INC_TCP_READ_OFFER(value) \ grpc_stats_inc_tcp_read_offer((int)(value)) -void grpc_stats_inc_tcp_read_offer(int value); +void grpc_stats_inc_tcp_read_offer(int x); #define GRPC_STATS_INC_TCP_READ_OFFER_IOV_SIZE(value) \ grpc_stats_inc_tcp_read_offer_iov_size((int)(value)) -void grpc_stats_inc_tcp_read_offer_iov_size(int value); +void grpc_stats_inc_tcp_read_offer_iov_size(int x); #define GRPC_STATS_INC_HTTP2_SEND_MESSAGE_SIZE(value) \ grpc_stats_inc_http2_send_message_size((int)(value)) -void grpc_stats_inc_http2_send_message_size(int value); +void grpc_stats_inc_http2_send_message_size(int x); #define GRPC_STATS_INC_HTTP2_SEND_INITIAL_METADATA_PER_WRITE(value) \ grpc_stats_inc_http2_send_initial_metadata_per_write((int)(value)) -void grpc_stats_inc_http2_send_initial_metadata_per_write(int value); +void grpc_stats_inc_http2_send_initial_metadata_per_write(int x); #define GRPC_STATS_INC_HTTP2_SEND_MESSAGE_PER_WRITE(value) \ grpc_stats_inc_http2_send_message_per_write((int)(value)) -void grpc_stats_inc_http2_send_message_per_write(int value); +void grpc_stats_inc_http2_send_message_per_write(int x); #define GRPC_STATS_INC_HTTP2_SEND_TRAILING_METADATA_PER_WRITE(value) \ grpc_stats_inc_http2_send_trailing_metadata_per_write((int)(value)) -void grpc_stats_inc_http2_send_trailing_metadata_per_write(int value); +void grpc_stats_inc_http2_send_trailing_metadata_per_write(int x); #define GRPC_STATS_INC_HTTP2_SEND_FLOWCTL_PER_WRITE(value) \ grpc_stats_inc_http2_send_flowctl_per_write((int)(value)) -void grpc_stats_inc_http2_send_flowctl_per_write(int value); +void grpc_stats_inc_http2_send_flowctl_per_write(int x); #define GRPC_STATS_INC_SERVER_CQS_CHECKED(value) \ grpc_stats_inc_server_cqs_checked((int)(value)) -void grpc_stats_inc_server_cqs_checked(int value); +void grpc_stats_inc_server_cqs_checked(int x); #else #define GRPC_STATS_INC_CLIENT_CALLS_CREATED() #define GRPC_STATS_INC_SERVER_CALLS_CREATED() @@ -450,8 +444,6 @@ void grpc_stats_inc_server_cqs_checked(int value); #define GRPC_STATS_INC_POLLSET_KICK_WAKEUP_FD() #define GRPC_STATS_INC_POLLSET_KICK_WAKEUP_CV() #define GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD() -#define GRPC_STATS_INC_SYSCALL_EPOLL_CTL() -#define GRPC_STATS_INC_POLLSET_FD_CACHE_HITS() #define GRPC_STATS_INC_HISTOGRAM_SLOW_LOOKUPS() #define GRPC_STATS_INC_SYSCALL_WRITE() #define GRPC_STATS_INC_SYSCALL_READ() diff --git a/src/core/lib/debug/stats_data.yaml b/src/core/lib/debug/stats_data.yaml index 775b09df740..af4553028e3 100644 --- a/src/core/lib/debug/stats_data.yaml +++ b/src/core/lib/debug/stats_data.yaml @@ -63,12 +63,6 @@ doc: How many times could a polling wakeup be satisfied by keeping the waking thread awake? (only valid for epoll1 right now) -# polling -- counter: syscall_epoll_ctl - doc: Number of epoll_ctl calls made (only valid for epollex right now) -- counter: pollset_fd_cache_hits - doc: Number of epoll_ctl calls skipped because the fd was cached as - already being added. (only valid for epollex right now) # stats system - counter: histogram_slow_lookups doc: Number of times histogram increments went through the slow diff --git a/src/core/lib/debug/stats_data_bq_schema.sql b/src/core/lib/debug/stats_data_bq_schema.sql index 7d1ab1dae9b..04b6d471f63 100644 --- a/src/core/lib/debug/stats_data_bq_schema.sql +++ b/src/core/lib/debug/stats_data_bq_schema.sql @@ -12,8 +12,6 @@ pollset_kicked_again_per_iteration:FLOAT, pollset_kick_wakeup_fd_per_iteration:FLOAT, pollset_kick_wakeup_cv_per_iteration:FLOAT, pollset_kick_own_thread_per_iteration:FLOAT, -syscall_epoll_ctl_per_iteration:FLOAT, -pollset_fd_cache_hits_per_iteration:FLOAT, histogram_slow_lookups_per_iteration:FLOAT, syscall_write_per_iteration:FLOAT, syscall_read_per_iteration:FLOAT, diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc deleted file mode 100644 index 630daf133a7..00000000000 --- a/src/core/lib/iomgr/ev_epollex_linux.cc +++ /dev/null @@ -1,1657 +0,0 @@ -/* - * - * Copyright 2017 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include - -#include - -#include "src/core/lib/iomgr/port.h" - -/* This polling engine is only relevant on linux kernels supporting epoll() */ -#ifdef GRPC_LINUX_EPOLL_CREATE1 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "absl/container/inlined_vector.h" -#include "absl/strings/str_cat.h" -#include "absl/strings/str_format.h" - -#include - -#include "src/core/lib/debug/stats.h" -#include "src/core/lib/gpr/spinlock.h" -#include "src/core/lib/gpr/tls.h" -#include "src/core/lib/gpr/useful.h" -#include "src/core/lib/gprpp/manual_constructor.h" -#include "src/core/lib/gprpp/ref_counted.h" -#include "src/core/lib/gprpp/sync.h" -#include "src/core/lib/iomgr/block_annotate.h" -#include "src/core/lib/iomgr/ev_epollex_linux.h" -#include "src/core/lib/iomgr/iomgr_internal.h" -#include "src/core/lib/iomgr/is_epollexclusive_available.h" -#include "src/core/lib/iomgr/lockfree_event.h" -#include "src/core/lib/iomgr/sys_epoll_wrapper.h" -#include "src/core/lib/iomgr/timer.h" -#include "src/core/lib/iomgr/wakeup_fd_posix.h" -#include "src/core/lib/profiling/timers.h" - -// debug aid: create workers on the heap (allows asan to spot -// use-after-destruction) -//#define GRPC_EPOLLEX_CREATE_WORKERS_ON_HEAP 1 - -#define MAX_EPOLL_EVENTS 100 -#define MAX_FDS_IN_CACHE 32 - -grpc_core::DebugOnlyTraceFlag grpc_trace_pollable_refcount(false, - "pollable_refcount"); - -/******************************************************************************* - * pollable Declarations - */ - -typedef enum { PO_MULTI, PO_FD, PO_EMPTY } pollable_type; - -typedef struct pollable pollable; - -/// A pollable is something that can be polled: it has an epoll set to poll on, -/// and a wakeup fd for kicks -/// There are three broad types: -/// - PO_EMPTY - the empty pollable, used before file descriptors are added to -/// a pollset -/// - PO_FD - a pollable containing only one FD - used to optimize single-fd -/// pollsets (which are common with synchronous api usage) -/// - PO_MULTI - a pollable containing many fds -struct pollable { - pollable_type type; // immutable - grpc_core::RefCount refs; - - int epfd; - grpc_wakeup_fd wakeup; - - // The following are relevant only for type PO_FD - grpc_fd* owner_fd; // Set to the owner_fd if the type is PO_FD - gpr_mu owner_orphan_mu; // Synchronizes access to owner_orphaned field - bool owner_orphaned; // Is the owner fd orphaned - - grpc_pollset_set* pollset_set; - pollable* next; - pollable* prev; - - gpr_mu mu; - grpc_pollset_worker* root_worker; - - int event_cursor; - int event_count; - struct epoll_event events[MAX_EPOLL_EVENTS]; -}; - -static const char* pollable_type_string(pollable_type t) { - switch (t) { - case PO_MULTI: - return "pollset"; - case PO_FD: - return "fd"; - case PO_EMPTY: - return "empty"; - } - return ""; -} - -static std::string pollable_desc(pollable* p) { - return absl::StrFormat("type=%s epfd=%d wakeup=%d", - pollable_type_string(p->type), p->epfd, - p->wakeup.read_fd); -} - -/// Shared empty pollable - used by pollset to poll on until the first fd is -/// added -static pollable* g_empty_pollable; - -static grpc_error_handle pollable_create(pollable_type type, pollable** p); -static pollable* pollable_ref(pollable* p, - const grpc_core::DebugLocation& dbg_loc, - const char* reason) { - p->refs.Ref(dbg_loc, reason); - return p; -} -static void pollable_unref(pollable* p, const grpc_core::DebugLocation& dbg_loc, - const char* reason) { - if (p == nullptr) return; - if (GPR_UNLIKELY(p != nullptr && p->refs.Unref(dbg_loc, reason))) { - GRPC_FD_TRACE("pollable_unref: Closing epfd: %d", p->epfd); - close(p->epfd); - grpc_wakeup_fd_destroy(&p->wakeup); - gpr_mu_destroy(&p->owner_orphan_mu); - gpr_mu_destroy(&p->mu); - gpr_free(p); - } -} -#define POLLABLE_REF(p, r) pollable_ref((p), DEBUG_LOCATION, (r)) -#define POLLABLE_UNREF(p, r) pollable_unref((p), DEBUG_LOCATION, (r)) - -/******************************************************************************* - * Fd Declarations - */ - -struct grpc_fd { - grpc_fd(int fd, const char* name, bool track_err) - : fd(fd), track_err(track_err) { - gpr_mu_init(&orphan_mu); - gpr_mu_init(&pollable_mu); - read_closure.InitEvent(); - write_closure.InitEvent(); - error_closure.InitEvent(); - - std::string fd_name = absl::StrCat(name, " fd=", fd); - grpc_iomgr_register_object(&iomgr_object, fd_name.c_str()); -#ifndef NDEBUG - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_fd_refcount)) { - gpr_log(GPR_DEBUG, "FD %d %p create %s", fd, this, fd_name.c_str()); - } -#endif - } - - // This is really the dtor, but the poller threads waking up from - // epoll_wait() may access the (read|write|error)_closure after destruction. - // Since the object will be added to the free pool, this behavior is - // not going to cause issues, except spurious events if the FD is reused - // while the race happens. - void destroy() { - grpc_iomgr_unregister_object(&iomgr_object); - - POLLABLE_UNREF(pollable_obj, "fd_pollable"); - - // To clear out the allocations of pollset_fds, we need to swap its - // contents with a newly-constructed (and soon to be destructed) local - // variable of its same type. This is because InlinedVector::clear is _not_ - // guaranteed to actually free up allocations and this is important since - // this object doesn't have a conventional destructor. - absl::InlinedVector pollset_fds_tmp; - pollset_fds_tmp.swap(pollset_fds); - - gpr_mu_destroy(&pollable_mu); - gpr_mu_destroy(&orphan_mu); - - read_closure.DestroyEvent(); - write_closure.DestroyEvent(); - error_closure.DestroyEvent(); - - invalidate(); - } - -#ifndef NDEBUG - /* Since an fd is never really destroyed (i.e gpr_free() is not called), it is - * hard-to-debug cases where fd fields are accessed even after calling - * fd_destroy(). The following invalidates fd fields to make catching such - * errors easier */ - void invalidate() { - fd = -1; - gpr_atm_no_barrier_store(&refst, -1); - memset(&orphan_mu, -1, sizeof(orphan_mu)); - memset(&pollable_mu, -1, sizeof(pollable_mu)); - pollable_obj = nullptr; - on_done_closure = nullptr; - memset(&iomgr_object, -1, sizeof(iomgr_object)); - track_err = false; - } -#else - void invalidate() {} -#endif - - int fd; - - // refst format: - // bit 0 : 1=Active / 0=Orphaned - // bits 1-n : refcount - // Ref/Unref by two to avoid altering the orphaned bit - gpr_atm refst = 1; - - gpr_mu orphan_mu; - - // Protects pollable_obj and pollset_fds. - gpr_mu pollable_mu; - absl::InlinedVector pollset_fds; // Used in PO_MULTI. - pollable* pollable_obj = nullptr; // Used in PO_FD. - - grpc_core::LockfreeEvent read_closure; - grpc_core::LockfreeEvent write_closure; - grpc_core::LockfreeEvent error_closure; - - struct grpc_fd* freelist_next = nullptr; - grpc_closure* on_done_closure = nullptr; - - grpc_iomgr_object iomgr_object; - - // Do we need to track EPOLLERR events separately? - bool track_err; -}; - -static void fd_global_init(void); -static void fd_global_shutdown(void); - -/******************************************************************************* - * Pollset Declarations - */ - -struct pwlink { - grpc_pollset_worker* next; - grpc_pollset_worker* prev; -}; -typedef enum { PWLINK_POLLABLE = 0, PWLINK_POLLSET, PWLINK_COUNT } pwlinks; - -struct grpc_pollset_worker { - bool kicked; - bool initialized_cv; -#ifndef NDEBUG - // debug aid: which thread started this worker - pid_t originator; -#endif - gpr_cv cv; - grpc_pollset* pollset; - pollable* pollable_obj; - - pwlink links[PWLINK_COUNT]; -}; - -struct grpc_pollset { - gpr_mu mu; - gpr_atm worker_count; - gpr_atm active_pollable_type; - pollable* active_pollable; - bool kicked_without_poller; - grpc_closure* shutdown_closure; - bool already_shutdown; - grpc_pollset_worker* root_worker; - int containing_pollset_set_count; -}; - -/******************************************************************************* - * Pollset-set Declarations - */ - -struct grpc_pollset_set { - grpc_core::RefCount refs; - gpr_mu mu; - grpc_pollset_set* parent; - - size_t pollset_count; - size_t pollset_capacity; - grpc_pollset** pollsets; - - size_t fd_count; - size_t fd_capacity; - grpc_fd** fds; -}; - -/******************************************************************************* - * Common helpers - */ - -static bool append_error(grpc_error_handle* composite, grpc_error_handle error, - const char* desc) { - if (error == GRPC_ERROR_NONE) return true; - if (*composite == GRPC_ERROR_NONE) { - *composite = GRPC_ERROR_CREATE_FROM_COPIED_STRING(desc); - } - *composite = grpc_error_add_child(*composite, error); - return false; -} - -/******************************************************************************* - * Fd Definitions - */ - -/* We need to keep a freelist not because of any concerns of malloc performance - * but instead so that implementations with multiple threads in (for example) - * epoll_wait deal with the race between pollset removal and incoming poll - * notifications. - * - * The problem is that the poller ultimately holds a reference to this - * object, so it is very difficult to know when is safe to free it, at least - * without some expensive synchronization. - * - * If we keep the object freelisted, in the worst case losing this race just - * becomes a spurious read notification on a reused fd. - */ - -static grpc_fd* fd_freelist = nullptr; -static gpr_mu fd_freelist_mu; - -#ifndef NDEBUG -#define REF_BY(fd, n, reason) ref_by(fd, n, reason, __FILE__, __LINE__) -#define UNREF_BY(fd, n, reason) unref_by(fd, n, reason, __FILE__, __LINE__) -static void ref_by(grpc_fd* fd, int n, const char* reason, const char* file, - int line) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_fd_refcount)) { - gpr_log(GPR_DEBUG, - "FD %d %p ref %d %" PRIdPTR " -> %" PRIdPTR " [%s; %s:%d]", - fd->fd, fd, n, gpr_atm_no_barrier_load(&fd->refst), - gpr_atm_no_barrier_load(&fd->refst) + n, reason, file, line); - } -#else -#define REF_BY(fd, n, reason) \ - do { \ - ref_by(fd, n); \ - (void)(reason); \ - } while (0) -#define UNREF_BY(fd, n, reason) \ - do { \ - unref_by(fd, n); \ - (void)(reason); \ - } while (0) -static void ref_by(grpc_fd* fd, int n) { -#endif - GPR_ASSERT(gpr_atm_no_barrier_fetch_add(&fd->refst, n) > 0); -} - -/* Uninitialize and add to the freelist */ -static void fd_destroy(void* arg, grpc_error_handle /*error*/) { - grpc_fd* fd = static_cast(arg); - fd->destroy(); - - /* Add the fd to the freelist */ - gpr_mu_lock(&fd_freelist_mu); - fd->freelist_next = fd_freelist; - fd_freelist = fd; - gpr_mu_unlock(&fd_freelist_mu); -} - -#ifndef NDEBUG -static void unref_by(grpc_fd* fd, int n, const char* reason, const char* file, - int line) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_fd_refcount)) { - gpr_log(GPR_DEBUG, - "FD %d %p unref %d %" PRIdPTR " -> %" PRIdPTR " [%s; %s:%d]", - fd->fd, fd, n, gpr_atm_no_barrier_load(&fd->refst), - gpr_atm_no_barrier_load(&fd->refst) - n, reason, file, line); - } -#else -static void unref_by(grpc_fd* fd, int n) { -#endif - gpr_atm old = gpr_atm_full_fetch_add(&fd->refst, -n); - if (old == n) { - grpc_core::ExecCtx::Run( - DEBUG_LOCATION, - GRPC_CLOSURE_CREATE(fd_destroy, fd, grpc_schedule_on_exec_ctx), - GRPC_ERROR_NONE); - } else { - GPR_ASSERT(old > n); - } -} - -static void fd_global_init(void) { gpr_mu_init(&fd_freelist_mu); } - -static void fd_global_shutdown(void) { - // TODO(guantaol): We don't have a reasonable explanation about this - // lock()/unlock() pattern. It can be a valid barrier if there is at most one - // pending lock() at this point. Otherwise, there is still a possibility of - // use-after-free race. Need to reason about the code and/or clean it up. - gpr_mu_lock(&fd_freelist_mu); - gpr_mu_unlock(&fd_freelist_mu); - while (fd_freelist != nullptr) { - grpc_fd* fd = fd_freelist; - fd_freelist = fd_freelist->freelist_next; - gpr_free(fd); - } - gpr_mu_destroy(&fd_freelist_mu); -} - -static grpc_fd* fd_create(int fd, const char* name, bool track_err) { - grpc_fd* new_fd = nullptr; - - gpr_mu_lock(&fd_freelist_mu); - if (fd_freelist != nullptr) { - new_fd = fd_freelist; - fd_freelist = fd_freelist->freelist_next; - } - gpr_mu_unlock(&fd_freelist_mu); - - if (new_fd == nullptr) { - new_fd = static_cast(gpr_malloc(sizeof(grpc_fd))); - } - - return new (new_fd) grpc_fd(fd, name, track_err); -} - -static int fd_wrapped_fd(grpc_fd* fd) { - int ret_fd = fd->fd; - return (gpr_atm_acq_load(&fd->refst) & 1) ? ret_fd : -1; -} - -static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd, - const char* reason) { - bool is_fd_closed = false; - - gpr_mu_lock(&fd->orphan_mu); - - // Get the fd->pollable_obj and set the owner_orphaned on that pollable to - // true so that the pollable will no longer access its owner_fd field. - gpr_mu_lock(&fd->pollable_mu); - pollable* pollable_obj = fd->pollable_obj; - - if (pollable_obj) { - gpr_mu_lock(&pollable_obj->owner_orphan_mu); - pollable_obj->owner_orphaned = true; - } - - fd->on_done_closure = on_done; - - /* If release_fd is not NULL, we should be relinquishing control of the file - descriptor fd->fd (but we still own the grpc_fd structure). */ - if (release_fd != nullptr) { - // Remove the FD from all epolls sets, before releasing it. - // Otherwise, we will receive epoll events after we release the FD. - epoll_event ev_fd; - memset(&ev_fd, 0, sizeof(ev_fd)); - if (pollable_obj != nullptr) { // For PO_FD. - epoll_ctl(pollable_obj->epfd, EPOLL_CTL_DEL, fd->fd, &ev_fd); - } - for (size_t i = 0; i < fd->pollset_fds.size(); ++i) { // For PO_MULTI. - const int epfd = fd->pollset_fds[i]; - epoll_ctl(epfd, EPOLL_CTL_DEL, fd->fd, &ev_fd); - } - *release_fd = fd->fd; - } else { - close(fd->fd); - is_fd_closed = true; - } - - // TODO(sreek): handle fd removal (where is_fd_closed=false) - if (!is_fd_closed) { - GRPC_FD_TRACE("epoll_fd %p (%d) was orphaned but not closed.", fd, fd->fd); - } - - /* Remove the active status but keep referenced. We want this grpc_fd struct - to be alive (and not added to freelist) until the end of this function */ - REF_BY(fd, 1, reason); - - grpc_core::ExecCtx::Run(DEBUG_LOCATION, fd->on_done_closure, GRPC_ERROR_NONE); - - if (pollable_obj) { - gpr_mu_unlock(&pollable_obj->owner_orphan_mu); - } - - gpr_mu_unlock(&fd->pollable_mu); - gpr_mu_unlock(&fd->orphan_mu); - - UNREF_BY(fd, 2, reason); /* Drop the reference */ -} - -static bool fd_is_shutdown(grpc_fd* fd) { - return fd->read_closure.IsShutdown(); -} - -/* Might be called multiple times */ -static void fd_shutdown(grpc_fd* fd, grpc_error_handle why) { - if (fd->read_closure.SetShutdown(GRPC_ERROR_REF(why))) { - if (shutdown(fd->fd, SHUT_RDWR)) { - if (errno != ENOTCONN) { - gpr_log(GPR_ERROR, "Error shutting down fd %d. errno: %d", - grpc_fd_wrapped_fd(fd), errno); - } - } - fd->write_closure.SetShutdown(GRPC_ERROR_REF(why)); - fd->error_closure.SetShutdown(GRPC_ERROR_REF(why)); - } - GRPC_ERROR_UNREF(why); -} - -static void fd_notify_on_read(grpc_fd* fd, grpc_closure* closure) { - fd->read_closure.NotifyOn(closure); -} - -static void fd_notify_on_write(grpc_fd* fd, grpc_closure* closure) { - fd->write_closure.NotifyOn(closure); -} - -static void fd_notify_on_error(grpc_fd* fd, grpc_closure* closure) { - fd->error_closure.NotifyOn(closure); -} - -static bool fd_has_pollset(grpc_fd* fd, grpc_pollset* pollset) { - const int epfd = pollset->active_pollable->epfd; - grpc_core::MutexLockForGprMu lock(&fd->pollable_mu); - for (size_t i = 0; i < fd->pollset_fds.size(); ++i) { - if (fd->pollset_fds[i] == epfd) { - return true; - } - } - return false; -} - -static void fd_add_pollset(grpc_fd* fd, grpc_pollset* pollset) { - const int epfd = pollset->active_pollable->epfd; - grpc_core::MutexLockForGprMu lock(&fd->pollable_mu); - fd->pollset_fds.push_back(epfd); -} - -/******************************************************************************* - * Pollable Definitions - */ - -static grpc_error_handle pollable_create(pollable_type type, pollable** p) { - *p = nullptr; - - int epfd = epoll_create1(EPOLL_CLOEXEC); - if (epfd == -1) { - return GRPC_OS_ERROR(errno, "epoll_create1"); - } - GRPC_FD_TRACE("Pollable_create: created epfd: %d (type: %d)", epfd, type); - *p = static_cast(gpr_malloc(sizeof(**p))); - grpc_error_handle err = grpc_wakeup_fd_init(&(*p)->wakeup); - if (err != GRPC_ERROR_NONE) { - GRPC_FD_TRACE( - "Pollable_create: closed epfd: %d (type: %d). wakeupfd_init error", - epfd, type); - close(epfd); - gpr_free(*p); - *p = nullptr; - return err; - } - struct epoll_event ev; - ev.events = static_cast(EPOLLIN | EPOLLET); - ev.data.ptr = - reinterpret_cast(1 | reinterpret_cast(&(*p)->wakeup)); - if (epoll_ctl(epfd, EPOLL_CTL_ADD, (*p)->wakeup.read_fd, &ev) != 0) { - err = GRPC_OS_ERROR(errno, "epoll_ctl"); - GRPC_FD_TRACE( - "Pollable_create: closed epfd: %d (type: %d). epoll_ctl error", epfd, - type); - close(epfd); - grpc_wakeup_fd_destroy(&(*p)->wakeup); - gpr_free(*p); - *p = nullptr; - return err; - } - - (*p)->type = type; - new (&(*p)->refs) grpc_core::RefCount( - 1, GRPC_TRACE_FLAG_ENABLED(grpc_trace_pollable_refcount) - ? "pollable_refcount" - : nullptr); - gpr_mu_init(&(*p)->mu); - (*p)->epfd = epfd; - (*p)->owner_fd = nullptr; - gpr_mu_init(&(*p)->owner_orphan_mu); - (*p)->owner_orphaned = false; - (*p)->pollset_set = nullptr; - (*p)->next = (*p)->prev = *p; - (*p)->root_worker = nullptr; - (*p)->event_cursor = 0; - (*p)->event_count = 0; - return GRPC_ERROR_NONE; -} - -static grpc_error_handle pollable_add_fd(pollable* p, grpc_fd* fd) { - grpc_error_handle error = GRPC_ERROR_NONE; - static const char* err_desc = "pollable_add_fd"; - const int epfd = p->epfd; - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, "add fd %p (%d) to pollable %p", fd, fd->fd, p); - } - - struct epoll_event ev_fd; - ev_fd.events = - static_cast(EPOLLET | EPOLLIN | EPOLLOUT | EPOLLEXCLUSIVE); - /* Use the second least significant bit of ev_fd.data.ptr to store track_err - * to avoid synchronization issues when accessing it after receiving an event. - * Accessing fd would be a data race there because the fd might have been - * returned to the free list at that point. */ - ev_fd.data.ptr = reinterpret_cast(reinterpret_cast(fd) | - (fd->track_err ? 2 : 0)); - GRPC_STATS_INC_SYSCALL_EPOLL_CTL(); - if (epoll_ctl(epfd, EPOLL_CTL_ADD, fd->fd, &ev_fd) != 0) { - switch (errno) { - case EEXIST: - break; - default: - append_error(&error, GRPC_OS_ERROR(errno, "epoll_ctl"), err_desc); - } - } - - return error; -} - -/******************************************************************************* - * Pollset Definitions - */ - -static GPR_THREAD_LOCAL(grpc_pollset*) g_current_thread_pollset; -static GPR_THREAD_LOCAL(grpc_pollset_worker*) g_current_thread_worker; - -/* Global state management */ -static grpc_error_handle pollset_global_init(void) { - return pollable_create(PO_EMPTY, &g_empty_pollable); -} - -static void pollset_global_shutdown(void) { - POLLABLE_UNREF(g_empty_pollable, "g_empty_pollable"); -} - -/* pollset->mu must be held while calling this function */ -static void pollset_maybe_finish_shutdown(grpc_pollset* pollset) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, - "PS:%p (pollable:%p) maybe_finish_shutdown sc=%p (target:!NULL) " - "rw=%p (target:NULL) cpsc=%d (target:0)", - pollset, pollset->active_pollable, pollset->shutdown_closure, - pollset->root_worker, pollset->containing_pollset_set_count); - } - if (pollset->shutdown_closure != nullptr && pollset->root_worker == nullptr && - pollset->containing_pollset_set_count == 0) { - GPR_TIMER_MARK("pollset_finish_shutdown", 0); - grpc_core::ExecCtx::Run(DEBUG_LOCATION, pollset->shutdown_closure, - GRPC_ERROR_NONE); - pollset->shutdown_closure = nullptr; - pollset->already_shutdown = true; - } -} - -/* pollset->mu must be held before calling this function, - * pollset->active_pollable->mu & specific_worker->pollable_obj->mu must not be - * held */ -static grpc_error_handle kick_one_worker(grpc_pollset_worker* specific_worker) { - GPR_TIMER_SCOPE("kick_one_worker", 0); - pollable* p = specific_worker->pollable_obj; - grpc_core::MutexLockForGprMu lock(&p->mu); - GPR_ASSERT(specific_worker != nullptr); - if (specific_worker->kicked) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, "PS:%p kicked_specific_but_already_kicked", p); - } - GRPC_STATS_INC_POLLSET_KICKED_AGAIN(); - return GRPC_ERROR_NONE; - } - if (g_current_thread_worker == specific_worker) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, "PS:%p kicked_specific_but_awake", p); - } - GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD(); - specific_worker->kicked = true; - return GRPC_ERROR_NONE; - } - if (specific_worker == p->root_worker) { - GRPC_STATS_INC_POLLSET_KICK_WAKEUP_FD(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, "PS:%p kicked_specific_via_wakeup_fd", p); - } - specific_worker->kicked = true; - grpc_error_handle error = grpc_wakeup_fd_wakeup(&p->wakeup); - return error; - } - if (specific_worker->initialized_cv) { - GRPC_STATS_INC_POLLSET_KICK_WAKEUP_CV(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, "PS:%p kicked_specific_via_cv", p); - } - specific_worker->kicked = true; - gpr_cv_signal(&specific_worker->cv); - return GRPC_ERROR_NONE; - } - // we can get here during end_worker after removing specific_worker from the - // pollable list but before removing it from the pollset list - return GRPC_ERROR_NONE; -} - -static grpc_error_handle pollset_kick(grpc_pollset* pollset, - grpc_pollset_worker* specific_worker) { - GPR_TIMER_SCOPE("pollset_kick", 0); - GRPC_STATS_INC_POLLSET_KICK(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, - "PS:%p kick %p tls_pollset=%p tls_worker=%p pollset.root_worker=%p", - pollset, specific_worker, - static_cast(g_current_thread_pollset), - static_cast(g_current_thread_worker), pollset->root_worker); - } - if (specific_worker == nullptr) { - if (g_current_thread_pollset != pollset) { - if (pollset->root_worker == nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, "PS:%p kicked_any_without_poller", pollset); - } - GRPC_STATS_INC_POLLSET_KICKED_WITHOUT_POLLER(); - pollset->kicked_without_poller = true; - return GRPC_ERROR_NONE; - } else { - // We've been asked to kick a poller, but we haven't been told which one - // ... any will do - // We look at the pollset worker list because: - // 1. the pollable list may include workers from other pollers, so we'd - // need to do an O(N) search - // 2. we'd additionally need to take the pollable lock, which we've so - // far avoided - // Now, we would prefer to wake a poller in cv_wait, and not in - // epoll_wait (since the latter would imply the need to do an additional - // wakeup) - // We know that if a worker is at the root of a pollable, it's (likely) - // also the root of a pollset, and we know that if a worker is NOT at - // the root of a pollset, it's (likely) not at the root of a pollable, - // so we take our chances and choose the SECOND worker enqueued against - // the pollset as a worker that's likely to be in cv_wait - return kick_one_worker( - pollset->root_worker->links[PWLINK_POLLSET].next); - } - } else { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, "PS:%p kicked_any_but_awake", pollset); - } - GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD(); - return GRPC_ERROR_NONE; - } - } else { - return kick_one_worker(specific_worker); - } -} - -static grpc_error_handle pollset_kick_all(grpc_pollset* pollset) { - GPR_TIMER_SCOPE("pollset_kick_all", 0); - grpc_error_handle error = GRPC_ERROR_NONE; - const char* err_desc = "pollset_kick_all"; - grpc_pollset_worker* w = pollset->root_worker; - if (w != nullptr) { - do { - GRPC_STATS_INC_POLLSET_KICK(); - append_error(&error, kick_one_worker(w), err_desc); - w = w->links[PWLINK_POLLSET].next; - } while (w != pollset->root_worker); - } - return error; -} - -static void pollset_init(grpc_pollset* pollset, gpr_mu** mu) { - gpr_mu_init(&pollset->mu); - gpr_atm_no_barrier_store(&pollset->worker_count, 0); - gpr_atm_no_barrier_store(&pollset->active_pollable_type, PO_EMPTY); - pollset->active_pollable = POLLABLE_REF(g_empty_pollable, "pollset"); - pollset->kicked_without_poller = false; - pollset->shutdown_closure = nullptr; - pollset->already_shutdown = false; - pollset->root_worker = nullptr; - pollset->containing_pollset_set_count = 0; - *mu = &pollset->mu; -} - -static int poll_deadline_to_millis_timeout(grpc_core::Timestamp millis) { - if (millis == grpc_core::Timestamp::InfFuture()) return -1; - int64_t delta = (millis - grpc_core::ExecCtx::Get()->Now()).millis(); - if (delta > INT_MAX) { - return INT_MAX; - } else if (delta < 0) { - return 0; - } else { - return static_cast(delta); - } -} - -static void fd_become_readable(grpc_fd* fd) { fd->read_closure.SetReady(); } - -static void fd_become_writable(grpc_fd* fd) { fd->write_closure.SetReady(); } - -static void fd_has_errors(grpc_fd* fd) { fd->error_closure.SetReady(); } - -/* Get the pollable_obj attached to this fd. If none is attached, create a new - * pollable object (of type PO_FD), attach it to the fd and return it - * - * Note that if a pollable object is already attached to the fd, it may be of - * either PO_FD or PO_MULTI type */ -static grpc_error_handle get_fd_pollable(grpc_fd* fd, pollable** p) { - gpr_mu_lock(&fd->pollable_mu); - grpc_error_handle error = GRPC_ERROR_NONE; - static const char* err_desc = "get_fd_pollable"; - if (fd->pollable_obj == nullptr) { - if (append_error(&error, pollable_create(PO_FD, &fd->pollable_obj), - err_desc)) { - fd->pollable_obj->owner_fd = fd; - if (!append_error(&error, pollable_add_fd(fd->pollable_obj, fd), - err_desc)) { - POLLABLE_UNREF(fd->pollable_obj, "fd_pollable"); - fd->pollable_obj = nullptr; - } - } - } - if (error == GRPC_ERROR_NONE) { - GPR_ASSERT(fd->pollable_obj != nullptr); - *p = POLLABLE_REF(fd->pollable_obj, "pollset"); - } else { - GPR_ASSERT(fd->pollable_obj == nullptr); - *p = nullptr; - } - gpr_mu_unlock(&fd->pollable_mu); - return error; -} - -/* pollset->po.mu lock must be held by the caller before calling this */ -static void pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) { - GPR_TIMER_SCOPE("pollset_shutdown", 0); - GPR_ASSERT(pollset->shutdown_closure == nullptr); - pollset->shutdown_closure = closure; - GRPC_LOG_IF_ERROR("pollset_shutdown", pollset_kick_all(pollset)); - pollset_maybe_finish_shutdown(pollset); -} - -static grpc_error_handle pollable_process_events(grpc_pollset* pollset, - pollable* pollable_obj, - bool drain) { - GPR_TIMER_SCOPE("pollable_process_events", 0); - static const char* err_desc = "pollset_process_events"; - // Use a simple heuristic to determine how many fd events to process - // per loop iteration. (events/workers) - int handle_count = 1; - int worker_count = gpr_atm_no_barrier_load(&pollset->worker_count); - GPR_ASSERT(worker_count > 0); - handle_count = - (pollable_obj->event_count - pollable_obj->event_cursor) / worker_count; - if (handle_count == 0) { - handle_count = 1; - } - grpc_error_handle error = GRPC_ERROR_NONE; - for (int i = 0; (drain || i < handle_count) && - pollable_obj->event_cursor != pollable_obj->event_count; - i++) { - int n = pollable_obj->event_cursor++; - struct epoll_event* ev = &pollable_obj->events[n]; - void* data_ptr = ev->data.ptr; - if (1 & reinterpret_cast(data_ptr)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, "PS:%p got pollset_wakeup %p", pollset, data_ptr); - } - append_error( - &error, - grpc_wakeup_fd_consume_wakeup(reinterpret_cast( - ~static_cast(1) & - reinterpret_cast(data_ptr))), - err_desc); - } else { - grpc_fd* fd = - reinterpret_cast(reinterpret_cast(data_ptr) & ~2); - bool track_err = reinterpret_cast(data_ptr) & 2; - bool cancel = (ev->events & EPOLLHUP) != 0; - bool error = (ev->events & EPOLLERR) != 0; - bool read_ev = (ev->events & (EPOLLIN | EPOLLPRI)) != 0; - bool write_ev = (ev->events & EPOLLOUT) != 0; - bool err_fallback = error && !track_err; - - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, - "PS:%p got fd %p: cancel=%d read=%d " - "write=%d", - pollset, fd, cancel, read_ev, write_ev); - } - if (error && !err_fallback) { - fd_has_errors(fd); - } - if (read_ev || cancel || err_fallback) { - fd_become_readable(fd); - } - if (write_ev || cancel || err_fallback) { - fd_become_writable(fd); - } - } - } - - return error; -} - -/* pollset_shutdown is guaranteed to be called before pollset_destroy. */ -static void pollset_destroy(grpc_pollset* pollset) { - POLLABLE_UNREF(pollset->active_pollable, "pollset"); - pollset->active_pollable = nullptr; - gpr_mu_destroy(&pollset->mu); -} - -static grpc_error_handle pollable_epoll(pollable* p, - grpc_core::Timestamp deadline) { - GPR_TIMER_SCOPE("pollable_epoll", 0); - int timeout = poll_deadline_to_millis_timeout(deadline); - - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, "POLLABLE:%p[%s] poll for %dms", p, - pollable_desc(p).c_str(), timeout); - } - - if (timeout != 0) { - GRPC_SCHEDULING_START_BLOCKING_REGION; - } - int r; - do { - GRPC_STATS_INC_SYSCALL_POLL(); - r = epoll_wait(p->epfd, p->events, MAX_EPOLL_EVENTS, timeout); - } while (r < 0 && errno == EINTR); - if (timeout != 0) { - GRPC_SCHEDULING_END_BLOCKING_REGION; - } - - if (r < 0) return GRPC_OS_ERROR(errno, "epoll_wait"); - - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, "POLLABLE:%p got %d events", p, r); - } - - p->event_cursor = 0; - p->event_count = r; - - return GRPC_ERROR_NONE; -} - -/* Return true if first in list */ -static bool worker_insert(grpc_pollset_worker** root_worker, - grpc_pollset_worker* worker, pwlinks link) { - if (*root_worker == nullptr) { - *root_worker = worker; - worker->links[link].next = worker->links[link].prev = worker; - return true; - } else { - worker->links[link].next = *root_worker; - worker->links[link].prev = worker->links[link].next->links[link].prev; - worker->links[link].next->links[link].prev = worker; - worker->links[link].prev->links[link].next = worker; - return false; - } -} - -/* returns the new root IFF the root changed */ -typedef enum { WRR_NEW_ROOT, WRR_EMPTIED, WRR_REMOVED } worker_remove_result; - -static worker_remove_result worker_remove(grpc_pollset_worker** root_worker, - grpc_pollset_worker* worker, - pwlinks link) { - if (worker == *root_worker) { - if (worker == worker->links[link].next) { - *root_worker = nullptr; - return WRR_EMPTIED; - } else { - *root_worker = worker->links[link].next; - worker->links[link].prev->links[link].next = worker->links[link].next; - worker->links[link].next->links[link].prev = worker->links[link].prev; - return WRR_NEW_ROOT; - } - } else { - worker->links[link].prev->links[link].next = worker->links[link].next; - worker->links[link].next->links[link].prev = worker->links[link].prev; - return WRR_REMOVED; - } -} - -/* Return true if this thread should poll */ -static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, - grpc_pollset_worker** worker_hdl, - grpc_core::Timestamp deadline) { - GPR_TIMER_SCOPE("begin_worker", 0); - bool do_poll = - (pollset->shutdown_closure == nullptr && !pollset->already_shutdown); - gpr_atm_no_barrier_fetch_add(&pollset->worker_count, 1); - if (worker_hdl != nullptr) *worker_hdl = worker; - worker->initialized_cv = false; - worker->kicked = false; - worker->pollset = pollset; - worker->pollable_obj = - POLLABLE_REF(pollset->active_pollable, "pollset_worker"); - worker_insert(&pollset->root_worker, worker, PWLINK_POLLSET); - gpr_mu_lock(&worker->pollable_obj->mu); - if (!worker_insert(&worker->pollable_obj->root_worker, worker, - PWLINK_POLLABLE)) { - worker->initialized_cv = true; - gpr_cv_init(&worker->cv); - gpr_mu_unlock(&pollset->mu); - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace) && - worker->pollable_obj->root_worker != worker) { - gpr_log(GPR_INFO, "PS:%p wait %p w=%p for %dms", pollset, - worker->pollable_obj, worker, - poll_deadline_to_millis_timeout(deadline)); - } - while (do_poll && worker->pollable_obj->root_worker != worker) { - if (gpr_cv_wait(&worker->cv, &worker->pollable_obj->mu, - deadline.as_timespec(GPR_CLOCK_REALTIME))) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, "PS:%p timeout_wait %p w=%p", pollset, - worker->pollable_obj, worker); - } - do_poll = false; - } else if (worker->kicked) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, "PS:%p wakeup %p w=%p", pollset, - worker->pollable_obj, worker); - } - do_poll = false; - } else if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace) && - worker->pollable_obj->root_worker != worker) { - gpr_log(GPR_INFO, "PS:%p spurious_wakeup %p w=%p", pollset, - worker->pollable_obj, worker); - } - } - grpc_core::ExecCtx::Get()->InvalidateNow(); - } else { - gpr_mu_unlock(&pollset->mu); - } - gpr_mu_unlock(&worker->pollable_obj->mu); - - return do_poll; -} - -static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, - grpc_pollset_worker** /*worker_hdl*/) { - GPR_TIMER_SCOPE("end_worker", 0); - gpr_mu_lock(&pollset->mu); - gpr_mu_lock(&worker->pollable_obj->mu); - switch (worker_remove(&worker->pollable_obj->root_worker, worker, - PWLINK_POLLABLE)) { - case WRR_NEW_ROOT: { - // wakeup new poller - grpc_pollset_worker* new_root = worker->pollable_obj->root_worker; - GPR_ASSERT(new_root->initialized_cv); - gpr_cv_signal(&new_root->cv); - break; - } - case WRR_EMPTIED: - if (pollset->active_pollable != worker->pollable_obj) { - // pollable no longer being polled: flush events - (void)pollable_process_events(pollset, worker->pollable_obj, true); - } - break; - case WRR_REMOVED: - break; - } - gpr_mu_unlock(&worker->pollable_obj->mu); - POLLABLE_UNREF(worker->pollable_obj, "pollset_worker"); - if (worker_remove(&pollset->root_worker, worker, PWLINK_POLLSET) == - WRR_EMPTIED) { - pollset_maybe_finish_shutdown(pollset); - } - if (worker->initialized_cv) { - gpr_cv_destroy(&worker->cv); - } - gpr_atm_no_barrier_fetch_add(&pollset->worker_count, -1); -} - -#ifndef NDEBUG -static long sys_gettid(void) { return syscall(__NR_gettid); } -#endif - -/* pollset->mu lock must be held by the caller before calling this. - The function pollset_work() may temporarily release the lock (pollset->po.mu) - during the course of its execution but it will always re-acquire the lock and - ensure that it is held by the time the function returns */ -static grpc_error_handle pollset_work(grpc_pollset* pollset, - grpc_pollset_worker** worker_hdl, - grpc_core::Timestamp deadline) { - GPR_TIMER_SCOPE("pollset_work", 0); -#ifdef GRPC_EPOLLEX_CREATE_WORKERS_ON_HEAP - grpc_pollset_worker* worker = - (grpc_pollset_worker*)gpr_malloc(sizeof(*worker)); -#define WORKER_PTR (worker) -#else - grpc_pollset_worker worker; -#define WORKER_PTR (&worker) -#endif -#ifndef NDEBUG - WORKER_PTR->originator = sys_gettid(); -#endif - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, - "PS:%p work hdl=%p worker=%p now=%" PRId64 " deadline=%" PRId64 - " kwp=%d pollable=%p", - pollset, worker_hdl, WORKER_PTR, - grpc_core::ExecCtx::Get()->Now().milliseconds_after_process_epoch(), - deadline.milliseconds_after_process_epoch(), - pollset->kicked_without_poller, pollset->active_pollable); - } - static const char* err_desc = "pollset_work"; - grpc_error_handle error = GRPC_ERROR_NONE; - if (pollset->kicked_without_poller) { - pollset->kicked_without_poller = false; - } else { - if (begin_worker(pollset, WORKER_PTR, worker_hdl, deadline)) { - g_current_thread_pollset = pollset; - g_current_thread_worker = WORKER_PTR; - if (WORKER_PTR->pollable_obj->event_cursor == - WORKER_PTR->pollable_obj->event_count) { - append_error(&error, pollable_epoll(WORKER_PTR->pollable_obj, deadline), - err_desc); - } - append_error( - &error, - pollable_process_events(pollset, WORKER_PTR->pollable_obj, false), - err_desc); - grpc_core::ExecCtx::Get()->Flush(); - g_current_thread_pollset = nullptr; - g_current_thread_worker = nullptr; - } - end_worker(pollset, WORKER_PTR, worker_hdl); - } -#ifdef GRPC_EPOLLEX_CREATE_WORKERS_ON_HEAP - gpr_free(worker); -#endif -#undef WORKER_PTR - return error; -} - -static grpc_error_handle pollset_transition_pollable_from_empty_to_fd_locked( - grpc_pollset* pollset, grpc_fd* fd) { - static const char* err_desc = "pollset_transition_pollable_from_empty_to_fd"; - grpc_error_handle error = GRPC_ERROR_NONE; - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, - "PS:%p add fd %p (%d); transition pollable from empty to fd", - pollset, fd, fd->fd); - } - append_error(&error, pollset_kick_all(pollset), err_desc); - POLLABLE_UNREF(pollset->active_pollable, "pollset"); - append_error(&error, get_fd_pollable(fd, &pollset->active_pollable), - err_desc); - return error; -} - -static grpc_error_handle pollset_transition_pollable_from_fd_to_multi_locked( - grpc_pollset* pollset, grpc_fd* and_add_fd) { - static const char* err_desc = "pollset_transition_pollable_from_fd_to_multi"; - grpc_error_handle error = GRPC_ERROR_NONE; - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log( - GPR_INFO, - "PS:%p add fd %p (%d); transition pollable from fd %p to multipoller", - pollset, and_add_fd, and_add_fd ? and_add_fd->fd : -1, - pollset->active_pollable->owner_fd); - } - append_error(&error, pollset_kick_all(pollset), err_desc); - grpc_fd* initial_fd = pollset->active_pollable->owner_fd; - POLLABLE_UNREF(pollset->active_pollable, "pollset"); - pollset->active_pollable = nullptr; - if (append_error(&error, pollable_create(PO_MULTI, &pollset->active_pollable), - err_desc)) { - append_error(&error, pollable_add_fd(pollset->active_pollable, initial_fd), - err_desc); - if (and_add_fd != nullptr) { - append_error(&error, - pollable_add_fd(pollset->active_pollable, and_add_fd), - err_desc); - } - } - return error; -} - -/* expects pollsets locked, flag whether fd is locked or not */ -static grpc_error_handle pollset_add_fd_locked(grpc_pollset* pollset, - grpc_fd* fd) { - grpc_error_handle error = GRPC_ERROR_NONE; - pollable* po_at_start = - POLLABLE_REF(pollset->active_pollable, "pollset_add_fd"); - switch (pollset->active_pollable->type) { - case PO_EMPTY: - /* empty pollable --> single fd pollable */ - error = pollset_transition_pollable_from_empty_to_fd_locked(pollset, fd); - break; - case PO_FD: - gpr_mu_lock(&po_at_start->owner_orphan_mu); - if (po_at_start->owner_orphaned) { - error = - pollset_transition_pollable_from_empty_to_fd_locked(pollset, fd); - } else { - /* fd --> multipoller */ - error = - pollset_transition_pollable_from_fd_to_multi_locked(pollset, fd); - } - gpr_mu_unlock(&po_at_start->owner_orphan_mu); - break; - case PO_MULTI: - error = pollable_add_fd(pollset->active_pollable, fd); - break; - } - if (error != GRPC_ERROR_NONE) { - POLLABLE_UNREF(pollset->active_pollable, "pollset"); - pollset->active_pollable = po_at_start; - } else { - gpr_atm_rel_store(&pollset->active_pollable_type, - pollset->active_pollable->type); - POLLABLE_UNREF(po_at_start, "pollset_add_fd"); - } - return error; -} - -static grpc_error_handle pollset_as_multipollable_locked( - grpc_pollset* pollset, pollable** pollable_obj) { - grpc_error_handle error = GRPC_ERROR_NONE; - pollable* po_at_start = - POLLABLE_REF(pollset->active_pollable, "pollset_as_multipollable"); - switch (pollset->active_pollable->type) { - case PO_EMPTY: - POLLABLE_UNREF(pollset->active_pollable, "pollset"); - error = pollable_create(PO_MULTI, &pollset->active_pollable); - /* Any workers currently polling on this pollset must now be woked up so - * that they can pick up the new active_pollable */ - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, - "PS:%p active pollable transition from empty to multi", - pollset); - } - static const char* err_desc = - "pollset_as_multipollable_locked: empty -> multi"; - append_error(&error, pollset_kick_all(pollset), err_desc); - break; - case PO_FD: - gpr_mu_lock(&po_at_start->owner_orphan_mu); - if (po_at_start->owner_orphaned) { - // Unlock before Unref'ing the pollable - gpr_mu_unlock(&po_at_start->owner_orphan_mu); - POLLABLE_UNREF(pollset->active_pollable, "pollset"); - error = pollable_create(PO_MULTI, &pollset->active_pollable); - } else { - error = pollset_transition_pollable_from_fd_to_multi_locked(pollset, - nullptr); - gpr_mu_unlock(&po_at_start->owner_orphan_mu); - } - break; - case PO_MULTI: - break; - } - if (error != GRPC_ERROR_NONE) { - POLLABLE_UNREF(pollset->active_pollable, "pollset"); - pollset->active_pollable = po_at_start; - *pollable_obj = nullptr; - } else { - gpr_atm_rel_store(&pollset->active_pollable_type, - pollset->active_pollable->type); - *pollable_obj = POLLABLE_REF(pollset->active_pollable, "pollset_set"); - POLLABLE_UNREF(po_at_start, "pollset_as_multipollable"); - } - return error; -} - -static void pollset_add_fd(grpc_pollset* pollset, grpc_fd* fd) { - GPR_TIMER_SCOPE("pollset_add_fd", 0); - - // We never transition from PO_MULTI to other modes (i.e., PO_FD or PO_EMPTY) - // and, thus, it is safe to simply store and check whether the FD has already - // been added to the active pollable previously. - if (gpr_atm_acq_load(&pollset->active_pollable_type) == PO_MULTI && - fd_has_pollset(fd, pollset)) { - return; - } - - grpc_core::MutexLockForGprMu lock(&pollset->mu); - grpc_error_handle error = pollset_add_fd_locked(pollset, fd); - - // If we are in PO_MULTI mode, we should update the pollsets of the FD. - if (gpr_atm_no_barrier_load(&pollset->active_pollable_type) == PO_MULTI) { - fd_add_pollset(fd, pollset); - } - - GRPC_LOG_IF_ERROR("pollset_add_fd", error); -} - -/******************************************************************************* - * Pollset-set Definitions - */ - -static grpc_pollset_set* pss_lock_adam(grpc_pollset_set* pss) { - gpr_mu_lock(&pss->mu); - while (pss->parent != nullptr) { - gpr_mu_unlock(&pss->mu); - pss = pss->parent; - gpr_mu_lock(&pss->mu); - } - return pss; -} - -static grpc_pollset_set* pollset_set_create(void) { - grpc_pollset_set* pss = - static_cast(gpr_zalloc(sizeof(*pss))); - gpr_mu_init(&pss->mu); - new (&pss->refs) grpc_core::RefCount(); - return pss; -} - -static void pollset_set_unref(grpc_pollset_set* pss) { - if (pss == nullptr) return; - if (GPR_LIKELY(!pss->refs.Unref())) return; - pollset_set_unref(pss->parent); - gpr_mu_destroy(&pss->mu); - for (size_t i = 0; i < pss->pollset_count; i++) { - gpr_mu_lock(&pss->pollsets[i]->mu); - if (0 == --pss->pollsets[i]->containing_pollset_set_count) { - pollset_maybe_finish_shutdown(pss->pollsets[i]); - } - gpr_mu_unlock(&pss->pollsets[i]->mu); - } - for (size_t i = 0; i < pss->fd_count; i++) { - UNREF_BY(pss->fds[i], 2, "pollset_set"); - } - gpr_free(pss->pollsets); - gpr_free(pss->fds); - gpr_free(pss); -} - -static void pollset_set_add_fd(grpc_pollset_set* pss, grpc_fd* fd) { - GPR_TIMER_SCOPE("pollset_set_add_fd", 0); - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, "PSS:%p: add fd %p (%d)", pss, fd, fd->fd); - } - grpc_error_handle error = GRPC_ERROR_NONE; - static const char* err_desc = "pollset_set_add_fd"; - pss = pss_lock_adam(pss); - for (size_t i = 0; i < pss->pollset_count; i++) { - append_error(&error, pollable_add_fd(pss->pollsets[i]->active_pollable, fd), - err_desc); - } - if (pss->fd_count == pss->fd_capacity) { - pss->fd_capacity = std::max(pss->fd_capacity * 2, size_t(8)); - pss->fds = static_cast( - gpr_realloc(pss->fds, pss->fd_capacity * sizeof(*pss->fds))); - } - REF_BY(fd, 2, "pollset_set"); - pss->fds[pss->fd_count++] = fd; - gpr_mu_unlock(&pss->mu); - - GRPC_LOG_IF_ERROR(err_desc, error); -} - -static void pollset_set_del_fd(grpc_pollset_set* pss, grpc_fd* fd) { - GPR_TIMER_SCOPE("pollset_set_del_fd", 0); - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, "PSS:%p: del fd %p", pss, fd); - } - pss = pss_lock_adam(pss); - size_t i; - for (i = 0; i < pss->fd_count; i++) { - if (pss->fds[i] == fd) { - UNREF_BY(fd, 2, "pollset_set"); - break; - } - } - GPR_ASSERT(i != pss->fd_count); - for (; i < pss->fd_count - 1; i++) { - pss->fds[i] = pss->fds[i + 1]; - } - pss->fd_count--; - gpr_mu_unlock(&pss->mu); -} - -static void pollset_set_del_pollset(grpc_pollset_set* pss, grpc_pollset* ps) { - GPR_TIMER_SCOPE("pollset_set_del_pollset", 0); - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, "PSS:%p: del pollset %p", pss, ps); - } - pss = pss_lock_adam(pss); - size_t i; - for (i = 0; i < pss->pollset_count; i++) { - if (pss->pollsets[i] == ps) { - break; - } - } - GPR_ASSERT(i != pss->pollset_count); - for (; i < pss->pollset_count - 1; i++) { - pss->pollsets[i] = pss->pollsets[i + 1]; - } - pss->pollset_count--; - gpr_mu_unlock(&pss->mu); - gpr_mu_lock(&ps->mu); - if (0 == --ps->containing_pollset_set_count) { - pollset_maybe_finish_shutdown(ps); - } - gpr_mu_unlock(&ps->mu); -} - -// add all fds to pollables, and output a new array of unorphaned out_fds -// assumes pollsets are multipollable -static grpc_error_handle add_fds_to_pollsets(grpc_fd** fds, size_t fd_count, - grpc_pollset** pollsets, - size_t pollset_count, - const char* err_desc, - grpc_fd** out_fds, - size_t* out_fd_count) { - GPR_TIMER_SCOPE("add_fds_to_pollsets", 0); - grpc_error_handle error = GRPC_ERROR_NONE; - for (size_t i = 0; i < fd_count; i++) { - gpr_mu_lock(&fds[i]->orphan_mu); - if ((gpr_atm_no_barrier_load(&fds[i]->refst) & 1) == 0) { - gpr_mu_unlock(&fds[i]->orphan_mu); - UNREF_BY(fds[i], 2, "pollset_set"); - } else { - for (size_t j = 0; j < pollset_count; j++) { - append_error(&error, - pollable_add_fd(pollsets[j]->active_pollable, fds[i]), - err_desc); - } - gpr_mu_unlock(&fds[i]->orphan_mu); - out_fds[(*out_fd_count)++] = fds[i]; - } - } - return error; -} - -static void pollset_set_add_pollset(grpc_pollset_set* pss, grpc_pollset* ps) { - GPR_TIMER_SCOPE("pollset_set_add_pollset", 0); - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, "PSS:%p: add pollset %p", pss, ps); - } - grpc_error_handle error = GRPC_ERROR_NONE; - static const char* err_desc = "pollset_set_add_pollset"; - pollable* pollable_obj = nullptr; - gpr_mu_lock(&ps->mu); - if (!GRPC_LOG_IF_ERROR(err_desc, - pollset_as_multipollable_locked(ps, &pollable_obj))) { - GPR_ASSERT(pollable_obj == nullptr); - gpr_mu_unlock(&ps->mu); - return; - } - ps->containing_pollset_set_count++; - gpr_mu_unlock(&ps->mu); - pss = pss_lock_adam(pss); - size_t initial_fd_count = pss->fd_count; - pss->fd_count = 0; - append_error(&error, - add_fds_to_pollsets(pss->fds, initial_fd_count, &ps, 1, err_desc, - pss->fds, &pss->fd_count), - err_desc); - if (pss->pollset_count == pss->pollset_capacity) { - pss->pollset_capacity = std::max(pss->pollset_capacity * 2, size_t(8)); - pss->pollsets = static_cast(gpr_realloc( - pss->pollsets, pss->pollset_capacity * sizeof(*pss->pollsets))); - } - pss->pollsets[pss->pollset_count++] = ps; - gpr_mu_unlock(&pss->mu); - POLLABLE_UNREF(pollable_obj, "pollset_set"); - - GRPC_LOG_IF_ERROR(err_desc, error); -} - -static void pollset_set_add_pollset_set(grpc_pollset_set* a, - grpc_pollset_set* b) { - GPR_TIMER_SCOPE("pollset_set_add_pollset_set", 0); - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, "PSS: merge (%p, %p)", a, b); - } - grpc_error_handle error = GRPC_ERROR_NONE; - static const char* err_desc = "pollset_set_add_fd"; - for (;;) { - if (a == b) { - // pollset ancestors are the same: nothing to do - return; - } - if (a > b) { - std::swap(a, b); - } - gpr_mu* a_mu = &a->mu; - gpr_mu* b_mu = &b->mu; - gpr_mu_lock(a_mu); - gpr_mu_lock(b_mu); - if (a->parent != nullptr) { - a = a->parent; - } else if (b->parent != nullptr) { - b = b->parent; - } else { - break; // exit loop, both pollsets locked - } - gpr_mu_unlock(a_mu); - gpr_mu_unlock(b_mu); - } - // try to do the least copying possible - // TODO(sreek): there's probably a better heuristic here - const size_t a_size = a->fd_count + a->pollset_count; - const size_t b_size = b->fd_count + b->pollset_count; - if (b_size > a_size) { - std::swap(a, b); - } - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - gpr_log(GPR_INFO, "PSS: parent %p to %p", b, a); - } - a->refs.Ref(); - b->parent = a; - if (a->fd_capacity < a->fd_count + b->fd_count) { - a->fd_capacity = std::max(2 * a->fd_capacity, a->fd_count + b->fd_count); - a->fds = static_cast( - gpr_realloc(a->fds, a->fd_capacity * sizeof(*a->fds))); - } - size_t initial_a_fd_count = a->fd_count; - a->fd_count = 0; - append_error( - &error, - add_fds_to_pollsets(a->fds, initial_a_fd_count, b->pollsets, - b->pollset_count, "merge_a2b", a->fds, &a->fd_count), - err_desc); - append_error( - &error, - add_fds_to_pollsets(b->fds, b->fd_count, a->pollsets, a->pollset_count, - "merge_b2a", a->fds, &a->fd_count), - err_desc); - if (a->pollset_capacity < a->pollset_count + b->pollset_count) { - a->pollset_capacity = - std::max(2 * a->pollset_capacity, a->pollset_count + b->pollset_count); - a->pollsets = static_cast( - gpr_realloc(a->pollsets, a->pollset_capacity * sizeof(*a->pollsets))); - } - if (b->pollset_count > 0) { - memcpy(a->pollsets + a->pollset_count, b->pollsets, - b->pollset_count * sizeof(*b->pollsets)); - } - a->pollset_count += b->pollset_count; - gpr_free(b->fds); - gpr_free(b->pollsets); - b->fds = nullptr; - b->pollsets = nullptr; - b->fd_count = b->fd_capacity = b->pollset_count = b->pollset_capacity = 0; - gpr_mu_unlock(&a->mu); - gpr_mu_unlock(&b->mu); -} - -static void pollset_set_del_pollset_set(grpc_pollset_set* /*bag*/, - grpc_pollset_set* /*item*/) {} - -/******************************************************************************* - * Event engine binding - */ - -static bool is_any_background_poller_thread(void) { return false; } - -static void shutdown_background_closure(void) {} - -static bool add_closure_to_background_poller(grpc_closure* /*closure*/, - grpc_error_handle /*error*/) { - return false; -} - -static void shutdown_engine(void) { - fd_global_shutdown(); - pollset_global_shutdown(); -} - -static const grpc_event_engine_vtable vtable = { - sizeof(grpc_pollset), - true, - false, - - fd_create, - fd_wrapped_fd, - fd_orphan, - fd_shutdown, - fd_notify_on_read, - fd_notify_on_write, - fd_notify_on_error, - fd_become_readable, - fd_become_writable, - fd_has_errors, - fd_is_shutdown, - - pollset_init, - pollset_shutdown, - pollset_destroy, - pollset_work, - pollset_kick, - pollset_add_fd, - - pollset_set_create, - pollset_set_unref, // destroy ==> unref 1 public ref - pollset_set_add_pollset, - pollset_set_del_pollset, - pollset_set_add_pollset_set, - pollset_set_del_pollset_set, - pollset_set_add_fd, - pollset_set_del_fd, - - is_any_background_poller_thread, - shutdown_background_closure, - shutdown_engine, - add_closure_to_background_poller, -}; - -const grpc_event_engine_vtable* grpc_init_epollex_linux( - bool /*explicitly_requested*/) { - if (!grpc_has_wakeup_fd()) { - gpr_log(GPR_ERROR, "Skipping epollex because of no wakeup fd."); - return nullptr; - } - - if (!grpc_is_epollexclusive_available()) { - gpr_log(GPR_INFO, "Skipping epollex because it is not supported."); - return nullptr; - } - - fd_global_init(); - - if (!GRPC_LOG_IF_ERROR("pollset_global_init", pollset_global_init())) { - pollset_global_shutdown(); - fd_global_shutdown(); - return nullptr; - } - - return &vtable; -} - -#else /* defined(GRPC_LINUX_EPOLL_CREATE1) */ -#if defined(GRPC_POSIX_SOCKET_EV_EPOLLEX) -#include "src/core/lib/iomgr/ev_epollex_linux.h" -/* If GRPC_LINUX_EPOLL_CREATE1 is not defined, it means - epoll_create1 is not available. Return NULL */ -const grpc_event_engine_vtable* grpc_init_epollex_linux( - bool /*explicitly_requested*/) { - return nullptr; -} -#endif /* defined(GRPC_POSIX_SOCKET_EV_EPOLLEX) */ - -#endif /* !defined(GRPC_LINUX_EPOLL_CREATE1) */ diff --git a/src/core/lib/iomgr/ev_epollex_linux.h b/src/core/lib/iomgr/ev_epollex_linux.h deleted file mode 100644 index e70ba72a7db..00000000000 --- a/src/core/lib/iomgr/ev_epollex_linux.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_CORE_LIB_IOMGR_EV_EPOLLEX_LINUX_H -#define GRPC_CORE_LIB_IOMGR_EV_EPOLLEX_LINUX_H - -#include - -#include "src/core/lib/iomgr/ev_posix.h" -#include "src/core/lib/iomgr/port.h" - -const grpc_event_engine_vtable* grpc_init_epollex_linux( - bool explicitly_requested); - -#endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLLEX_LINUX_H */ diff --git a/src/core/lib/iomgr/ev_posix.cc b/src/core/lib/iomgr/ev_posix.cc index 88b0d695ca4..a472716d25f 100644 --- a/src/core/lib/iomgr/ev_posix.cc +++ b/src/core/lib/iomgr/ev_posix.cc @@ -32,7 +32,6 @@ #include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/global_config.h" #include "src/core/lib/iomgr/ev_epoll1_linux.h" -#include "src/core/lib/iomgr/ev_epollex_linux.h" #include "src/core/lib/iomgr/ev_poll_posix.h" #include "src/core/lib/iomgr/ev_posix.h" #include "src/core/lib/iomgr/internal_errqueue.h" @@ -126,12 +125,12 @@ const grpc_event_engine_vtable* init_non_polling(bool explicit_request) { // environment variable if that variable is set (which should be a // comma-separated list of one or more event engine names) static event_engine_factory g_factories[] = { - {ENGINE_HEAD_CUSTOM, nullptr}, {ENGINE_HEAD_CUSTOM, nullptr}, - {ENGINE_HEAD_CUSTOM, nullptr}, {ENGINE_HEAD_CUSTOM, nullptr}, - {"epollex", grpc_init_epollex_linux}, {"epoll1", grpc_init_epoll1_linux}, - {"poll", grpc_init_poll_posix}, {"none", init_non_polling}, - {ENGINE_TAIL_CUSTOM, nullptr}, {ENGINE_TAIL_CUSTOM, nullptr}, - {ENGINE_TAIL_CUSTOM, nullptr}, {ENGINE_TAIL_CUSTOM, nullptr}, + {ENGINE_HEAD_CUSTOM, nullptr}, {ENGINE_HEAD_CUSTOM, nullptr}, + {ENGINE_HEAD_CUSTOM, nullptr}, {ENGINE_HEAD_CUSTOM, nullptr}, + {"epoll1", grpc_init_epoll1_linux}, {"poll", grpc_init_poll_posix}, + {"none", init_non_polling}, {ENGINE_TAIL_CUSTOM, nullptr}, + {ENGINE_TAIL_CUSTOM, nullptr}, {ENGINE_TAIL_CUSTOM, nullptr}, + {ENGINE_TAIL_CUSTOM, nullptr}, }; static void add(const char* beg, const char* end, char*** ss, size_t* ns) { diff --git a/src/core/lib/iomgr/is_epollexclusive_available.cc b/src/core/lib/iomgr/is_epollexclusive_available.cc deleted file mode 100644 index 80cac4a5af0..00000000000 --- a/src/core/lib/iomgr/is_epollexclusive_available.cc +++ /dev/null @@ -1,119 +0,0 @@ -/* - * - * Copyright 2017 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include - -#include "src/core/lib/iomgr/is_epollexclusive_available.h" - -#include "src/core/lib/iomgr/port.h" - -#ifdef GRPC_LINUX_EPOLL_CREATE1 - -#include -#include -#include -#include - -#include - -#include "src/core/lib/iomgr/sys_epoll_wrapper.h" - -/* This polling engine is only relevant on linux kernels supporting epoll() */ -bool grpc_is_epollexclusive_available(void) { - static bool logged_why_not = false; - - int fd = epoll_create1(EPOLL_CLOEXEC); - if (fd < 0) { - if (!logged_why_not) { - gpr_log(GPR_DEBUG, - "epoll_create1 failed with error: %d. Not using epollex polling " - "engine.", - fd); - logged_why_not = true; - } - return false; - } - int evfd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); - if (evfd < 0) { - if (!logged_why_not) { - gpr_log(GPR_DEBUG, - "eventfd failed with error: %d. Not using epollex polling " - "engine.", - fd); - logged_why_not = true; - } - close(fd); - return false; - } - struct epoll_event ev; - /* choose events that should cause an error on - EPOLLEXCLUSIVE enabled kernels - specifically the combination of - EPOLLONESHOT and EPOLLEXCLUSIVE */ - ev.events = - static_cast(EPOLLET | EPOLLIN | EPOLLEXCLUSIVE | EPOLLONESHOT); - ev.data.ptr = nullptr; - if (epoll_ctl(fd, EPOLL_CTL_ADD, evfd, &ev) != 0) { - if (errno != EINVAL) { - if (!logged_why_not) { - gpr_log( - GPR_ERROR, - "epoll_ctl with EPOLLEXCLUSIVE | EPOLLONESHOT failed with error: " - "%d. Not using epollex polling engine.", - errno); - logged_why_not = true; - } - close(fd); - close(evfd); - return false; - } - } else { - if (!logged_why_not) { - gpr_log(GPR_DEBUG, - "epoll_ctl with EPOLLEXCLUSIVE | EPOLLONESHOT succeeded. This is " - "evidence of no EPOLLEXCLUSIVE support. Not using " - "epollex polling engine."); - logged_why_not = true; - } - close(fd); - close(evfd); - return false; - } - // Check that EPOLLEXCLUSIVE is supported at all. - ev.events = static_cast(EPOLLET | EPOLLIN | EPOLLEXCLUSIVE); - if (epoll_ctl(fd, EPOLL_CTL_ADD, evfd, &ev) != 0) { - if (!logged_why_not) { - gpr_log(GPR_DEBUG, - "epoll_ctl with EPOLLEXCLUSIVE failed with error: " - "%d. Not using epollex polling engine.", - errno); - logged_why_not = true; - } - close(fd); - close(evfd); - return false; - } - close(evfd); - close(fd); - return true; -} - -#else - -bool grpc_is_epollexclusive_available(void) { return false; } - -#endif diff --git a/src/core/lib/iomgr/is_epollexclusive_available.h b/src/core/lib/iomgr/is_epollexclusive_available.h deleted file mode 100644 index 8a44113c3f7..00000000000 --- a/src/core/lib/iomgr/is_epollexclusive_available.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_CORE_LIB_IOMGR_IS_EPOLLEXCLUSIVE_AVAILABLE_H -#define GRPC_CORE_LIB_IOMGR_IS_EPOLLEXCLUSIVE_AVAILABLE_H - -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -bool grpc_is_epollexclusive_available(void); - -#ifdef __cplusplus -} -#endif - -#endif /* GRPC_CORE_LIB_IOMGR_IS_EPOLLEXCLUSIVE_AVAILABLE_H */ diff --git a/src/core/lib/iomgr/port.h b/src/core/lib/iomgr/port.h index e2ecbd8c2b7..8762791e796 100644 --- a/src/core/lib/iomgr/port.h +++ b/src/core/lib/iomgr/port.h @@ -107,7 +107,6 @@ #define GRPC_POSIX_SOCKET_ARES_EV_DRIVER 1 #define GRPC_POSIX_SOCKET_EV 1 #define GRPC_POSIX_SOCKET_EV_EPOLL1 1 -#define GRPC_POSIX_SOCKET_EV_EPOLLEX 1 #define GRPC_POSIX_SOCKET_EV_POLL 1 #define GRPC_POSIX_SOCKET_IF_NAMETOINDEX 1 #define GRPC_POSIX_SOCKET_RESOLVE_ADDRESS 1 @@ -192,7 +191,6 @@ #ifdef GRPC_POSIX_SOCKET #define GRPC_POSIX_SOCKET_ARES_EV_DRIVER 1 #define GRPC_POSIX_SOCKET_EV 1 -#define GRPC_POSIX_SOCKET_EV_EPOLLEX 1 #define GRPC_POSIX_SOCKET_EV_POLL 1 #define GRPC_POSIX_SOCKET_EV_EPOLL1 1 #define GRPC_POSIX_SOCKET_IF_NAMETOINDEX 1 diff --git a/src/core/lib/iomgr/sys_epoll_wrapper.h b/src/core/lib/iomgr/sys_epoll_wrapper.h deleted file mode 100644 index d21d853665b..00000000000 --- a/src/core/lib/iomgr/sys_epoll_wrapper.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * Copyright 2017 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_CORE_LIB_IOMGR_SYS_EPOLL_WRAPPER_H -#define GRPC_CORE_LIB_IOMGR_SYS_EPOLL_WRAPPER_H - -#include - -#include - -#ifndef EPOLLEXCLUSIVE -#define EPOLLEXCLUSIVE (1 << 28) -#endif - -#endif /* GRPC_CORE_LIB_IOMGR_SYS_EPOLL_WRAPPER_H */ diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index f80acb34d33..7305945dc3f 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -501,7 +501,6 @@ CORE_SOURCE_FILES = [ 'src/core/lib/iomgr/error_cfstream.cc', 'src/core/lib/iomgr/ev_apple.cc', 'src/core/lib/iomgr/ev_epoll1_linux.cc', - 'src/core/lib/iomgr/ev_epollex_linux.cc', 'src/core/lib/iomgr/ev_poll_posix.cc', 'src/core/lib/iomgr/ev_posix.cc', 'src/core/lib/iomgr/ev_windows.cc', @@ -531,7 +530,6 @@ CORE_SOURCE_FILES = [ 'src/core/lib/iomgr/iomgr_posix.cc', 'src/core/lib/iomgr/iomgr_posix_cfstream.cc', 'src/core/lib/iomgr/iomgr_windows.cc', - 'src/core/lib/iomgr/is_epollexclusive_available.cc', 'src/core/lib/iomgr/load_file.cc', 'src/core/lib/iomgr/lockfree_event.cc', 'src/core/lib/iomgr/polling_entity.cc', diff --git a/test/build/check_epollexclusive.c b/test/build/check_epollexclusive.c deleted file mode 100644 index 3f862ce07d5..00000000000 --- a/test/build/check_epollexclusive.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * - * Copyright 2017 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include "src/core/lib/iomgr/is_epollexclusive_available.h" - -int main(int argc, char **argv) { - return grpc_is_epollexclusive_available() ? 0 : 1; -} diff --git a/test/core/end2end/generate_tests.bzl b/test/core/end2end/generate_tests.bzl index 9f572f6f831..84d0f5a5a27 100755 --- a/test/core/end2end/generate_tests.bzl +++ b/test/core/end2end/generate_tests.bzl @@ -16,7 +16,7 @@ load("//bazel:grpc_build_system.bzl", "grpc_cc_binary", "grpc_cc_library") -POLLERS = ["epollex", "epoll1", "poll"] +POLLERS = ["epoll1", "poll"] def _fixture_options( fullstack = True, diff --git a/test/core/iomgr/BUILD b/test/core/iomgr/BUILD index 2879faf7177..2ac6f4d8a93 100644 --- a/test/core/iomgr/BUILD +++ b/test/core/iomgr/BUILD @@ -79,18 +79,6 @@ grpc_cc_test( ], ) -grpc_cc_test( - name = "ev_epollex_linux_test", - srcs = ["ev_epollex_linux_test.cc"], - language = "C++", - tags = ["no_windows"], - deps = [ - "//:gpr", - "//:grpc", - "//test/core/util:grpc_test_util", - ], -) - grpc_cc_test( name = "fd_conservation_posix_test", srcs = ["fd_conservation_posix_test.cc"], diff --git a/test/core/iomgr/ev_epollex_linux_test.cc b/test/core/iomgr/ev_epollex_linux_test.cc deleted file mode 100644 index 5656efa7eac..00000000000 --- a/test/core/iomgr/ev_epollex_linux_test.cc +++ /dev/null @@ -1,115 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#include "src/core/lib/iomgr/port.h" - -/* This test only relevant on linux systems where epoll() is available */ -#if defined(GRPC_LINUX_EPOLL_CREATE1) && defined(GRPC_LINUX_EVENTFD) -#include -#include - -#include - -#include "src/core/lib/iomgr/ev_epollex_linux.h" -#include "test/core/util/test_config.h" - -static void pollset_destroy(void* ps, grpc_error_handle /*error*/) { - grpc_pollset_destroy(static_cast(ps)); - gpr_free(ps); -} - -// This test is added to cover the case found in bug: -// https://github.com/grpc/grpc/issues/15760 -static void test_pollable_owner_fd() { - grpc_core::ExecCtx exec_ctx; - int ev_fd1; - int ev_fd2; - grpc_fd* grpc_fd1; - grpc_fd* grpc_fd2; - grpc_pollset* ps; - gpr_mu* mu; - - // == Create two grpc_fds == - // All we need is two file descriptors. Doesn't matter what type. We use - // eventfd type here for the purpose of this test - ev_fd1 = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); - ev_fd2 = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); - if (ev_fd1 < 0 || ev_fd2 < 0) { - gpr_log(GPR_ERROR, "Error in creating event fds for the test"); - return; - } - grpc_fd1 = grpc_fd_create(ev_fd1, "epollex-test-fd1", false); - grpc_fd2 = grpc_fd_create(ev_fd2, "epollex-test-fd2", false); - grpc_core::ExecCtx::Get()->Flush(); - - // == Create a pollset == - ps = static_cast(gpr_zalloc(grpc_pollset_size())); - grpc_pollset_init(ps, &mu); - grpc_core::ExecCtx::Get()->Flush(); - - // == Add fd1 to pollset == - grpc_pollset_add_fd(ps, grpc_fd1); - grpc_core::ExecCtx::Get()->Flush(); - - // == Destroy fd1 == - grpc_fd_orphan(grpc_fd1, nullptr, nullptr, "test fd1 orphan"); - grpc_core::ExecCtx::Get()->Flush(); - - // = Add fd2 to pollset == - // - // Before https://github.com/grpc/grpc/issues/15760, the following line caused - // unexpected behavior (The previous grpc_pollset_add_fd(ps, grpc_fd1) created - // an underlying structure in epollex that held a reference to grpc_fd1 which - // was being accessed here even after grpc_fd_orphan(grpc_fd1) was called - grpc_pollset_add_fd(ps, grpc_fd2); - grpc_core::ExecCtx::Get()->Flush(); - - // == Destroy fd2 == - grpc_fd_orphan(grpc_fd2, nullptr, nullptr, "test fd2 orphan"); - grpc_core::ExecCtx::Get()->Flush(); - - // == Destroy pollset - grpc_closure ps_destroy_closure; - GRPC_CLOSURE_INIT(&ps_destroy_closure, pollset_destroy, ps, - grpc_schedule_on_exec_ctx); - grpc_pollset_shutdown(ps, &ps_destroy_closure); - grpc_core::ExecCtx::Get()->Flush(); -} - -int main(int argc, char** argv) { - const char* poll_strategy = nullptr; - grpc::testing::TestEnvironment env(argc, argv); - grpc_init(); - { - grpc_core::ExecCtx exec_ctx; - poll_strategy = grpc_get_poll_strategy_name(); - if (poll_strategy != nullptr && strcmp(poll_strategy, "epollex") == 0) { - test_pollable_owner_fd(); - } else { - gpr_log(GPR_INFO, - "Skipping the test. The test is only relevant for 'epollex' " - "strategy. and the current strategy is: '%s'", - poll_strategy); - } - } - - grpc_shutdown(); - return 0; -} -#else /* defined(GRPC_LINUX_EPOLL_CREATE1) && defined(GRPC_LINUX_EVENTFD) */ -int main(int /*argc*/, char** /*argv*/) { return 0; } -#endif diff --git a/tools/dockerfile/grpc_clang_tidy/clang_tidy_all_the_things.sh b/tools/dockerfile/grpc_clang_tidy/clang_tidy_all_the_things.sh index 1127679d79f..1e606638ec8 100755 --- a/tools/dockerfile/grpc_clang_tidy/clang_tidy_all_the_things.sh +++ b/tools/dockerfile/grpc_clang_tidy/clang_tidy_all_the_things.sh @@ -23,6 +23,7 @@ cd ${CLANG_TIDY_ROOT} # run clang tidy for all source files cat compile_commands.json | jq -r '.[].file' \ | grep -E "(^include/|^src/core/|^src/cpp/|^test/core/|^test/cpp/)" \ + | grep -v -E "src/core/lib/debug/stats_data" \ | grep -v -E "/upb-generated/|/upbdefs-generated/" \ | sort \ | xargs tools/distrib/run_clang_tidy.py "$@" diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 3ad601a94ae..1625b8c33de 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -2044,8 +2044,6 @@ src/core/lib/iomgr/ev_apple.cc \ src/core/lib/iomgr/ev_apple.h \ src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_epoll1_linux.h \ -src/core/lib/iomgr/ev_epollex_linux.cc \ -src/core/lib/iomgr/ev_epollex_linux.h \ src/core/lib/iomgr/ev_poll_posix.cc \ src/core/lib/iomgr/ev_poll_posix.h \ src/core/lib/iomgr/ev_posix.cc \ @@ -2093,8 +2091,6 @@ src/core/lib/iomgr/iomgr_internal.h \ src/core/lib/iomgr/iomgr_posix.cc \ src/core/lib/iomgr/iomgr_posix_cfstream.cc \ src/core/lib/iomgr/iomgr_windows.cc \ -src/core/lib/iomgr/is_epollexclusive_available.cc \ -src/core/lib/iomgr/is_epollexclusive_available.h \ src/core/lib/iomgr/load_file.cc \ src/core/lib/iomgr/load_file.h \ src/core/lib/iomgr/lockfree_event.cc \ @@ -2136,7 +2132,6 @@ src/core/lib/iomgr/socket_utils_posix.h \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ src/core/lib/iomgr/socket_windows.h \ -src/core/lib/iomgr/sys_epoll_wrapper.h \ src/core/lib/iomgr/tcp_client.cc \ src/core/lib/iomgr/tcp_client.h \ src/core/lib/iomgr/tcp_client_cfstream.cc \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 22abe9a8faa..ec96d23da06 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -1839,8 +1839,6 @@ src/core/lib/iomgr/ev_apple.cc \ src/core/lib/iomgr/ev_apple.h \ src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_epoll1_linux.h \ -src/core/lib/iomgr/ev_epollex_linux.cc \ -src/core/lib/iomgr/ev_epollex_linux.h \ src/core/lib/iomgr/ev_poll_posix.cc \ src/core/lib/iomgr/ev_poll_posix.h \ src/core/lib/iomgr/ev_posix.cc \ @@ -1888,8 +1886,6 @@ src/core/lib/iomgr/iomgr_internal.h \ src/core/lib/iomgr/iomgr_posix.cc \ src/core/lib/iomgr/iomgr_posix_cfstream.cc \ src/core/lib/iomgr/iomgr_windows.cc \ -src/core/lib/iomgr/is_epollexclusive_available.cc \ -src/core/lib/iomgr/is_epollexclusive_available.h \ src/core/lib/iomgr/load_file.cc \ src/core/lib/iomgr/load_file.h \ src/core/lib/iomgr/lockfree_event.cc \ @@ -1931,7 +1927,6 @@ src/core/lib/iomgr/socket_utils_posix.h \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ src/core/lib/iomgr/socket_windows.h \ -src/core/lib/iomgr/sys_epoll_wrapper.h \ src/core/lib/iomgr/tcp_client.cc \ src/core/lib/iomgr/tcp_client.h \ src/core/lib/iomgr/tcp_client_cfstream.cc \ diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index 7946680b306..3e67534a1a8 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -879,28 +879,6 @@ ], "uses_polling": false }, - { - "args": [], - "benchmark": false, - "ci_platforms": [ - "linux", - "mac", - "posix" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "exclude_iomgrs": [], - "flaky": false, - "gtest": false, - "language": "c", - "name": "ev_epollex_linux_test", - "platforms": [ - "linux", - "mac", - "posix" - ], - "uses_polling": true - }, { "args": [], "benchmark": false, diff --git a/tools/run_tests/helper_scripts/build_cxx.sh b/tools/run_tests/helper_scripts/build_cxx.sh index af479595da2..310da2e9ae0 100755 --- a/tools/run_tests/helper_scripts/build_cxx.sh +++ b/tools/run_tests/helper_scripts/build_cxx.sh @@ -24,4 +24,4 @@ cd cmake/build cmake -DgRPC_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE="${MSBUILD_CONFIG}" "$@" ../.. # GRPC_RUN_TESTS_CXX_LANGUAGE_SUFFIX will be set to either "c" or "cxx" -make -j"${GRPC_RUN_TESTS_JOBS}" "buildtests_${GRPC_RUN_TESTS_CXX_LANGUAGE_SUFFIX}" "tools_${GRPC_RUN_TESTS_CXX_LANGUAGE_SUFFIX}" "check_epollexclusive" +make -j"${GRPC_RUN_TESTS_JOBS}" "buildtests_${GRPC_RUN_TESTS_CXX_LANGUAGE_SUFFIX}" "tools_${GRPC_RUN_TESTS_CXX_LANGUAGE_SUFFIX}" diff --git a/tools/run_tests/performance/massage_qps_stats.py b/tools/run_tests/performance/massage_qps_stats.py index ab1985484ad..d89e8aa18d8 100644 --- a/tools/run_tests/performance/massage_qps_stats.py +++ b/tools/run_tests/performance/massage_qps_stats.py @@ -14,10 +14,6 @@ # Autogenerated by tools/codegen/core/gen_stats_data.py -import os -import sys - -sys.path.append(os.path.dirname(os.path.abspath(__file__))) import massage_qps_stats_helpers @@ -66,11 +62,6 @@ def massage_qps_stats(scenario_result): stats[ "core_pollset_kick_own_thread"] = massage_qps_stats_helpers.counter( core_stats, "pollset_kick_own_thread") - stats["core_syscall_epoll_ctl"] = massage_qps_stats_helpers.counter( - core_stats, "syscall_epoll_ctl") - stats[ - "core_pollset_fd_cache_hits"] = massage_qps_stats_helpers.counter( - core_stats, "pollset_fd_cache_hits") stats[ "core_histogram_slow_lookups"] = massage_qps_stats_helpers.counter( core_stats, "histogram_slow_lookups") diff --git a/tools/run_tests/performance/scenario_result_schema.json b/tools/run_tests/performance/scenario_result_schema.json index 095f6c96bda..b6f30a332dd 100644 --- a/tools/run_tests/performance/scenario_result_schema.json +++ b/tools/run_tests/performance/scenario_result_schema.json @@ -2,1898 +2,1878 @@ { "fields": [ { - "mode": "NULLABLE", - "name": "buildNumber", + "mode": "NULLABLE", + "name": "buildNumber", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "buildUrl", + "mode": "NULLABLE", + "name": "buildUrl", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "jobName", + "mode": "NULLABLE", + "name": "jobName", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "gitCommit", + "mode": "NULLABLE", + "name": "gitCommit", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "gitActualCommit", + "mode": "NULLABLE", + "name": "gitActualCommit", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "created", + "mode": "NULLABLE", + "name": "created", "type": "TIMESTAMP" } - ], - "mode": "NULLABLE", - "name": "metadata", + ], + "mode": "NULLABLE", + "name": "metadata", "type": "RECORD" - }, + }, { "fields": [ { - "mode": "NULLABLE", - "name": "name", + "mode": "NULLABLE", + "name": "name", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "clientConfig", + "mode": "NULLABLE", + "name": "clientConfig", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "numClients", + "mode": "NULLABLE", + "name": "numClients", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "serverConfig", + "mode": "NULLABLE", + "name": "serverConfig", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "numServers", + "mode": "NULLABLE", + "name": "numServers", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "warmupSeconds", + "mode": "NULLABLE", + "name": "warmupSeconds", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "benchmarkSeconds", + "mode": "NULLABLE", + "name": "benchmarkSeconds", "type": "INTEGER" } - ], - "mode": "NULLABLE", - "name": "scenario", + ], + "mode": "NULLABLE", + "name": "scenario", "type": "RECORD" - }, + }, { - "mode": "NULLABLE", - "name": "latencies", + "mode": "NULLABLE", + "name": "latencies", "type": "STRING" - }, + }, { "fields": [ { - "mode": "NULLABLE", - "name": "latencies", + "mode": "NULLABLE", + "name": "latencies", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "timeElapsed", + "mode": "NULLABLE", + "name": "timeElapsed", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "timeUser", + "mode": "NULLABLE", + "name": "timeUser", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "timeSystem", + "mode": "NULLABLE", + "name": "timeSystem", "type": "FLOAT" - }, - { - "mode": "NULLABLE", - "name": "cqPollCount", - "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_client_calls_created", + "mode": "NULLABLE", + "name": "cqPollCount", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_server_calls_created", + "mode": "NULLABLE", + "name": "core_client_calls_created", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_cqs_created", + "mode": "NULLABLE", + "name": "core_server_calls_created", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_client_channels_created", + "mode": "NULLABLE", + "name": "core_cqs_created", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_client_subchannels_created", + "mode": "NULLABLE", + "name": "core_client_channels_created", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_server_channels_created", + "mode": "NULLABLE", + "name": "core_client_subchannels_created", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_syscall_poll", + "mode": "NULLABLE", + "name": "core_server_channels_created", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_syscall_wait", + "mode": "NULLABLE", + "name": "core_syscall_poll", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_pollset_kick", + "mode": "NULLABLE", + "name": "core_syscall_wait", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_pollset_kicked_without_poller", + "mode": "NULLABLE", + "name": "core_pollset_kick", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_pollset_kicked_again", + "mode": "NULLABLE", + "name": "core_pollset_kicked_without_poller", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_pollset_kick_wakeup_fd", + "mode": "NULLABLE", + "name": "core_pollset_kicked_again", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_pollset_kick_wakeup_cv", + "mode": "NULLABLE", + "name": "core_pollset_kick_wakeup_fd", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_pollset_kick_own_thread", + "mode": "NULLABLE", + "name": "core_pollset_kick_wakeup_cv", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_syscall_epoll_ctl", + "mode": "NULLABLE", + "name": "core_pollset_kick_own_thread", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_pollset_fd_cache_hits", + "mode": "NULLABLE", + "name": "core_histogram_slow_lookups", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_histogram_slow_lookups", + "mode": "NULLABLE", + "name": "core_syscall_write", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_syscall_write", + "mode": "NULLABLE", + "name": "core_syscall_read", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_syscall_read", + "mode": "NULLABLE", + "name": "core_tcp_backup_pollers_created", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_backup_pollers_created", + "mode": "NULLABLE", + "name": "core_tcp_backup_poller_polls", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_backup_poller_polls", + "mode": "NULLABLE", + "name": "core_http2_op_batches", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_op_batches", + "mode": "NULLABLE", + "name": "core_http2_op_cancel", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_op_cancel", + "mode": "NULLABLE", + "name": "core_http2_op_send_initial_metadata", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_op_send_initial_metadata", + "mode": "NULLABLE", + "name": "core_http2_op_send_message", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_op_send_message", + "mode": "NULLABLE", + "name": "core_http2_op_send_trailing_metadata", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_op_send_trailing_metadata", + "mode": "NULLABLE", + "name": "core_http2_op_recv_initial_metadata", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_op_recv_initial_metadata", + "mode": "NULLABLE", + "name": "core_http2_op_recv_message", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_op_recv_message", + "mode": "NULLABLE", + "name": "core_http2_op_recv_trailing_metadata", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_op_recv_trailing_metadata", + "mode": "NULLABLE", + "name": "core_http2_settings_writes", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_settings_writes", + "mode": "NULLABLE", + "name": "core_http2_pings_sent", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_pings_sent", + "mode": "NULLABLE", + "name": "core_http2_writes_begun", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_writes_begun", + "mode": "NULLABLE", + "name": "core_http2_writes_offloaded", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_writes_offloaded", + "mode": "NULLABLE", + "name": "core_http2_writes_continued", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_writes_continued", + "mode": "NULLABLE", + "name": "core_http2_partial_writes", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_partial_writes", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_initial_write", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_initial_write", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_start_new_stream", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_start_new_stream", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_send_message", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_send_message", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_send_initial_metadata", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_send_initial_metadata", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_send_trailing_metadata", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_send_trailing_metadata", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_retry_send_ping", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_retry_send_ping", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_continue_pings", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_continue_pings", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_goaway_sent", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_goaway_sent", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_rst_stream", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_rst_stream", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_close_from_api", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_close_from_api", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_stream_flow_control", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_stream_flow_control", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_transport_flow_control", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_transport_flow_control", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_send_settings", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_send_settings", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_bdp_estimator_ping", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_bdp_estimator_ping", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_flow_control_unstalled_by_setting", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_flow_control_unstalled_by_setting", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_flow_control_unstalled_by_update", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_flow_control_unstalled_by_update", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_application_ping", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_application_ping", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_keepalive_ping", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_keepalive_ping", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_transport_flow_control_unstalled", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_transport_flow_control_unstalled", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_ping_response", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_ping_response", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_force_rst_stream", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_force_rst_stream", + "mode": "NULLABLE", + "name": "core_http2_spurious_writes_begun", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_spurious_writes_begun", + "mode": "NULLABLE", + "name": "core_hpack_recv_indexed", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_indexed", + "mode": "NULLABLE", + "name": "core_hpack_recv_lithdr_incidx", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_lithdr_incidx", + "mode": "NULLABLE", + "name": "core_hpack_recv_lithdr_incidx_v", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_lithdr_incidx_v", + "mode": "NULLABLE", + "name": "core_hpack_recv_lithdr_notidx", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_lithdr_notidx", + "mode": "NULLABLE", + "name": "core_hpack_recv_lithdr_notidx_v", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_lithdr_notidx_v", + "mode": "NULLABLE", + "name": "core_hpack_recv_lithdr_nvridx", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_lithdr_nvridx", + "mode": "NULLABLE", + "name": "core_hpack_recv_lithdr_nvridx_v", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_lithdr_nvridx_v", + "mode": "NULLABLE", + "name": "core_hpack_recv_uncompressed", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_uncompressed", + "mode": "NULLABLE", + "name": "core_hpack_recv_huffman", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_huffman", + "mode": "NULLABLE", + "name": "core_hpack_recv_binary", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_binary", + "mode": "NULLABLE", + "name": "core_hpack_recv_binary_base64", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_binary_base64", + "mode": "NULLABLE", + "name": "core_hpack_send_indexed", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_indexed", + "mode": "NULLABLE", + "name": "core_hpack_send_lithdr_incidx", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_lithdr_incidx", + "mode": "NULLABLE", + "name": "core_hpack_send_lithdr_incidx_v", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_lithdr_incidx_v", + "mode": "NULLABLE", + "name": "core_hpack_send_lithdr_notidx", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_lithdr_notidx", + "mode": "NULLABLE", + "name": "core_hpack_send_lithdr_notidx_v", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_lithdr_notidx_v", + "mode": "NULLABLE", + "name": "core_hpack_send_lithdr_nvridx", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_lithdr_nvridx", + "mode": "NULLABLE", + "name": "core_hpack_send_lithdr_nvridx_v", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_lithdr_nvridx_v", + "mode": "NULLABLE", + "name": "core_hpack_send_uncompressed", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_uncompressed", + "mode": "NULLABLE", + "name": "core_hpack_send_huffman", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_huffman", + "mode": "NULLABLE", + "name": "core_hpack_send_binary", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_binary", + "mode": "NULLABLE", + "name": "core_hpack_send_binary_base64", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_binary_base64", + "mode": "NULLABLE", + "name": "core_combiner_locks_initiated", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_combiner_locks_initiated", + "mode": "NULLABLE", + "name": "core_combiner_locks_scheduled_items", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_combiner_locks_scheduled_items", + "mode": "NULLABLE", + "name": "core_combiner_locks_scheduled_final_items", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_combiner_locks_scheduled_final_items", + "mode": "NULLABLE", + "name": "core_combiner_locks_offloaded", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_combiner_locks_offloaded", + "mode": "NULLABLE", + "name": "core_call_combiner_locks_initiated", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_call_combiner_locks_initiated", + "mode": "NULLABLE", + "name": "core_call_combiner_locks_scheduled_items", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_call_combiner_locks_scheduled_items", + "mode": "NULLABLE", + "name": "core_call_combiner_set_notify_on_cancel", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_call_combiner_set_notify_on_cancel", + "mode": "NULLABLE", + "name": "core_call_combiner_cancelled", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_call_combiner_cancelled", + "mode": "NULLABLE", + "name": "core_executor_scheduled_short_items", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_executor_scheduled_short_items", + "mode": "NULLABLE", + "name": "core_executor_scheduled_long_items", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_executor_scheduled_long_items", + "mode": "NULLABLE", + "name": "core_executor_scheduled_to_self", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_executor_scheduled_to_self", + "mode": "NULLABLE", + "name": "core_executor_wakeup_initiated", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_executor_wakeup_initiated", + "mode": "NULLABLE", + "name": "core_executor_queue_drained", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_executor_queue_drained", + "mode": "NULLABLE", + "name": "core_executor_push_retries", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_executor_push_retries", + "mode": "NULLABLE", + "name": "core_server_requested_calls", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_server_requested_calls", + "mode": "NULLABLE", + "name": "core_server_slowpath_requests_queued", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_server_slowpath_requests_queued", + "mode": "NULLABLE", + "name": "core_cq_ev_queue_trylock_failures", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_cq_ev_queue_trylock_failures", + "mode": "NULLABLE", + "name": "core_cq_ev_queue_trylock_successes", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_cq_ev_queue_trylock_successes", + "mode": "NULLABLE", + "name": "core_cq_ev_queue_transient_pop_failures", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_cq_ev_queue_transient_pop_failures", - "type": "INTEGER" - }, - { - "mode": "NULLABLE", - "name": "core_call_initial_size", + "mode": "NULLABLE", + "name": "core_call_initial_size", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_call_initial_size_bkts", + "mode": "NULLABLE", + "name": "core_call_initial_size_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_call_initial_size_50p", + "mode": "NULLABLE", + "name": "core_call_initial_size_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_call_initial_size_95p", + "mode": "NULLABLE", + "name": "core_call_initial_size_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_call_initial_size_99p", + "mode": "NULLABLE", + "name": "core_call_initial_size_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_poll_events_returned", + "mode": "NULLABLE", + "name": "core_poll_events_returned", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_poll_events_returned_bkts", + "mode": "NULLABLE", + "name": "core_poll_events_returned_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_poll_events_returned_50p", + "mode": "NULLABLE", + "name": "core_poll_events_returned_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_poll_events_returned_95p", + "mode": "NULLABLE", + "name": "core_poll_events_returned_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_poll_events_returned_99p", + "mode": "NULLABLE", + "name": "core_poll_events_returned_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_size", + "mode": "NULLABLE", + "name": "core_tcp_write_size", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_size_bkts", + "mode": "NULLABLE", + "name": "core_tcp_write_size_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_size_50p", + "mode": "NULLABLE", + "name": "core_tcp_write_size_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_size_95p", + "mode": "NULLABLE", + "name": "core_tcp_write_size_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_size_99p", + "mode": "NULLABLE", + "name": "core_tcp_write_size_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_iov_size", + "mode": "NULLABLE", + "name": "core_tcp_write_iov_size", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_iov_size_bkts", + "mode": "NULLABLE", + "name": "core_tcp_write_iov_size_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_iov_size_50p", + "mode": "NULLABLE", + "name": "core_tcp_write_iov_size_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_iov_size_95p", + "mode": "NULLABLE", + "name": "core_tcp_write_iov_size_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_iov_size_99p", + "mode": "NULLABLE", + "name": "core_tcp_write_iov_size_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_size", + "mode": "NULLABLE", + "name": "core_tcp_read_size", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_size_bkts", + "mode": "NULLABLE", + "name": "core_tcp_read_size_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_size_50p", + "mode": "NULLABLE", + "name": "core_tcp_read_size_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_size_95p", + "mode": "NULLABLE", + "name": "core_tcp_read_size_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_size_99p", + "mode": "NULLABLE", + "name": "core_tcp_read_size_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer", + "mode": "NULLABLE", + "name": "core_tcp_read_offer", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer_bkts", + "mode": "NULLABLE", + "name": "core_tcp_read_offer_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer_50p", + "mode": "NULLABLE", + "name": "core_tcp_read_offer_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer_95p", + "mode": "NULLABLE", + "name": "core_tcp_read_offer_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer_99p", + "mode": "NULLABLE", + "name": "core_tcp_read_offer_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer_iov_size", + "mode": "NULLABLE", + "name": "core_tcp_read_offer_iov_size", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer_iov_size_bkts", + "mode": "NULLABLE", + "name": "core_tcp_read_offer_iov_size_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer_iov_size_50p", + "mode": "NULLABLE", + "name": "core_tcp_read_offer_iov_size_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer_iov_size_95p", + "mode": "NULLABLE", + "name": "core_tcp_read_offer_iov_size_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer_iov_size_99p", + "mode": "NULLABLE", + "name": "core_tcp_read_offer_iov_size_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_size", + "mode": "NULLABLE", + "name": "core_http2_send_message_size", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_size_bkts", + "mode": "NULLABLE", + "name": "core_http2_send_message_size_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_size_50p", + "mode": "NULLABLE", + "name": "core_http2_send_message_size_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_size_95p", + "mode": "NULLABLE", + "name": "core_http2_send_message_size_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_size_99p", + "mode": "NULLABLE", + "name": "core_http2_send_message_size_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_initial_metadata_per_write", + "mode": "NULLABLE", + "name": "core_http2_send_initial_metadata_per_write", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_initial_metadata_per_write_bkts", + "mode": "NULLABLE", + "name": "core_http2_send_initial_metadata_per_write_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_initial_metadata_per_write_50p", + "mode": "NULLABLE", + "name": "core_http2_send_initial_metadata_per_write_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_initial_metadata_per_write_95p", + "mode": "NULLABLE", + "name": "core_http2_send_initial_metadata_per_write_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_initial_metadata_per_write_99p", + "mode": "NULLABLE", + "name": "core_http2_send_initial_metadata_per_write_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_per_write", + "mode": "NULLABLE", + "name": "core_http2_send_message_per_write", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_per_write_bkts", + "mode": "NULLABLE", + "name": "core_http2_send_message_per_write_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_per_write_50p", + "mode": "NULLABLE", + "name": "core_http2_send_message_per_write_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_per_write_95p", + "mode": "NULLABLE", + "name": "core_http2_send_message_per_write_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_per_write_99p", + "mode": "NULLABLE", + "name": "core_http2_send_message_per_write_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_trailing_metadata_per_write", + "mode": "NULLABLE", + "name": "core_http2_send_trailing_metadata_per_write", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_trailing_metadata_per_write_bkts", + "mode": "NULLABLE", + "name": "core_http2_send_trailing_metadata_per_write_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_trailing_metadata_per_write_50p", + "mode": "NULLABLE", + "name": "core_http2_send_trailing_metadata_per_write_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_trailing_metadata_per_write_95p", + "mode": "NULLABLE", + "name": "core_http2_send_trailing_metadata_per_write_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_trailing_metadata_per_write_99p", + "mode": "NULLABLE", + "name": "core_http2_send_trailing_metadata_per_write_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_flowctl_per_write", + "mode": "NULLABLE", + "name": "core_http2_send_flowctl_per_write", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_flowctl_per_write_bkts", + "mode": "NULLABLE", + "name": "core_http2_send_flowctl_per_write_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_flowctl_per_write_50p", + "mode": "NULLABLE", + "name": "core_http2_send_flowctl_per_write_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_flowctl_per_write_95p", + "mode": "NULLABLE", + "name": "core_http2_send_flowctl_per_write_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_flowctl_per_write_99p", + "mode": "NULLABLE", + "name": "core_http2_send_flowctl_per_write_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_server_cqs_checked", + "mode": "NULLABLE", + "name": "core_server_cqs_checked", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_server_cqs_checked_bkts", + "mode": "NULLABLE", + "name": "core_server_cqs_checked_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_server_cqs_checked_50p", + "mode": "NULLABLE", + "name": "core_server_cqs_checked_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_server_cqs_checked_95p", + "mode": "NULLABLE", + "name": "core_server_cqs_checked_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_server_cqs_checked_99p", + "mode": "NULLABLE", + "name": "core_server_cqs_checked_99p", "type": "FLOAT" } - ], - "mode": "REPEATED", - "name": "clientStats", + ], + "mode": "REPEATED", + "name": "clientStats", "type": "RECORD" - }, + }, { "fields": [ { - "mode": "NULLABLE", - "name": "timeElapsed", + "mode": "NULLABLE", + "name": "timeElapsed", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "timeUser", + "mode": "NULLABLE", + "name": "timeUser", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "timeSystem", + "mode": "NULLABLE", + "name": "timeSystem", "type": "FLOAT" - }, - { - "mode": "NULLABLE", - "name": "cqPollCount", - "type": "INTEGER" - }, - { - "mode": "NULLABLE", - "name": "core_client_calls_created", - "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_server_calls_created", + "mode": "NULLABLE", + "name": "cqPollCount", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_cqs_created", + "mode": "NULLABLE", + "name": "core_client_calls_created", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_client_channels_created", + "mode": "NULLABLE", + "name": "core_server_calls_created", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_client_subchannels_created", + "mode": "NULLABLE", + "name": "core_cqs_created", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_server_channels_created", + "mode": "NULLABLE", + "name": "core_client_channels_created", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_syscall_poll", + "mode": "NULLABLE", + "name": "core_client_subchannels_created", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_syscall_wait", + "mode": "NULLABLE", + "name": "core_server_channels_created", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_pollset_kick", + "mode": "NULLABLE", + "name": "core_syscall_poll", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_pollset_kicked_without_poller", + "mode": "NULLABLE", + "name": "core_syscall_wait", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_pollset_kicked_again", + "mode": "NULLABLE", + "name": "core_pollset_kick", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_pollset_kick_wakeup_fd", + "mode": "NULLABLE", + "name": "core_pollset_kicked_without_poller", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_pollset_kick_wakeup_cv", + "mode": "NULLABLE", + "name": "core_pollset_kicked_again", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_pollset_kick_own_thread", + "mode": "NULLABLE", + "name": "core_pollset_kick_wakeup_fd", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_syscall_epoll_ctl", + "mode": "NULLABLE", + "name": "core_pollset_kick_wakeup_cv", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_pollset_fd_cache_hits", + "mode": "NULLABLE", + "name": "core_pollset_kick_own_thread", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_histogram_slow_lookups", + "mode": "NULLABLE", + "name": "core_histogram_slow_lookups", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_syscall_write", + "mode": "NULLABLE", + "name": "core_syscall_write", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_syscall_read", + "mode": "NULLABLE", + "name": "core_syscall_read", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_backup_pollers_created", + "mode": "NULLABLE", + "name": "core_tcp_backup_pollers_created", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_backup_poller_polls", + "mode": "NULLABLE", + "name": "core_tcp_backup_poller_polls", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_op_batches", + "mode": "NULLABLE", + "name": "core_http2_op_batches", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_op_cancel", + "mode": "NULLABLE", + "name": "core_http2_op_cancel", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_op_send_initial_metadata", + "mode": "NULLABLE", + "name": "core_http2_op_send_initial_metadata", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_op_send_message", + "mode": "NULLABLE", + "name": "core_http2_op_send_message", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_op_send_trailing_metadata", + "mode": "NULLABLE", + "name": "core_http2_op_send_trailing_metadata", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_op_recv_initial_metadata", + "mode": "NULLABLE", + "name": "core_http2_op_recv_initial_metadata", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_op_recv_message", + "mode": "NULLABLE", + "name": "core_http2_op_recv_message", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_op_recv_trailing_metadata", + "mode": "NULLABLE", + "name": "core_http2_op_recv_trailing_metadata", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_settings_writes", + "mode": "NULLABLE", + "name": "core_http2_settings_writes", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_pings_sent", + "mode": "NULLABLE", + "name": "core_http2_pings_sent", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_writes_begun", + "mode": "NULLABLE", + "name": "core_http2_writes_begun", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_writes_offloaded", + "mode": "NULLABLE", + "name": "core_http2_writes_offloaded", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_writes_continued", + "mode": "NULLABLE", + "name": "core_http2_writes_continued", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_partial_writes", + "mode": "NULLABLE", + "name": "core_http2_partial_writes", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_initial_write", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_initial_write", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_start_new_stream", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_start_new_stream", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_send_message", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_send_message", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_send_initial_metadata", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_send_initial_metadata", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_send_trailing_metadata", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_send_trailing_metadata", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_retry_send_ping", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_retry_send_ping", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_continue_pings", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_continue_pings", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_goaway_sent", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_goaway_sent", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_rst_stream", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_rst_stream", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_close_from_api", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_close_from_api", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_stream_flow_control", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_stream_flow_control", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_transport_flow_control", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_transport_flow_control", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_send_settings", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_send_settings", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_bdp_estimator_ping", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_bdp_estimator_ping", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_flow_control_unstalled_by_setting", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_flow_control_unstalled_by_setting", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_flow_control_unstalled_by_update", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_flow_control_unstalled_by_update", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_application_ping", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_application_ping", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_keepalive_ping", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_keepalive_ping", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_transport_flow_control_unstalled", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_transport_flow_control_unstalled", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_ping_response", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_ping_response", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_initiate_write_due_to_force_rst_stream", + "mode": "NULLABLE", + "name": "core_http2_initiate_write_due_to_force_rst_stream", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_spurious_writes_begun", + "mode": "NULLABLE", + "name": "core_http2_spurious_writes_begun", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_indexed", + "mode": "NULLABLE", + "name": "core_hpack_recv_indexed", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_lithdr_incidx", + "mode": "NULLABLE", + "name": "core_hpack_recv_lithdr_incidx", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_lithdr_incidx_v", + "mode": "NULLABLE", + "name": "core_hpack_recv_lithdr_incidx_v", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_lithdr_notidx", + "mode": "NULLABLE", + "name": "core_hpack_recv_lithdr_notidx", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_lithdr_notidx_v", + "mode": "NULLABLE", + "name": "core_hpack_recv_lithdr_notidx_v", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_lithdr_nvridx", + "mode": "NULLABLE", + "name": "core_hpack_recv_lithdr_nvridx", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_lithdr_nvridx_v", + "mode": "NULLABLE", + "name": "core_hpack_recv_lithdr_nvridx_v", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_uncompressed", + "mode": "NULLABLE", + "name": "core_hpack_recv_uncompressed", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_huffman", + "mode": "NULLABLE", + "name": "core_hpack_recv_huffman", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_binary", + "mode": "NULLABLE", + "name": "core_hpack_recv_binary", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_recv_binary_base64", + "mode": "NULLABLE", + "name": "core_hpack_recv_binary_base64", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_indexed", + "mode": "NULLABLE", + "name": "core_hpack_send_indexed", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_lithdr_incidx", + "mode": "NULLABLE", + "name": "core_hpack_send_lithdr_incidx", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_lithdr_incidx_v", + "mode": "NULLABLE", + "name": "core_hpack_send_lithdr_incidx_v", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_lithdr_notidx", + "mode": "NULLABLE", + "name": "core_hpack_send_lithdr_notidx", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_lithdr_notidx_v", + "mode": "NULLABLE", + "name": "core_hpack_send_lithdr_notidx_v", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_lithdr_nvridx", + "mode": "NULLABLE", + "name": "core_hpack_send_lithdr_nvridx", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_lithdr_nvridx_v", + "mode": "NULLABLE", + "name": "core_hpack_send_lithdr_nvridx_v", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_uncompressed", + "mode": "NULLABLE", + "name": "core_hpack_send_uncompressed", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_huffman", + "mode": "NULLABLE", + "name": "core_hpack_send_huffman", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_binary", + "mode": "NULLABLE", + "name": "core_hpack_send_binary", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_hpack_send_binary_base64", + "mode": "NULLABLE", + "name": "core_hpack_send_binary_base64", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_combiner_locks_initiated", + "mode": "NULLABLE", + "name": "core_combiner_locks_initiated", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_combiner_locks_scheduled_items", + "mode": "NULLABLE", + "name": "core_combiner_locks_scheduled_items", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_combiner_locks_scheduled_final_items", + "mode": "NULLABLE", + "name": "core_combiner_locks_scheduled_final_items", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_combiner_locks_offloaded", + "mode": "NULLABLE", + "name": "core_combiner_locks_offloaded", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_call_combiner_locks_initiated", + "mode": "NULLABLE", + "name": "core_call_combiner_locks_initiated", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_call_combiner_locks_scheduled_items", + "mode": "NULLABLE", + "name": "core_call_combiner_locks_scheduled_items", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_call_combiner_set_notify_on_cancel", + "mode": "NULLABLE", + "name": "core_call_combiner_set_notify_on_cancel", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_call_combiner_cancelled", + "mode": "NULLABLE", + "name": "core_call_combiner_cancelled", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_executor_scheduled_short_items", + "mode": "NULLABLE", + "name": "core_executor_scheduled_short_items", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_executor_scheduled_long_items", + "mode": "NULLABLE", + "name": "core_executor_scheduled_long_items", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_executor_scheduled_to_self", + "mode": "NULLABLE", + "name": "core_executor_scheduled_to_self", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_executor_wakeup_initiated", + "mode": "NULLABLE", + "name": "core_executor_wakeup_initiated", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_executor_queue_drained", + "mode": "NULLABLE", + "name": "core_executor_queue_drained", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_executor_push_retries", + "mode": "NULLABLE", + "name": "core_executor_push_retries", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_server_requested_calls", + "mode": "NULLABLE", + "name": "core_server_requested_calls", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_server_slowpath_requests_queued", + "mode": "NULLABLE", + "name": "core_server_slowpath_requests_queued", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_cq_ev_queue_trylock_failures", + "mode": "NULLABLE", + "name": "core_cq_ev_queue_trylock_failures", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_cq_ev_queue_trylock_successes", + "mode": "NULLABLE", + "name": "core_cq_ev_queue_trylock_successes", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_cq_ev_queue_transient_pop_failures", + "mode": "NULLABLE", + "name": "core_cq_ev_queue_transient_pop_failures", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "core_call_initial_size", + "mode": "NULLABLE", + "name": "core_call_initial_size", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_call_initial_size_bkts", + "mode": "NULLABLE", + "name": "core_call_initial_size_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_call_initial_size_50p", + "mode": "NULLABLE", + "name": "core_call_initial_size_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_call_initial_size_95p", + "mode": "NULLABLE", + "name": "core_call_initial_size_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_call_initial_size_99p", + "mode": "NULLABLE", + "name": "core_call_initial_size_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_poll_events_returned", + "mode": "NULLABLE", + "name": "core_poll_events_returned", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_poll_events_returned_bkts", + "mode": "NULLABLE", + "name": "core_poll_events_returned_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_poll_events_returned_50p", + "mode": "NULLABLE", + "name": "core_poll_events_returned_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_poll_events_returned_95p", + "mode": "NULLABLE", + "name": "core_poll_events_returned_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_poll_events_returned_99p", + "mode": "NULLABLE", + "name": "core_poll_events_returned_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_size", + "mode": "NULLABLE", + "name": "core_tcp_write_size", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_size_bkts", + "mode": "NULLABLE", + "name": "core_tcp_write_size_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_size_50p", + "mode": "NULLABLE", + "name": "core_tcp_write_size_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_size_95p", + "mode": "NULLABLE", + "name": "core_tcp_write_size_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_size_99p", + "mode": "NULLABLE", + "name": "core_tcp_write_size_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_iov_size", + "mode": "NULLABLE", + "name": "core_tcp_write_iov_size", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_iov_size_bkts", + "mode": "NULLABLE", + "name": "core_tcp_write_iov_size_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_iov_size_50p", + "mode": "NULLABLE", + "name": "core_tcp_write_iov_size_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_iov_size_95p", + "mode": "NULLABLE", + "name": "core_tcp_write_iov_size_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_write_iov_size_99p", + "mode": "NULLABLE", + "name": "core_tcp_write_iov_size_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_size", + "mode": "NULLABLE", + "name": "core_tcp_read_size", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_size_bkts", + "mode": "NULLABLE", + "name": "core_tcp_read_size_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_size_50p", + "mode": "NULLABLE", + "name": "core_tcp_read_size_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_size_95p", + "mode": "NULLABLE", + "name": "core_tcp_read_size_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_size_99p", + "mode": "NULLABLE", + "name": "core_tcp_read_size_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer", + "mode": "NULLABLE", + "name": "core_tcp_read_offer", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer_bkts", + "mode": "NULLABLE", + "name": "core_tcp_read_offer_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer_50p", + "mode": "NULLABLE", + "name": "core_tcp_read_offer_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer_95p", + "mode": "NULLABLE", + "name": "core_tcp_read_offer_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer_99p", + "mode": "NULLABLE", + "name": "core_tcp_read_offer_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer_iov_size", + "mode": "NULLABLE", + "name": "core_tcp_read_offer_iov_size", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer_iov_size_bkts", + "mode": "NULLABLE", + "name": "core_tcp_read_offer_iov_size_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer_iov_size_50p", + "mode": "NULLABLE", + "name": "core_tcp_read_offer_iov_size_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer_iov_size_95p", + "mode": "NULLABLE", + "name": "core_tcp_read_offer_iov_size_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_tcp_read_offer_iov_size_99p", + "mode": "NULLABLE", + "name": "core_tcp_read_offer_iov_size_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_size", + "mode": "NULLABLE", + "name": "core_http2_send_message_size", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_size_bkts", + "mode": "NULLABLE", + "name": "core_http2_send_message_size_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_size_50p", + "mode": "NULLABLE", + "name": "core_http2_send_message_size_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_size_95p", + "mode": "NULLABLE", + "name": "core_http2_send_message_size_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_size_99p", + "mode": "NULLABLE", + "name": "core_http2_send_message_size_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_initial_metadata_per_write", + "mode": "NULLABLE", + "name": "core_http2_send_initial_metadata_per_write", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_initial_metadata_per_write_bkts", + "mode": "NULLABLE", + "name": "core_http2_send_initial_metadata_per_write_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_initial_metadata_per_write_50p", + "mode": "NULLABLE", + "name": "core_http2_send_initial_metadata_per_write_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_initial_metadata_per_write_95p", + "mode": "NULLABLE", + "name": "core_http2_send_initial_metadata_per_write_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_initial_metadata_per_write_99p", + "mode": "NULLABLE", + "name": "core_http2_send_initial_metadata_per_write_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_per_write", + "mode": "NULLABLE", + "name": "core_http2_send_message_per_write", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_per_write_bkts", + "mode": "NULLABLE", + "name": "core_http2_send_message_per_write_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_per_write_50p", + "mode": "NULLABLE", + "name": "core_http2_send_message_per_write_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_per_write_95p", + "mode": "NULLABLE", + "name": "core_http2_send_message_per_write_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_message_per_write_99p", + "mode": "NULLABLE", + "name": "core_http2_send_message_per_write_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_trailing_metadata_per_write", + "mode": "NULLABLE", + "name": "core_http2_send_trailing_metadata_per_write", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_trailing_metadata_per_write_bkts", + "mode": "NULLABLE", + "name": "core_http2_send_trailing_metadata_per_write_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_trailing_metadata_per_write_50p", + "mode": "NULLABLE", + "name": "core_http2_send_trailing_metadata_per_write_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_trailing_metadata_per_write_95p", + "mode": "NULLABLE", + "name": "core_http2_send_trailing_metadata_per_write_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_trailing_metadata_per_write_99p", + "mode": "NULLABLE", + "name": "core_http2_send_trailing_metadata_per_write_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_flowctl_per_write", + "mode": "NULLABLE", + "name": "core_http2_send_flowctl_per_write", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_flowctl_per_write_bkts", + "mode": "NULLABLE", + "name": "core_http2_send_flowctl_per_write_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_flowctl_per_write_50p", + "mode": "NULLABLE", + "name": "core_http2_send_flowctl_per_write_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_flowctl_per_write_95p", + "mode": "NULLABLE", + "name": "core_http2_send_flowctl_per_write_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_http2_send_flowctl_per_write_99p", + "mode": "NULLABLE", + "name": "core_http2_send_flowctl_per_write_99p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_server_cqs_checked", + "mode": "NULLABLE", + "name": "core_server_cqs_checked", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_server_cqs_checked_bkts", + "mode": "NULLABLE", + "name": "core_server_cqs_checked_bkts", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "core_server_cqs_checked_50p", + "mode": "NULLABLE", + "name": "core_server_cqs_checked_50p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_server_cqs_checked_95p", + "mode": "NULLABLE", + "name": "core_server_cqs_checked_95p", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "core_server_cqs_checked_99p", + "mode": "NULLABLE", + "name": "core_server_cqs_checked_99p", "type": "FLOAT" } - ], - "mode": "REPEATED", - "name": "serverStats", + ], + "mode": "REPEATED", + "name": "serverStats", "type": "RECORD" - }, + }, { - "mode": "NULLABLE", - "name": "serverCores", + "mode": "NULLABLE", + "name": "serverCores", "type": "STRING" - }, + }, { "fields": [ { - "mode": "NULLABLE", - "name": "qps", + "mode": "NULLABLE", + "name": "qps", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "qpsPerServerCore", + "mode": "NULLABLE", + "name": "qpsPerServerCore", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "serverSystemTime", + "mode": "NULLABLE", + "name": "serverSystemTime", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "serverUserTime", + "mode": "NULLABLE", + "name": "serverUserTime", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "clientSystemTime", + "mode": "NULLABLE", + "name": "clientSystemTime", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "clientUserTime", + "mode": "NULLABLE", + "name": "clientUserTime", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "latency50", + "mode": "NULLABLE", + "name": "latency50", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "latency90", + "mode": "NULLABLE", + "name": "latency90", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "latency95", + "mode": "NULLABLE", + "name": "latency95", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "latency99", + "mode": "NULLABLE", + "name": "latency99", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "latency999", + "mode": "NULLABLE", + "name": "latency999", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "clientPollsPerRequest", + "mode": "NULLABLE", + "name": "clientPollsPerRequest", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "serverPollsPerRequest", + "mode": "NULLABLE", + "name": "serverPollsPerRequest", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "serverQueriesPerCpuSec", + "mode": "NULLABLE", + "name": "serverQueriesPerCpuSec", "type": "FLOAT" - }, + }, { - "mode": "NULLABLE", - "name": "clientQueriesPerCpuSec", + "mode": "NULLABLE", + "name": "clientQueriesPerCpuSec", "type": "FLOAT" } - ], - "mode": "NULLABLE", - "name": "summary", + ], + "mode": "NULLABLE", + "name": "summary", "type": "RECORD" - }, + }, { - "mode": "NULLABLE", - "name": "clientSuccess", + "mode": "NULLABLE", + "name": "clientSuccess", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "serverSuccess", + "mode": "NULLABLE", + "name": "serverSuccess", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "requestResults", + "mode": "NULLABLE", + "name": "requestResults", "type": "STRING" - }, + }, { "fields": [ { - "mode": "NULLABLE", - "name": "totalCpuTime", + "mode": "NULLABLE", + "name": "totalCpuTime", "type": "INTEGER" - }, + }, { - "mode": "NULLABLE", - "name": "idleCpuTime", + "mode": "NULLABLE", + "name": "idleCpuTime", "type": "INTEGER" } - ], - "mode": "REPEATED", - "name": "serverCpuStats", + ], + "mode": "REPEATED", + "name": "serverCpuStats", "type": "RECORD" - }, + }, { - "mode": "NULLABLE", - "name": "serverCpuUsage", + "mode": "NULLABLE", + "name": "serverCpuUsage", "type": "FLOAT" }, { @@ -1906,72 +1886,72 @@ { "fields": [ { - "mode": "NULLABLE", - "name": "name", + "mode": "NULLABLE", + "name": "name", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "podIP", + "mode": "NULLABLE", + "name": "podIP", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "nodeName", + "mode": "NULLABLE", + "name": "nodeName", "type": "STRING" } ], - "mode": "NULLABLE", - "name": "driver", + "mode": "NULLABLE", + "name": "driver", "type": "RECORD" - }, + }, { "fields": [ { - "mode": "NULLABLE", - "name": "name", + "mode": "NULLABLE", + "name": "name", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "podIP", + "mode": "NULLABLE", + "name": "podIP", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "nodeName", + "mode": "NULLABLE", + "name": "nodeName", "type": "STRING" } ], - "mode": "REPEATED", - "name": "servers", + "mode": "REPEATED", + "name": "servers", "type": "RECORD" - }, + }, { "fields": [ { - "mode": "NULLABLE", - "name": "name", + "mode": "NULLABLE", + "name": "name", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "podIP", + "mode": "NULLABLE", + "name": "podIP", "type": "STRING" - }, + }, { - "mode": "NULLABLE", - "name": "nodeName", + "mode": "NULLABLE", + "name": "nodeName", "type": "STRING" } ], - "mode": "REPEATED", - "name": "clients", + "mode": "REPEATED", + "name": "clients", "type": "RECORD" } - ], - "mode": "NULLABLE", - "name": "nodeMetadata", + ], + "mode": "NULLABLE", + "name": "nodeMetadata", "type": "RECORD" } -] +] \ No newline at end of file diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 3666defaa1d..b09d779c8ff 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -63,7 +63,7 @@ _FORCE_ENVIRON_FOR_WRAPPERS = { } _POLLING_STRATEGIES = { - 'linux': ['epollex', 'epoll1', 'poll'], + 'linux': ['epoll1', 'poll'], 'mac': ['poll'], } @@ -1341,20 +1341,6 @@ def _calculate_num_runs_failures(list_of_results): return num_runs, num_failures -def _has_epollexclusive(): - binary = 'cmake/build/check_epollexclusive' - if not os.path.exists(binary): - return False - try: - subprocess.check_call(binary) - return True - except subprocess.CalledProcessError as e: - return False - except OSError as e: - # For languages other than C and Windows the binary won't exist - return False - - class BuildAndRunError(object): """Represents error type in _build_and_run.""" @@ -1384,12 +1370,6 @@ def _build_and_run(check_cancelled, resultset, xml_report, suite_name=args.report_suite_name) return [] - if not args.travis and not _has_epollexclusive() and platform_string( - ) in _POLLING_STRATEGIES and 'epollex' in _POLLING_STRATEGIES[ - platform_string()]: - print('\n\nOmitting EPOLLEXCLUSIVE tests\n\n') - _POLLING_STRATEGIES[platform_string()].remove('epollex') - # start antagonists antagonists = [ subprocess.Popen(['tools/run_tests/python_utils/antagonist.py'])