This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Bump the default thread stack size on Darwin in libgomp (PR libgomp/79876)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: "Dominique d'Humières" <dominiq at lps dot ens dot fr>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 3 Apr 2017 19:00:42 +0200
- Subject: Re: [PATCH] Bump the default thread stack size on Darwin in libgomp (PR libgomp/79876)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E62E785376
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E62E785376
- References: <20170401122418.GU17461@tucnak> <72fda698-ef0c-c1b3-9aef-6fa5cde859a5@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Apr 03, 2017 at 10:56:13AM -0600, Jeff Law wrote:
> On 04/01/2017 06:24 AM, Jakub Jelinek wrote:
> > Apparently Darwin has insane default stack size for pthread_create
> > unless overridden through pthread_attr_setstacksize - 512kB, compared e.g.
> > to Linux usual default of around 8MB. For typical OpenMP uses that is way
> > too low, so the following patch is an attempt to bump it to 2MB just on
> > Darwin, and on other targets keep the default. Everything can be in any
> > case overridden through {,G}OMP_STACKSIZE env variables.
> >
> > Bootstrapped/regtested on x86_64-linux and i686-linux, can anyone please test it
> > on darwin?
> >
> > 2017-04-01 Jakub Jelinek <jakub@redhat.com>
> >
> > PR libgomp/79876
> > * config/posix/thread-stacksize.h: New file.
> > * config/darwin/thread-stacksize.h: New file.
> > * config/nvptx/thread-stacksize.h: New file.
> > * env.c: Include thread-stacksize.h.
> > (initialize_env): Initialize stacksize to GOMP_DEFAULT_STACKSIZE
> > instead of 0. Call pthread_attr_setstacksize even if
> > GOMP_DEFAULT_STACKSIZE is non-zero.
> I've got a build started, but it's on an ancient macbook pro, so it'll take
> a long time. Someone else with modern hardware could certainly get this
> done faster :-)
Dominique has already tested it on Darwin 16 and said he'll test on Darwin
10; I'm waiting for those results.
Jakub