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.user Subject: continuation and gc performance Date: Thu, 30 Jan 2020 22:03:37 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="2523"; mail-complaints-to="usenet@ciao.gmane.io" To: Guile User Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Thu Jan 30 22:04:02 2020 Return-path: Envelope-to: guile-user@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 1ixGyo-0000bN-Db for guile-user@m.gmane-mx.org; Thu, 30 Jan 2020 22:04:02 +0100 Original-Received: from localhost ([::1]:39000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixGyn-0000vR-C9 for guile-user@m.gmane-mx.org; Thu, 30 Jan 2020 16:04:01 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47494) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixGyd-0000vH-D5 for guile-user@gnu.org; Thu, 30 Jan 2020 16:03:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ixGyc-00065A-Bp for guile-user@gnu.org; Thu, 30 Jan 2020 16:03:51 -0500 Original-Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:33753) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ixGyc-00063y-2T for guile-user@gnu.org; Thu, 30 Jan 2020 16:03:50 -0500 Original-Received: by mail-wm1-x334.google.com with SMTP id m10so7287906wmc.0 for ; Thu, 30 Jan 2020 13:03:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=prtvCP+PTXRENxUSe4vz37Pm5J69LKBx7FAzLUFR0SM=; b=bNbIFYHIiFINCNmoX9xRMmVzLi5mNdIDnDyGkYOzfjSqmdDazwDKny6MGbb5ozk6En RyAvp9scHvKVC64Mxcd5BfSVTjPBiI8fYdxkJPCBi1EYd9IvCREX+U6lmAWBJA6vxu1t iNysLYAoI8rHHk/bLcOAso17kZPr2ZQ2LSi3EOgdjn/Heq9m+uuO2IiIvsdUm4YgGjeU ZnEFr7JNWT3/mVmvRJpvuI5qrA3VI2j4+xK/lBAfOpk9k15iROPHDjvrh65FA7VAaEML Yd66HZGLBnaFQTf2lWS04Iv/RM9BgVDb1cA+1iiC2otUY3hIShrQ9AXNgAx4R1Ej2kx+ +P+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=prtvCP+PTXRENxUSe4vz37Pm5J69LKBx7FAzLUFR0SM=; b=SqictpnpxF7Z27msjUPzsrybyxb27XPeuVEGVEL+SEEKC7nWbQr1EEK01kJ2kfGOil 2gwn6uhadw1L/S4gi1nTSN9AOAHz4LYZlh1zZzEJnhHGN58/5kUk0AmhXa4isqH2eHjU 1IvfGFKJJWtDfQW3LFhdPuWT34Qw9rQdIjpItFiYrkO9qinWTN8/LncbVrSGwLGyWjoD eCWO3NwF5UStF1zcyYbglC1DPJ9eLbFcJhAyPgU7BuSKsA5OHEef+HfI4GSy01JjE9Mv Q8CnHQh6sUiD70aCyobyJlpT16rZ7gICMzF4hfOKy8aJjeV2/E5a0S7316LSj83Ymqmv wlJA== X-Gm-Message-State: APjAAAVPkHJDvhCjNh/HwCwUSHTNJbYLpXV0TBrh6ertS8L+f6afaB9i eIxBsDd0r+hrVEjqvqagDRrRkZZUIsTMmOek/LtkNw== X-Google-Smtp-Source: APXvYqzScTyiy3nxEmqog0JM6wiLZpaiI3wy9Io8ag9G5aptGtZ6FOtpbXOg/E3tOCq/PD8Ih1ea5uKtU5oBWH+9q/I= X-Received: by 2002:a1c:df09:: with SMTP id w9mr7129331wmg.143.1580418228073; Thu, 30 Jan 2020 13:03:48 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::334 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16122 Archived-At: Hi, 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