Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp418222pxu; Tue, 6 Oct 2020 09:25:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIpcIH9gW4OGwXnOb+eVLmFbyMCq1zVbziCwyJyPXGMo+wtei7aCpVzNuApXPURp8BomFM X-Received: by 2002:a50:d987:: with SMTP id w7mr6360755edj.113.1602001557572; Tue, 06 Oct 2020 09:25:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602001557; cv=none; d=google.com; s=arc-20160816; b=xp/NHSyQ3WY85CrYr4u4m2nCPmE+GpCEGzy03GaTZfdM6C/dy5N0WcMPHlATQzS1fO 9YKD7/2gn6O6Zy4c1S34udxObACU0t6KkQlasFijH2X8C8PgOHYhcaMALpaG2tmTq5zE Wn35urf9gFd3Pm2p4j5Kb0sYbr6KnfrnUcXABWBax73tQcAqphHEIgpgdY31Q6/By52G qcZkRIiFBIJ/kqi9Bj9+TS7dWdog5Qx7kOsikotNc/LiW9gYZMTWhYXCTmvWKRrwfYR4 Fbc8eeycO92JBV9vDdd7WHMtYxOfna9SsfQQC9mtWJjPuK45PmFcATn4cdxtWuOXiuQi hF4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=TGCOEr6LQRQLyQNmu4B35aWvRdnpiOq9HryVOTC4XI0=; b=G7Ki2qW7+JmmqkiwaeRdtxx6/Sy0FxvWkNwJ8nDrCpHzG6E+5Yh95gYihl8Km3MLpL EFABs//eedjG0rWRAuC45Pvdza3f1MC0jwwW0orQmp98PPFT7b0aVnWo0y7C+rbu6ev0 CsygTNdGIhwBHMLFRYEobhV9tXH/RTbY6vkT4OBZgIE+DIsqMFLK9EnIq7m6z8qUmsQz 2xDqYlRchlB0JNSKutKHsA90ovUepMLEmwlnNQbCsn+5NWg6LNjbNBis02WpjduNb99m LKUNmcexS+knGpYlhtejPXPTt83NDMU5TngoLGehFgz99tX+qA7ftW7bkB0QxTcEab2x dojw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y22si2744465edi.469.2020.10.06.09.25.34; Tue, 06 Oct 2020 09:25:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726087AbgJFQWP convert rfc822-to-8bit (ORCPT + 99 others); Tue, 6 Oct 2020 12:22:15 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]:26753 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725972AbgJFQWP (ORCPT ); Tue, 6 Oct 2020 12:22:15 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-214-PwnpPkW5Ose2mzPbAEManw-1; Tue, 06 Oct 2020 17:22:11 +0100 X-MC-Unique: PwnpPkW5Ose2mzPbAEManw-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Tue, 6 Oct 2020 17:22:10 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Tue, 6 Oct 2020 17:22:10 +0100 From: David Laight To: 'Willy Tarreau' , "Paul E. McKenney" CC: 'Nick Clifton' , Peter Zijlstra , "stern@rowland.harvard.edu" , "linux-toolchains@vger.kernel.org" , "Will Deacon" , "linux-kernel@vger.kernel.org" , "parri.andrea@gmail.com" , "boqun.feng@gmail.com" , "npiggin@gmail.com" , "dhowells@redhat.com" , "j.alglave@ucl.ac.uk" , "luc.maranget@inria.fr" , "akiyks@gmail.com" , "dlustig@nvidia.com" , "joel@joelfernandes.org" , "torvalds@linux-foundation.org" Subject: RE: Control Dependencies vs C Compilers Thread-Topic: Control Dependencies vs C Compilers Thread-Index: AQHWm9Z2gJDHxIOMJkCFRnXrafG7EamKgJsQgAAvGJKAAASM8IAACo9JgAABq0A= Date: Tue, 6 Oct 2020 16:22:10 +0000 Message-ID: References: <20201006114710.GQ2628@hirez.programming.kicks-ass.net> <3dfe7daed3c44f46a6989b6513ad7bb0@AcuMS.aculab.com> <20201006133115.GT2628@hirez.programming.kicks-ass.net> <20201006142324.GB416765@rowland.harvard.edu> <20201006144302.GY2628@hirez.programming.kicks-ass.net> <47bfda8f-304e-5283-c6d6-0753037b0b2c@redhat.com> <1dabfd1939f348198678121f94d6c9b2@AcuMS.aculab.com> <20201006155052.GJ29330@paulmck-ThinkPad-P72> <20201006161039.GF5822@1wt.eu> In-Reply-To: <20201006161039.GF5822@1wt.eu> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Willy Tarreau > Sent: 06 October 2020 17:11 > > On Tue, Oct 06, 2020 at 08:50:52AM -0700, Paul E. McKenney wrote: > > Comparing 25+ assembly languages to but two compilers most definitely > > motivates looking hard at doing something with the compilers. > > +1, especially since the kernel is not special; anyone working with > threads faces the same issues in userland, which are often hidden > behind the implicit whole-memory clobbers of certain operations or > the call to mutex manipulation functions, but which become a reality > again as soon as you go slightly away from these and try to use > lockless mechanisms. AFAICT most windows and android apps completely ignore the problem of thread locking - which is why the crash and lock up all the time :-) I've spent most of the day looking at some library traces from a customer bug. I almost suspect a bug in the pthread mutex code on their system. They are using a nice, modern, 3.10.0-957.el7.x86_64 kernel. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)