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.devel Subject: Re: MPS: User GC customizations Date: Thu, 04 Jul 2024 16:58:14 +0300 Message-ID: <86sewp8djd.fsf@gnu.org> References: <87v81pbgzi.fsf@localhost> <86a5j1fhd1.fsf@gnu.org> <87y16khvhy.fsf@localhost> <87frspqwhr.fsf@localhost> <87tth5pdqc.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26031"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yantar92@posteo.net, pipcet@protonmail.com, emacs-devel@gnu.org, eller.helmut@gmail.com To: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jul 04 15:59:02 2024 Return-path: Envelope-to: ged-emacs-devel@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 1sPMzG-0006Yx-Nc for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Jul 2024 15:59:02 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPMye-00079W-Hf; Thu, 04 Jul 2024 09:58:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPMya-00077T-LM for emacs-devel@gnu.org; Thu, 04 Jul 2024 09:58:20 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPMyZ-0008CS-GI; Thu, 04 Jul 2024 09:58:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=Cy/hc4ZZAXeKYyU8UK855wJ9yBF5aq1MkMqQJa7em9w=; b=H3uXk+M6k8SuC1BtHEjB M0TtacGLGmRE/6dUjiK1p4Vk9nIH2+XlSPImTUVussKKpXCtjlzDKsJKfcqU9hhRpw9QZl+MB7ecd 4bBdHHHjJS+Qyj7e/SXbzuyZWSQ7NbLyFI+oAh23e0rPyMsBD9Y12jWbxS1dz2YV2lm9JDYvnyQd8 MvNXZ2yYcq4TC8KNWZhD0WFVH2nr12Dly/Sbf6gb9Sy7x6QjTPjGG6TqSS/cVKbWf04TPKGQYfRZ1 hhhxj/PwknmQ9ZUA44vo3/hqZkr8/MH2+BNUdMeinWDnvG1wbMY6RpbZLhXr9mpPAaPEGhMipq8wB rqz2gSSLAf0zbQ==; In-Reply-To: (message from Gerd =?utf-8?Q?M=C3=B6llmann?= on Thu, 04 Jul 2024 14:51:16 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:321319 Archived-At: > From: Gerd Möllmann > Cc: Pip Cet , Eli Zaretskii , > 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. If my interpretation is wrong, then the doc string definitely needs to be amended, but I think what you say is also in contradiction with what MPS documentation itself says: ‘interval’ is the time, in seconds, the MPS is permitted to take. It must not be negative, but may be ‘0.0’. [...] mps_arena_step() allows the client program to make use of idle time to do some garbage collection, for example when it is waiting for interactive input. 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. Did I misunderstand what this step means?