unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Peter Ludemann <peter.ludemann@gmail.com>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 38644@debbugs.gnu.org
Subject: bug#38644: 26.3; emacs uses 100% CPU with auto-revert-mode
Date: Sat, 4 Jan 2020 10:50:16 -0800	[thread overview]
Message-ID: <CAHjfyZ3UsvREY_=tfX4rqZNbK70yvBaY4U0wGKigPn7QzuWwKw@mail.gmail.com> (raw)
In-Reply-To: <877e2fm9z1.fsf@gmx.de>

[-- Attachment #1: Type: text/plain, Size: 3450 bytes --]

A few small comments/questions inline ...

On Sun, 29 Dec 2019 at 07:23, Michael Albinus <michael.albinus@gmx.de>
wrote:

> Peter Ludemann <peter.ludemann@gmail.com> writes:
>
> Hi Peter,
>
> >> In bug#33194, a patch for Emacs 27.0.50 is mentioned. Do you have a
> >> chance to run this for test?
> >
> > Emacs 27.0.50 somewhat fixes the problem with global-auto-revert-mode,
> > using the same desktop file (and same open files) that was causing
> > problems with Emacs 26.3. (Sorry I took so long to test this.)
>
> Thanks for the feedback, the fix in Emacs 27 seems to work.
>

Correction: Emacs 28.05, cloned from git://git.sv.gnu.org/emacs.git and
built using the instructions at
https://www.emacswiki.org/emacs/EmacsSnapshotAndDebian#toc3


> > Emacs CPU utilization is now ~30-80% (according to top(1)) instead of
> > 100%; and responsiveness is good. Of course, it would be nicer if
> > emacs CPU utilization were less, so that I could fully utilize that
> > core (I only have 4 cores, so losing half a core is notable on large
> > tests).
>
> If I count correctly, your desktop file contains 489 buffers. Heavy load
> for global-auto-revert-mode.
>

This is the result of working on a project for several months (using
emacs-daemon). For example, 94 of those files are from Python and
SWI-Prolog standard libraries, because I needed to get implementation
details ("use the source, Luke"); and I'm using pieces from about 5
packages, whose source I also need to look at.

So, it's a little sloppy, but not unreasonable, I think.


>
> > Michael Albinus - you had a number of other questions ... do you still
> > want them (or some of them) answered?
>
> No, I don't believe so.
>
> > PS: Here's the desktop file, in case that can give some clue as to
> > what file or directory is causing problems. The "compilation"
> > processes both input from and output into /tmp/pykythe_test -- as you
> > can see, there are a couple of open files from that directory, but
> > they're not being continuously updated, only once or twice per test.
>
> auto-revert watches directories. Even if you watch only some few files
> in a directory (I count 29 buffers which are bound to "/tmp"), there
> will be lot of file notification events when other files in that
> directory are changed. Maybe it helps to set auto-revert-use-notify to
> nil for those files? You could do it via directory-local variales, as in
>

If I understand you correctly, Emacs doesn't watch individual files but
instead watches the directories that those files are in ... if a file
changes, then the directory will be changed with the file is
written/closed. Is this a correct understanding? (Presumably the reason for
this is that if files /path/to/dir/A, /path/to/dir/B, /path/to/dir/C are
open in buffers, it suffices to only watch for changes to /path/to/dir; and
if /path/to/dir/D is opened, no change to the watch list is needed.)


>
> (dir-locals-set-class-variables 'auto-revert-with-polling
>    '((nil . ((auto-revert-use-notify . nil)))))
>
> (dir-locals-set-directory-class
>    "/tmp/" 'auto-revert-with-polling)
>
> (This is untested.)
>

I haven't tested this because emacs 28.05 gives me adequate performance and
I can live with turning global-auto-revert on/off when I do a big test
(turning it off makes the test run a bit faster because there's another 0.5
CPU available for the test).

Thanks again!

- peter


> > best,
> > - peter
>
> Best regards, Michael.
>

[-- Attachment #2: Type: text/html, Size: 6061 bytes --]

  reply	other threads:[~2020-01-04 18:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-17  1:23 bug#38644: 26.3; emacs uses 100% CPU with auto-revert-mode Peter Ludemann
2019-12-17 13:59 ` Michael Albinus
2019-12-17 16:17 ` Eli Zaretskii
2019-12-17 18:27   ` Peter Ludemann
2019-12-17 19:30     ` Michael Albinus
2019-12-28 21:12       ` Peter Ludemann
2019-12-29 15:23         ` Michael Albinus
2020-01-04 18:50           ` Peter Ludemann [this message]
2020-01-05  9:28             ` Michael Albinus
2020-01-05 13:04 ` Mattias Engdegård
2020-01-05 19:31   ` Peter Ludemann
2020-01-05 19:57     ` Mattias Engdegård
2020-01-07  0:01       ` Peter Ludemann
2020-01-07  0:34         ` Peter Ludemann

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='CAHjfyZ3UsvREY_=tfX4rqZNbK70yvBaY4U0wGKigPn7QzuWwKw@mail.gmail.com' \
    --to=peter.ludemann@gmail.com \
    --cc=38644@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    /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).