From c7d1aee76d5713d1f337ab1c831c0ed74e4676e1 Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Thu, 27 Dec 2018 18:56:16 +0200 Subject: Multiple files: reduce work while under lock. Mostly, unlock before logging. In some cases, moved different code that was not needed to be under lock (for example, taking time, or malloc'ing) to be executed before taking the lock. Note: logging might be slightly less accurate in order, since it may not be done now under the lock, so order of logs is racy. I think it's a reasonable compromise. Compile-tested only! updates: bz#1193929 Signed-off-by: Yaniv Kaul Change-Id: I2438710016afc9f4f62a176ef1a0d3ed793b4f89 --- libglusterfs/src/event-epoll.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libglusterfs/src/event-epoll.c') diff --git a/libglusterfs/src/event-epoll.c b/libglusterfs/src/event-epoll.c index dcaf9804529..be8b204b7a7 100644 --- a/libglusterfs/src/event-epoll.c +++ b/libglusterfs/src/event-epoll.c @@ -1018,7 +1018,7 @@ event_handled_epoll(struct event_pool *event_pool, int fd, int idx, int gen) " from gen=%d to slot->gen=%d, fd=%d, " "slot->fd=%d", idx, gen, slot->gen, fd, slot->fd); - goto post_unlock; + goto unlock; } /* This call also picks up the changes made by another @@ -1033,7 +1033,7 @@ event_handled_epoll(struct event_pool *event_pool, int fd, int idx, int gen) ret = epoll_ctl(event_pool->fd, EPOLL_CTL_MOD, fd, &epoll_event); } } -post_unlock: +unlock: UNLOCK(&slot->lock); event_slot_unref(event_pool, slot, idx); -- cgit