Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp578139imm; Fri, 8 Jun 2018 01:34:38 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIi/7vnNAUON15FWcF+XVnxPyqIR3upHzNlVj1G5Tdm+9hfO0zwXPWwLr7gsOA1Q7lAxyk4 X-Received: by 2002:a65:5d4a:: with SMTP id e10-v6mr4551508pgt.25.1528446878083; Fri, 08 Jun 2018 01:34:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528446878; cv=none; d=google.com; s=arc-20160816; b=IXnCKiz7jW7ebO9UtGJZj/KUr8GIuXIL0F4jcbY72uy0bn689mNUr05kyLNJpE8hu5 q3f/W/7QZCfHy0SZEKLEZN9Emxk2CbRzDo6qEnAMRK+UhY/pSaKvw71BAGjqAGXI3HyG TCZHsT/oTiAzqP+dfYn4makG88uDqxgWUFW63xfLcUu5d8WYC3jDhFvGwGDWvNI3D074 Gh74rGAT6rw+ysXEjt1ABH9zxiG1GLR3rzBC27mORpZ2tR55Jxc/ebj+C2Z7WBuN0HH7 dhP4bMv/rJltEl7oyEzDzZ+D6qaLiRo1tJ2RXN47O0glCoSAtiGIZdcx5J/Eo0xnCUWM LCTA== 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=3KrAf/h+4Bv+j/cg5jNr741Bkz4qPUij/iYLWT5ILzU=; b=P2TZg8e8DP8hKoTtlAkpDkwhnG63CcwpMOWYgswWBo3CqTqsgzs74CFNt5KF+V4jLP s23fxdeMdPmbEoV9rW5ogeQ8jzcxxNefz/lM60MAEpvwAJCHy4+F+oLgGHBMiAEUx5/0 S8bdtT3OgS5NbRzsicl9fvT/V0sAkELOVvZGkbE8aWHHr87vqLNBXHZ/G4GoO/nnlwM4 664pyNhEMJz+H7rGcqdA5RTeslkTNOQimX562Tc72vjPanF4KetiR373xUmaZnsR3/T1 QPDlVQ8VhpXpO2b3ULHoRK01/S+b4NcKwpRcRtmxMTKA1dlXY+q/r/Ka4X3sDA2dQ5wm QpHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LPuenH0s; 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 r12-v6si15433362pgp.39.2018.06.08.01.34.23; Fri, 08 Jun 2018 01:34:38 -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=LPuenH0s; 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 S1752937AbeFHIcB (ORCPT + 99 others); Fri, 8 Jun 2018 04:32:01 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:51871 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752886AbeFHIbz (ORCPT ); Fri, 8 Jun 2018 04:31:55 -0400 Received: by mail-wm0-f65.google.com with SMTP id r15-v6so1855432wmc.1 for ; Fri, 08 Jun 2018 01:31:55 -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=3KrAf/h+4Bv+j/cg5jNr741Bkz4qPUij/iYLWT5ILzU=; b=LPuenH0seR6JBxB9U3O7OQMFeVHK3pevV3M+EFJQHT5hUS0ZBGghfEimCb11MrbGyv 01gkzae1CPaaGcZvDyCoTnC3Mcy+6QXLnKgbv8tNT7UYo2+wb3F59BawPSwFh0QUqueR ZLVo4EcX5wUHg6WBNjmKVLAYf5aATnEwb346U= 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=3KrAf/h+4Bv+j/cg5jNr741Bkz4qPUij/iYLWT5ILzU=; b=WWuXfMjmBPxM1Y0+5SZtgPrw0gJ9S2fa1WgnLmcN1R3g5uQ+ScBW9298eZJspMqJZ2 dy6fsRvzIfU2I5T07KjvqNBUZajXrP58GGxbrA1g4wt1T5wXT+N5SyxUJeIUsQWgOAs0 ztZG491te/lARXTwn07yozjMtlgrnCNvGzOjXnuKVDEVxNy3bjTXUsPtJJXHrvJYzzeW nUGOzyz30oOmmPkVPI7fj9kPXFfgPIoqFpynYaRhZ/0zLaL7oVGYJh65o3aH+FfReMYo xUpGas13cUnSDxZPOvkOUmnGRyT2aJ5XjdWzyhhqcCCgKIlrd/5nrMzeZiZ92rO/5Bvw 0VJA== X-Gm-Message-State: APt69E3yZNF1j+Kh6PnmEzdvLuQ2SVCOiWTlcDSns1utAEfKOijnFiw2 es8IfhGhX75dgztORPBHPROJWw== X-Received: by 2002:a1c:4a5d:: with SMTP id x90-v6mr835676wma.67.1528446714214; Fri, 08 Jun 2018 01:31:54 -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 l69-v6sm5306303wma.45.2018.06.08.01.31.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Jun 2018 01:31:53 -0700 (PDT) Subject: Re: [PATCH V5] powercap/drivers/idle_injection: Add an idle injection framework To: Viresh Kumar 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" 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> <20180608044839.eyaib5gkbw7biu2a@vireshk-i7> From: Daniel Lezcano Message-ID: <39960620-dc59-92a5-0e57-f00a4d930f7f@linaro.org> Date: Fri, 8 Jun 2018 10:31:52 +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: <20180608044839.eyaib5gkbw7biu2a@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 08/06/2018 06:48, Viresh Kumar wrote: > 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. Hmm, perhaps. I will have a look at it. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog