From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: Stack calibration
Date: Sat, 11 Oct 2008 19:22:02 +0200 [thread overview]
Message-ID: <87k5cfujwl.fsf@gnu.org> (raw)
In-Reply-To: 49dd78620810091553gbb10a0aod55076f5eb93b28b@mail.gmail.com
Hi Neil,
"Neil Jerram" <neiljerram@googlemail.com> 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'.
next prev parent reply other threads:[~2008-10-11 17:22 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <47B2A8DF.9070004@tammer.net>
[not found] ` <87tzkd8bvz.fsf@gnu.org>
[not found] ` <87ejbh8ben.fsf@gnu.org>
[not found] ` <47B2D88F.1040505@tammer.net>
[not found] ` <87ir0tvx6e.fsf@inria.fr>
2008-02-13 20:40 ` stack overflow Neil Jerram
2008-02-14 8:48 ` Ludovic Courtès
2008-02-14 10:26 ` Mikael Djurfeldt
2008-02-14 11:25 ` Ludovic Courtès
2008-02-14 11:39 ` Mikael Djurfeldt
2008-02-25 21:52 ` Neil Jerram
2008-07-16 12:34 ` Ludovic Courtès
2008-09-12 20:47 ` Stack calibration Ludovic Courtès
2008-09-27 18:20 ` Neil Jerram
2008-09-28 20:05 ` Ludovic Courtès
2008-09-30 22:10 ` Neil Jerram
2008-10-02 8:25 ` Andy Wingo
2008-10-02 8:38 ` Neil Jerram
2008-10-02 22:30 ` Neil Jerram
2008-10-06 22:32 ` Ludovic Courtès
2008-10-06 23:11 ` Neil Jerram
2008-10-09 22:53 ` Neil Jerram
2008-10-10 13:22 ` Greg Troxel
2008-10-10 18:04 ` Neil Jerram
2008-10-10 18:28 ` Greg Troxel
2008-10-10 18:41 ` Neil Jerram
2008-10-11 17:22 ` Ludovic Courtès [this message]
2008-10-12 15:59 ` Neil Jerram
2008-10-12 21:16 ` Neil Jerram
2008-10-13 21:37 ` Neil Jerram
2008-10-14 7:25 ` Ludovic Courtès
2008-10-17 20:49 ` Neil Jerram
2008-10-14 7:19 ` Ludovic Courtès
2008-09-28 20:07 ` Ludovic Courtès
2008-09-30 22:11 ` Neil Jerram
2008-02-17 1:38 ` stack overflow Han-Wen Nienhuys
2008-02-17 9:20 ` Mikael Djurfeldt
2009-03-27 21:19 stack calibration Andy Wingo
2009-03-27 22:04 ` Mike Gran
2009-03-27 22:29 ` Julian Graham
2009-03-30 20:43 ` Neil Jerram
2009-03-31 3:39 ` Andy Wingo
2009-03-31 22:47 ` Neil Jerram
2009-04-03 17:44 ` Andy Wingo
2009-03-31 17:45 ` Greg Troxel
2009-04-17 9:35 ` Andy Wingo
2009-03-31 16:20 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k5cfujwl.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=guile-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).