gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: more on *after-gbc-hook*


From: Camm Maguire
Subject: [Gcl-devel] Re: more on *after-gbc-hook*
Date: 28 Nov 2005 20:40:10 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings!  While I cannot reproduce this exactly (your image appears
tighter on memory than mine), it would appear that what is happening
is that the hole is being overrun, sgc turned off, a gc collecting
relocatable pages triggered to move them and make a new hole, then sgc
turned on again, which triggers another gc in getting enough space for
the sgc pages.  So before the original call to alloc_page completes,
two gc calls have been made, and the pending after-gbc-hook flag set
to trigger (only one) call to this function when it is safe.

In general, it appears that the existing design strove to first
satisfy the allocation request which triggered the gc, and then call
the hook.  If the hook is called when the allocation is partially
complete, then the hook itself could trigger another allocation which
would corrupt the partial one.  The hook could in principle be called
at the end of GBC, but if it allocated enough space to trigger another
gc one could get endless recursion.  This also could happen if the
original allocation is not first satisfied -- at least if it is, the
image is guaranteed to be making some other progress before calling
the hook. 

In any case, with this design, these two gc calls are not separated by
a safe place to call the hook, if I understand correctly.

I guess I don't understand the purpose of the hook.  Do you just want
one call per gc reasonably close to the end of the call even if two
pile up together, or do you want a call on a pristine swept heap
before the next allocation is made?

Take care,

Robert Boyer <address@hidden> writes:

> I think that the following transcript shows that *after-gbc-hook* is still,
> perhaps, not being called after some garbage collections.
> 
> I count 12 exclamation marks, 7 "[SGC for", and 8 "[GC for".
> 
> It is also a curiosity that the first thing after
> 
>   (progn (make-list 1000000) nil)
> 
> is an exclamation mark, suggesting that *after-gbc-hook* is being called here
> before a gc!
> 
> Bob
> 
> -------------------------------------------------------------------------------
> 
> % g
> GCL (GNU Common Lisp)  2.7.0 ANSI    Nov 27 2005 13:38:44
> Source License: LGPL(gcl,gmp,pargcl), GPL(unexec,bfd)
> Binary License:  GPL due to GPL'ed components: (BFD UNEXEC)
> Modifications of this banner must retain notice of a compatible license
> Dedicated to the memory of W. Schelter
> 
> Use (help) to get some basic information on how to use GCL.
> 
> >(setq si::*notify-gbc* t)
> 
> T
> 
> >(setq si::*after-gbc-hook* (function (lambda (type) (format t "!"))))
> 
> #<interpreted-function (LAMBDA-CLOSURE () () () (TYPE) (FORMAT T "!"))>
> 
> >(si::sgc-on t)
> [GC for 39 RELOCATABLE-BLOCKS pages..(T=2).GC finished]
> [SGC on]
> T
> 
> >(progn (make-list 1000000) nil)
> ![SGC off][GC for 39 RELOCATABLE-BLOCKS pages..(T=2).GC finished]
> [GC for 39 RELOCATABLE-BLOCKS pages..(T=2).GC finished]
> [SGC on]![SGC for 75 CONS pages..(752 writable)..(T=1).GC finished]
> ![SGC for 75 CONS pages..(752 writable)..(T=0).GC finished]
> ![SGC off][GC for 39 RELOCATABLE-BLOCKS pages..(T=3).GC finished]
> [GC for 39 RELOCATABLE-BLOCKS pages..(T=3).GC finished]
> [SGC on]![SGC for 438 CONS pages..(1115 writable)..(T=1).GC finished]
> ![SGC for 438 CONS pages..(1115 writable)..(T=1).GC finished]
> ![SGC off][GC for 39 RELOCATABLE-BLOCKS pages..(T=3).GC finished]
> [GC for 39 RELOCATABLE-BLOCKS pages..(T=4).GC finished]
> [SGC on]![SGC for 667 CONS pages..(1344 writable)..(T=0).GC finished]
> ![SGC for 667 CONS pages..(1344 writable)..(T=1).GC finished]
> ![SGC off][GC for 39 RELOCATABLE-BLOCKS pages..(T=4).GC finished]
> [GC for 39 RELOCATABLE-BLOCKS pages..(T=4).GC finished]
> [SGC on]![SGC for 832 CONS pages..(1509 writable)..(T=1).GC finished]
> !
> NIL
> 
> >
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]