Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp407312imm; Thu, 7 Jun 2018 21:50:34 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIEJ1s1SvS21PaaBokcoUGEl7gdbkVBbA4aFia3h7oQlr0lzRyVetX9dGb9QorEVlIQIxGO X-Received: by 2002:a17:902:2c01:: with SMTP id m1-v6mr4894884plb.347.1528433433971; Thu, 07 Jun 2018 21:50:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528433433; cv=none; d=google.com; s=arc-20160816; b=UiDnjI0GFpcRq2wkxKUcd5Wcsm50kPy7UMLezFWfui+A09tNXOGZAZHaPdS5z6CkDS GN0aYXfLrgYBt3509hYGmXqKSvljyf267UpeVUu3C5ATHUWGxTHTfWx68tOaxzyH9AUW JELy8uxWuugiGD3rR6hm3yclH0JUaC6l5fZh6qOEoJGFh0vH5o030myPnYztfv5fCiwQ 3sNiolYAm48UDdWGWDa3flZ2IkBQLyeHTEBSXGYuwpUA2fmIqk9WtVGFUfqnr4ixR4Oh Sk4S9R4Fx20LjQHUA7fpSFDzvgNnrbQQxvelPn3YpqEwR4SHr1v4hoTC2GjHWFJh+INA DjSw== 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=Py+1R73YwcoNEMFbhO+eVWpBPwYbKkGS5BYEgnYsIv0=; b=jRieyxmTNvE1713r0+5mi8E92qkv0XsG2eXjcViyif+bLmt5Sckn8vmTR4Ji3+zhx5 dfQNqlyygfEsv4pK6pUzeFL4J3yYiZxGRAVzMLPe1XeuLLzQSb5rpa6ZymVieX0ZL8FH QKEMNOjVcc39GH+7OFiQb9S6GnpGwx3zVQzk0mCbq7Vvr6R9aknO+bd92Gt2Onb4UPBw k5DqzlLK8+Jp2gPradttVBiL88FEtzfwv+SmA2OXcRtMUK7AvKSr8RM0UuofthmBnlgP uf/yKD6UGrHA8C7jzeosxJhYrn1dt6FMPt906hHlw0r/BEAyrxdHGe0p8KMnYqZu4k33 YlaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CPUxak8x; 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 a5-v6si45154707pgc.537.2018.06.07.21.50.19; Thu, 07 Jun 2018 21:50:33 -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=CPUxak8x; 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 S1751255AbeFHEso (ORCPT + 99 others); Fri, 8 Jun 2018 00:48:44 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:43397 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750960AbeFHEsm (ORCPT ); Fri, 8 Jun 2018 00:48:42 -0400 Received: by mail-pf0-f195.google.com with SMTP id j20-v6so5982300pff.10 for ; Thu, 07 Jun 2018 21:48:42 -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=Py+1R73YwcoNEMFbhO+eVWpBPwYbKkGS5BYEgnYsIv0=; b=CPUxak8xn7janXRY+NxViyjdD0+Kv3HroqlWKuNd76iI/Aq6gyw7lhkn0wpqUglyrk 0qm/McnBthmQcRfRAbcSO+YkWj5Cnuxcj6evMyaqO8OjKGjlEZawsir7Yc38YRC+ZZjs TrbF+SpvKins4XyNp9p2Ez6Hi/CMgBR8p4esU= 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=Py+1R73YwcoNEMFbhO+eVWpBPwYbKkGS5BYEgnYsIv0=; b=p3EtG0EEn3gCDJfOy8nevWlUvoDUn9dTwVJF0k8u/r0JRdX8a1c7qcpXyEEd+xEb83 GfUQFqguM3rgECwd3eaGXq5S5NeaMBe+H8yO2jKv5O6lPHG1eazHOEt3zo8ZaAdFsFww 4mZXPqI0TgG33ZCvEQdsWcECNDRabt7pv2UNuXi2DSB0PR7PzPe6XP4YWnpvkQs3OtYB Lf5MhodgUeLpndJRIY3cf1ggUmWyC9Ign89vogLSYZS3QZrVDnfHAB3kKj7rG0S2rDo+ llmkzXTHXlfWHWsrKZCwlObcxzMiMHDYrjOAbLsdnh5ZtVDEvBfqClmYLCEdZAzWZUks siow== X-Gm-Message-State: APt69E16AcncT/9OjvwsDo+yG8ObknLrki1RnKcSj3i9IfLAccHs/JHV 9c5Pqa6+jKjjWA9W1c25E8Qq8g== X-Received: by 2002:a65:49cb:: with SMTP id t11-v6mr3868448pgs.218.1528433322334; Thu, 07 Jun 2018 21:48:42 -0700 (PDT) Received: from localhost ([223.226.91.101]) by smtp.gmail.com with ESMTPSA id u84-v6sm62105199pfg.156.2018.06.07.21.48.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 21:48:41 -0700 (PDT) Date: Fri, 8 Jun 2018 10:18:39 +0530 From: Viresh Kumar To: Daniel Lezcano Cc: 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: <20180608044839.eyaib5gkbw7biu2a@vireshk-i7> 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> <1d542490-fcb5-33fd-ab3b-eddf3d300bd4@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1d542490-fcb5-33fd-ab3b-eddf3d300bd4@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, 16:11, Daniel Lezcano wrote: > >> I'm wondering if we can have a CPU hotplugged right after the > >> 'put_online_cpus', resulting in the 'should park' flag set and then the > >> thread goes in the kthread_parkme instead of jumping back the idle > >> injection function and decrease the count, leading up to the timer not > >> being set again. > > > > True. That looks like a valid problem to me as well. > > > > What about starting the hrtimer right from this routine itself, after taking > > into account running-time, idle-time, delay, etc ? That would get rid of the > > count stuff, this get_online_cpus(), etc. > > > > Even if we restart the next play-idle cycle a bit early or with some delay, sky > > wouldn't fall :) > > We won't be able to call completion() in this case. I was just having a look at smpboot.h and saw the park/unpark callbacks. I think you can very much use them to align things with CPU hotplug. -- viresh