all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: yantar92@posteo.net,  pipcet@protonmail.com,
	 emacs-devel@gnu.org, eller.helmut@gmail.com
Subject: Re: MPS: User GC customizations
Date: Thu, 04 Jul 2024 16:30:06 +0200	[thread overview]
Message-ID: <m2bk3dz0up.fsf@pro2.fritz.box> (raw)
In-Reply-To: <86sewp8djd.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 04 Jul 2024 16:58:14 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>> Cc: Pip Cet <pipcet@protonmail.com>,  Eli Zaretskii <eliz@gnu.org>,
>>   emacs-devel@gnu.org,  eller.helmut@gmail.com
>> Date: Thu, 04 Jul 2024 14:51:16 +0200
>> 
>> >>   igc-step-interval is a variable defined in ‘C source code’.
>> >>
>> >>   Its value is 0.1
>> >>
>> >>   How much time is MPS allowed to spend in GC when Emacs is idle.
>> >>   The value is in seconds, and should be a non-negative number.  It can
>> >>   be either an integer or a float.  The default value is 0 which means .
>> >>   don’t do something when idle.  Negative values and values that are not numbers
>> >>   are handled as if they were the default value.
>> >>
>> >> It's for interactive use.
>> > [...]
>> What this variable does is give MPS notice that the client is currently
>> idle and it might be a good time to do some work.
>
> Is that really what this variable does?  My reading of the
> documentation is that it tells MPS how soon to stop GC which it
> started when Emacs was idle.  IOW, it's not about _triggering_ GC,
> it's about _ending_ it.  And the reason, AFAIU, is to avoid making
> Emacs responses slow because MPS started GC when it detected that
> Emacs is idle.

I'm taking my view from this;:

  2.4.6 Using idle time for collection
  ------------------------------------

  Some types of program have “idle time” in which they are waiting for an
  external event such as user input or network activity.  The MPS provides
  a function, *note mps_arena_step(): 19c, for making use of idle time to
  make memory management progress.
  ...
  
The name interval I've taken from 

 -- C Function: *note mps_bool_t: 129. mps_arena_step (mps_arena_t
          arena, double interval, double multiplier)

     ‘interval’ is the time, in seconds, the MPS is permitted to take.
     It must not be negative, but may be ‘0.0’.

Alas, it doesn't promise to always obey interval:

     The MPS makes every effort to
     return from this function within ‘interval’ seconds, but cannot
     guarantee to do so, as it may need to call your own scanning code.
     It uses ‘multiplier’ to decide whether to commence long-duration
     operations that consume CPU (such as a full collection): it will
     only start such an operation if it is expected to be completed
     within ‘multiplier * interval’ seconds.

(Haven't found out yet to prevent full collections with a message "client
predicts plenty of idle time" or some such yet. Please see the comment
in igc.c where mps_arena_step is called.)




  reply	other threads:[~2024-07-04 14:30 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01  9:26 MPS: Crash when switching to buffer Ihor Radchenko
2024-07-01 12:04 ` Eli Zaretskii
2024-07-01 12:13   ` Ihor Radchenko
2024-07-01 12:46     ` Eli Zaretskii
2024-07-01 14:14   ` Pip Cet
2024-07-01 14:42     ` Gerd Möllmann
2024-07-02  0:22       ` Pip Cet
2024-07-02  4:04         ` Gerd Möllmann
2024-07-02 11:40         ` Ihor Radchenko
2024-07-04 10:31           ` Ihor Radchenko
2024-07-04 11:48             ` Gerd Möllmann
2024-07-04 12:02               ` MPS: User GC customizations (was: MPS: Crash when switching to buffer) Ihor Radchenko
2024-07-04 12:51                 ` MPS: User GC customizations Gerd Möllmann
2024-07-04 13:20                   ` Ihor Radchenko
2024-07-04 14:45                     ` Gerd Möllmann
2024-07-04 15:12                       ` Pip Cet
2024-07-04 16:07                         ` Gerd Möllmann
2024-07-04 16:38                           ` Ihor Radchenko
2024-07-04 17:02                             ` Gerd Möllmann
2024-07-04 17:53                           ` Eli Zaretskii
2024-07-04 18:18                             ` Gerd Möllmann
2024-07-04 18:28                               ` Ihor Radchenko
2024-07-04 18:32                                 ` Pip Cet
2024-07-04 18:43                                   ` Gerd Möllmann
2024-07-04 18:39                               ` Eli Zaretskii
2024-07-04 18:48                                 ` Ihor Radchenko
2024-07-04 13:58                   ` Eli Zaretskii
2024-07-04 14:30                     ` Gerd Möllmann [this message]
2024-07-04 15:43                       ` Eli Zaretskii
2024-07-04 15:48                       ` Eli Zaretskii
2024-07-04 15:52                         ` Pip Cet
2024-07-04 16:04                           ` Eli Zaretskii
2024-07-04 17:01                             ` Gerd Möllmann
2024-07-04 18:03                               ` Eli Zaretskii
2024-07-04 18:28                                 ` Gerd Möllmann
2024-07-04 18:43                                   ` Eli Zaretskii
2024-07-04 19:09                                     ` Gerd Möllmann
2024-07-04 19:12                                       ` Eli Zaretskii
2024-07-04 16:38                     ` Pip Cet
2024-07-04 17:06                       ` Gerd Möllmann

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=m2bk3dz0up.fsf@pro2.fritz.box \
    --to=gerd.moellmann@gmail.com \
    --cc=eliz@gnu.org \
    --cc=eller.helmut@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=pipcet@protonmail.com \
    --cc=yantar92@posteo.net \
    /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.