From: Jon Tombs (jon@robots.ox.ac.uk)
Date: 01/22/93


From: jon@robots.ox.ac.uk (Jon Tombs)
Subject: Re: wow, suggestion for library improvment/shared memory,X suggestion
Date: 22 Jan 1993 18:03:35 GMT

In article <C174y9.940@world.std.com> entropy@world.std.com (The Entropic one) writes:
>
>I just noticed that the linux munmap call is completely general
>purpose. I've started using it on very large pieces of data when
>I free them, so that the pages are really freed rather than sitting
>around waiting to be swapped out.
>It seems like the libraries could be easily changed so that free would
>automatically call munmap whenever large chunks of data are freed.
>This would greatly improve performance when using large amounts of
>data (I wish I had this when I was working on tinymush).

Only if the data you free is larger than a page so that none of the malloc
linked list is left on it, but this could be usefull in some places. might
mean if you are running xmd then maybe X386 won't grow without limit...

>If this was done local X windows speed could be greatly improved, the
>X windows server could map in all processes using it and transfer
>stuff directly from the users memory to the screen. For example
>dumping a large Ximage would involve only a copy to the VGA memory
>rather than a copy into and out of the kernel.

X already has the support for using SYSV shmem to do this, and yes it
does greatly improve transfer speed (try play_mpeg with and without
shmem enabled). It doesn't matter how shared memory is implemented, but
if linux is to use the code that already exists, then we need SYSV shared
memory calls in libc.