summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/event.c
diff options
context:
space:
mode:
authorVijaikumar M <vmallika@redhat.com>2014-06-19 15:41:22 +0530
committerVijay Bellur <vbellur@redhat.com>2015-02-07 13:17:30 -0800
commitc61074400a45e69c6edbf82b8ed02568726d37ae (patch)
treec9c826414bcd3da0e1f30edbaaf79ac0c716a371 /libglusterfs/src/event.c
parent5e25569ed0717aa8636ad708430a823d39f9aa60 (diff)
epoll: edge triggered and multi-threaded epoll
- edge triggered (oneshot) polling with epoll - pick one event to avoid multiple events getting picked up by same thread and so get better distribution of events against multiple threads - wire support for multiple poll threads to epoll_wait in parallel - evdata to store absolute index and not hint for epoll - store index and gen of slot instead of fd and index hint - perform fd close asynchronously inside event.c for multithread safety - poll is still single threaded Change-Id: I536851dda0ab224c5d5a1b130a571397c9cace8f BUG: 1104462 Signed-off-by: Anand Avati <avati@redhat.com> Signed-off-by: Vijaikumar M <vmallika@redhat.com> Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Signed-off-by: Shyam <srangana@redhat.com> Reviewed-on: http://review.gluster.org/3842 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'libglusterfs/src/event.c')
-rw-r--r--libglusterfs/src/event.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/libglusterfs/src/event.c b/libglusterfs/src/event.c
index 0197e7948b5..6c253df3c1a 100644
--- a/libglusterfs/src/event.c
+++ b/libglusterfs/src/event.c
@@ -32,10 +32,10 @@ struct event_pool *
event_pool_new (int count)
{
struct event_pool *event_pool = NULL;
- extern struct event_ops event_ops_poll;
+ extern struct event_ops event_ops_poll;
#ifdef HAVE_SYS_EPOLL_H
- extern struct event_ops event_ops_epoll;
+ extern struct event_ops event_ops_epoll;
event_pool = event_ops_epoll.new (count);
@@ -89,6 +89,20 @@ out:
int
+event_unregister_close (struct event_pool *event_pool, int fd, int idx)
+{
+ int ret = -1;
+
+ GF_VALIDATE_OR_GOTO ("event", event_pool, out);
+
+ ret = event_pool->ops->event_unregister_close (event_pool, fd, idx);
+
+out:
+ return ret;
+}
+
+
+int
event_select_on (struct event_pool *event_pool, int fd, int idx_hint,
int poll_in, int poll_out)
{