Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1921672imm; Thu, 7 Jun 2018 02:27:08 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIwjhN0gX3Blk/TJH2JJGSdl0Dzfs8lPJbZ0MMUsfiJXGbjXv+N4O69eMYFZj+v5sCzLOuf X-Received: by 2002:a62:4556:: with SMTP id s83-v6mr1067570pfa.73.1528363628140; Thu, 07 Jun 2018 02:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528363628; cv=none; d=google.com; s=arc-20160816; b=xGKFzNkiMWB4twHuBxZBBbVMOOV9rPT4ry0N9jOQ9j2xyvrbSfeULg3+/A09M0wOOV q3ldwWXqdO7WQ3/NcP4SYHO5nMnR7S+5GjYnTJj10BQvJETHNcWt1zfxfx42KaogdJ4b fQhgPNWsDS3NjZNO/rY2CKwwDPP+B6lxN/lIAOigYvvHBW09Gvzg3DkgD2BrIqNJxtjJ WmZAZxWy3I1OecWADMmiaHgmGNUi14CZPdYjoJSH0X5xTE9+XVtKlI/6Nk9D3rap66Yd ZDNig+PgCKPKnIdW0IjQ8ioO/4Rr9bUHhMzD0UdQtlu/dvndT+Z2gyfdeijc6s3ZOPf1 9yOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=i5+dDbox0dsFguYCwuRboG468m/HPJp+3Ojdj907BxA=; b=fja644iP5XODq1g6DoleBJKG4Zm89GFG2PzC1d+1MiI9GTmlaFO2BB0d7ASplzIMUb +bMwf+6kxS9qyDU4SUT3U9fi7x4k8V3i8D9qAeVav5BxXceXnusQKkewnZnJdTAurnct cp/BPdf9Miy0rAl8B9H+vvkvPvmZ1GcvWkhhgMkpFtOpjKp9ZqB1X0X3TkxrFdfXgehE 54rJDeBqYGZF/4NdC9L/pJBH2+w8PIFXpJ/UH0vghsbuysSLvQ4weSupVCVAq+Dg7rXC gx+l1pd4mHrKgxl186JvCr6ZMp1ARUBnJsN3XBPCCbsR9Xt6avEb8pcmB8MajnrIjCpa OZKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hebXUYnW; 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 a4-v6si53682809plp.219.2018.06.07.02.26.53; Thu, 07 Jun 2018 02:27:08 -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=hebXUYnW; 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 S1753642AbeFGJJR (ORCPT + 99 others); Thu, 7 Jun 2018 05:09:17 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:40130 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753167AbeFGJJP (ORCPT ); Thu, 7 Jun 2018 05:09:15 -0400 Received: by mail-wm0-f66.google.com with SMTP id n5-v6so17290274wmc.5 for ; Thu, 07 Jun 2018 02:09:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=i5+dDbox0dsFguYCwuRboG468m/HPJp+3Ojdj907BxA=; b=hebXUYnWQTI9sgXLyDlAqBUKtMcFsJKU+18OXxvSrz2XX5QvULLBD7bATe32HdB1/P Z0sr797q5io+h3XZvAXbYTbJDeP/l4ioL+tJREyqL7/jceNkvvuACTPFKrzeE9Ud42al S6nDuhGfXxzp4tE7scAwpFLEA15gN8UeAzHxU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=i5+dDbox0dsFguYCwuRboG468m/HPJp+3Ojdj907BxA=; b=Ti2Fm8XmfnnCztCMkRrJvRM6tZSJ/+sF6Dl6kITGsETB8CZ4Ja9UXTMTQn8sKLe0ou EhFGM/jD/IgUxXSjNzp5N2WbqjGo6PzZMMG+7zK+lOu6yJU8b+xKKAlTFBdOKXn4o3Bv YM00fr8LkWZ05eULHk080u1TFWawrEqDOQfuOMtaKRhCqwbYlbkBLVDqG2ysLsL2rHPf QTC9UkmIQ6TEYX1Y4OzclbheprDf4J9GVMyaEtzAFecIAr1ypYGaKyUH6t/ErkPTDDCK A+E3FC41xJQJG/CDN6p8BrR0q/GqC8qigoOMYNGVnhv+b5g44j+g5P/Fg5fVFEALzr6c MbZA== X-Gm-Message-State: APt69E2w+OS3+xOpCT3EbC81Ejgrcj9eA0hfYCJ0+MXlrzJe6H5k+etW bM2lnVMROEZvUKDtQD/cshOiqg== X-Received: by 2002:a1c:8409:: with SMTP id g9-v6mr1099860wmd.90.1528362553953; Thu, 07 Jun 2018 02:09:13 -0700 (PDT) Received: from [192.168.1.75] (lft31-1-88-121-166-205.fbx.proxad.net. [88.121.166.205]) by smtp.googlemail.com with ESMTPSA id u15-v6sm1575729wma.37.2018.06.07.02.09.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 02:09:13 -0700 (PDT) Subject: Re: [PATCH V5] powercap/drivers/idle_injection: Add an idle injection framework To: Viresh Kumar 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" 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> <20180607084921.toctrooftl6y7kkx@vireshk-i7> From: Daniel Lezcano Message-ID: Date: Thu, 7 Jun 2018 11:09:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180607084921.toctrooftl6y7kkx@vireshk-i7> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/06/2018 10:49, Viresh Kumar wrote: > 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. Ok understood. Why would a compiler do this kind of things ? -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog