diff options
| author | Andy Wingo <wingo@pobox.com> | 2017-02-14 22:06:00 +0100 |
|---|---|---|
| committer | Andy Wingo <wingo@pobox.com> | 2017-02-14 22:06:00 +0100 |
| commit | 0291c72866b88200be7ba392d6b9fe6b46a8c87a (patch) | |
| tree | 181cd21c8616669a84b630b186a67650ac5af30d /fibers | |
| parent | Minor tweak to web server (diff) | |
| download | guile-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.scm | 2 |
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 |
