[lkml]   [2003]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: TASK_UNMAPPED_BASE & stack location

    Only problem with moving TASK_UNMAPPED_BASE right above
    text would be - limiting the malloc() space. malloc() is clever enough
    to mmap() and do the right thing. Once I moved TASK_UNMAPPED_BASE
    to 0x10000000 and I could not run some of the programs with large
    data segments.

    Moving stacks below text would be tricky. pthread library knows
    the placement of stack. It uses this to distinguish between
    threads and pthreads manager.

    I don't know what other librarys/apps depend on this kind of stuff.


    static inline pthread_descr thread_self (void)
    #ifdef THREAD_SELF
    return THREAD_SELF;
    char *sp = CURRENT_STACK_FRAME;
    if (sp >= __pthread_initial_thread_bos)
    return &__pthread_initial_thread;
    else if (sp >= __pthread_manager_thread_bos
    && sp < __pthread_manager_thread_tos)
    return &__pthread_manager_thread;
    else if (__pthread_nonstandard_stacks)
    return __pthread_find_self();
    #ifdef _STACK_GROWS_DOWN
    return (pthread_descr)(((unsigned long)sp | (STACK_SIZE-1))+1) - 1;
    return (pthread_descr)((unsigned long)sp &~ (STACK_SIZE-1));

    "Martin J. Bligh" wrote:

    > Is there any good reason we can't remove TASK_UNMAPPED_BASE, and just shove
    > libraries directly above the program text? Red Hat seems to have patches to
    > dynamically tune it on a per-processes basis anyway ...
    > Moreover, can we put the stack back where it's meant to be, below the
    > program text, in that wasted 128MB of virtual space? Who really wants
    > > 128MB of stack anyway (and can't fix their app)?
    > I'm sure there's some horrible reason we can't do this ... would just like
    > to know what it is. If it's "standards compilance" I don't really believe
    > it - we don't comply with the standard now anyway ...
    > M.
    > PS. Motivation is creating large shmem segments for DBs.
    > --
    > To unsubscribe, send a message with 'unsubscribe linux-mm' in
    > the body to For more info on Linux MM,
    > see: .
    > Don't email: <a href=mailto:""> </a>

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:35    [W:0.021 / U:38.684 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site