From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101012 invoked by alias); 14 Jun 2018 08:04:31 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 100222 invoked by uid 89); 14 Jun 2018 08:02:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Subject: Re: [PATCH] Fix race in pthread_mutex_lock while promoting to PTHREAD_MUTEX_ELISION_NP [BZ #23275] To: libc-alpha@sourceware.org References: <4851b1b3-2fd5-75c2-cc5e-68519e373df2@redhat.com> <6538b117-5f58-181c-a52c-4c668ac4deb4@linux.ibm.com> <0ce60d10-94f5-6014-0a8c-33c9ff9d99b5@redhat.com> From: Stefan Liebler Date: Thu, 14 Jun 2018 08:04:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18061408-0012-0000-0000-0000027F492D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18061408-0013-0000-0000-000020B06A06 Message-Id: <61452ecb-ec00-8d65-e211-18659819fc70@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-14_02:,, signatures=0 X-SW-Source: 2018-06/txt/msg00393.txt.bz2 > I've also retested tst-mutex10 without the remaining patch on multiple > s390x machines. I've found out, that it depends on the used gcc (at > least on s390x). On one machine, gcc 6 was used. With gcc 7 / 8, the > type of the mutex was loaded from memory multiple times. > With gcc 6, it is loaded only one time and thus all threads are > promoting the mutex to PTHREAD_MUTEX_ELISION_NP. Then you don't see a fail. > > On x86_64, I've used gcc 8. Perhaps I can try other gcc versions. I've tried gcc 6, 7, 8 on x86_64: -gcc 6: the mutex-type is only loaded one time from memory => no fails -gcc 7/8: the mutex-type is loaded two times from memory => fails