Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5247892imm; Tue, 19 Jun 2018 07:27:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI1+dbTIOD4MqcgO6NTr04otpaO9eaGw7Lx2Iz2kU6j1zf4wZeXDauI/FaheaLYf7ARiuv4 X-Received: by 2002:a63:a05d:: with SMTP id u29-v6mr14915462pgn.80.1529418438496; Tue, 19 Jun 2018 07:27:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529418438; cv=none; d=google.com; s=arc-20160816; b=QzKl7w7r69ygDW10aNA+3YI1D7anSYLn9Q2nsFt0B4RvhrFt/nEZKpBBOJS7DNCPm/ tzCkzicK3JzsfIKA88eOALUwxpIZ4Wt2eVbrJE7ZiYIWKeIQxMlIqohblYBEexDODw51 XB/a0dRNnJBJVuXq1s5/YfztVOw53gd1THHfhJEzQmjrk01g/jBxcBeLS3ZAyfXZfThX BW7q2shAXoGFD5va8pqb7pL3ZznQX2x2BoREPhpe0rERZNN3BR9dc6ccVP3B5UNAQJQg UBvnhVak9xT7wcY8D/1v3BiI80bqjCdOq0XIuoJDEoga8hbPe9hKdJ60PqhfTN84gX0d YGfg== 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:arc-authentication-results; bh=chIvn2u20IZRnoY3Bvi17Y0JvdlSMnYjdVQZhf4alUo=; b=MFkbqGIvQvnlWU8sNSEaUOoLsJzStOum/TM+BZFPILGXX8p2CF9SXZ5fTIivpltfP5 w1nbKrwE51RfPfrPu8LGOusmBK+5KSRhNMZdXpWkcbeJuAL7GUkdgiUFx9WWkTtiRaOM xlkzCEt4uBOpkxonGYSF/QzyU5NCrqjD7hGjjK/bdAbNammT2yp6wASa7+8LWtJI02hU fPURo/K6DePfc9KB4TCumrMhadHOqG/NdxH2GH1z1eNkMpLo+2tC9xN1OJron6bgLJ3F yED1hZZ1hXaQryiz3UGgntz9BgiFm5Kk7xj4vKRuclE8IeolEeb5DE3bZ//5kNP/ee1s urzA== 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 g10-v6si14797601pgr.72.2018.06.19.07.27.04; Tue, 19 Jun 2018 07:27:18 -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 S1757209AbeFSOYD (ORCPT + 99 others); Tue, 19 Jun 2018 10:24:03 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:51394 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757102AbeFSOYB (ORCPT ); Tue, 19 Jun 2018 10:24:01 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D75EA1596; Tue, 19 Jun 2018 07:24:00 -0700 (PDT) Received: from e108498-lin.cambridge.arm.com (e108498-lin.cambridge.arm.com [10.1.211.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E33803F557; Tue, 19 Jun 2018 07:23:56 -0700 (PDT) Date: Tue, 19 Jun 2018 15:23:51 +0100 From: Quentin Perret To: Peter Zijlstra 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: <20180619142351.GA29374@e108498-lin.cambridge.arm.com> 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.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 19 Jun 2018 at 16:16:42 (+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). OK, good, I'll get rid of the spinlock in v4 (and read more about RCU foundations then :-)) Thanks, Quentin