Skip to content

Don't count internal threads against ExecCtx count#15825

Merged
kpayson64 merged 1 commit intogrpc:v1.13.xfrom
kpayson64:exec_ctx_check_bugfix
Jun 21, 2018
Merged

Don't count internal threads against ExecCtx count#15825
kpayson64 merged 1 commit intogrpc:v1.13.xfrom
kpayson64:exec_ctx_check_bugfix

Conversation

@kpayson64
Copy link
Copy Markdown
Contributor

This should avoid counting the ExecCtx's from the timer and executor, so that fork can proceed if these are alive.

@grpc-testing
Copy link
Copy Markdown

****************************************************************

libgrpc.so

     VM SIZE                                                                             FILE SIZE
 ++++++++++++++ GROWING                                                               ++++++++++++++
  +0.0%      +3 [None]                                                                +7.14Ki  +0.1%
  +0.6%    +235 [Other]                                                                  +235  +0.6%
  +1.4%     +58 src/core/lib/iomgr/tcp_server_custom.cc                                   +58  +1.4%
       +10%     +26 grpc_custom_close_server_callback                                         +26   +10%
      +7.0%     +21 custom_close_callback                                                     +21  +7.0%
      +2.1%     +16 custom_accept_callback                                                    +16  +2.1%
      +2.3%     +11 tcp_server_unref                                                          +11  +2.3%
  +0.7%     +58 src/core/lib/surface/completion_queue.cc                                  +58  +0.7%
       +23%     +13 ExecCtxNext::~ExecCtxNext                                                 +13   +23%
       +23%     +13 ExecCtxPluck::~ExecCtxPluck                                               +13   +23%
      +0.7%      +8 cq_next                                                                    +8  +0.7%
      +1.8%      +8 grpc_completion_queue_thread_local_cache_flush                             +8  +1.8%
      +1.7%      +7 grpc_completion_queue_create_internal                                      +7  +1.7%
      +2.7%      +7 grpc_completion_queue_destroy                                              +7  +2.7%
      +2.5%      +7 grpc_completion_queue_shutdown                                             +7  +2.5%
  +1.6%     +55 src/core/lib/iomgr/tcp_custom.cc                                          +55  +1.6%
      +9.2%     +24 custom_close_callback                                                     +24  +9.2%
      +5.2%      +8 [Unmapped]                                                                 +8  +5.2%
      +1.9%      +8 custom_read_callback                                                       +8  +1.9%
      +2.3%      +8 custom_write_callback                                                      +8  +2.3%
      +1.5%      +7 custom_tcp_endpoint_create                                                 +7  +1.5%
  +7.3%     +48 src/core/lib/iomgr/fork_posix.cc                                          +48  +7.3%
      +9.1%     +36 grpc_prefork                                                              +36  +9.1%
      +7.8%     +18 grpc_postfork_child() [clone .localalias.1]                               +18  +7.8%
  +2.1%     +48 src/core/lib/security/credentials/credentials.cc                          +48  +2.1%
       +12%     +27 [Unmapped]                                                                +27   +12%
      +2.7%      +7 grpc_call_credentials_release                                              +7  +2.7%
      +2.7%      +7 grpc_channel_credentials_release                                           +7  +2.7%
      +2.7%      +7 grpc_server_credentials_release                                            +7  +2.7%
  +0.9%     +48 src/core/lib/surface/channel.cc                                           +48  +0.9%
      +2.6%     +16 grpc_channel_create_call                                                  +16  +2.6%
      +1.6%      +8 grpc_channel_create_registered_call                                        +8  +1.6%
      +1.2%      +8 grpc_channel_register_call                                                 +8  +1.2%
      +1.8%      +7 grpc_channel_destroy                                                       +7  +1.8%
      +3.0%      +7 grpc_channel_get_info                                                      +7  +3.0%
      +1.5%      +2 [Unmapped]                                                                 +2  +1.5%
  +0.4%     +48 src/core/lib/surface/server.cc                                            +48  +0.4%
      +5.2%     +17 [Unmapped]                                                                +17  +5.2%
      +2.8%     +16 grpc_server_request_call                                                  +16  +2.8%
      +0.9%      +8 grpc_server_shutdown_and_notify                                            +8  +0.9%
      +1.8%      +7 grpc_server_cancel_all_calls                                               +7  +1.8%
  +1.0%     +32 src/core/lib/security/context/security_context.cc                         +32  +1.0%
      +3.5%     +16 grpc_call_set_credentials                                                 +16  +3.5%
      +5.3%      +9 [Unmapped]                                                                 +9  +5.3%
      +2.6%      +7 grpc_client_security_context_destroy                                       +7  +2.6%
  +0.7%     +32 src/core/lib/slice/slice_buffer.cc                                        +32  +0.7%
      +4.6%     +11 grpc_slice_buffer_destroy                                                 +11  +4.6%
      +4.6%     +11 grpc_slice_buffer_reset_and_unref                                         +11  +4.6%
      +7.2%     +10 [Unmapped]                                                                +10  +7.2%
  +0.2%     +23 src/core/ext/transport/inproc/inproc_transport.cc                         +23  +0.2%
      +1.1%      +7 grpc_inproc_channel_create                                                 +7  +1.1%
      +1.0%      +7 grpc_inproc_transport_init                                                 +7  +1.0%
      +1.9%      +7 grpc_inproc_transport_shutdown                                             +7  +1.9%
      +0.9%      +2 [Unmapped]                                                                 +2  +0.9%
  +2.4%     +16 src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc     +16  +2.4%
      +2.4%     +16 grpc_insecure_channel_create_from_fd                                      +16  +2.4%
  +0.7%     +16 src/core/lib/compression/stream_compression_gzip.cc                       +16  +0.7%
      +1.0%     +16 gzip_flate                                                                +16  +1.0%
  +2.3%     +16 src/core/lib/iomgr/endpoint_pair_posix.cc                                 +16  +2.3%
      +2.3%     +16 grpc_iomgr_create_endpoint_pair                                           +16  +2.3%
  +5.0%     +16 src/core/lib/iomgr/iomgr_custom.cc                                        +16  +5.0%
       +32%      +9 [Unmapped]                                                                 +9   +32%
      +3.2%      +7 iomgr_platform_init                                                        +7  +3.2%
  +1.1%     +16 src/core/lib/iomgr/resolve_address_custom.cc                              +16  +1.1%
       +26%      +8 [Unmapped]                                                                 +8   +26%
      +2.1%      +8 grpc_custom_resolve_callback                                               +8  +2.1%
  +0.9%     +16 src/core/lib/iomgr/resolve_address_posix.cc                               +16  +0.9%
      +1.1%     +16 posix_blocking_resolve_address                                            +16  +1.1%
  +0.2%     +16 src/core/lib/iomgr/resource_quota.cc                                      +16  +0.2%
      +2.3%      +7 grpc_resource_quota_resize                                                 +7  +2.3%
      +3.3%      +7 grpc_resource_quota_unref                                                  +7  +3.3%
      +0.7%      +2 [Unmapped]                                                                 +2  +0.7%
  +1.5%     +16 src/core/lib/iomgr/tcp_client_custom.cc                                   +16  +1.5%
      +4.2%     +16 custom_connect_callback                                                   +16  +4.2%
  +0.6%     +16 src/core/lib/iomgr/timer_manager.cc                                       +16  +0.6%
      +1.3%     +16 timer_thread                                                              +16  +1.3%
      +3.1%      +7 grpc_timer_manager_tick                                                    +7  +3.1%

  +0.1%    +832 TOTAL                                                                 +7.95Ki  +0.1%


****************************************************************

libgrpc++.so

     VM SIZE                                                     FILE SIZE
 ++++++++++++++ GROWING                                       ++++++++++++++
  +0.0%     +22 [None]                                        +1.26Ki  +0.0%
  +4.2%    +122 src/cpp/common/alarm.cc                          +122  +4.2%
      +9.8%     +64 grpc::Alarm::~Alarm                               +64  +9.8%
      +7.2%     +24 grpc::internal::AlarmImpl::FinalizeResult         +24  +7.2%
       +23%     +13 grpc_core::ExecCtx::~ExecCtx                      +13   +23%
      +2.7%      +7 grpc::Alarm::Cancel                                +7  +2.7%
      +2.6%      +7 grpc::internal::AlarmImpl::~AlarmImpl              +7  +2.6%
      +2.7%      +7 grpc::internal::AlarmImpl::~AlarmImpl              +7  +2.7%
  +0.3%     +16 src/cpp/common/channel_arguments.cc               +16  +0.3%
      +1.9%     +16 grpc::ChannelArguments::SetSocketMutator          +16  +1.9%
      +2.3%      +7 grpc::ChannelArguments::~ChannelArguments          +7  +2.3%

  +0.0%    +160 TOTAL                                         +1.39Ki  +0.0%



Copy link
Copy Markdown
Contributor

@ericgribkoff ericgribkoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Tested locally and this change allows the fork handlers to still run after a channel has been created.

@grpc-testing
Copy link
Copy Markdown

[trickle] No significant performance differences

@grpc-testing
Copy link
Copy Markdown

[microbenchmarks] No significant performance differences

@kpayson64
Copy link
Copy Markdown
Contributor Author

All the failures are caused by node failing to build.

@kpayson64 kpayson64 merged commit 8c6bea1 into grpc:v1.13.x Jun 21, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Sep 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants