From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH] {dir,inbox}idle: use level-triggered epoll
Date: Mon, 4 Oct 2021 08:26:33 +0000 [thread overview]
Message-ID: <20211004082633.9400-1-e@80x24.org> (raw)
Both read(2) on inotify and kevent(2) have a finite amount of
This can prevent missed/delayed notifications while still
ensuring fairness in busy event loops.
---
lib/PublicInbox/DirIdle.pm | 4 ++--
lib/PublicInbox/InboxIdle.pm | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/PublicInbox/DirIdle.pm b/lib/PublicInbox/DirIdle.pm
index d572c2749f7f..c9a293e9355a 100644
--- a/lib/PublicInbox/DirIdle.pm
+++ b/lib/PublicInbox/DirIdle.pm
@@ -5,7 +5,7 @@
package PublicInbox::DirIdle;
use strict;
use parent 'PublicInbox::DS';
-use PublicInbox::Syscall qw(EPOLLIN EPOLLET);
+use PublicInbox::Syscall qw(EPOLLIN);
use PublicInbox::In2Tie;
my ($MAIL_IN, $MAIL_GONE, $ino_cls);
@@ -38,7 +38,7 @@ sub new {
if ($ino_cls) {
$inot = $ino_cls->new or die "E: $ino_cls->new: $!";
my $io = PublicInbox::In2Tie::io($inot);
- $self->SUPER::new($io, EPOLLIN | EPOLLET);
+ $self->SUPER::new($io, EPOLLIN);
} else {
require PublicInbox::FakeInotify;
$inot = PublicInbox::FakeInotify->new; # starts timer
diff --git a/lib/PublicInbox/InboxIdle.pm b/lib/PublicInbox/InboxIdle.pm
index 4d74b3545902..2781b3e15bb9 100644
--- a/lib/PublicInbox/InboxIdle.pm
+++ b/lib/PublicInbox/InboxIdle.pm
@@ -7,7 +7,7 @@
package PublicInbox::InboxIdle;
use strict;
use parent qw(PublicInbox::DS);
-use PublicInbox::Syscall qw(EPOLLIN EPOLLET);
+use PublicInbox::Syscall qw(EPOLLIN);
my $IN_MODIFY = 0x02; # match Linux inotify
my $ino_cls;
if ($^O eq 'linux' && eval { require Linux::Inotify2; 1 }) {
@@ -73,7 +73,7 @@ sub new {
if ($ino_cls) {
$inot = $ino_cls->new or die "E: $ino_cls->new: $!";
my $io = PublicInbox::In2Tie::io($inot);
- $self->SUPER::new($io, EPOLLIN | EPOLLET);
+ $self->SUPER::new($io, EPOLLIN);
} else {
require PublicInbox::FakeInotify;
$inot = PublicInbox::FakeInotify->new;
next reply other threads:[~2021-10-04 8:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-04 8:26 Eric Wong [this message]
2021-10-04 9:55 ` [PATCH] {dir,inbox}idle: use level-triggered epoll Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211004082633.9400-1-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).