From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754559Ab3KAQ1a (ORCPT ); Fri, 1 Nov 2013 12:27:30 -0400 Received: from mx0.aculab.com ([213.249.233.131]:55149 "HELO mx0.aculab.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752828Ab3KAQ13 convert rfc822-to-8bit (ORCPT ); Fri, 1 Nov 2013 12:27:29 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT Subject: RE: perf events ring buffer memory barrier on powerpc Date: Fri, 1 Nov 2013 16:25:29 -0000 Message-ID: In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: perf events ring buffer memory barrier on powerpc Thread-Index: Ac7XHG4wfY6ad4u+TjSC18bMRKor8gAAd0vA References: <20131028132634.GO19466@laptop.lan> <20131028163418.GD4126@linux.vnet.ibm.com> <20131028201735.GA15629@redhat.com> <20131030092725.GL4126@linux.vnet.ibm.com> <20131031043258.GQ4126@linux.vnet.ibm.com> <20131031152543.GC4067@linux.vnet.ibm.com> From: "David Laight" To: "Victor Kaplansky" , Cc: "Michael Neuling" , "Mathieu Desnoyers" , "Peter Zijlstra" , "LKML" , "Oleg Nesterov" , "Linux PPC dev" , "Anton Blanchard" , "Frederic Weisbecker" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > But "broken" compiler is much wider issue to be deeply discussed in this > thread. I'm pretty sure that kernel have tons of very subtle > code that actually creates locks and memory ordering. Such code > usually just use the "barrier()" approach to tell gcc not to combine > or move memory accesses around it. gcc will do unexpected memory accesses for bit fields that are adjacent to volatile data. In particular it may generate 64bit sized (and aligned) RMW cycles when accessing bit fields. And yes, this has caused real problems. David