Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1888068imm; Thu, 7 Jun 2018 01:50:20 -0700 (PDT) X-Google-Smtp-Source: ADUXVKISzYdHL5tlRmsZ2lMgegpc5M5SVuQPFjZ6g+TT8gLcGMY8wki02wKRztXNkSGIIZKYH44C X-Received: by 2002:a62:234a:: with SMTP id j71-v6mr929471pfj.221.1528361420187; Thu, 07 Jun 2018 01:50:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528361420; cv=none; d=google.com; s=arc-20160816; b=tH5tY0BSk7NUGKU30xyudCwv1t4fIky+3GHK17VGH/Ku7gNTQLG5uVp+00FiLLKDn7 Ck52uhHz3cZosWTNRxgzeVak1PD+NZm9P35cvksW59Rfv16xg2boW24Sg1sd1UWhBTdW Xk3qEV2bMos4fOCHzgx3y2LfGB1z/B4v/rLVnEbrGR8mF/V8qxqjrLtkgeud9NYQH5+b ziHDcmTTnnl7QJnB5skfYgcAW0S7Ygop6dLB7gt1aXhrDz1t8NAcQ2sLj3C16+FRytxP YzCa1wh+3nWXQkRfGMlgPWA23nVLVwzSaIZ43lcCnKA/nOvdCR3gbajZ2/a3HBIAr1xC Ye/Q== 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=CghJsvp2s6j1fXfMuhENnUTS1OrRgPOuN6UC+h4COxk=; b=jB/zGtyL0Eg7TA3eumVhz1dK5Tg53ktEdXchbfDgwbz/Qwbj5q5o17haQzlzxn2mS9 4ztBECyy13ViFX11A4/E72YqfOsUWdDmWpO1Id4B4gs7ApzNEQk+WsSHjrS23hVskH98 xhn+3Q9RjkgGU/Ey0jITX9LLtbBp9FQp4jykPvRKWHvpFkw9aA+wLKn06vQxAK1slkUE y59cSyfRtRnuetst+mG1qppMxZ9Kq2TpvTTu/btC71ncg6MK4yjX5JAPhbc9Dt5Yp9rl 1BHR997o60jm8tbnDUj3wtS/3kjuIc6dhaFXixhkgblxRtRAtn6NsP7Pn7Dctrv7LJ7F rMfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Pqyr5n1W; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91-v6si34841956ple.308.2018.06.07.01.50.04; Thu, 07 Jun 2018 01:50:20 -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=pass header.i=@linaro.org header.s=google header.b=Pqyr5n1W; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932668AbeFGIt1 (ORCPT + 99 others); Thu, 7 Jun 2018 04:49:27 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:37937 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932550AbeFGItY (ORCPT ); Thu, 7 Jun 2018 04:49:24 -0400 Received: by mail-pg0-f66.google.com with SMTP id c9-v6so4425980pgf.5 for ; Thu, 07 Jun 2018 01:49:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=CghJsvp2s6j1fXfMuhENnUTS1OrRgPOuN6UC+h4COxk=; b=Pqyr5n1WwlG3cGpAXomQNBFVuDl662SWFWYwnKM7VVRh3qtJB+DijqSyPs86MGmP6n YJdXelkWQ80V3i+xRPhK4fCdTsI0TDyDD0QxqEn5wtPR2rrfaIYB5fu8VPvuTffSYfWX QxYs/yS8eoFvNm4/AsKyM2dC6ZKfmoXzvWp2Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=CghJsvp2s6j1fXfMuhENnUTS1OrRgPOuN6UC+h4COxk=; b=cC/ntmoPOWEdEdSWdWqro6yv4dnIM4B0a/JBpmrCx0qERLCW6kfK077NBXrmqBxBjG XfzulBLmEAkIoPDxmJKJPFp3Fu2GCER7fyYKwX3DbLiXmha+NoVA30yUdVOr1WoajWDL d87B09TuuzUe8EY562UHEGh8c8ZsaQZnnOpo0An65ItclYCTcD1GF6ndqwsO+EZOAlFm zldL9MF+4cbYKgPIfZSxWc2SDHPjN9j8siafXIxSycqyuRQxTyl44qsEUsw+9iQsFuOo f1Jklbifh2IuDqs1yWJZby8j8a3XSH6kAJZjt8YO2Qkx5LHIZGYPkspyH9C/8+1PNFtr xyrg== X-Gm-Message-State: APt69E33HXcimdSbgUZIt1I44eKpXH1SqDxvn7Zms7HJi+PMR/pzlFtO HWvMQECMexrfYB2ZvK4wPGAQxw== X-Received: by 2002:aa7:8345:: with SMTP id z5-v6mr949469pfm.251.1528361364438; Thu, 07 Jun 2018 01:49:24 -0700 (PDT) Received: from localhost ([122.172.167.207]) by smtp.gmail.com with ESMTPSA id q9-v6sm19544132pgv.84.2018.06.07.01.49.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 01:49:23 -0700 (PDT) Date: Thu, 7 Jun 2018 14:19:21 +0530 From: Viresh Kumar To: Daniel Lezcano Cc: Peter Zijlstra , rjw@rjwysocki.net, linux-kernel@vger.kernel.org, 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: <20180607084921.toctrooftl6y7kkx@vireshk-i7> 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> <20180607083229.GJ12198@hirez.programming.kicks-ass.net> <20180607084251.rv2tg3kgz4aohlpd@vireshk-i7> <9996fb40-c7aa-db61-5445-52c146f44d85@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9996fb40-c7aa-db61-5445-52c146f44d85@linaro.org> User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07-06-18, 10:46, Daniel Lezcano wrote: > Yes, correct. > > But if we don't care about who wins to store to value, is there a risk > of scramble variable if we just assign a value ? Normally no, as the compiler wouldn't screw it up badly. But there is no rule which stops the compiler from doing this: idle_duration_ms = 5; idle_duration_ms = -5; idle_duration_ms = 0; idle_duration_ms = ; So we *must* use READ/WRITE_ONCE() to make sure garbage values aren't seen by readers. -- viresh