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: Thu, 30 Jan 2020 22:10:50 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000dfd1ff059d61e4f8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="48960"; mail-complaints-to="usenet@ciao.gmane.io" To: 39361@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Thu Jan 30 22:12:12 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 1ixH6i-000Cha-66 for guile-bugs@m.gmane-mx.org; Thu, 30 Jan 2020 22:12:12 +0100 Original-Received: from localhost ([::1]:39094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixH6h-0003dF-8c for guile-bugs@m.gmane-mx.org; Thu, 30 Jan 2020 16:12:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49993) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixH6a-0003cs-3O for bug-guile@gnu.org; Thu, 30 Jan 2020 16:12:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ixH6Y-0001Aa-Pr for bug-guile@gnu.org; Thu, 30 Jan 2020 16:12:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58588) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ixH6Y-0001AW-94 for bug-guile@gnu.org; Thu, 30 Jan 2020 16:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ixH6Y-0000fs-4C for bug-guile@gnu.org; Thu, 30 Jan 2020 16:12:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Israelsson Tampe Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 30 Jan 2020 21:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39361 X-GNU-PR-Package: guile X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15804186682529 (code B ref -1); Thu, 30 Jan 2020 21:12:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 Jan 2020 21:11:08 +0000 Original-Received: from localhost ([127.0.0.1]:36328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ixH5g-0000ei-E5 for submit@debbugs.gnu.org; Thu, 30 Jan 2020 16:11:08 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:46161) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ixH5f-0000eb-5d for submit@debbugs.gnu.org; Thu, 30 Jan 2020 16:11:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49752) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixH5b-0003PE-Qb for bug-guile@gnu.org; Thu, 30 Jan 2020 16:11:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ixH5a-0000He-Qh for bug-guile@gnu.org; Thu, 30 Jan 2020 16:11:03 -0500 Original-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 ) id 1ixH5a-0000Fi-KO for bug-guile@gnu.org; Thu, 30 Jan 2020 16:11:02 -0500 Original-Received: by mail-wr1-x42b.google.com with SMTP id y11so5914177wrt.6 for ; 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) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:9553 Archived-At: --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

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 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.

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.

= With this information it would also be possible to serialize continuations = even if they have slots that are raw values.

Happy= Hacking
=C2=A0
--000000000000dfd1ff059d61e4f8--