lpsm_zalloc
H. Peter Anvin
hpa@transmeta.com
Tue, 23 Oct 2001 09:09:25 -0700
Stephan Engström wrote:
> Hi!
>
> First I must say that this project is really, really welcomed here. I
> have been looking for this a long time and even began coding something
> like this, but I just had too many questions regarding portability and
> other troubles.
> If Peter has massive amount of time to spare I would really like some
> more information on the following:
>
> - Can this project ever be portable to, let's say, Solaris?
"Portable" probably not, "ported" probably. What I mean with that is
that it's probably going to require Solaris-specific code to be added.
Now, that's not really a huge tragedy, but it's not going to be my main
focus.
> - This fixed adress that the PM attaches to, how safe it is and in what
> conditions can it fail?
It's pretty safe. The main reason it would fail is due to very large
mmap()s (more than a few hundred MB) in use at the same time.
> - Is it possible to share the PM among processes?
No. I have been thinking about how to possibly make it thread-safe, but
making it shared between processes seems almost impossible.
> Anyway, I wanted to test and benchmark the clever lpsm_zalloc() and it
> doesn't work very well, I get a segfault when the first buddy allocation
> is called.
> I use v 0.1.5.
>
> In zalloc.c the mmap call return -1 (ENODEV), when I try to add the
> MAP_ANONYMOUS flag to mmap the program segfaults a couple of hundred
> times and then dies. Thats how far I came.
Not too good :( I'll have to look at it and get it fixed. Probably have
to write another test program... those darned test programs seem to be
finding all kinds of bugs... :-)
-hpa