From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932969AbaICPvR (ORCPT ); Wed, 3 Sep 2014 11:51:17 -0400 Received: from qmta15.emeryville.ca.mail.comcast.net ([76.96.27.228]:50608 "EHLO qmta15.emeryville.ca.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932678AbaICPvQ (ORCPT ); Wed, 3 Sep 2014 11:51:16 -0400 Date: Wed, 3 Sep 2014 10:51:13 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@gentwo.org To: "Paul E. McKenney" cc: Frederic Weisbecker , linux-kernel@vger.kernel.org Subject: Re: [RFC] dynticks: dynticks_idle is only modified locally use this_cpu ops In-Reply-To: <20140903144349.GT5001@linux.vnet.ibm.com> Message-ID: References: <20140902203743.GL5001@linux.vnet.ibm.com> <20140902211517.GO5001@linux.vnet.ibm.com> <20140903021152.GA14069@linux.vnet.ibm.com> <20140903144349.GT5001@linux.vnet.ibm.com> Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 3 Sep 2014, Paul E. McKenney wrote: > You would prefer that I instead allocated an NR_CPUS-sized array? Well, a shared data structure would be cleaner in general but there are certainly other approaches. But lets focus on the dynticks_idle case we are discussing here rather than tackle the more difficult other atomics. What is checked in the loop over the remote cpus is the dynticks_idle value plus dynticks_idle_jiffies. So it seems that memory ordering is only used to ensure that the jiffies are seen correctly. In that case both the dynticks_idle and dynticks_idle_jiffies could be placed in one 64 bit value. If this is stored and retrieved as one then there is no issue with ordering anymore and the barriers would no longer be needed.