From unknown Sat Sep 13 08:57:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#46978: 27.1; Shell mode performs extremely poorly in Linux-libre 5.10.20 Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Mar 2021 23:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46978 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 46978@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161507498124963 (code B ref -1); Sat, 06 Mar 2021 23:57:01 +0000 Received: (at submit) by debbugs.gnu.org; 6 Mar 2021 23:56:21 +0000 Received: from localhost ([127.0.0.1]:38537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIgmS-0006UZ-Px for submit@debbugs.gnu.org; Sat, 06 Mar 2021 18:56:21 -0500 Received: from lists.gnu.org ([209.51.188.17]:42912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIgmR-0006UR-4Y for submit@debbugs.gnu.org; Sat, 06 Mar 2021 18:56:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIgmQ-00061J-SD for bug-gnu-emacs@gnu.org; Sat, 06 Mar 2021 18:56:18 -0500 Received: from world.peace.net ([64.112.178.59]:35414) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIgmO-0002CQ-EP for bug-gnu-emacs@gnu.org; Sat, 06 Mar 2021 18:56:18 -0500 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lIgmM-0005fA-0h; Sat, 06 Mar 2021 18:56:14 -0500 From: Mark H Weaver Date: Sat, 06 Mar 2021 18:54:48 -0500 Message-ID: <878s6z25y4.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=64.112.178.59; envelope-from=mhw@netris.org; helo=world.peace.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) On a GNU Guix system, after upgrading my kernel from Linux-libre 5.10.19 to 5.10.20, Emacs Shell mode now performs extremely poorly, specifically when displaying the output from commands. For example, using "cat" to print a 14 kilobyte text file on a Thinkpad X200, Emacs Shell mode now requires approximately 11 seconds to display the output. That's ~1200 characters per second. It appears to me that Emacs might now be performing a display update for each character received from the pseudo-tty, instead of processing larger blocks at a time, as it has previously done. Other programs I've tried that use pseudo-ttys don't seem to have this problem with the new kernel. For example, the performance of GNU Screen 4.8.0 is not noticeably affected. Ditto for GNOME Terminal 3.34.2, based on VTE 0.60.3. The problem is reproducible using "emacs -Q", and does not seem to depend on the windowing system. It happens both within X using an Emacs built with --with-x-toolkit=no (the "emacs-no-x-toolkit" package in Guix), and also within a Linux text console using an Emacs built without X support at all (the "emacs-no-x" package in Guix). I've skimmed the list of changes between Linux 5.10.19 and 5.10.20, and found these two commits that might be relevant: tty: implement read_iter tty: convert tty_ldisc_ops 'read()' function to take a kernel pointer These changes are also included in Linux-libre 5.11.3 (the newest release), but I haven't yet tried that version. I'm currently building a variant of Linux-libre 5.10.20 with these two commits reverted, to see if that makes the problem go away, and I will report back when I have those results. See below for some details generated by M-x report-emacs-bug. I could provide further details, including the full build log of the Emacs binary I'm using, or instructions for how to build precisely the same Emacs binary using GNU Guix, but I suspect that this bug is insensitive to such details. Mark In GNU Emacs 27.1 (build 1, x86_64-unknown-linux-gnu) Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Configured using: 'configure CONFIG_SHELL=/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bash SHELL=/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bash --prefix=/gnu/store/ack6blyzqgwx3cfsxk0drgj61xghri0x-emacs-no-x-27.1 --enable-fast-install --build=x86_64-unknown-linux-gnu --with-modules --disable-build-details' Configured features: SOUND NOTIFY INOTIFY ACL GNUTLS LIBXML2 ZLIB MODULES THREADS JSON PDUMPER GMP Important settings: value of $EMACSLOADPATH: /root/.guix-profile/share/emacs/site-lisp:/root/.guix-profile/share/emacs/27.1/lisp value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: gpm-mouse-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow regexp-opt sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail tool-bar rmail-loaddefs text-property-search time-date subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils t-mouse term/linux disp-table tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads inotify multi-tty make-network-process emacs) Memory information: ((conses 16 42993 4300) (symbols 48 5872 1) (strings 32 16278 1702) (string-bytes 1 528232) (vectors 16 6851) (vector-slots 8 82979 4968) (floats 8 17 248) (intervals 56 175 0) (buffers 1000 11)) From unknown Sat Sep 13 08:57:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#46978: 27.1; Shell mode performs extremely poorly in Linux-libre 5.10.20 Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Mar 2021 02:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46978 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 46978@debbugs.gnu.org Received: via spool by 46978-submit@debbugs.gnu.org id=B46978.161508488716636 (code B ref 46978); Sun, 07 Mar 2021 02:42:02 +0000 Received: (at 46978) by debbugs.gnu.org; 7 Mar 2021 02:41:27 +0000 Received: from localhost ([127.0.0.1]:38668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIjMF-0004KF-3L for submit@debbugs.gnu.org; Sat, 06 Mar 2021 21:41:27 -0500 Received: from world.peace.net ([64.112.178.59]:53540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIjMD-0004K2-LQ for 46978@debbugs.gnu.org; Sat, 06 Mar 2021 21:41:26 -0500 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lIjM7-00073K-Eg; Sat, 06 Mar 2021 21:41:19 -0500 From: Mark H Weaver In-Reply-To: <878s6z25y4.fsf@netris.org> References: <878s6z25y4.fsf@netris.org> Date: Sat, 06 Mar 2021 21:39:54 -0500 Message-ID: <87ft17it4a.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Mark H Weaver writes: > I've skimmed the list of changes between Linux 5.10.19 and 5.10.20, and > found these two commits that might be relevant: > > tty: implement read_iter > > > tty: convert tty_ldisc_ops 'read()' function to take a kernel pointer > > > These changes are also included in Linux-libre 5.11.3 (the newest > release), but I haven't yet tried that version. > > I'm currently building a variant of Linux-libre 5.10.20 with these two > commits reverted, to see if that makes the problem go away, and I will > report back when I have those results. Reverting the two commits cited above fixes the problem. Mark From unknown Sat Sep 13 08:57:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#46978: 27.1; Shell mode performs extremely poorly in Linux-libre 5.10.20 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Mar 2021 06:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46978 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mark H Weaver Cc: 46978@debbugs.gnu.org Received: via spool by 46978-submit@debbugs.gnu.org id=B46978.16150991817119 (code B ref 46978); Sun, 07 Mar 2021 06:40:02 +0000 Received: (at 46978) by debbugs.gnu.org; 7 Mar 2021 06:39:41 +0000 Received: from localhost ([127.0.0.1]:38805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIn4n-0001ql-JD for submit@debbugs.gnu.org; Sun, 07 Mar 2021 01:39:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIn4m-0001qY-0V for 46978@debbugs.gnu.org; Sun, 07 Mar 2021 01:39:40 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53819) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lIn4e-0004CE-5E; Sun, 07 Mar 2021 01:39:33 -0500 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4753 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lIn4c-0006Dh-DL; Sun, 07 Mar 2021 01:39:31 -0500 Date: Sun, 07 Mar 2021 08:39:21 +0200 Message-Id: <83o8fvtqli.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87ft17it4a.fsf@netris.org> (message from Mark H Weaver on Sat, 06 Mar 2021 21:39:54 -0500) References: <878s6z25y4.fsf@netris.org> <87ft17it4a.fsf@netris.org> X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Mark H Weaver > Date: Sat, 06 Mar 2021 21:39:54 -0500 > > Mark H Weaver writes: > > > I've skimmed the list of changes between Linux 5.10.19 and 5.10.20, and > > found these two commits that might be relevant: > > > > tty: implement read_iter > > > > > > tty: convert tty_ldisc_ops 'read()' function to take a kernel pointer > > > > > > These changes are also included in Linux-libre 5.11.3 (the newest > > release), but I haven't yet tried that version. > > > > I'm currently building a variant of Linux-libre 5.10.20 with these two > > commits reverted, to see if that makes the problem go away, and I will > > report back when I have those results. > > Reverting the two commits cited above fixes the problem. So does this mean this isn't an Emacs issue, but the issue with that kernel? Or is there still something you'd like us to look into on the Emacs side? Thanks. From unknown Sat Sep 13 08:57:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#46978: 27.1; Shell mode performs extremely poorly in Linux-libre 5.10.20 Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Mar 2021 08:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46978 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 46978@debbugs.gnu.org Received: via spool by 46978-submit@debbugs.gnu.org id=B46978.161510710820043 (code B ref 46978); Sun, 07 Mar 2021 08:52:01 +0000 Received: (at 46978) by debbugs.gnu.org; 7 Mar 2021 08:51:48 +0000 Received: from localhost ([127.0.0.1]:38880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIp8e-0005DC-5g for submit@debbugs.gnu.org; Sun, 07 Mar 2021 03:51:48 -0500 Received: from world.peace.net ([64.112.178.59]:53992) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIp8d-0005D0-B3 for 46978@debbugs.gnu.org; Sun, 07 Mar 2021 03:51:47 -0500 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lIp8X-0001m1-9T; Sun, 07 Mar 2021 03:51:41 -0500 From: Mark H Weaver In-Reply-To: <83o8fvtqli.fsf@gnu.org> References: <878s6z25y4.fsf@netris.org> <87ft17it4a.fsf@netris.org> <83o8fvtqli.fsf@gnu.org> Date: Sun, 07 Mar 2021 03:50:15 -0500 Message-ID: <87y2ezgxel.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: Mark H Weaver >> Date: Sat, 06 Mar 2021 21:39:54 -0500 >> >> Mark H Weaver writes: >> >> > I've skimmed the list of changes between Linux 5.10.19 and 5.10.20, and >> > found these two commits that might be relevant: >> > >> > tty: implement read_iter >> > >> > >> > tty: convert tty_ldisc_ops 'read()' function to take a kernel pointer >> > >> > >> > These changes are also included in Linux-libre 5.11.3 (the newest >> > release), but I haven't yet tried that version. >> > >> > I'm currently building a variant of Linux-libre 5.10.20 with these two >> > commits reverted, to see if that makes the problem go away, and I will >> > report back when I have those results. >> >> Reverting the two commits cited above fixes the problem. > > So does this mean this isn't an Emacs issue, but the issue with that > kernel? That's not clear to me. What I know is that these changes to Linux's TTY subsystem, authored by Linus Torvalds himself and recently included in upstream Linux 5.11.3 and 5.10.20, have lead to this regression in Emacs. This might simply be a kernel bug, or it could be that Emacs is making an improper assumption about how the kernel behaves. > Or is there still something you'd like us to look into on the > Emacs side? I would suggest investigating to find out what's going wrong here, and then: (1) if it can reasonably be considered a kernel regression, submit a bug report to the Linux developers, and (2) if Emacs is found to behave suboptimally in its interactions with the kernel, or if the Linux developers do not soon deploy their own fix, modify Emacs as needed to avoid the problem. What do you think? Thanks, Mark From unknown Sat Sep 13 08:57:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#46978: 27.1; Shell mode performs extremely poorly in Linux-libre 5.10.20 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Mar 2021 11:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46978 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mark H Weaver Cc: 46978@debbugs.gnu.org Received: via spool by 46978-submit@debbugs.gnu.org id=B46978.16151166452650 (code B ref 46978); Sun, 07 Mar 2021 11:31:01 +0000 Received: (at 46978) by debbugs.gnu.org; 7 Mar 2021 11:30:45 +0000 Received: from localhost ([127.0.0.1]:38962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIrcS-0000gf-PA for submit@debbugs.gnu.org; Sun, 07 Mar 2021 06:30:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44486) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIrcQ-0000gS-Ml for 46978@debbugs.gnu.org; Sun, 07 Mar 2021 06:30:43 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55700) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lIrcK-0004gM-Ub; Sun, 07 Mar 2021 06:30:36 -0500 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2819 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lIrcJ-0005m1-4B; Sun, 07 Mar 2021 06:30:36 -0500 Date: Sun, 07 Mar 2021 13:30:26 +0200 Message-Id: <83eegrtd4d.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87y2ezgxel.fsf@netris.org> (message from Mark H Weaver on Sun, 07 Mar 2021 03:50:15 -0500) References: <878s6z25y4.fsf@netris.org> <87ft17it4a.fsf@netris.org> <83o8fvtqli.fsf@gnu.org> <87y2ezgxel.fsf@netris.org> X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Mark H Weaver > Cc: 46978@debbugs.gnu.org > Date: Sun, 07 Mar 2021 03:50:15 -0500 > > Eli Zaretskii writes: > > >> From: Mark H Weaver > >> Date: Sat, 06 Mar 2021 21:39:54 -0500 > >> > >> Mark H Weaver writes: > >> > >> > I've skimmed the list of changes between Linux 5.10.19 and 5.10.20, and > >> > found these two commits that might be relevant: > >> > > >> > tty: implement read_iter > >> > > >> > > >> > tty: convert tty_ldisc_ops 'read()' function to take a kernel pointer > >> > > >> > > >> > These changes are also included in Linux-libre 5.11.3 (the newest > >> > release), but I haven't yet tried that version. > >> > > >> > I'm currently building a variant of Linux-libre 5.10.20 with these two > >> > commits reverted, to see if that makes the problem go away, and I will > >> > report back when I have those results. > >> > >> Reverting the two commits cited above fixes the problem. > > > > So does this mean this isn't an Emacs issue, but the issue with that > > kernel? > > That's not clear to me. What I know is that these changes to Linux's > TTY subsystem, authored by Linus Torvalds himself and recently included > in upstream Linux 5.11.3 and 5.10.20, have lead to this regression in > Emacs. This might simply be a kernel bug, or it could be that Emacs is > making an improper assumption about how the kernel behaves. Emacs doesn't assume anything about the kernel, it simply reads from the PTY which serves as stdout for the subprocess. Your description seems to indicate that the reads stall, because that's the only explanation I can come up with to the fact that we display 'cat's output one character at a time. Do these changes affect the way characters are written to the PTY? For example, do they affect the frequency with which stuff is written, or the batching of the bytes (i.e. how many bytes are written in one go)? Or maybe they affect the read side of the PTY? Does it help to set process-connection-type to nil? Does it help to play with process-adaptive-read-buffering? > I would suggest investigating to find out what's going wrong here, and > then: If someone here knows enough about this part of the Linux kernel to understand its effect on Emacs communications with subprocess, I hope they speak up soon. I looked at the two commits you mentioned and didn't see anything that immediately caught my eye, but then I have no idea how TTYs work on Linux at that level. Failing that, my suggestion is to inform the kernel developers of the problem and see if they have any suggestions for where in Emacs to look for the cause, if at all. From unknown Sat Sep 13 08:57:09 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Mark H Weaver Subject: bug#46978: closed (Re: bug#46978: 27.1; Shell mode performs extremely poorly in Linux-libre 5.10.20) Message-ID: References: <87y2eyi6lw.fsf@netris.org> <878s6z25y4.fsf@netris.org> X-Gnu-PR-Message: they-closed 46978 X-Gnu-PR-Package: emacs Reply-To: 46978@debbugs.gnu.org Date: Mon, 08 Mar 2021 05:00:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1615179602-13405-1" This is a multi-part message in MIME format... ------------=_1615179602-13405-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #46978: 27.1; Shell mode performs extremely poorly in Linux-libre 5.10.20 which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 46978@debbugs.gnu.org. --=20 46978: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D46978 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1615179602-13405-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 46978-done) by debbugs.gnu.org; 8 Mar 2021 04:59:57 +0000 Received: from localhost ([127.0.0.1]:41878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJ7zp-0003T4-Mw for submit@debbugs.gnu.org; Sun, 07 Mar 2021 23:59:57 -0500 Received: from world.peace.net ([64.112.178.59]:56026) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJ7zo-0003Sr-H6 for 46978-done@debbugs.gnu.org; Sun, 07 Mar 2021 23:59:56 -0500 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lJ7zi-0001fB-8s; Sun, 07 Mar 2021 23:59:50 -0500 From: Mark H Weaver To: Eli Zaretskii Subject: Re: bug#46978: 27.1; Shell mode performs extremely poorly in Linux-libre 5.10.20 In-Reply-To: <83eegrtd4d.fsf@gnu.org> References: <878s6z25y4.fsf@netris.org> <87ft17it4a.fsf@netris.org> <83o8fvtqli.fsf@gnu.org> <87y2ezgxel.fsf@netris.org> <83eegrtd4d.fsf@gnu.org> Date: Sun, 07 Mar 2021 23:58:24 -0500 Message-ID: <87y2eyi6lw.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 46978-done Cc: 46978-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Linux-libre 5.10.21 and 5.11.4 have since been released, each including another batch of 5 commits by Linus to the TTY subsystem (with commit logs acknowledging problems in the earlier commits), and I'm glad to report that the performance regression no longer occurs in 5.10.21. I'll assume that it's fixed in 5.11.4 as well, and close this bug now. Thanks! Mark ------------=_1615179602-13405-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 6 Mar 2021 23:56:21 +0000 Received: from localhost ([127.0.0.1]:38537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIgmS-0006UZ-Px for submit@debbugs.gnu.org; Sat, 06 Mar 2021 18:56:21 -0500 Received: from lists.gnu.org ([209.51.188.17]:42912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIgmR-0006UR-4Y for submit@debbugs.gnu.org; Sat, 06 Mar 2021 18:56:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIgmQ-00061J-SD for bug-gnu-emacs@gnu.org; Sat, 06 Mar 2021 18:56:18 -0500 Received: from world.peace.net ([64.112.178.59]:35414) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIgmO-0002CQ-EP for bug-gnu-emacs@gnu.org; Sat, 06 Mar 2021 18:56:18 -0500 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lIgmM-0005fA-0h; Sat, 06 Mar 2021 18:56:14 -0500 From: Mark H Weaver To: bug-gnu-emacs@gnu.org Subject: 27.1; Shell mode performs extremely poorly in Linux-libre 5.10.20 Date: Sat, 06 Mar 2021 18:54:48 -0500 Message-ID: <878s6z25y4.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=64.112.178.59; envelope-from=mhw@netris.org; helo=world.peace.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) On a GNU Guix system, after upgrading my kernel from Linux-libre 5.10.19 to 5.10.20, Emacs Shell mode now performs extremely poorly, specifically when displaying the output from commands. For example, using "cat" to print a 14 kilobyte text file on a Thinkpad X200, Emacs Shell mode now requires approximately 11 seconds to display the output. That's ~1200 characters per second. It appears to me that Emacs might now be performing a display update for each character received from the pseudo-tty, instead of processing larger blocks at a time, as it has previously done. Other programs I've tried that use pseudo-ttys don't seem to have this problem with the new kernel. For example, the performance of GNU Screen 4.8.0 is not noticeably affected. Ditto for GNOME Terminal 3.34.2, based on VTE 0.60.3. The problem is reproducible using "emacs -Q", and does not seem to depend on the windowing system. It happens both within X using an Emacs built with --with-x-toolkit=no (the "emacs-no-x-toolkit" package in Guix), and also within a Linux text console using an Emacs built without X support at all (the "emacs-no-x" package in Guix). I've skimmed the list of changes between Linux 5.10.19 and 5.10.20, and found these two commits that might be relevant: tty: implement read_iter tty: convert tty_ldisc_ops 'read()' function to take a kernel pointer These changes are also included in Linux-libre 5.11.3 (the newest release), but I haven't yet tried that version. I'm currently building a variant of Linux-libre 5.10.20 with these two commits reverted, to see if that makes the problem go away, and I will report back when I have those results. See below for some details generated by M-x report-emacs-bug. I could provide further details, including the full build log of the Emacs binary I'm using, or instructions for how to build precisely the same Emacs binary using GNU Guix, but I suspect that this bug is insensitive to such details. Mark In GNU Emacs 27.1 (build 1, x86_64-unknown-linux-gnu) Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Configured using: 'configure CONFIG_SHELL=/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bash SHELL=/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bash --prefix=/gnu/store/ack6blyzqgwx3cfsxk0drgj61xghri0x-emacs-no-x-27.1 --enable-fast-install --build=x86_64-unknown-linux-gnu --with-modules --disable-build-details' Configured features: SOUND NOTIFY INOTIFY ACL GNUTLS LIBXML2 ZLIB MODULES THREADS JSON PDUMPER GMP Important settings: value of $EMACSLOADPATH: /root/.guix-profile/share/emacs/site-lisp:/root/.guix-profile/share/emacs/27.1/lisp value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: gpm-mouse-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow regexp-opt sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail tool-bar rmail-loaddefs text-property-search time-date subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils t-mouse term/linux disp-table tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads inotify multi-tty make-network-process emacs) Memory information: ((conses 16 42993 4300) (symbols 48 5872 1) (strings 32 16278 1702) (string-bytes 1 528232) (vectors 16 6851) (vector-slots 8 82979 4968) (floats 8 17 248) (intervals 56 175 0) (buffers 1000 11)) ------------=_1615179602-13405-1-- From unknown Sat Sep 13 08:57:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#46978: 27.1; Shell mode performs extremely poorly in Linux-libre 5.10.20 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Mar 2021 13:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46978 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mark H Weaver Cc: 46978@debbugs.gnu.org Received: via spool by 46978-submit@debbugs.gnu.org id=B46978.16152106377152 (code B ref 46978); Mon, 08 Mar 2021 13:38:02 +0000 Received: (at 46978) by debbugs.gnu.org; 8 Mar 2021 13:37:17 +0000 Received: from localhost ([127.0.0.1]:42381 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJG4T-0001rI-1D for submit@debbugs.gnu.org; Mon, 08 Mar 2021 08:37:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59960) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJG4R-0001r4-6p for 46978@debbugs.gnu.org; Mon, 08 Mar 2021 08:37:15 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47112) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJG4L-00033b-E2; Mon, 08 Mar 2021 08:37:09 -0500 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4419 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lJG4K-0001xb-Iw; Mon, 08 Mar 2021 08:37:09 -0500 Date: Mon, 08 Mar 2021 15:37:02 +0200 Message-Id: <83lfaxsr5t.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87y2eyi6lw.fsf@netris.org> (message from Mark H Weaver on Sun, 07 Mar 2021 23:58:24 -0500) References: <878s6z25y4.fsf@netris.org> <87ft17it4a.fsf@netris.org> <83o8fvtqli.fsf@gnu.org> <87y2ezgxel.fsf@netris.org> <83eegrtd4d.fsf@gnu.org> <87y2eyi6lw.fsf@netris.org> X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Mark H Weaver > Cc: 46978-done@debbugs.gnu.org > Date: Sun, 07 Mar 2021 23:58:24 -0500 > > Linux-libre 5.10.21 and 5.11.4 have since been released, each including > another batch of 5 commits by Linus to the TTY subsystem (with commit > logs acknowledging problems in the earlier commits), and I'm glad to > report that the performance regression no longer occurs in 5.10.21. > I'll assume that it's fixed in 5.11.4 as well, and close this bug now. Great, thanks for telling us.