diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-01-03 21:42:51 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-01-03 21:42:51 +0000 |
commit | a2f36c82bede91326449c9144d17f384663c5ab8 (patch) | |
tree | 743c2759816fd3eef8f9709d72e538001852db31 /libc/nptl | |
parent | acd1e4884e92bebf4ca870d510936604f5188e96 (diff) |
Merge changes between r16332 and r16348 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@16493 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/nptl')
-rw-r--r-- | libc/nptl/ChangeLog | 15 | ||||
-rw-r--r-- | libc/nptl/Versions | 2 | ||||
-rw-r--r-- | libc/nptl/nptl-init.c | 12 | ||||
-rw-r--r-- | libc/nptl/pthreadP.h | 1 | ||||
-rw-r--r-- | libc/nptl/sysdeps/pthread/gai_misc.h | 6 | ||||
-rw-r--r-- | libc/nptl/sysdeps/unix/sysv/linux/mq_notify.c | 4 | ||||
-rw-r--r-- | libc/nptl/sysdeps/unix/sysv/linux/timer_routines.c | 4 |
7 files changed, 36 insertions, 8 deletions
diff --git a/libc/nptl/ChangeLog b/libc/nptl/ChangeLog index 31177bf17..e8ff69ab0 100644 --- a/libc/nptl/ChangeLog +++ b/libc/nptl/ChangeLog @@ -1,3 +1,18 @@ +2011-12-22 Ulrich Drepper <drepper@gmail.com> + + * sysdeps/pthread/gai_misc.h (__gai_create_helper_thread): Use + __pthread_get_minstack. + * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Likewise. + + [BZ #13088] + * sysdeps/unix/sysv/linux/timer_routines.c: Get minimum stack size + through __pthread_get_minstack. + * nptl-init.c (__pthread_initialize_minimal_internal): Get page size + directly from _rtld_global_ro. + (__pthread_get_minstack): New function. + * pthreadP.h: Declare __pthread_get_minstack. + * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_get_minstack. + 2011-12-21 Ulrich Drepper <drepper@gmail.com> [BZ #13515] diff --git a/libc/nptl/Versions b/libc/nptl/Versions index 5a884202f..6a1037550 100644 --- a/libc/nptl/Versions +++ b/libc/nptl/Versions @@ -255,6 +255,6 @@ libpthread { GLIBC_PRIVATE { __pthread_initialize_minimal; __pthread_clock_gettime; __pthread_clock_settime; - __pthread_unwind; + __pthread_unwind; __pthread_get_minstack; } } diff --git a/libc/nptl/nptl-init.c b/libc/nptl/nptl-init.c index db45cab23..434922446 100644 --- a/libc/nptl/nptl-init.c +++ b/libc/nptl/nptl-init.c @@ -427,7 +427,7 @@ __pthread_initialize_minimal_internal (void) /* Make sure it meets the minimum size that allocate_stack (allocatestack.c) will demand, which depends on the page size. */ - const uintptr_t pagesz = __sysconf (_SC_PAGESIZE); + const uintptr_t pagesz = GLRO(dl_pagesize); const size_t minstack = pagesz + __static_tls_size + MINIMAL_REST_STACK; if (limit.rlim_cur < minstack) limit.rlim_cur = minstack; @@ -469,3 +469,13 @@ __pthread_initialize_minimal_internal (void) } strong_alias (__pthread_initialize_minimal_internal, __pthread_initialize_minimal) + + +size_t +__pthread_get_minstack (const pthread_attr_t *attr) +{ + struct pthread_attr *iattr = (struct pthread_attr *) attr; + + return (GLRO(dl_pagesize) + __static_tls_size + PTHREAD_STACK_MIN + + iattr->guardsize); +} diff --git a/libc/nptl/pthreadP.h b/libc/nptl/pthreadP.h index df4f4d769..845434e50 100644 --- a/libc/nptl/pthreadP.h +++ b/libc/nptl/pthreadP.h @@ -397,6 +397,7 @@ weak_function; extern void __pthread_init_static_tls (struct link_map *) attribute_hidden; +extern size_t __pthread_get_minstack (const pthread_attr_t *attr); /* Namespace save aliases. */ extern int __pthread_getschedparam (pthread_t thread_id, int *policy, diff --git a/libc/nptl/sysdeps/pthread/gai_misc.h b/libc/nptl/sysdeps/pthread/gai_misc.h index 9094c1e37..cbbe47657 100644 --- a/libc/nptl/sysdeps/pthread/gai_misc.h +++ b/libc/nptl/sysdeps/pthread/gai_misc.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. +/* Copyright (C) 2006, 2007, 2008, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -97,7 +97,9 @@ __gai_create_helper_thread (pthread_t *threadp, void *(*tf) (void *), pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); /* The helper thread needs only very little resources. */ - (void) pthread_attr_setstacksize (&attr, 4 * PTHREAD_STACK_MIN); + (void) pthread_attr_setstacksize (&attr, + __pthread_get_minstack (&attr) + + 4 * PTHREAD_STACK_MIN); /* Block all signals in the helper thread. To do this thoroughly we temporarily have to block all signals here. */ diff --git a/libc/nptl/sysdeps/unix/sysv/linux/mq_notify.c b/libc/nptl/sysdeps/unix/sysv/linux/mq_notify.c index 49ddeae05..11ffc328e 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/mq_notify.c +++ b/libc/nptl/sysdeps/unix/sysv/linux/mq_notify.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004, 2005, 2008 Free Software Foundation, Inc. +/* Copyright (C) 2004, 2005, 2008, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contribute by Ulrich Drepper <drepper@redhat.com>, 2004. @@ -201,7 +201,7 @@ init_mq_netlink (void) (void) pthread_attr_init (&attr); (void) pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); /* We do not need much stack space, the bare minimum will be enough. */ - (void) pthread_attr_setstacksize (&attr, PTHREAD_STACK_MIN); + (void) pthread_attr_setstacksize (&attr, __pthread_get_minstack (&attr)); /* Temporarily block all signals so that the newly created thread inherits the mask. */ diff --git a/libc/nptl/sysdeps/unix/sysv/linux/timer_routines.c b/libc/nptl/sysdeps/unix/sysv/linux/timer_routines.c index b159316fb..44da8563d 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/timer_routines.c +++ b/libc/nptl/sysdeps/unix/sysv/linux/timer_routines.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003-2007, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. @@ -165,7 +165,7 @@ __start_helper_thread (void) and should go away automatically when canceled. */ pthread_attr_t attr; (void) pthread_attr_init (&attr); - (void) pthread_attr_setstacksize (&attr, PTHREAD_STACK_MIN); + (void) pthread_attr_setstacksize (&attr, __pthread_get_minstack (&attr)); /* Block all signals in the helper thread but SIGSETXID. To do this thoroughly we temporarily have to block all signals here. The |