X-Loop: help-debbugs@HIDDEN Subject: bug#39361: continuation and gc performance Resent-From: Stefan Israelsson Tampe <stefan.itampe@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-guile@HIDDEN Resent-Date: Thu, 30 Jan 2020 21:12:01 +0000 Resent-Message-ID: <handler.39361.B.15804186682529 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 39361 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 39361 <at> debbugs.gnu.org X-Debbugs-Original-To: bug-guile@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.15804186682529 (code B ref -1); Thu, 30 Jan 2020 21:12:01 +0000 Received: (at submit) by debbugs.gnu.org; 30 Jan 2020 21:11:08 +0000 Received: from localhost ([127.0.0.1]:36328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ixH5g-0000ei-E5 for submit <at> debbugs.gnu.org; Thu, 30 Jan 2020 16:11:08 -0500 Received: from lists.gnu.org ([209.51.188.17]:46161) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <stefan.itampe@HIDDEN>) id 1ixH5f-0000eb-5d for submit <at> debbugs.gnu.org; Thu, 30 Jan 2020 16:11:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49752) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <stefan.itampe@HIDDEN>) id 1ixH5b-0003PE-Qb for bug-guile@HIDDEN; Thu, 30 Jan 2020 16:11:07 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <stefan.itampe@HIDDEN>) id 1ixH5a-0000He-Qh for bug-guile@HIDDEN; Thu, 30 Jan 2020 16:11:03 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:39550) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <stefan.itampe@HIDDEN>) id 1ixH5a-0000Fi-KO for bug-guile@HIDDEN; Thu, 30 Jan 2020 16:11:02 -0500 Received: by mail-wr1-x42b.google.com with SMTP id y11so5914177wrt.6 for <bug-guile@HIDDEN>; Thu, 30 Jan 2020 13:11:02 -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; bh=ptd5pGFZbxUMz0SkETfp0/UqXLYRhxderXv7JKXCrv0=; b=XnwXc58VFQhO9dPPlyzV7UM//JUHJVBwvTSdNs6bHXayqL/ZG6uf7hOVqPyUAxvu5i 30R0kNkSmau6oqR1YQS2wSGHZxmcVjiAfwmp6fvttAdke0AueihstJ25L4GLCYY2qZwy QlfQQUn6+vJ2bdxqusTJkr6wCv0BBtwQCASiQHrMeBacCeqGNjuu05uVlcNzUIUREaVn WfPSisGXqyAHywwTIi1STBMD2+n7qcIFnS3bsp8FP2leJHqiIBY0tt0gbEc3ECcIDpHn 9gMyhghm9gd1iV+KcfZim5cHUN9DEa9m8SAm83XS2HmhwLzny6PfOYF6Cx29zMS8xJ40 rhbg== 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; bh=ptd5pGFZbxUMz0SkETfp0/UqXLYRhxderXv7JKXCrv0=; b=VGmILck6KVo+zFllU7dcTaEMzDYcPHQfuCgqG7Cm8jpslIh1b/MG+peJtOe13CYxcM BPYUsmEE+U8vCSuBB8L73bNJHYxWkL8LPuztuZxDRqmtb9unX9SsGDpw3GSQTN3ZPuFj 8GyEn/5dkjo0A+jOEh5BTEWatBG/lGGSKNUalljohJdLZUYTW66OOkt20WDKl/x/B573 ewlXGE/MJmdyAU4wT8ORLNMAlMGFi/ziAjbxHMe9rb596X042ROW+I2RowH5sZzZCe+l IuGjAHbXzhKFEDu698c2y08+k3WE0OGozBiGNIikai1oOWkWoqEJDo3gsP10G0Juz1Gb 6IUg== X-Gm-Message-State: APjAAAUr50qBrQjqRohAOa1JLoJAyzcmolyZWT/ON/RK1YdB8t+hr8KV pupkmy+9E6vU+iDk0TP6/g2fnWKi9CRIn2r+uOnVmg== X-Google-Smtp-Source: APXvYqzf8T3LaeNIEdIcBme9kn24Bc6DVSfUW/gVe9u/Kl8Umhj+UN9eP1D7lSlQ2X81DYyknAUAw0Itr4Lla8gaJ10= X-Received: by 2002:a5d:4d8d:: with SMTP id b13mr7685488wru.6.1580418660812; Thu, 30 Jan 2020 13:11:00 -0800 (PST) MIME-Version: 1.0 References: <CAGua6m1DQ+=VoypegHmcAELrHVb-s=DymVv6nMJQoj7aN9=EuA@HIDDEN> In-Reply-To: <CAGua6m1DQ+=VoypegHmcAELrHVb-s=DymVv6nMJQoj7aN9=EuA@HIDDEN> From: Stefan Israelsson Tampe <stefan.itampe@HIDDEN> Date: Thu, 30 Jan 2020 22:10:50 +0100 Message-ID: <CAGua6m31eJUXj_B-2AoNkarvzjat9dYVd-HD3pEyjz5=RYmbeQ@HIDDEN> Content-Type: multipart/alternative; boundary="000000000000dfd1ff059d61e4f8" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42b X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) --000000000000dfd1ff059d61e4f8 Content-Type: text/plain; charset="UTF-8" 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 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 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 make sure to mark only scm slots in the stored continuation therby improving gc perfromance. With this information it would also be possible to serialize continuations even if they have slots that are raw values. Happy Hacking --000000000000dfd1ff059d61e4f8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail= _attr"><br></div><div dir=3D"ltr"><div>I think I found a gc leak in guile 3= .0</div><div><br></div><div>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 m= ay be present and so the gc properties is less then ideal as those may be i= nterpreted as pointers by the GC and lead to parts of the heap being kept f= rom garnage collecting.</div><div><br></div><div>The information about a sl= ot being a raw value or a scm value is available=C2=A0as we do the correct = gc updating of the=C2=A0stack 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 th= e closure. Finally a custom made mark procedure for closures can be made th= at uses all this information to make sure to mark only scm slots in the sto= red continuation therby improving gc perfromance.</div><div><br></div><div>= With this information it would also be possible to serialize continuations = even if they have slots that are raw values.</div><div><br></div><div>Happy= Hacking</div><div>=C2=A0</div></div> </div></div> --000000000000dfd1ff059d61e4f8--
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Stefan Israelsson Tampe <stefan.itampe@HIDDEN> Subject: bug#39361: Acknowledgement (continuation and gc performance) Message-ID: <handler.39361.B.15804186682529.ack <at> debbugs.gnu.org> References: <CAGua6m31eJUXj_B-2AoNkarvzjat9dYVd-HD3pEyjz5=RYmbeQ@HIDDEN> X-Gnu-PR-Message: ack 39361 X-Gnu-PR-Package: guile Reply-To: 39361 <at> debbugs.gnu.org Date: Thu, 30 Jan 2020 21:12:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-guile@HIDDEN If you wish to submit further information on this problem, please send it to 39361 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 39361: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D39361 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: bug#39361: continuation and gc performance Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-guile@HIDDEN Resent-Date: Sat, 21 Mar 2020 17:34:02 +0000 Resent-Message-ID: <handler.39361.B39361.1584812029404 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 39361 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: Stefan Israelsson Tampe <stefan.itampe@HIDDEN> Cc: 39361 <at> debbugs.gnu.org Received: via spool by 39361-submit <at> debbugs.gnu.org id=B39361.1584812029404 (code B ref 39361); Sat, 21 Mar 2020 17:34:02 +0000 Received: (at 39361) by debbugs.gnu.org; 21 Mar 2020 17:33:49 +0000 Received: from localhost ([127.0.0.1]:47938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jFi0K-00006S-TF for submit <at> debbugs.gnu.org; Sat, 21 Mar 2020 13:33:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41009) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1jFi0J-00006F-Rb for 39361 <at> debbugs.gnu.org; Sat, 21 Mar 2020 13:33:48 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>) id 1jFi0E-0004MO-NS; Sat, 21 Mar 2020 13:33:42 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=56122 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from <ludo@HIDDEN>) id 1jFi0E-0003cK-9K; Sat, 21 Mar 2020 13:33:42 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> References: <CAGua6m1DQ+=VoypegHmcAELrHVb-s=DymVv6nMJQoj7aN9=EuA@HIDDEN> <CAGua6m31eJUXj_B-2AoNkarvzjat9dYVd-HD3pEyjz5=RYmbeQ@HIDDEN> Date: Sat, 21 Mar 2020 18:33:41 +0100 In-Reply-To: <CAGua6m31eJUXj_B-2AoNkarvzjat9dYVd-HD3pEyjz5=RYmbeQ@HIDDEN> (Stefan Israelsson Tampe's message of "Thu, 30 Jan 2020 22:10:50 +0100") Message-ID: <878sjtzk7e.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) Hi Stefan, Stefan Israelsson Tampe <stefan.itampe@HIDDEN> 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 > 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 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 make > 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.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.