all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Justin Van Winkle <justin.vanwinkle@gmail.com>, 33194@debbugs.gnu.org
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: Tue, 30 Oct 2018 09:39:50 +0100	[thread overview]
Message-ID: <874ld3bzft.fsf@gmx.de> (raw)
In-Reply-To: <83pnvskl8b.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 30 Oct 2018 08:21:56 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> It was outside of emacs.  SCP would trigger the cpu usage in emacs,
>> rsync would not (oddly).  Both "cat
>> /dev/zero > somefile" and "dd if=/dev/zero of=somefile" would
>> trigger it if somefile was in my $HOME
>> directory, but none of these would trigger it if I did it in, for
>> example, $HOME/Downloads/
>
> Isn't this expected?  Auto-revert watches the directory of the file,
> so if a lot of changes happen in that directory, Emacs will get a lot
> of file-change notifications, and will need to process them.

Yes.

> If you don't like this, customize auto-revert-use-notify to not use
> notifications.  Or maybe there's some system-wide customization of
> inotify that determine the max frequency of inotify notifications when
> the changes are to the same file.  (I don't know enough about inotify
> to say anything more specific, sorry.)

From inotify(7):

       If successive output  inotify  events  produced  on  the  inotify  file
       descriptor  are  identical (same wd, mask, cookie, and name), then they
       are coalesced into a single event if the older event has not  yet  been
       read (but see BUGS).  This reduces the amount of kernel memory required
       for the event queue, but also means that an application can't use  ino‐
       tify to reliably count file events.

Maybe we will get the burst of events due to scp; a simple cp might
profit from the described behaviour.

One defense action which comes to mind is to manage the incoming
events. If there is a burst of `change' events in a short time, they
could be cumulated to one event, as inotify does. Implemented in
`file-notify-handle-event', this would applicable to all file
notification backends, and not only to inotify.

Best regards, Michael.





  reply	other threads:[~2018-10-30  8:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29 16:01 bug#33194: 26.1; Auto-revert mode causes emacs to use 100% cpu whenever a file is being written to in the home directory Justin Van Winkle
2018-10-29 20:27 ` Michael Albinus
2018-10-29 21:13   ` Justin Van Winkle
2018-10-29 21:14     ` Justin Van Winkle
2018-10-30  6:21     ` Eli Zaretskii
2018-10-30  8:39       ` Michael Albinus [this message]
2018-10-30 10:41         ` Eli Zaretskii
2018-10-30 10:44           ` Michael Albinus
2018-10-30 12:28             ` Eli Zaretskii
2018-10-30 13:12               ` Michael Albinus
2018-10-30 16:18       ` Justin Van Winkle
2018-10-30 16:58         ` Michael Albinus
2018-10-30 17:02           ` Justin Van Winkle
2018-10-30 17:08             ` Michael Albinus
2018-10-30 17:09               ` Justin Van Winkle
2018-10-30 17:32         ` Eli Zaretskii
2018-10-30 18:54           ` Justin Van Winkle
2018-10-30 18:55             ` Justin Van Winkle
2018-11-03 10:57               ` Michael Albinus
2018-11-04 11:58                 ` Michael Albinus
2018-11-05 16:28                   ` Justin Van Winkle
2018-11-05 21:18                     ` Michael Albinus
2019-01-04 12:56                       ` Michael Albinus
2019-03-28 12:36                         ` Michael Albinus

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

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

  git send-email \
    --in-reply-to=874ld3bzft.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=33194@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=justin.vanwinkle@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.