delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/10/21/10:15:54

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=YYHoMjKNYPBIH4sd6VwBtT8uCOLjxSLKuyIfXQTPB1TpodhmIvC7I
eBq5RNhm8puAeehAWsBQ3rd9r+khOmR9CBJJJv5nR3+8fxKF2ZS4jHd2qMeL3Kge
XtwyNXCs2mOUeFOCRl2lGPsshb6UMP5PsRFbfOk9DU4M7iZjmLY+Hw=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=YOZrEeAO/DX/jSRTFpIjBapVjFU=; b=WooSpX/8a8vxMBuaVl3vXTJz6Uo+
RrZHPJP+asmRReLgexTCPOuFki0C/QeVL9x9N90+Lz3hcwI2pJ5a1xImXdtofLf/
uPEiYF9tVJKGXLdedOjCtar/fs7Kn2f+RKVrmICE1As5HPfS67Kgs80Mf7HfSinf
O1rCMQ1LyGj1CMs=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2
X-Spam-User: qpsmtpd, 2 recipients
X-HELO: calimero.vinschen.de
Date: Wed, 21 Oct 2015 16:15:23 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com, cygwin-developers AT cygwin DOT com
Subject: Re: Jemalloc under CYGWIN
Message-ID: <20151021141523.GV5319@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com, cygwin-developers AT cygwin DOT com
References: <CAJygYd2T9JSJCDT178F8mzmuA79MsBbWCLsr8eF7Aguxk_-YWQ AT mail DOT gmail DOT com> <CAJygYd1tU+Nc5+owTw0Lfuk8SWQQS2vE1mhKjoz5br4c9zVF8A AT mail DOT gmail DOT com> <20151021105300 DOT GN5319 AT calimero DOT vinschen DOT de> <CAJygYd3o5tjmLx8e8zCFi+T5LxzBLk02nMrcC03Fp-MbnuBsHQ AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <CAJygYd3o5tjmLx8e8zCFi+T5LxzBLk02nMrcC03Fp-MbnuBsHQ@mail.gmail.com>
User-Agent: Mutt/1.5.23 (2014-03-12)

--LbN0412894TjpI52
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Oct 21 21:49, Yucong Sun wrote:
> > What exactly is the malloc problem you're seeing?
>=20
> The specific problem I'm having is that jemalloc's malloc_init() calls
> needs to use pthread_mutex_init()  or even pthread_mutex with a
> initializer.   Both in-turn uses malloc, triggering this issue.
>=20
> A quick fix would be somehow make pthread always use system
> malloc/free, which shouldn't be that bad.

What about using a native critical section instead?  It shouldn't be too
tricky to conditionalize this in jemalloc.

> Another issue I saw is that jemalloc will use readlink()  for
> "/etc/jemalloc.conf" during malloc_init(), which on cygwin, this
> function uses "new" to do some path manipulating work, which also have
> the same issue.  However, we can probably just disable that .

Or alternatively the file can be reasd like the other files in /etc
Cygwin needs early access to.  See the NT_readline class and an
example usage in, e.g, mount_info::from_fstab.

> So, the quickest fix would be to make cygwin's thread implementations
> always use system malloc.
>=20
> some small workarounds in jemalloc would be needed afterwards, but it
> should be a nice starting point.


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--LbN0412894TjpI52
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWJ537AAoJEPU2Bp2uRE+gBMYP/28Dm4tPXM+zfgKJKL0HyrSD
WByrJwhNQL7xoSgFELU0hJ1pyju2VPmctHXIGpQ3VThW0FbHqwT6wsoTwu6PItRO
5wRx9cxLM9/m+dD8zpS1vyXo7/rkEYG1lxlcUVfmYfqPzFtxWCq5gLeMWVEb7NL7
JyKCrNpAZrfjwxi5xXCpBEHwFixsYh9EdOKEHwyGZAG3mRlZx8kibJ+3VC8co2Sm
pLqTwKzo0DxAF7sE2WCRa+bPIgTkCCVRqBFdGUt4iBTX3Hq0jAIN1hIJVuEuETlV
Fab3zXO32MyVW0cVQhA0PstFwqRNBxjeu93fDCA4kp5s9Ywxgge+opO7ZcNw0npy
6KYPHSBbn6u54gEla5MKyEQBsAj1cJFPPT118TEkXeLlvt4dEGA9akLJZJFgCIO4
+1jNtxr6wub7BWbOzV1CCO1XW4L5WYWJvP2aXuZRghoUn0Nw3cuFT2XfhuHCOdiJ
qoJ16+dlueUm+csfot0OPKso506POnI6SpUb3eIeeVwIL9OmDeEFYod5wYF3C1T1
ezX/lI6b1Aa0rLV2zzaTBofjnMWIRZbjUWA1ICA2Y7ksY2tMgfnUu4YwKHuj7cn1
qacrR7//VHRcA6OhO2MmLvXASGwv00g92r3g856RNrVwR9pPRk3Z1f1RGUk9ga5J
8a8SRkI7/vO5AwAg5Nm5
=bSow
-----END PGP SIGNATURE-----

--LbN0412894TjpI52--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019