From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933239AbcFJM7L (ORCPT ); Fri, 10 Jun 2016 08:59:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38938 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932124AbcFJM7K (ORCPT ); Fri, 10 Jun 2016 08:59:10 -0400 Date: Fri, 10 Jun 2016 14:59:04 +0200 From: Oleg Nesterov To: Andrea Parri Cc: Peter Zijlstra , LKML Subject: Re: [PATCH] events/uprobes: move smp_read_barrier_depends() where needed Message-ID: <20160610125904.GA8203@redhat.com> References: <1465496321-10898-1-git-send-email-parri.andrea@gmail.com> <20160610070310.GA6843@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 10 Jun 2016 12:59:09 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/10, Andrea Parri wrote: > > On Fri, Jun 10, 2016 at 9:03 AM, Oleg Nesterov wrote: > > > On 06/09, Andrea Parri wrote: > > > > > > There is no need to use the barrier if there is no dereference/ > > > memory access; move it where needed (currently, affecting only > > > Alpha). > > > > OK, although area == NULL is unlikely case, > > > > > While touching this, also make the reads _ONCE(). > > > > Why? both xol_area/vaddr can't change. > > > > This is to ensure current (and future) compiler transformations > won't optimize out or reorder the reads (do not ask me how ..., > IAC the volatile casts will prevent this to happen). > > AFAICT, xol_area can be "== NULL" and "!= NULL" ... Yes, but it can't change if it is not NULL. So we do not care if gcc reads xol_area/vaddr twice or reorderes this with other LOADs. Oleg.