From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: Opportunistic GC Date: Wed, 10 Mar 2021 20:35:47 +0000 Message-ID: References: <666da624-2f59-2eb4-8e56-f0ad20dd900c@gmx.at> <26ff7447-9c29-a2f2-bf3d-9eac20a95d0f@gmx.at> <1401c9fa-4236-4060-9a32-51354ab5bd0f@gmx.at> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28554"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eliz@gnu.org, Stefan Monnier , emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 10 21:49:36 2021 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 1lK5lw-0007Jo-1l for ged-emacs-devel@m.gmane-mx.org; Wed, 10 Mar 2021 21:49:36 +0100 Original-Received: from localhost ([::1]:43576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lK5lv-0007YI-38 for ged-emacs-devel@m.gmane-mx.org; Wed, 10 Mar 2021 15:49:35 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37226) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lK5ZI-0000ke-15 for emacs-devel@gnu.org; Wed, 10 Mar 2021 15:36:32 -0500 Original-Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]:38267) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lK5ZB-0002HP-JC; Wed, 10 Mar 2021 15:36:31 -0500 Original-Received: by mail-oi1-x234.google.com with SMTP id v192so13035912oia.5; Wed, 10 Mar 2021 12:36:24 -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=ieNtFmF8tkKqEjhqCZ0pYRVUxUPYJ7c9Y4c0WB9dOp8=; b=FC/kEuHD7/oMfLZCHJDECnwbsr2reAEisnB/d+1SNXmf9VDdAFbJxHL+3UFluwnihq DDXba3ldAczV2+kER9/qdH8F66ItSfWq+CROjmXGJyog8eFF1CM2NYDgqVrPobpTX/P/ GXUQ1WYXt65sSP80Se4/NZ0XXdFGjfeJXGt3Z/GuOlMnVrrICi7u23kgTwXm9qj11GH5 fXn5ptqnpB5+ONfSUSQMhrV/T8fkqtHrIkgRRBTt05SMg8gjVOP9piD346Y8WwsYorVi k14WDVub05cxgr+5gJ/sQwd8rWZj2EREZMQrFAyGeZ22KShrodb96rw7ovG1+rJ+XNpS Ya6g== 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=ieNtFmF8tkKqEjhqCZ0pYRVUxUPYJ7c9Y4c0WB9dOp8=; b=XFyDX9Q/gt2dMMyhSTDnkSsS5tLaEwt00pqfy5UVWqq1hKLr7GHvMXGq5sn2Sh8/Lx LT5nQJx0pSKty5X8nMRZfjhtLKGeW5roSfT7bfBa/8gQrAg4mLgVhcNA98PfspAsQzTT IvoKbsbhzRz1AnFqy2MyEkduyQVATDJl+X/mPVyJXw3kr4n8XE/D2V7EXrtwToO92RE9 4Y56lnNdHesjsjraoBhhnSVD6zK6Eju7ZCK8Zaiod2IQSt63jnum+Jnz7QJuOB39VX1X h5HvKLK/0+gDU11e5Nd7KgJjxMB6rda+9jE+BffnBrqntZ7fa7EfVP+l1p/GZoxjJ2VN yFiw== X-Gm-Message-State: AOAM5327oebqYmabsMD6mCH/hvy9oW+DjyaOhpBTSazgucgPl0GPjfBL zHBWwEmxUVicy/g3Za02HhuR4f1QvPQQfxNmCBM= X-Google-Smtp-Source: ABdhPJw6rsYGj4Hx/fmcK7lFKIYgbJktKUrKCxDGiDg6tqHM6LJfvofWpa86RPhW4OIRxEjpw3drMsnpIcHEPtwvOaw= X-Received: by 2002:aca:4c0f:: with SMTP id z15mr3737867oia.44.1615408583851; Wed, 10 Mar 2021 12:36:23 -0800 (PST) In-Reply-To: <1401c9fa-4236-4060-9a32-51354ab5bd0f@gmx.at> Received-SPF: pass client-ip=2607:f8b0:4864:20::234; envelope-from=pipcet@gmail.com; helo=mail-oi1-x234.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:266304 Archived-At: On Mon, Mar 8, 2021 at 6:06 PM martin rudalics wrote: > > I don't think it's going to matter in practice, though. GC, after all, > > does not take that long, > > .. as long as we do not increase the heap size with the excuse that GC > is now no more intrusive anyway ... You're worried about this patch making it less likely someone will actually improve the garbage collector? So am I, actually... > > and the retained working set of most Lisp > > programs is small, memory is cheap, and it is a factor of two in the > > absolute worst conceivable case. > > We don't have to reserve that space and closing the fork automatically > returns it to the OS? I have no idea how copy-on-write is implemented. The space might be counted towards quota limits, but it won't actually be backed by real memory until it's used. Yes, when the child terminates, the memory will be freed. > >> Each such write causes its associated page getting written > >> out to avoid that an old link gets lost. And if the action was to drop > >> an old link, writing the page out doesn't even make sense. > > > > I'm not sure what you mean by "drop an old link". > > Setting a car or cdr to nil (as opposed to setting a car or cdr to some > other cons cell). In this case, the copy on write will trigger a fault > on that object's page to make sure that the previous reference gets > traced by the collector. Usually, concurrent collectors do not care. Okay, I think I understand now. You're absolutely correct, that's something the simplistic (but fast) kernel copy-on-write machinery cannot handle. > We never collected any evidence on how long Elisp objects live. So it's > not clear how much we could gain from promoting long-lived objects. Ah, but let me try to turn around that argument: if you wanted to collect such data, my fork-to-GC proposal would be precisely how I'd do it :-) Pip