From 9520dc9163d5a1e9e4cb080e986eddc03a81c661 Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Fri, 14 Oct 2022 15:26:07 -0600 Subject: [PATCH] opal/event: use epoll by default on Linux Under normal circumstances epoll and poll produce similar performance on Linux. When busy polling is enabled they do not. Testing with a TCP-based system shows a significan performance degredation when using poll with busy waiting enabled. This performance regression is not seen when using epoll. This PR adjusts the default value of opal_event_include to epoll on Linux only to fix the regression. Fixes #10929 Signed-off-by: Nathan Hjelm (cherry picked from commit 279f6b6fc5182be9bd2f929229391bce118ffdee) --- opal/util/event.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/opal/util/event.c b/opal/util/event.c index aab045220d0..263adecd97d 100644 --- a/opal/util/event.c +++ b/opal/util/event.c @@ -12,6 +12,7 @@ * Copyright (c) 2017 IBM Corporation. All rights reserved. * Copyright (c) 2018-2020 Amazon.com, Inc. or its affiliates. All * Rights reserved. + * Copyright (c) 2022 Google, LLC. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -45,8 +46,10 @@ int opal_event_register_params(void) // Get supported methods opal_event_all_available_eventops = event_get_supported_methods(); -#ifdef __APPLE__ +#if defined(PLATFORM_OS_DARWIN) opal_event_module_include = "select"; +#elif defined(PLATFORM_OS_LINUX) + opal_event_module_include = "epoll"; #else opal_event_module_include = "poll"; #endif