delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/11/19/02:00:00

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 4AJ6xxT03003985
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 4AJ6xxT03003985
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=MjFGAIrj
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C40DC385841C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1731999597;
bh=/I62HZjeeI4+vmJbN9RXyT5piHhqDJcA52FJ85PyVEc=;
h=Date:To:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=MjFGAIrjrOH8XIXYJ3be+UHPyJ64gGgh7iSqJZVzv5EXj7RI9DQiKPXm5V1XXtlDV
WsfOXioXuJQP2gpm4iBnuSl3bAlThagGue4zKCXzGqnxaWTT+M4cfl6PKOxWhkD2aF
YXre3Lnfn9FaZ0HQ7Ud9y+zHP0Y0unabiyYkqWOA=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5DF663858C32
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5DF663858C32
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1731999562; cv=none;
b=CkUXvWayGaoSkTp2oKOPGowNJhLIkDpYG0FxUmEtZZmo6RUZTzkXgPPzmHB2kub9RCEmLbxJZac6290S41mPVlLwaNZveEmQ4+0o9tGb2FXqwN2I99o6slQpL9E0i6tBC8G0HgcGn5N4AbABGyIsPgvI74XD67qfvZGSzNZf03s=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1731999562; c=relaxed/simple;
bh=xxFO5XjE2paAfq7l8yZd4l6ZwrdgauogwCRZL0VG24E=;
h=DKIM-Signature:Date:From:To:Message-ID:Subject:MIME-Version;
b=HAp737Yz96xXta1avCm9MD/vTF8ab8DM4gE9djOQsqe2Eaew166X3NCcMW2JgGPOPYFo8y3P/W3acwVGZCMinMH1RK7vIpi7S48To6jmDZK3WBNY8CHkPEqssvqgP5FiElRNwevNsZWr1OO4hiQOYFtQwEEGlCZvLuNJ07PuleQ=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5DF663858C32
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
t=1731999561; bh=hP43vVgEWWsI2wfWkbqzexSecZcUoqDEOQvrG1c1Wc3=;
h=X-Sonic-MF:Date:From:To:Subject:From:Subject;
b=ezi8JlllYA98v+8xp8RJq1b3T+6nb7zGkBgzAyrpQLof7PknYiU/e3heyLj3xcT9EaajwXhPiel/XEln1nshtIK1vF+cpwlcWYi6sCOeV1Jfc++Th71/WefauORB1oQU0ijyoXw4yF53q1DSt9A9KYHqSHRJ1QBdXCU6LnNrWI/AXGXO3+DqPit+3RWg/jNhhPfXHhfCLZeDrUtPxh9BhXxqKGlPTUiodjIwEk7TZpC+X4RyUpjqzfAUvsjFzcXVlJeyVvH4TlUB5OEKKlLR8f6coiuRNEoJV/CEOzpgxSE04lU9Zy3x6RpsUVZbfM2geKFQGXqaI83S8lmS+x4A2Q==
X-YMail-OSG: pxDyRm4VM1kiDlH2ghFaJ2ws7PR7cp98y9908.XFHsW3Bnioff11azqJiNgg0fL
9ciB25EZAiDBAUWGlBShM_R3JK8XBNq0xcchc_8fXuWhZw_ni.qsgSuFu__0cpP2emeP03H7wqTK
66_WCos9GQJB1g6g0XRNpXvyDwMM1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VKPEF8c0nJdrS
X-Sonic-MF: <stinkf42 AT yahoo DOT com>
X-Sonic-ID: 812c17e9-d85b-4b77-a875-2a916a9f4b0e
Date: Tue, 19 Nov 2024 06:59:19 +0000 (UTC)
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Message-ID: <2093810197.191568.1731999559821@mail.yahoo.com>
In-Reply-To: <0bec82b7-503d-4cfd-b940-cb66914b61f1@maxrnd.com>
References: <791865992 DOT 3601338 DOT 1731871978376 DOT ref AT mail DOT yahoo DOT com>
<791865992 DOT 3601338 DOT 1731871978376 AT mail DOT yahoo DOT com>
<0bec82b7-503d-4cfd-b940-cb66914b61f1 AT maxrnd DOT com>
Subject: Re: Thread memory allocation issue
MIME-Version: 1.0
X-Mailer: WebService/1.1.22941 YMailNorrin
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Teepean via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Teepean <stinkf42 AT yahoo DOT com>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 4AJ6xxT03003985

> Given that the result of the investigation a couple years ago was,
> essentially, no change to Cygwin's malloc*, why has the problem 
> manifested again recently?  Have you been benchmarking/testing all 
> along?  Can you be more specific about which recent Cygwin versions?

The original executable with patches was compiled around 2021 using Cygwin the current GCC and Cygwin at that time. This version does work without problems. There have been several changes to Cygwin after that time so I decided compiling bwa using current Cygwin (3.5.4) to see if it would work without patching and I found that it did not. I compiled a patched version (GCC versions 12.0 - 15.0) and noticed that it did not work either. I then tested the 2021 compiled version and noticed that executable still works.

>> Steps to Reproduce
>> 
>> 1. Compile BWA normally
>> 
>> https://github.com/lh3/bwa/
>
> What's involved with that? Clone the repo, ./configure, make? Anything else?

git clone https://github.com/lh3/bwa/
cd bwa
make

>> 2. Compile BWA with rpmalloc and the following patch:
>> 
>> 
>> // In thread worker function:
>> #ifdef __CYGWIN__
>> rpmalloc_thread_initialize();
>> #endif
>> 
>> 
>> // ... thread work ...
>> #ifdef __CYGWIN__
>> rpmalloc_thread_finalize(1);
>> #endif

> Where does that patch go? Assume I know nothing about BWA.

These two files are patched:

https://github.com/WGSExtract/bwa/blob/cygwin/main.c

https://github.com/WGSExtract/bwa/blob/cygwin/kthread.c

> Are these examples of runs one would do "in production"? Or are you
> running much longer-lasting processing in the usual case?

Normal production samples are usually gigabytes in size whereas the testcase has a sample that is only around 20 megabytes but even with a small sample like this it is possible to benchmark the problem. So a production sample of human DNA that might be 60 gigabytes in size and would take Linux version of bwa about three hours would take 24 hours or more on an unpatched bwa on Cygwin.

>> 1. The default malloc implementation shows extremely high system time (11.265s) compared to the rpmalloc version (0.327s)
>> 2. Total real time is about 4.5x slower with default malloc
>> 3. The dramatic difference in system time suggests heavy contention in the memory allocation subsystem
>> 4. The issue only manifests on Cygwin with bwa; the same code performs normally on native Linux and MacOS
>
> Are you saying there is non-bwa code that runs on Cygwin comparably to 
> Linux and Mac?

I think most code runs nearly as fast on Cygwin as it does on Linux, assuming the code does not heavily rely on disk I/O.

>> 5. The issue manifests with recent versions of Cygwin but does work with older versions
>
> Again, it would really help if you could give Cygwin versions or at 
> least dates here...

The patch for Cygwin version was committed Mar 28, 2021.

> I'll glance at this stuff when I can but I hope to have some answers to
> my questions above from you to save me some time.

Thank you! I know that there are only a handful of people using bwa on Cygwin but I would guess that this is a good test case to learn something about Cygwin's malloc.

Regards,
Teemu Nätkinniemi

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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