unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ian Jackson <ijackson@chiark.greenend.org.uk>
Cc: 53432@debbugs.gnu.org
Subject: bug#53432: [PATCH] Avoid losing keyboard input when inotify is too busy
Date: Sat, 22 Jan 2022 08:45:03 +0200	[thread overview]
Message-ID: <838rv8nua8.fsf@gnu.org> (raw)
In-Reply-To: <25067.17249.604070.872185@chiark.greenend.org.uk> (message from Ian Jackson on Fri, 21 Jan 2022 23:36:01 +0000)

> From: Ian Jackson <ijackson@chiark.greenend.org.uk>
> Date: Fri, 21 Jan 2022 23:36:01 +0000
> 
> I experienced a bug where my Emacs (Debian's emacs-lucid) would lose
> keystrokes under pathological conditions.  I tracked this down to the
> keyboard input buffer filling up with inotify events.
> 
> The attached patches have been rebased onto emacs-28 (fbc9b121e062)
> and I have tested before-and-after versions in parallel to verify that
> the bug appears in the upstream branch and has been fixed with my
> patches.
> 
> The bug was really quite severe in my (rather abusive) situation, with
> Debian's emacs-lucid 26.1.  With the upstream emacs-28 branch it
> requires more effort, and loses fewer keys.  I suspect that some more
> sophisticated approach to inotify requests means it's harder to get
> the buffer to fill up with the newer version.  Unfortunately I am not
> able to share my whole repro, but a key part is to visit the output
> file from this
>   while yes | dd of=t bs=1 count=1000000; do : ;
> with global-auto-revert-mode enabled.
> 
> With my patches it is still possible to get emacs to perform very
> poorly by abusing it this way, but at least all the keys arrive
> eventually.  I added some FIXMEs for further work that would be good,
> but is not critical to fixing the bug.

Thanks.  I doubt that we want to complicate our input handling this
way on behalf of "abusing" inotify.  File notifications are known not
to be scalable enough to support global-auto-revert-mode well.

In any case, installing this on the emacs-28 branch is out of the
question: it's too late for that.  We may install some variant of this
on master, after discussing how best to handle this.  Po Lu's
suggestion to stop processing inotify events sounds better to me.

> I hope the commit messages are in the expected format.  I think I
> probably have GNU copyright paperwork on file already, perhaps under a
> different email address.

I don't see your name or email address on file, so maybe they are both
different?





      parent reply	other threads:[~2022-01-22  6:45 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-21 23:36 bug#53432: [PATCH] Avoid losing keyboard input when inotify is too busy Ian Jackson
2022-01-22  0:38 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-22 19:34   ` bug#53432: [PATCH] Avoid losing keyboard input when inotify is too busy [and 1 more messages] Ian Jackson
2022-01-22 19:48     ` Eli Zaretskii
2022-01-23  2:37       ` Dmitry Gutov
2022-01-23  2:47         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-23  2:49           ` Dmitry Gutov
2022-01-23  2:53             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-23  3:23               ` Dmitry Gutov
2022-01-23  3:26                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-23  3:36                   ` Dmitry Gutov
2022-01-23  3:48                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-23  4:07                       ` Dmitry Gutov
2022-01-23  5:50                   ` Eli Zaretskii
2022-01-23 16:34                     ` Michael Albinus
2022-01-23  1:00     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-23 13:38       ` Ian Jackson
2022-01-23 16:37         ` Michael Albinus
2022-01-23 18:31           ` Ian Jackson
2022-01-24  0:42             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-24 14:42             ` Michael Albinus
2022-01-24 14:57               ` Eli Zaretskii
2022-01-24 15:35                 ` Michael Albinus
2022-01-24 16:52                   ` Eli Zaretskii
2022-01-24 17:12                     ` Michael Albinus
2022-01-24 17:25                       ` Eli Zaretskii
2022-01-24 15:45               ` Ian Jackson
2022-01-24 17:05                 ` Michael Albinus
2022-01-24 18:59                   ` Ian Jackson
2022-01-25 14:50                     ` Michael Albinus
2022-01-24  0:26         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-22  6:45 ` Eli Zaretskii [this message]

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://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=838rv8nua8.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=53432@debbugs.gnu.org \
    --cc=ijackson@chiark.greenend.org.uk \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).