From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.bugs Subject: bug#39361: continuation and gc performance Date: Sat, 21 Mar 2020 21:43:49 +0100 Message-ID: References: <878sjtzk7e.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000003b3fbb05a1637673" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="69902"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 39361@debbugs.gnu.org To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sat Mar 21 21:45:45 2020 Return-path: Envelope-to: guile-bugs@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 1jFl05-000I4Q-7z for guile-bugs@m.gmane-mx.org; Sat, 21 Mar 2020 21:45:45 +0100 Original-Received: from localhost ([::1]:40792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFl04-0003pF-9i for guile-bugs@m.gmane-mx.org; Sat, 21 Mar 2020 16:45:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50471) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFkzP-0003B0-OP for bug-guile@gnu.org; Sat, 21 Mar 2020 16:45:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jFkzO-0002nk-Gb for bug-guile@gnu.org; Sat, 21 Mar 2020 16:45:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42288) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jFkzO-0002ng-Bg for bug-guile@gnu.org; Sat, 21 Mar 2020 16:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jFkzO-0005k9-AB for bug-guile@gnu.org; Sat, 21 Mar 2020 16:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Israelsson Tampe Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 21 Mar 2020 20:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39361 X-GNU-PR-Package: guile Original-Received: via spool by 39361-submit@debbugs.gnu.org id=B39361.158482344821953 (code B ref 39361); Sat, 21 Mar 2020 20:45:02 +0000 Original-Received: (at 39361) by debbugs.gnu.org; 21 Mar 2020 20:44:08 +0000 Original-Received: from localhost ([127.0.0.1]:48256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFkyW-0005i1-GY for submit@debbugs.gnu.org; Sat, 21 Mar 2020 16:44:08 -0400 Original-Received: from mail-wm1-f54.google.com ([209.85.128.54]:33867) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFkyU-0005hd-Vc for 39361@debbugs.gnu.org; Sat, 21 Mar 2020 16:44:07 -0400 Original-Received: by mail-wm1-f54.google.com with SMTP id 26so5805201wmk.1 for <39361@debbugs.gnu.org>; Sat, 21 Mar 2020 13:44:06 -0700 (PDT) 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=JYP+20OXUcsTl6EkDJxgSaQ8iHxoS+9Q4lEnh5AfZQE=; b=bM9ltLCO1SW5D27Y1S9QOJkmEEDIpHh0a+OAixz697mLP89jmmsBemlN/eYpJ1DR0w BNuOtTBviBJ+DNs114AtT4IaiRyxn1w1E/NTomAyWsCg0uaCPATj4j5N4SPuh+jw3L2g 8KQrZFHtEV4bNzngtmC/BkgwJu1iaBmOvr9TIbw8s2GlmpOk0h0ar/Xni44F6Ea0akPF KdEOTVnu1yAJmO6UUiz6jqX0y095GlyYwqdBFcmpDK+ET37s0IlXl7cxem6asL8Env7+ yBsCAk3CNl4ssEH3AFueb9KIfCtFUKZxpgtq2sir+QWeAdMz21t+Eojfr7qSvR1A4eGQ yQng== 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=JYP+20OXUcsTl6EkDJxgSaQ8iHxoS+9Q4lEnh5AfZQE=; b=nxBMOlsaJTClMpKSPO5UwhE0t7ukTSWu0N1hI3v0XOaAtqwvWsgWhEdPQVvKDn0L2+ iLUt+f5V6tcrP0fxR2bjFcSDr/eJnEyuClBgmWQC5UK1Qw3oQzOeQ/NvNomcIyBjFYN8 eIEj7UBH0iY3ItMvZ6RPy9pFLiHheebKl8QW5a418CKVPOkKeQAqMLHiDO+PRKW+Ku6q on1EouYccm4M9o7zkuZNUfdntB+b+04sK7zLtHNYZtvOXR4dex7ocpyk3k69jWhJ9P5a 1O1Mmw0YQhc0fA6Ko5x+DZ+n7PiyUYe+0Zm6NQuC4u1L4RlkEEe3b528GnfeclowrPE7 uW2A== X-Gm-Message-State: ANhLgQ1cJaGzICjpVhh2IiaSVBI1FDVj3lYKqHvMEmOjBWjdnjpeS3JO GphNunveKc8wL+rruz+OqZRslGmU0DcMWrAakSY= X-Google-Smtp-Source: ADFU+vs59Ty2dqOXS1nEjd3HL3jGxxAq2ZL+x7KJawHGYxjpJ46ySAquByqsCfQIsv5q+cF0n3uQ7dGLyDA44bC3rvQ= X-Received: by 2002:a7b:c74d:: with SMTP id w13mr7242426wmk.189.1584823440980; Sat, 21 Mar 2020 13:44:00 -0700 (PDT) In-Reply-To: <878sjtzk7e.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:9673 Archived-At: --0000000000003b3fbb05a1637673 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable That function marks the working stack no, what about stack segments in continuations will they be marked correctly as well? On Sat, Mar 21, 2020 at 6:33 PM Ludovic Court=C3=A8s wrote: > Hi Stefan, > > Stefan Israelsson Tampe skribis: > > > I think I found a gc leak in guile 3.0 > > > > Isn't it so that so the continuation keep a copy of the stack. The issu= e > is > > that in the stack a raw integer or float may be present and so the gc > > properties is less then ideal as those may be interpreted as pointers b= y > > the GC and lead to parts of the heap being kept from garnage collecting= . > > > > The information about a slot being a raw value or a scm value is > > available as we do the correct gc updating of the stack inside guile 3.= 0. > > May I propose that we add a bitvector to the continuation that indicate > > that if a lslot is raw or not. Then add a pass that collect the rawness > > information in the creation of the closure. Finally a custom made mark > > procedure for closures can be made that uses all this information to ma= ke > > sure to mark only scm slots in the stored continuation therby improving > gc > > perfromance. > > I believe what you describe is already what happens in > =E2=80=98scm_i_vm_mark_stack=E2=80=99. Or am I missing something? > > Thanks, > Ludo=E2=80=99. > --0000000000003b3fbb05a1637673 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
That function marks the working stack no, what about stack= segments in continuations will they be marked correctly as well?

=
On Sat, Ma= r 21, 2020 at 6:33 PM Ludovic Court=C3=A8s <ludo@gnu.org> wrote:
Hi Stefan,

Stefan Israelsson Tampe <stefan.itampe@gmail.com> skribis:

> I think I found a gc leak in guile 3.0
>
> Isn't it so that so the continuation keep a copy of the stack. The= issue is
> that in the stack a raw integer or float may be present and so the gc<= br> > properties is less then ideal as those may be interpreted as pointers = by
> the GC and lead to parts of the heap being kept from garnage collectin= g.
>
> The information about a slot being a raw value or a scm value is
> available as we do the correct gc updating of the stack inside guile 3= .0.
> May I propose that we add a bitvector to the continuation that indicat= e
> that if a lslot is raw or not. Then add a pass that collect the rawnes= s
> information in the creation of the closure. Finally a custom made mark=
> procedure for closures can be made that uses all this information to m= ake
> sure to mark only scm slots in the stored continuation therby improvin= g gc
> perfromance.

I believe what you describe is already what happens in
=E2=80=98scm_i_vm_mark_stack=E2=80=99.=C2=A0 Or am I missing something?

Thanks,
Ludo=E2=80=99.
--0000000000003b3fbb05a1637673--