public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ppluzhnikov at google dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sources.redhat.com
Subject: [Bug libc/11787] Program with large TLS segment fails aio_write
Date: Sat, 24 Mar 2012 10:30:00 -0000	[thread overview]
Message-ID: <bug-11787-131-QtERRXqEc5@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-11787-131@http.sourceware.org/bugzilla/>

http://sourceware.org/bugzilla/show_bug.cgi?id=11787

--- Comment #12 from Paul Pluzhnikov <ppluzhnikov at google dot com> 2012-03-24 02:21:06 UTC ---
(In reply to comment #8)

> Please note that the aio helper thread *should* be using a default 2MB stack on
> x86, not 16K, I don't see anywhere that sets the helper threads stack to 16K.

The helper thread stack size *is* set by __pthread_get_minstack.

The test case here no longer crashes using the current git trunk, but only
because the aio thread stack is now increased to accomodate static tls:

  // nptl/nptl-init.c
  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);
  }

This was done here:

2011-12-22  Ulrich Drepper  <drepper@gmail.com>

       [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.

and is *precisely* the change we are asking for for the other threads.

I see that Rich Felker is in exact agreement with me:
http://sourceware.org/bugzilla/show_bug.cgi?id=13088#c1

> You are also increasing the memory footprint of all applications that use TLS
> that worked fine before.

It depends on what you call "memory footprint". Yes, we'll increase memory
we *reserve* for stacks (VM size). But we will not *use* any more memory
than what's already used (RSS).

I think the only application that would notice this is one that was almost
running out of VM space. An answer for such app would be to decrease its
default stack sizes, use smaller number of threads, or switch to 64 bits.

> Before making any changes we need to hear from the distros (RH, SuSE, Debian,
> Gentoo, Ubuntu etc) about the kind of impact this might have e.g. a quick find
> / readelf -a / grep to determine on average the memory increase we are looking
> at.

Would above still apply if it's just VM size we are talking about?
I don't see how readelf will reveal anything.

> There are multiple cases here.

> You appear to be suggesting the following:
> 
> For (a) the behaviour remains the same.
> 
> For (b) we adjust upward by the size of the static TLS data.
> 
> For (c) "
> 
> For (d) "
> 
> For (e) "

Yes, I believe that's what we are proposing.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


  parent reply	other threads:[~2012-03-24  2:22 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-11787-131@http.sourceware.org/bugzilla/>
2012-02-24  4:35 ` ppluzhnikov at google dot com
2012-02-24 19:36 ` asharif.tools at gmail dot com
2012-03-22 21:48 ` asharif.tools at gmail dot com
2012-03-23 20:35 ` vapier at gentoo dot org
2012-03-23 20:37 ` carlos_odonell at mentor dot com
2012-03-23 20:39 ` carlos_odonell at mentor dot com
2012-03-23 21:33 ` carlos_odonell at mentor dot com
2012-03-23 22:07 ` ppluzhnikov at google dot com
2012-03-23 22:47 ` asharif.tools at gmail dot com
2012-03-23 22:51 ` carlos_odonell at mentor dot com
2012-03-23 23:02 ` carlos_odonell at mentor dot com
2012-03-23 23:03 ` carlos_odonell at mentor dot com
2012-03-24  2:22 ` carlos_odonell at mentor dot com
2012-03-24 10:30 ` ppluzhnikov at google dot com [this message]
2012-03-24 16:10 ` carlos_odonell at mentor dot com
2012-03-24 17:08 ` carlos_odonell at mentor dot com
2012-03-24 17:39 ` vapier at gentoo dot org
2012-03-24 18:30 ` ppluzhnikov at google dot com
2012-03-24 20:13 ` carlos_odonell at mentor dot com
2012-03-24 20:46 ` carlos_odonell at mentor dot com
2012-03-24 20:57 ` ppluzhnikov at google dot com
2012-03-25  2:01 ` carlos_odonell at mentor dot com
2012-03-25 23:16 ` vapier at gentoo dot org
2012-03-26 14:29 ` joseph at codesourcery dot com
2012-03-26 17:44 ` carlos_odonell at mentor dot com
2012-03-27 21:21 ` carlos_odonell at mentor dot com
2012-03-30 16:21 ` carlos_odonell at mentor dot com
2012-03-30 16:46 ` law at redhat dot com
2012-03-30 21:28 ` ppluzhnikov at google dot com
2012-04-01 19:47 ` carlos_odonell at mentor dot com
2012-04-24 22:03 ` asharif.tools at gmail dot com
2012-04-24 22:36 ` carlos_odonell at mentor dot com
2012-04-25  2:55 ` vapier at gentoo dot org
2012-04-25 18:25 ` asharif.tools at gmail dot com
2012-04-25 20:11 ` carlos_odonell at mentor dot com
2012-05-07 21:22 ` [Bug libc/11787] Program with large TLS segments fail carlos_odonell at mentor dot com
2012-05-17 14:11 ` carlos_odonell at mentor dot com
2012-05-22  7:05 ` siddhesh at redhat dot com
2012-05-23 16:41 ` carlos_odonell at mentor dot com
2012-05-23 17:09 ` siddhesh at redhat dot com
2012-05-23 17:09 ` siddhesh at redhat dot com
2012-06-05 15:15 ` ian at airs dot com
2012-11-19  6:18 ` carlos_odonell at mentor dot com
2012-12-03 23:52 ` carlos at systemhalted dot org
2012-12-03 23:53 ` carlos at systemhalted dot org
2013-04-26 18:06 ` ppluzhnikov at google dot com
2013-04-27  2:02 ` bugdal at aerifal dot cx
2013-05-22 18:40 ` carlos at redhat dot com
2013-09-13 21:45 ` bas at bmail dot ru
2013-11-23  9:05 ` david.abdurachmanov at gmail dot com
2013-11-23  9:20 ` david.abdurachmanov at gmail dot com
2013-11-24 15:58 ` carlos at redhat dot com
2014-02-16 19:42 ` jackie.rosen at hushmail dot com
2014-05-28 19:41 ` schwab at sourceware dot org
2014-06-30 17:33 ` fweimer at redhat dot com
2014-07-02  6:06 ` fweimer at redhat dot com
2015-03-23  2:50 ` andersk at mit dot edu
2015-08-22 21:36 ` [Bug dynamic-link/11787] " jsm28 at gcc dot gnu.org
2020-06-15 16:23 ` john.wellesz at hiventy dot com
2021-06-19  8:05 ` a3at.mail at gmail dot com
2022-01-26  6:44 ` sam at gentoo dot org
2022-06-07  8:09 ` i at maskray dot me
2022-11-06 20:12 ` i at maskray dot me
2010-07-02 23:02 [Bug libc/11787] New: Program with large TLS segment fails aio_write ppluzhnikov at google dot com
2010-07-02 23:03 ` [Bug libc/11787] " ppluzhnikov at google dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-11787-131-QtERRXqEc5@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).