chicken-janitors
[Top][All Lists]
Advanced

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

Re: [Chicken-janitors] Re: [Chicken-bugs] #367: optionally use mmap(2) t


From: Elf
Subject: Re: [Chicken-janitors] Re: [Chicken-bugs] #367: optionally use mmap(2) to allocate the heap for safer usage of tospace-locking
Date: Sat, 19 Jan 2008 22:09:58 -0800 (PST)


reason for using mmap optionally is that we're using it in a way that goes
against posix, iirc.

-elf

On Fri, 18 Jan 2008, Chicken Scheme wrote:

#367: optionally use mmap(2) to allocate the heap for safer usage of tospace-
locking
-----------------------------+----------------------------------------------
 Reporter:  felix           |       Owner:
     Type:  enhancement     |      Status:  new
 Priority:  minor           |   Milestone:
Component:  core libraries  |     Version:  2.7
Resolution:                  |    Keywords:
-----------------------------+----------------------------------------------
Comment (by Ivan Shmakov <address@hidden>):

Actually, I see no point in using mmap () just optionally iff
        the tospace-locking feature was requested, provided that such a
        feature is implemented on top of mprotect ().

        In order to familiarise myself with the Chicken internals, and
        to have some fun this evening as well, I've written the attached
        patch.

        I've successfully built Chicken with Chicken compiled with this
        patch.

{{{
chicken $ mkdir +build-2 && cd +build-2/
+build-2 $ LC_ALL=C nohup time make -f ../Makefile srcdir=.. \
               PREFIX=/nowhere/just/a/test ARCH=x86 PLATFORM=linux \
               USE_HOST_PCRE=yes LOCKTOSPACE=yes -j 4 \
               CHICKEN=../+build-1/chicken
...
+build-2 $ tail -n3 nohup.out
make[1]: Leaving directory `/.../+build-2'
414.38user 185.30system 2:33.85elapsed 389%CPU (0avgtext+0avgdata
0maxresident)k
0inputs+0outputs (0major+3712308minor)pagefaults 0swaps
+build-2 $ ./csi

CHICKEN
Version 3.0.0rc1 - linux-unix-gnu-x86   [ manyargs dload ptables applyhook
lockts hostpcre ]
(c)2000-2007 Felix L. Winkelmann        compiled 2008-01-18 on [...]
(Linux)

#;1> ,q
+build-2 $
}}}

        As a possible way to improve this further, I'd propose using a
        struct like the following for `heapspace's:

{{{
struct {
  C_byte *ptr;
#ifdef C_LOCK_TOSPACE
  size_t size;
#endif
} heapspace1, heapspace2;
}}}

        since `size' is required for munmap ().






reply via email to

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