lkml.org 
[lkml]   [1999]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: resize of vmalloced area possible?
    From
    Date
    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/

    \
     
     \ /
      Last update: 2005-03-22 13:54    [W:3.091 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site