Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1873991imm; Thu, 7 Jun 2018 01:34:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI4ynrLQvNEkAOCeULVQYDDWg59354sgbAgiBr1Yn259rAhmfDXDz1lWTuTYDI5La+Hy1FW X-Received: by 2002:a62:a09c:: with SMTP id p28-v6mr925027pfl.9.1528360453152; Thu, 07 Jun 2018 01:34:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528360453; cv=none; d=google.com; s=arc-20160816; b=KVpmX+PZsMRU1ReFuhMnD1IBTPRCPw4S0xLvJ29yihMBiCSKcgAjbjKUFLh4cnwCj+ qBwzYQjXgYS1J2bhvnZ3kyJa/tY+VC0Xu89mnR+sP74E8Nb2kPxmH1bXpz2b/gGtVers 6FmLrR7hsGvbE8uHZ+7Fuk6SKi+3/1EV694lZBMZNRJzYJ6pUz5NRmPFt0yUGDDJzyuQ QvYu8vJs3fcU41QKbLA8k98vYJReczPC1gbbj8F9T8jVbOftunzYOrzarE+NMNnH29M6 gA2EC7/5WF+Um/rwNCn4/Xer8hJy2NdejQHlq+hPQ94bfRofXhgOzON1QvGaX4hD63od WgTQ== 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=gG199qVn++i15hkbvtxiIIvowAu89gWF5LkzdmriZ9Y=; b=bXx1gNi1wDhVf/kEJCRpGmr/qVtf2EoaZwSR5UHrnGzbQ7XPKNIYxOCPsB1ZMHPSf/ 4mowsnGoGZ8K2FKso8cPo1vPPS+KtVOt+Bm63/vI4BvWH3euWlVmmY40Dl/6mHyi+tzy gG1fc7ishTlHynil7lfFMTeM0jphBsQFmZQVlbYEAU4D8P3GlE9/m+st9FkD0lVaKMsc HMEyfh/twcXMXPNCm2KuQAuXckh3hWoNXQpPlbJvdDYVSFhQzjuM/4K/AWQFMYcOb1Jm Jz6Ht+/buRMOt20SfCy0CkerkNe8xXLUFLxBPlOM5O8ZsAtXrzQTuz0n7jHic9pvehYr rnPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Pw1ZbqSK; 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 b74-v6si27560222pfb.189.2018.06.07.01.33.58; Thu, 07 Jun 2018 01:34:13 -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=Pw1ZbqSK; 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 S932601AbeFGIcp (ORCPT + 99 others); Thu, 7 Jun 2018 04:32:45 -0400 Received: from merlin.infradead.org ([205.233.59.134]:43366 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752568AbeFGIcn (ORCPT ); Thu, 7 Jun 2018 04:32:43 -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=gG199qVn++i15hkbvtxiIIvowAu89gWF5LkzdmriZ9Y=; b=Pw1ZbqSKGPpva4D+8IN3VaS4z AoEBLab9yLwciz66DL7Spfd17uV2a2w25T1uSsu1+9D/sdyAotp1pQMY36Gvx8IiEOHF9ENHY7gxl rxoV3djEIbD++TFxVqG+HcER7I3wNj0ls9nYQNm331aU2Qr7h1/WVUvxns2ISfX/FN87xgHyOkUb/ 71Ccx/qJ7xAlIKgTCxi9argWuSPiLOTt+YWlinh+T4dfJgIrw24QtQocCPDP/6nz3PLvUmzklG86J rJBNg+epFwJxtTCSbpSGBUrMONyutKSkfiz8aQtR2wOYu47feqPS7lX6uDINeBf63kBJcw119oiiD vANrUHeEQ==; 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 1fQqLQ-0003iC-5M; Thu, 07 Jun 2018 08:32:32 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 2C29F201EA7A6; Thu, 7 Jun 2018 10:32:29 +0200 (CEST) Date: Thu, 7 Jun 2018 10:32:29 +0200 From: Peter Zijlstra To: Daniel Lezcano Cc: rjw@rjwysocki.net, linux-kernel@vger.kernel.org, Viresh Kumar , Eduardo Valentin , Javi Merino , Leo Yan , Kevin Wangtao , Vincent Guittot , Rui Zhang , Daniel Thompson , "open list:POWER MANAGEMENT CORE" Subject: Re: [PATCH V5] powercap/drivers/idle_injection: Add an idle injection framework Message-ID: <20180607083229.GJ12198@hirez.programming.kicks-ass.net> References: <1528190208-22915-1-git-send-email-daniel.lezcano@linaro.org> <20180606122357.GN12258@hirez.programming.kicks-ass.net> <22f5cf0b-049e-7938-55f6-4b4b154f8389@linaro.org> <20180606150203.GE12180@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 07, 2018 at 10:18:27AM +0200, Daniel Lezcano wrote: > So IIUC, neither atomic or WRITE|READ_ONCE are necessary in this code > because of the wake_up_process() barrier is enough, right ? I didn't look hard enough; if there ever is a time where the loads and stores happen concurrently, you need READ/WRITE_ONCE(). If there is no concurrency on the variables, you don't need anything. Neither atomic_read/set() nor REAd/WRITE_ONCE() will help with ordering, which is what the wake_up_process() would provide here, different things entirely.