Messages in this thread | | | Subject | Re: resize of vmalloced area possible? | From | Christoph Rohland <> | Date | 15 Oct 1999 20:04:23 +0200 |
| |
Hi Ben,
blah@kvack.org ("Benjamin C.R. LaHaise") writes:
> > Subject says it: Can I resize a vmalloced area without copying? > > It's possible, but it hasn't been done. Generally, the use of > vmalloc is strongly discouraged for anything other than occasional > allocation of large virtually contiguous memory areas. If possible, > rework your code to manage its own sparsely populated buffer.
Actually I am working on extending SYSV shared memory to be able to implement posix shared memory. What I need is the ability to resize shared memory segments. These are now implemented by vmalloc'ing a contiguous array of size (pages*sizeof(long)). This array has to be resized in ftruncate.
I thought a little bit longer about your comment and looked at the implementation. I realized that the actual implementation is only fine for light usage of shm. We did some tests here with ~400 segments each 128MB and had some problems with oom. Now I understand what happened: The vmalloc area was filled up. So I think there are more reasons to change the implementation of SYSV shm.
Is there any sample implementation where somebody handles big arrays, possibly resizeable?
Greetings Christoph
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |