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: Stack calibration Date: Sat, 11 Oct 2008 19:22:02 +0200 Message-ID: <87k5cfujwl.fsf@gnu.org> References: <47B2A8DF.9070004@tammer.net> <66e540fe0802140339n2121e1d9y85fcc9f019d8be0f@mail.gmail.com> <87prukog9w.fsf@ossau.uklinux.net> <87hc8lw0q2.fsf_-_@gnu.org> <49dd78620809271120j17097ffq4da8f2b8dffd4efd@mail.gmail.com> <87abdsf337.fsf@gnu.org> <49dd78620809301510q173d1777rd26240ce40f204f0@mail.gmail.com> <49dd78620810021530u8f29699x88fa8c0241105a07@mail.gmail.com> <87d4ide4md.fsf@gnu.org> <49dd78620810061611v2e67d646v29b479ca1fb23274@mail.gmail.com> <49dd78620810091553gbb10a0aod55076f5eb93b28b@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1223745805 9419 80.91.229.12 (11 Oct 2008 17:23:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 11 Oct 2008 17:23:25 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Oct 11 19:24:23 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 1KoiCA-0004eh-Vd for guile-devel@m.gmane.org; Sat, 11 Oct 2008 19:24:03 +0200 Original-Received: from localhost ([127.0.0.1]:39909 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KoiB7-00058x-1X for guile-devel@m.gmane.org; Sat, 11 Oct 2008 13:22:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KoiAW-00052g-Si for guile-devel@gnu.org; Sat, 11 Oct 2008 13:22:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KoiAW-00052U-CQ for guile-devel@gnu.org; Sat, 11 Oct 2008 13:22:20 -0400 Original-Received: from [199.232.76.173] (port=60364 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KoiAW-00052R-9v for guile-devel@gnu.org; Sat, 11 Oct 2008 13:22:20 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:42571 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 1KoiAV-00015I-Hr for guile-devel@gnu.org; Sat, 11 Oct 2008 13:22:20 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KoiAM-0000Wz-Uw for guile-devel@gnu.org; Sat, 11 Oct 2008 17:22:11 +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 ; Sat, 11 Oct 2008 17:22:10 +0000 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 11 Oct 2008 17:22:10 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 62 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: 20 =?iso-8859-1?Q?Vend=E9miaire?= an 217 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.3 (gnu/linux) Cancel-Lock: sha1:q949D5MrerjMnfzLh4EXicjSZV8= X-detected-operating-system: by monty-python.gnu.org: GNU/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:7770 Archived-At: Hi Neil, "Neil Jerram" writes: > - it uses a much larger amount of executed code to calibrate stack > usage: specifically, all the code involved in starting up a standard > debug-mode REPL > > - it focusses on the problem of getting `make check' to pass (when it > should do so) > > - it does not modify the value or meaning of the default, C-coded stack limit > > - it doesn't require building the whole of Guile twice! Great! > I'm only looking at this stage for general thoughts; if you think this > approach looks good, I will still need to The approach looks good to me. It's just annoying that `SCM_CHECK_STACK' (adding a slight overhead) and "threads.h" have to be modified. Instead of storing the high water mark in threads, could we have `%get-stack-depth' and call it from somewhere deep in the code (similar to what was in your previous patch)? In that case, instead of using a void port for the REPL's output, we could for instance use a soft port and measure the stack depth from there: (let ((before (%get-stack-depth)) (after #f) (port (make-soft-port (vector (lambda (chr) (set! after (%get-stack-depth))) (lambda (str) (set! after (%get-stack-depth))) (lambda () (set! after (%get-stack-depth))) #f #f #f)))) (with-output-to-port port (lambda () (with-input-from-string "\n" top-repl))) (abs (- after before))) > BUILT_SOURCES = cpp_err_symbols.c cpp_sig_symbols.c libpath.h \ > version.h scmconfig.h \ > - $(DOT_X_FILES) $(EXTRA_DOT_X_FILES) > + $(DOT_X_FILES) $(EXTRA_DOT_X_FILES) stack-limit-calibration.scm As Greg suggested, this could be in `check_DATA' or something like that. > +;; This is the value of top-repl-hwm-measured that we get on a > +;; `canonical' build platform. (See text below for what that means.) > +(define top-repl-hwm-i386-gnu-linux 9184) I'd tend to use the actual GNU triplet, like `i386-pc-linux-gnu'. Thanks for working on it! Ludo'.