From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#46978: 27.1; Shell mode performs extremely poorly in Linux-libre 5.10.20 Date: Sun, 07 Mar 2021 13:30:26 +0200 Message-ID: <83eegrtd4d.fsf@gnu.org> References: <878s6z25y4.fsf@netris.org> <87ft17it4a.fsf@netris.org> <83o8fvtqli.fsf@gnu.org> <87y2ezgxel.fsf@netris.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35600"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46978@debbugs.gnu.org To: Mark H Weaver Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 07 12:31:09 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lIrcr-0009AR-Lz for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Mar 2021 12:31:09 +0100 Original-Received: from localhost ([::1]:48148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lIrcq-0007ns-0O for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Mar 2021 06:31:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIrck-0007nd-6L for bug-gnu-emacs@gnu.org; Sun, 07 Mar 2021 06:31:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55649) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lIrcj-0004nJ-UL for bug-gnu-emacs@gnu.org; Sun, 07 Mar 2021 06:31:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lIrcj-0000hA-QV for bug-gnu-emacs@gnu.org; Sun, 07 Mar 2021 06:31:01 -0500 X-Loop: help-debbugs@gnu.org 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 Original-Received: via spool by 46978-submit@debbugs.gnu.org id=B46978.16151166452650 (code B ref 46978); Sun, 07 Mar 2021 11:31:01 +0000 Original-Received: (at 46978) by debbugs.gnu.org; 7 Mar 2021 11:30:45 +0000 Original-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 Original-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 Original-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 Original-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 In-Reply-To: <87y2ezgxel.fsf@netris.org> (message from Mark H Weaver on Sun, 07 Mar 2021 03:50:15 -0500) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:201737 Archived-At: > 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.