summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorShyam <srangana@redhat.com>2015-02-23 10:00:39 -0500
committerRaghavendra G <rgowdapp@redhat.com>2015-03-01 22:50:07 -0800
commitc48cbccfafbcf71aaad4ed7d868dbac609bc34fe (patch)
treeb563a62dc508808fe761dcc4df32aa2af43b9148 /libglusterfs
parent56488efe3c858da7f8a0b66d30a2eface2f6f35e (diff)
epoll: Fix broken RPC throttling due to MT epoll
The RPC throttle which kicks in by setting the poll-in event on a socket to false, is broken with the MT epoll commit. This is due to the event handler of poll-in attempting to read as much out of the socket till it receives an EAGAIN. Which may never happen and hence we would be processing far more RPCs that we want to. This is being fixed by changing the epoll from ET to LT, and reading request by request, so that we honor the throttle. The downside is that we do not drain the socket, but go back to epoll_wait before reading the next request, but when kicking in throttle, we need to anyway and so a busy connection would degrade to LT anyway to maintain the throttle. As a result this change should not cause deviation in the performance much for busy connections. Change-Id: I522d284d2d0f40e1812ab4c1a453c8aec666464c BUG: 1192114 Signed-off-by: Shyam <srangana@redhat.com> Reviewed-on: http://review.gluster.org/9726 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/event-epoll.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libglusterfs/src/event-epoll.c b/libglusterfs/src/event-epoll.c
index a8e9a08b93d..62085dbef10 100644
--- a/libglusterfs/src/event-epoll.c
+++ b/libglusterfs/src/event-epoll.c
@@ -335,7 +335,7 @@ event_register_epoll (struct event_pool *event_pool, int fd,
LOCK (&slot->lock);
{
- /* make epoll edge triggered and 'singleshot', which
+ /* make epoll 'singleshot', which
means we need to re-add the fd with
epoll_ctl(EPOLL_CTL_MOD) after delivery of every
single event. This assures us that while a poller
@@ -344,7 +344,7 @@ event_register_epoll (struct event_pool *event_pool, int fd,
time as well.
*/
- slot->events = EPOLLPRI | EPOLLET | EPOLLONESHOT;
+ slot->events = EPOLLPRI | EPOLLONESHOT;
slot->handler = handler;
slot->data = data;