Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1446934ybl; Fri, 16 Aug 2019 15:29:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/DY7iX2S7SNEQAH72tv6r1xJBkuClcgE2zzld2l/3G2i5JixLEtpcCoYDHZ3tHvaNwVpx X-Received: by 2002:a17:90a:380a:: with SMTP id w10mr9169458pjb.138.1565994543965; Fri, 16 Aug 2019 15:29:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565994543; cv=none; d=google.com; s=arc-20160816; b=CYtgQde0ZcHQjzV93Z8ivg0TUhmUCHwzBRdVIv8iCeMTg+4IGyZL5qyL7pn7b3Hpvl LsCJD0wQ/IoXKXsK+iUNQy0y9znebqp6tO0wa+gK1HRx1p9Kn7PYvdg/rYfi8oXUQiVq Rr8qWzn5jkh72tlOu4I57ZW/wrCeIsCXBM/TZ3rF0hWGjfnXRuqbu4Jg/f/ruxQUzz4V 7Uu0PAUf/kD323QgwI/Nw8mQH7R7+4Ok76X0vo8Xwfigsq8ro1VGGsdzHO7DQ+URg+NB vvuqpI4b/A0zfYWb4t7mj+dwiAvMnt7rGiUAfe5inJu40XBZ/KXVgRDEFcwB3ugn5uzw 6hVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=zHZOdVHU/KRYHkv00rVmIQnnmxZGtkqB3ZttjicNpNo=; b=Hp5Ov2ObE30KthTEAWyZZVwwS1DXG5GytI1Z9b6RVDrrCWoNM59CVxDdUGbpsbBCGY TvjZ98sWtbN6uEJa3sa8D4BY6qtR7gMwB8eQi9LlOiudbTMRCeDzCPVpD/gB/87sgnhL PDRQ5HkpuwYaJt2U0p+/FflAeW/jj4XNFvOlq6p7CVSEZh9jsZHercT8xu9+nC1vPknA PaMEHBqltUQS8netRlHS/WpZ3Yq01wnvg3paAruEFyqGNqUZUZKCEdOrC50kYGWgQCtk qK8dOBE8LE3HF9r6h6+g438lKqV2n3l1091SpDB8nm/alkEXzAVUYPCvOgfzOavbz+hW 40Lg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 142si5235593pfz.243.2019.08.16.15.28.47; Fri, 16 Aug 2019 15:29:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727787AbfHPW14 (ORCPT + 99 others); Fri, 16 Aug 2019 18:27:56 -0400 Received: from foss.arm.com ([217.140.110.172]:34058 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727682AbfHPW14 (ORCPT ); Fri, 16 Aug 2019 18:27:56 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D30F0344; Fri, 16 Aug 2019 15:27:55 -0700 (PDT) Received: from [10.0.2.15] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2DC773F718; Fri, 16 Aug 2019 15:27:54 -0700 (PDT) Subject: Re: [PATCH 1/1] Fix: trace sched switch start/stop racy updates To: Joel Fernandes , Thomas Gleixner Cc: Alan Stern , Mathieu Desnoyers , rostedt , linux-kernel , Peter Zijlstra , paulmck , Boqun Feng , Will Deacon , David Howells , Linus Torvalds References: <241506096.21688.1565977319832.JavaMail.zimbra@efficios.com> <20190816205740.GF10481@google.com> From: Valentin Schneider Message-ID: <3c0cb8a2-eba2-7bea-8523-b948253a6804@arm.com> Date: Fri, 16 Aug 2019 23:27:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190816205740.GF10481@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/08/2019 21:57, Joel Fernandes wrote: >> Can we finally put a foot down and tell compiler and standard committee >> people to stop this insanity? > > Sure, or could the compilers provide flags which prevent such optimization > similar to -O* flags? > How would you differentiate optimizations you want from those you don't with just a flag? There's a reason we use volatile casts instead of declaring everything volatile: we actually *want* those optimizations. It just so happens that we don't want them *in some places*, and we have tools to tag them as such. The alternative is having a compiler that can magically correlate e.g. locked writes with lock-free reads and properly handle them, but I don't think there's a foolproof way of doing that. > thanks, > > - Joel >