From 59203c51cc6a9676ef1ab42aebe070a55f55ead2 Mon Sep 17 00:00:00 2001 From: Sean Bright Date: Mon, 17 Apr 2017 20:06:10 -0400 Subject: core: Use eventfd for alert pipes on Linux when possible The primary win of switching to eventfd when possible is that it only uses a single file descriptor while pipe() will use two. This means for each bridge channel we're reducing the number of required file descriptors by 1, and - if you're using timerfd - we also now have 1 less file descriptor per Asterisk channel. The API is not ideal (passing int arrays), but this is the cleanest approach I could come up with to maintain API/ABI. I've also removed what I believe to be an erroneous code block that checked the non-blocking flag on the pipe ends for each read. If the file descriptor is 'losing' its non-blocking mode, it is because of a bug somewhere else in our code. In my testing I haven't seen any measurable difference in performance. Change-Id: Iff0fb1573e7f7a187d5211ddc60aa8f3da3edb1d --- include/asterisk/channel.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'include/asterisk/channel.h') diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 32c9c7f67..3e04b5d0b 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -123,6 +123,7 @@ References: #ifndef _ASTERISK_CHANNEL_H #define _ASTERISK_CHANNEL_H +#include "asterisk/alertpipe.h" #include "asterisk/abstract_jb.h" #include "asterisk/astobj2.h" #include "asterisk/poll-compat.h" @@ -4267,12 +4268,6 @@ struct ast_namedgroups *ast_channel_named_pickupgroups(const struct ast_channel void ast_channel_named_pickupgroups_set(struct ast_channel *chan, struct ast_namedgroups *value); /* Alertpipe accessors--the "internal" functions for channel.c use only */ -typedef enum { - AST_ALERT_READ_SUCCESS = 0, - AST_ALERT_NOT_READABLE, - AST_ALERT_READ_FAIL, - AST_ALERT_READ_FATAL, -} ast_alert_status_t; int ast_channel_alert_write(struct ast_channel *chan); int ast_channel_alert_writable(struct ast_channel *chan); ast_alert_status_t ast_channel_internal_alert_flush(struct ast_channel *chan); -- cgit v1.2.3