From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Justin Van Winkle Newsgroups: gmane.emacs.bugs Subject: bug#33194: 26.1; Auto-revert mode causes emacs to use 100% cpu whenever a file is being written to in the home directory Date: Mon, 5 Nov 2018 11:28:22 -0500 Message-ID: References: <878t2gbisr.fsf@gmx.de> <83pnvskl8b.fsf@gnu.org> <83lg6fjq6f.fsf@gnu.org> <87d0rmjumt.fsf@gmx.de> <878t29gikk.fsf@gmx.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000005419a50579ed60b2" X-Trace: blaine.gmane.org 1541435598 25826 195.159.176.226 (5 Nov 2018 16:33:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Nov 2018 16:33:18 +0000 (UTC) Cc: 33194@debbugs.gnu.org To: michael.albinus@gmx.de Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 05 17:33:14 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJhoQ-0006c5-6F for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Nov 2018 17:33:14 +0100 Original-Received: from localhost ([::1]:36137 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJhqW-0005bO-RT for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Nov 2018 11:35:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJhkS-0007ly-8Z for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2018 11:29:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJhkN-0004q1-47 for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2018 11:29:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59476) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gJhkM-0004oi-EC for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2018 11:29:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gJhkM-00050R-7P for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2018 11:29:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Justin Van Winkle Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Nov 2018 16:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33194 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 33194-submit@debbugs.gnu.org id=B33194.154143532219217 (code B ref 33194); Mon, 05 Nov 2018 16:29:02 +0000 Original-Received: (at 33194) by debbugs.gnu.org; 5 Nov 2018 16:28:42 +0000 Original-Received: from localhost ([127.0.0.1]:35501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJhk1-0004zs-Jy for submit@debbugs.gnu.org; Mon, 05 Nov 2018 11:28:41 -0500 Original-Received: from mail-lj1-f180.google.com ([209.85.208.180]:34031) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJhk0-0004zg-5G for 33194@debbugs.gnu.org; Mon, 05 Nov 2018 11:28:40 -0500 Original-Received: by mail-lj1-f180.google.com with SMTP id u6-v6so8636432ljd.1 for <33194@debbugs.gnu.org>; Mon, 05 Nov 2018 08:28:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cF7mVSFXPzYxHxfiKI2+irn/gaLFxavLE9Oe3UZk/P8=; b=odyxHaXT4D2hXpAcGWl1loA9oIdMIPheC1FyTGPPOhr4xXlZA9xO9Tbw5ABkzk48jP o1LEaVeQbZfI/jNgd4OluA8EV+HvnMkoXTZ/ZZjDV0ptPYH4dPOwRQMcG4TThc89CmP9 o2khImKlMvAr0NqoflLpuRV6vkySh7Bs2DcVuaNao626ZNeeI065l2YxxkNncDToOKhq MoCwVyLRf1wIzqqkPqCsxzs+C1/JnjWhzKQSARTGNeski2yaDqJ2yiLeX6pOIUEsym9E afJjubiTtQHldCWi9p/RkhK7NBRTO7LvrUu+WRGDsYIa3PZb2oKc+KHY7XrPtvndxHRZ 8kOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cF7mVSFXPzYxHxfiKI2+irn/gaLFxavLE9Oe3UZk/P8=; b=n72vZLQeXu17q2atcf3svEyptqRuIYx5c3ASOHlYncQp7Bp+dyhX5R9aWhBDA4ZX9m TJcE+RKCWe5vuImDYsQgBkby3QePhf5Wl4GDjBXX1x3dO+yWQ+sTstnIJ0bpITNq69Mq YH7Hu8NuSXKScrUdldOmPcyqMYxbrCnInuy6Fdc7UvVLdb8MEbEZc6JD1eGYE2gX7Thl Kf0d1ck3iqvI+qe7a4tD86g+NXGYNFU6bBOOqlfFb58hEG6hFhVWThYr1VvHd+gLFVix o2FRhAywhwoQFOI+0KVXbkEPuXHArSR/FHZJMEzqxWDMvx8AZXBlHtqQXXEgicFHNYlM vgOg== X-Gm-Message-State: AGRZ1gJIOGRxUo/C74coD8jj8e9kU4kIRbMsghMukJtBSUx03wRDOxwN gQbtyEkFYgD74xegzb8ilI/cmpqKQbN+bxWNNXc= X-Google-Smtp-Source: AJdET5dJqn/A0MmDZKmmgN44b1GoGaHw7WeRr53/yPlq3lmjLsf8kDa9/gZlWHZW1mURL557viXyZjCvCYwg6U4wtpw= X-Received: by 2002:a2e:9181:: with SMTP id f1-v6mr14273777ljg.64.1541435313885; Mon, 05 Nov 2018 08:28:33 -0800 (PST) In-Reply-To: <878t29gikk.fsf@gmx.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:152062 Archived-At: --0000000000005419a50579ed60b2 Content-Type: text/plain; charset="UTF-8" I checked out and installed from master (at 294a5246b264441d436612d4de0dd89fad130aa3). I still see 100% cpu usage in emacs. What I did: In one terminal I run 'emacs' from my home directory, and I don't open any files. In another terminal, again while in the home directory, I run 'cat /dev/zero > zed'. Emacs cpu usage spikes to 100%. - Justin On Sun, Nov 4, 2018 at 6:58 AM Michael Albinus wrote: > Michael Albinus writes: > > Hi Justin, > > >> I mean it is certainly a bug to use 100% of a cpu just because a file > >> that is in the same directory to a file you are editing is being > >> written to, but it may not be unintentional behavior. > > > > I could reproduce the problem. I have a running Emacs for some days, and > > I've enabled `global-auto-revert-mode'. Starting scp copy of a large > > file outside Emacs, brought Emacs up to 100% cpu usage. > > I have pushed a fix for this to Emacs' master branch in git. The case of > several buffers using the same file notification descriptor was prepared > already in the code; due to a silly bug it didn't work. > > > The variable `file-notify-descriptors' contains ... > > > > As we can see, many identical entries #s(file-notify--watch > > /home/albinus nil auto-revert-notify-handler). > > Every incoming event for "/home/albinus" triggers the many calls of > > `auto-revert-notify-handler', although one entry would be sufficient. I > > will check, where all these entries come from. > > This doesn't happen any longer for me. And Emacs doesn't eat all cpu > time. > > Do you have a chance to build Emacs 27.0.50, for verification? > > Best regards, Michael. > --0000000000005419a50579ed60b2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I checked out and installed from master (= at 294a5246b264441d436612d4de0dd89fad130aa3).

I still see 100% cpu usage in emacs.

What = I did:

In one terminal I run 'emacs' from = my home directory, and I don't open any files.
In another ter= minal, again while in the home directory, I run 'cat /dev/zero > zed= '.

Emacs cpu usage spikes to 100%.
<= br>
- Justin

On Sun, Nov 4, 2018 at 6:58 AM Michael Albinus <michael.albinus@gmx.de> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">Michael Albinus <michael.albinus@gmx.de> writes:
Hi Justin,

>> I mean it is certainly a bug to use 100% of a cpu just because a f= ile
>> that is in the same directory to a file you are editing is being >> written to, but it may not be unintentional behavior.
>
> I could reproduce the problem. I have a running Emacs for some days, a= nd
> I've enabled `global-auto-revert-mode'. Starting scp copy of a= large
> file outside Emacs, brought Emacs up to 100% cpu usage.

I have pushed a fix for this to Emacs' master branch in git. The case o= f
several buffers using the same file notification descriptor was prepared already in the code; due to a silly bug it didn't work.

> The variable `file-notify-descriptors' contains ...
>
> As we can see, many identical entries #s(file-notify--watch
> /home/albinus nil auto-revert-notify-handler).
> Every incoming event for "/home/albinus" triggers the many c= alls of
> `auto-revert-notify-handler', although one entry would be sufficie= nt. I
> will check, where all these entries come from.

This doesn't happen any longer for me. And Emacs doesn't eat all cp= u
time.

Do you have a chance to build Emacs 27.0.50, for verification?

Best regards, Michael.
--0000000000005419a50579ed60b2--