summaryrefslogtreecommitdiff
path: root/fibers
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2017-02-14 22:06:00 +0100
committerAndy Wingo <wingo@pobox.com>2017-02-14 22:06:00 +0100
commit0291c72866b88200be7ba392d6b9fe6b46a8c87a (patch)
tree181cd21c8616669a84b630b186a67650ac5af30d /fibers
parentMinor tweak to web server (diff)
downloadguile-fibers-0291c72866b88200be7ba392d6b9fe6b46a8c87a.tar.gz
Fix spurious epoll traffic
* fibers/internal.scm (schedule-fibers-for-fd): Fix sense of the POLLERR test. This was causing us to register and unregister our fd's with the kernel all the time. This was a scalability bottleneck as adding or removing an fd from an epoll set is serialized in the kernel through one mutex (!!!!), the "epmutex"; because you can nest epoll instances the kernel uses this to prevent cycles. Hint found in Voellmy's paper on the MIO system for Haskell.
Diffstat (limited to 'fibers')
-rw-r--r--fibers/internal.scm2
1 files changed, 1 insertions, 1 deletions
diff --git a/fibers/internal.scm b/fibers/internal.scm
index a495eb1..dceb5bf 100644
--- a/fibers/internal.scm
+++ b/fibers/internal.scm
@@ -238,7 +238,7 @@ thread."
(resume-fiber (source-fiber source) (lambda () revents))))
(cdr sources))
(cond
- ((zero? (logand revents EPOLLERR))
+ ((not (zero? (logand revents EPOLLERR)))
(hashv-remove! (scheduler-sources sched) fd)
(epoll-remove! (scheduler-epfd sched) fd))
(else