From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: GUILE_MAX_HEAP_SIZE Date: Thu, 21 Aug 2008 20:36:04 +0200 Message-ID: <87od3musff.fsf@gnu.org> References: <87ej4tmf4m.fsf@gnu.org> <87d4k7e0s8.fsf@gnu.org> <87hc9iwyxi.fsf@gnu.org> <878wuus5fc.fsf@gnu.org> <87abf9qffj.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1219343811 31437 80.91.229.12 (21 Aug 2008 18:36:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Aug 2008 18:36:51 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Aug 21 20:37:43 2008 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KWF2Q-00065x-Ti for guile-devel@m.gmane.org; Thu, 21 Aug 2008 20:37:39 +0200 Original-Received: from localhost ([127.0.0.1]:56597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KWF1T-0001Sr-Dn for guile-devel@m.gmane.org; Thu, 21 Aug 2008 14:36:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KWF1O-0001MU-5B for guile-devel@gnu.org; Thu, 21 Aug 2008 14:36:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KWF1N-0001Jw-Bq for guile-devel@gnu.org; Thu, 21 Aug 2008 14:36:33 -0400 Original-Received: from [199.232.76.173] (port=53254 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KWF1M-0001Jg-Sq for guile-devel@gnu.org; Thu, 21 Aug 2008 14:36:32 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:38812 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KWF1M-0004Be-HZ for guile-devel@gnu.org; Thu, 21 Aug 2008 14:36:32 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KWF16-0008WB-Dv for guile-devel@gnu.org; Thu, 21 Aug 2008 18:36:16 +0000 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 21 Aug 2008 18:36:16 +0000 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 21 Aug 2008 18:36:16 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 112 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 5 Fructidor an 216 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: i686-pc-linux-gnu User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Cancel-Lock: sha1:r1Q0dBiYmVvdBBtYppNl2+Z5ROk= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:7480 Archived-At: Hello, Han-Wen Nienhuys writes: > Ludovic Courtès escreveu: >> Off the top of my head: incorrect indentation, missing spaces around >> brackets, and more importantly comments (see (standards.info)Comments). > > The code I went through should not have that; please point me to locations > where things are broken so I can fix them. E.g., from commit: +/* + Classic MIT Hack, see e.g. http://www.tekpool.com/?cat=9 + */ +int scm_i_uint_bit_count(unsigned int u) (BTW, it'd make sense to use Gnulib's `count-one-bits' module, which is able to use GCC's `__builtin_popcount ()'.) +/* + Amount of cells marked in this cell, measured in 1-cells. + */ +int +scm_i_card_marked_count (scm_t_cell *card, int span) + while (bvec < bvec_end) { + count += scm_i_uint_bit_count(*bvec); + bvec ++; + } Other than that, the new `gc-segment-table.c' does look nice to the eye. ;-) >>> See below - note that the old .scm file was pretty much broken, as it >>> was using gc-live-object-stats which is only accurate just after the >>> mark phase. >> >> Hmm, `gc-live-object-stats' may return information from the previous >> cycle, but it shouldn't be *that* accurate, should it? Sorry, that should have read "that inaccurate"... > No; the current implementation uses a similar scheme to > gc-live-object-stats (counting in the bitvector) to determine the live > object count. There is now no way that it can ever be larger than the > total heap size. OK. > I also changed the code to not look at the penultimate GC stats, since > I couldn't invent a scenario where that would help, and IMO it only > confuses things. This may have been a remnant of the pre-lazy sweep > code. Well, it's actually hard to "invent" things in that area without any measurement to back them up. > There was some confusion about cells vs. double cells vs. bytes, but I > think was mostly in my head and perhaps in your stress test. > > If you really want to know, use git bisect. I would have expected you to use such an approach when you volunteered to fix things. > A likely candidate is the patch from you that I applied. In > particular, > 4c7016dc06525c7910ce6c99d97eb9c52c6b43e4 Well, that's a good candidate since it's the last significant change that was done to the GC on `master'. However, Kevin's original post compared 1.8 (which doesn't have this commit) to 1.6. > + seg->freelist->collected += collected * seg->span; > > looks fishy as this code is called multiple times for a given > card. This very line was already there before the patch (see the diff). > The scm_t_sweep_statistics were sometimes passed into the sweep > function and sometimes not; I couldn't work out what the global > variables were supposed to mean exactly, and consequently, if their > updates were correct. The reason I am confident about the statistics > now is the assert()s I added to scm_i_gc(), which compare exactly mark > bit counts, the sweep statistics and freelist statistics. Some of the > changes I did were to make these numbers match up exactly. OK, let's hope for the best. ;-) > I'd be interested in seeing benchmarks between Guile and PLT after my > cleanup. For a lot of benchmarks, GC time is an important factor, and > it might be that we can now beat PLT (they use BGC). Hmm, that seems unlikely to me, but that'd be good news. > > BTW, I'm attaching a new plot of the stress test, now up to iteration > 10000 (the large allocation). Interestingly, the large allocation is > cleaned up only once - (on iteration 1000), and remains 'live' after > that, so there may still be some bugs lurking. Eh, how fun. > char-sets are smobs and use single cells, AFAICT. Right (but `SCM_NEWSMOB{2,3} ()' use double cells, though). Thanks, Ludo'.