Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp749362imm; Wed, 6 Jun 2018 05:31:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLg6AA+vUqkhgsJVMVYK0lX4oilsKrawJay3aaXcH6GG2F7vCylOaTBUfeoA/UcU7YXhRIE X-Received: by 2002:a62:4c04:: with SMTP id z4-v6mr2265768pfa.205.1528288299925; Wed, 06 Jun 2018 05:31:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528288299; cv=none; d=google.com; s=arc-20160816; b=PcTA69phx+2iN2wxKCs7IEuV74IuzqOWZMCJOOEeOtkL2wLYaKs0SV2hVFYTiCYbAJ Hpl5vsOyE8NgaeJKVk8K0y7t/N2CRh6YkFl3lSTIXR+6wWRciRL4IeYhmtXXD27m9jlV 0HDDn5BQJlJ/ZO2bmT8K8wckwVn3Zh/31nU7BmJtFyeIr6V6ojA94EhFyuQtlb3vXSco IChXXAmSlcdV2u3hJe8n3pc4abdyFhKmA3jZauCib2b9gprE9FVyOZfSVps+uzvakVld kFJE+rh8gxw292H+zD9GGpo6nW6RU2HAY5sdWltbml8bYnOO/53bcWNXnz8ayvCT4td1 /eFA== 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=nnEKD7AKAJWmAyYwIDKrdP094KHmlIqf4EsXWHqokDU=; b=IcDbITO3UK3ZD8eYw9Oezvk6lekUgAhxga/5T0/aY6qaiT3L6sE1gk3SULcOImidEW Rny5l+8azkpEK0GLnKWLmKjnndNz7EZQlQ4K5gQ2xkzArQJut88uOBDXek8YfNDRHlMh 34Ik62r5InqvEaCf4RJkDDdenAClAQ+f0ioIHLS9QqsbZl4tR/MuQ8ZfAD4r4HwEyuFE X1wS7QtCe5a2q/NhhYCSl+jkqUQNCNTpMQGQ6MkKzHXMSs8rGiuPk8L4pbKRzJUuozmV DJ8KFtcWVhObG+lp42s3NQPr2gg2W8ny0Ku2df5j0ehL4oPeyFeGtAPrdghzugQmFB4/ reag== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=SkXAaW6z; 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 34-v6si51993281plp.409.2018.06.06.05.31.24; Wed, 06 Jun 2018 05:31:39 -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=bombadil.20170209 header.b=SkXAaW6z; 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 S1751980AbeFFMaC (ORCPT + 99 others); Wed, 6 Jun 2018 08:30:02 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:39828 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751730AbeFFMaA (ORCPT ); Wed, 6 Jun 2018 08:30:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=nnEKD7AKAJWmAyYwIDKrdP094KHmlIqf4EsXWHqokDU=; b=SkXAaW6zfamb8VHaU5mmUH79Q dxnfpW4obqsYyu+kaUMns5sySf8iRJsIgjPtUFvwq7E0eixYuPh5cHvgyuXuihwGgaEBabvaKt9UM lWbC6k0G6l87UPGZG5t3V+d0TFCT2DRzxufxsyUeGcmKfR7F4u8iJLPGiIYJQsjjiCZqvyqOpzY3U gPHrHrgCIHPjKgcPvYlvgBioc4dLQFS9Itd/Yl81/saPEagLfK/qHp8DxVFj1clhxgUNMvVA6z892 zRPDLAdTNDFczChh44boCNV30ZeVKvkHf+8MwOZKJnsCHBL512tSLZLonciHnCwQFSQnKZL+Lxu56 KNMyY3rCw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fQXZf-00039u-8j; Wed, 06 Jun 2018 12:29:59 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BC014201EA7AB; Wed, 6 Jun 2018 14:29:57 +0200 (CEST) Date: Wed, 6 Jun 2018 14:29:57 +0200 From: Peter Zijlstra To: Andrea Parri Cc: Viresh Kumar , Daniel Lezcano , 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: <20180606122957.GO12258@hirez.programming.kicks-ass.net> References: <1528190208-22915-1-git-send-email-daniel.lezcano@linaro.org> <20180605103917.pyhhcobdvaivqv6g@vireshk-i7> <57d769f8-46ea-512e-8f89-a0439c9d053f@linaro.org> <20180606042708.mtwd66ecy2cnjp7a@vireshk-i7> <2bebd1bc-e1ad-6d22-ad1e-aee2cf8ba878@linaro.org> <20180606104528.nhwcd2qnxeouk6il@vireshk-i7> <20180606120539.GA13130@andrea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180606120539.GA13130@andrea> 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 Wed, Jun 06, 2018 at 02:05:39PM +0200, Andrea Parri wrote: > Hi Daniel, Viresh, > > On Wed, Jun 06, 2018 at 04:15:28PM +0530, Viresh Kumar wrote: > > On 06-06-18, 12:22, Daniel Lezcano wrote: > > > (mb() are done in the atomic operations AFAICT). > > To do my bit, not all atomic ops do/imply memory barriers; e.g., > > [from Documentation/atomic_t.txt] > > - non-RMW operations [e.g., atomic_set()] are unordered > > - RMW operations that have no return value [e.g., atomic_inc()] are unordered Quite so indeed. > > AFAIU, it is required to make sure the operations are seen in a particular order > > on another CPU and the compiler doesn't reorganize code to optimize it. > > > > For example, in our case what if the compiler reorganizes the atomic-set > > operation after wakeup-process ? But maybe that wouldn't happen across function > > calls and we should be safe then. > > IIUC, wake_up_process() implies a full memory barrier and a compiler barrier, > due to: Yes, the wakeup being a RELEASE (at least) is a fairly fundamental property for causality. You expect the woken task to observe the condition it got woken up on.