Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5239420imm; Tue, 19 Jun 2018 07:19:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLWtiqrI/6cC1cvcCdHXejY0x9+nJ3PUEDluUkzl5j/YfjOPHSBN7dlXsaz+o2igYG5VfWx X-Received: by 2002:a65:6504:: with SMTP id x4-v6mr15208891pgv.131.1529417963950; Tue, 19 Jun 2018 07:19:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529417963; cv=none; d=google.com; s=arc-20160816; b=wkFvIab6btJGac7M1hFKUuKnhvV3tjqUAyvXss5GQJ95RY3S9VNBENCkx6p4adFrvX RhlpQpR6mU71wjYf0JQ7xmuAsM4OqI4BEAhKalumOssuTJRj8sjjKWHHG92ig4ISSK/6 rX8EYfntA127iUG5LKB/uM/ZH1KmlPvY3NePTa+VY7CD7SgNQQujF1pR7QYffEyv9453 luB17gEWPpqrLcAau/7z2m+wdkvyGvXbphoH5mWWhDxJu6tFLz7KEgKnoq+EQVt57fKd 9ThGyXMZcOpxRjyHwmq1uoSpLu4Z9e/XGh/VNRJaZ607p5kvMJg1Pmw/qc/G12elfRX4 kYbA== 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=tCMkny1l1fXJhviFc1MWVkyLSSh8CIavvuVt+oyQAp0=; b=QWko1gBzZvrhmIcmzekKYGzVwU9hzIO7rMRKmpA8QXREWMeQONJsVwu5lYVNmDnXub tDXiFOBNi4s81VzeTseDRLqSOsVUqtxWNTtDzxFmkJ33EaKlaPD6XR4EkYcOgeUInC4j Ya0kZZCwZE231bYYSWkHjjDiFkAgbS5FjDVWRFmyE9h4KevLi1nFtup+k8c34vCfh154 wzKLljGvKKgcJOXBY6lsKt0yp9LaLBlS2WSqgbzJGFYABofINhFTU0oK1nAg/y/6w0R4 b4Z7PBLn1sE+NrG0HL9SAg931ZY3CoR3F5NZtLnQXDesZ50+unI3bInm1AP6gWxqum5A BIsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="0x2ouUm/"; 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 k91-v6si17802310pld.248.2018.06.19.07.18.53; Tue, 19 Jun 2018 07:19:23 -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="0x2ouUm/"; 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 S937769AbeFSORQ (ORCPT + 99 others); Tue, 19 Jun 2018 10:17:16 -0400 Received: from merlin.infradead.org ([205.233.59.134]:49840 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937635AbeFSORO (ORCPT ); Tue, 19 Jun 2018 10:17:14 -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=tCMkny1l1fXJhviFc1MWVkyLSSh8CIavvuVt+oyQAp0=; b=0x2ouUm/IoA+U/IeXzdQqGaZh 1O4pAMTrBTxwYb8hDOnIhHT6FlRmXRviSm0Ps9Ds6WTc96YXkdW3/uQFWetgoVMKlZ+mxIfokXOxl Wl1mWrZ0cWwEPsftQ03MeroxDVM7tvG/SpAKoBYIs4vFh4Q7F9ksqoMcKh5/uhIlT1en5GtF31k1h KVd6Btg50owftUFy1d7KLb9cCJzrlap/jAG/r/I3yGV25ovgpyDikUsLFGqZcndeblFjkGPKU1NQk 4tDez3sGL1SVVKGkYYpQFtvLYvd69jnOb2VRFK2uE9sVM+8d6tJURdiZBadU2CXzSncqvsbX4qxTC hW/0nj9BQ==; 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 1fVHR5-0003WQ-Sz; Tue, 19 Jun 2018 14:16:44 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A798220267E79; Tue, 19 Jun 2018 16:16:42 +0200 (CEST) Date: Tue, 19 Jun 2018 16:16:42 +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: <20180619141642.GE2494@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180619133844.GB17720@e108498-lin.cambridge.arm.com> 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 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).