[m-rev.] for review: boehm gc unmap capability

Julien Fischer juliensf at csse.unimelb.edu.au
Wed Feb 6 11:27:26 AEDT 2008


On Tue, 22 Jan 2008, Peter Wang wrote:

> Estimated hours taken: 6
> Branches: main
>
> Allow the use of munmap() in Boehm GC, in order to return unused memory pages
> back to the OS.  This has an adverse effect on run times so we want to be able
> to enable it on a per-application basis.  To avoid installing both
> munmap-enabled and munmap-disabled copies of Boehm GC, we make it so that
> munmap() capability can be compiled in but disabled with a global variable.
> In that case the performance difference (seems to) be negligible.
>
> As mmap/munmap aren't supported on all platforms, munmap() capability needs to
> be selected with `configure'.  It is currently disabled by default.
>
> Mmake.common.in:
> configure.in:
> 	Add the configure option `--enable-gc-munmap' and
> 	add -DUSE_MMAP -DUSE_MUNMAP to the Boehm GC C flags if set.
>
> boehm_gc/allchblk.c:
> boehm_gc/alloc.c:
> boehm_gc/malloc.c:
> boehm_gc/include/gc.h:
> boehm_gc/include/private/gc_priv.h:
> 	Add the global variable `GC_mercury_use_munmap'.
>
> 	Modify the code to check `GC_mercury_use_munmap' before executing code
> 	that would normally be run when USE_MUNMAP is set.
>
> runtime/mercury_wrapper.c:
> 	Set `GC_mercury_use_munmap' if MERCURY_OPTIONS contains `--munmap'.
>
> doc/user_guide.texi:
> 	Document the new MERCURY_OPTIONS and configure options.

...

> Index: doc/user_guide.texi
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/doc/user_guide.texi,v
> retrieving revision 1.556
> diff -u -r1.556 user_guide.texi
> --- doc/user_guide.texi	14 Jan 2008 00:08:03 -0000	1.556
> +++ doc/user_guide.texi	22 Jan 2008 00:36:52 -0000
> @@ -9785,6 +9785,13 @@
> @c bootcheck script (to reduce the time taken for a bootcheck while still
> @c testing the code writing out deep profiling data).
>
> + at sp 1
> + at item --munmap
> + at findex --munmap
> +This option enables code in the Boehm garbage collector to return unused memory
> +pages back to the operating system. It is meaningful only when using the Boehm
> +garbage collector, and requires @samp{--enable-gc-munmap} to be passed to
> + at samp{configure} (which may not work with all platforms).
> @end table

I suggest making that last bit a separate sentence, e.g.

 	(This may not work on all platforms.)

This diff looks fine.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list