Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5242916imm; Tue, 19 Jun 2018 07:22:30 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ47OWtTdDd7wVlhLrXzCEji+lVctXJ8gKm5wfnGw4wnXQTS0YNgSR0Rc5QZs0fgiq0tst5 X-Received: by 2002:a65:5143:: with SMTP id g3-v6mr14999361pgq.190.1529418150053; Tue, 19 Jun 2018 07:22:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529418150; cv=none; d=google.com; s=arc-20160816; b=U+K5AIiNfIm/njOtAwhAOrpcxSaPuPvJrPxFZgCd8rlsse9NWUK+6ujBj3SVkgBdsW wF/5ySeMmXExpwHWipQeOQkd8NR9MGW+NQu/YzKHtCis5sGfhyDJ26v+fW+no1RnzfOf WfRortN30ElicVEPjxGJgIN0L3f2RjEA9vI07K2CxvBINM+t+m2AuSaiLW8Wv7RH9ESB FkVyiKD0zgK26A17Tmm/vusumHlR+Gihw02UTYAh4B4prSq2MhWl2CbD6tXmO9NSAo6B vI90UJ05eTqXPh2ohbnpLAyTeoiaqqEwKOX+Ys2vhTmxPlx8LIDQAoLLP+zrx7ZpsstA u6Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=lYagv6Rr6geuVnsNy+UJSzOD9e1YuHy4XR+UA4XaTbU=; b=RA+4JNhKAi9fQsHkXYF8vTZSScsxDUgnBQH28f8Uz72fwWpuBBxl5pOFwd6/5/6j0/ v9I48+zgK0Uj5F/yEQYiiI/DxKqgGlB8FEHU4HVKfr54FtbHx/VrGp1i2OS0sPTd8qtw 3DNpA+OKNd8NTCfscHA19YJjic5AiMfoxlx4IYYj+gsE7ZNRhortNvrQ62yFwhwbarUw rhPX/9XXL94ui2U6ImmuqkPO05JWFzbl/fC5N1coRp22kV0hqBMtyARUqDdq4E6lBgAk +oQ6UwhNrOGBJmzxqI2whhiVT39oeTwuxDtJTeBTqR8YlSgJ+iO7EDFioPiIfr8EWtAS 2TQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Ta1KOp7A; 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 3-v6si17245705plc.415.2018.06.19.07.22.15; Tue, 19 Jun 2018 07:22:30 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Ta1KOp7A; 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 S937650AbeFSOVc (ORCPT + 99 others); Tue, 19 Jun 2018 10:21:32 -0400 Received: from merlin.infradead.org ([205.233.59.134]:49886 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937493AbeFSOVa (ORCPT ); Tue, 19 Jun 2018 10:21:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=lYagv6Rr6geuVnsNy+UJSzOD9e1YuHy4XR+UA4XaTbU=; b=Ta1KOp7AvcLQBEWk3k065GSZx 7KZDmpMRaFt0tSMvJRXKQe9igoF7xjX4o08G1f238mQEpmyJieLtKrHrqUIvtXfPZlLaaTFUBGdhb omX6Y04VTowwGZCBpPTaaFFIUFl+lVTFVR7VqFOeSLs4IZpFryBui7VnF42cyCEgcECsI7vHOVvjR 1x7auNeaYlU0OGwbwwMlCjfCdaYDul7TPI7q2RcI5gSI8Cf6UvBh3pxeqEgKvaboMRBT5/SntFmm+ aqbE7RPkSPeQJJ3EPFm/VbbZ225ka4l4j8ENvLBzDD3RZSBTOA+gGnFybZYKqmcHY3UEcJw78nANi ZS3sagaTA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVHVW-0003ZO-9z; Tue, 19 Jun 2018 14:21:18 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id F1B3020267E79; Tue, 19 Jun 2018 16:21:16 +0200 (CEST) Date: Tue, 19 Jun 2018 16:21:16 +0200 From: Peter Zijlstra To: Quentin Perret Cc: rjw@rjwysocki.net, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, mingo@redhat.com, dietmar.eggemann@arm.com, morten.rasmussen@arm.com, chris.redpath@arm.com, patrick.bellasi@arm.com, valentin.schneider@arm.com, vincent.guittot@linaro.org, thara.gopinath@linaro.org, viresh.kumar@linaro.org, tkjos@google.com, joelaf@google.com, smuckle@google.com, adharmap@quicinc.com, skannan@quicinc.com, pkondeti@codeaurora.org, juri.lelli@redhat.com, edubezval@gmail.com, srinivas.pandruvada@linux.intel.com, currojerez@riseup.net, javi.merino@kernel.org Subject: Re: [RFC PATCH v3 03/10] PM: Introduce an Energy Model management framework Message-ID: <20180619142116.GA2512@hirez.programming.kicks-ass.net> References: <20180521142505.6522-1-quentin.perret@arm.com> <20180521142505.6522-4-quentin.perret@arm.com> <20180619113408.GQ2458@hirez.programming.kicks-ass.net> <20180619125857.GY17720@e108498-lin.cambridge.arm.com> <20180619132338.GF2476@hirez.programming.kicks-ass.net> <20180619133844.GB17720@e108498-lin.cambridge.arm.com> <20180619141642.GE2494@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180619141642.GE2494@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 19, 2018 at 04:16:42PM +0200, Peter Zijlstra wrote: > On Tue, Jun 19, 2018 at 02:38:45PM +0100, Quentin Perret wrote: > > But maybe I could use something simpler than a lock in this case ? > > Would WRITE_ONCE/READ_ONCE be enough to ensure that atomicity for > > example ? > > Yes, since its a single pointer, smp_store_release() + READ_ONCE() > should be sufficient (these are the foundations of RCU). Note that per_cpu()/this_cpu_read() and friends should imply READ_ONCE().