about summary refs log tree commit homepage
path: root/lib/PublicInbox/Git.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-09-30 15:20:40 +0000
committerEric Wong <e@80x24.org>2023-10-01 07:05:23 +0000
commit3f5ac9b00bc95de4a5f4f06266d3a2eb5424e24a (patch)
treeb476745c0adabdf0a5a893d1c7ea13a2065222a5 /lib/PublicInbox/Git.pm
parent9b068be88b252355c1c62f804d4f081e9a20570d (diff)
downloadpublic-inbox-3f5ac9b00bc95de4a5f4f06266d3a2eb5424e24a.tar.gz
Instead of using ->requeue to emulate level-triggered wakeups in
userspace, just use level-triggered wakeups in the kernel to
save some user time at the expense of system (kernel) time.  Of
course, the ready list implementation in the kernel via C is
faster than a Perl one on our end.

We must still use requeue if we've got buffered data, however.

Followup-to: 1181a7e6a853 (listener: switch to level-triggered epoll)
Diffstat (limited to 'lib/PublicInbox/Git.pm')
-rw-r--r--lib/PublicInbox/Git.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm
index 3062f293..5003be53 100644
--- a/lib/PublicInbox/Git.pm
+++ b/lib/PublicInbox/Git.pm
@@ -650,15 +650,16 @@ sub event_step {
         if ($inflight && @$inflight) {
                 $self->cat_async_step($inflight);
                 return $self->close unless $self->{sock};
-                # more to do? requeue for fairness:
-                $self->requeue if @$inflight || exists($self->{rbuf});
+                # don't loop here to keep things fair, but we must requeue
+                # if there's already-read data in rbuf
+                $self->requeue if exists($self->{rbuf});
         }
 }
 
 # idempotently registers with DS epoll/kqueue/select/poll
 sub watch_async ($) {
         $_[0]->{epwatch} //= do {
-                $_[0]->SUPER::new($_[0]->{sock}, EPOLLIN|EPOLLET);
+                $_[0]->SUPER::new($_[0]->{sock}, EPOLLIN);
                 \undef;
         }
 }