Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp571032ybt; Wed, 24 Jun 2020 06:14:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqrS+oSaO1STLb90tolgVVXXNg+6aoC3PhtqtiM+ZcvPbzNNDgkqUplyj/Q/+qNnldut1n X-Received: by 2002:a17:907:9486:: with SMTP id dm6mr25672745ejc.248.1593004498835; Wed, 24 Jun 2020 06:14:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593004498; cv=none; d=google.com; s=arc-20160816; b=RPbxoKck1Gfdw76BReqaAW7tLm+dSU0mkqF1Kk5ludWmFy5ZgrXEYIUscN9RhHD9Kg 7OzsU7PeXDQr+dovGf2i5bNPbb5e2FRTyVmUMhKSLDcTRz7baYLjbDLAB0V83GOrrnC+ ZGxbCRJd7fR2w0uGAICLgE+TpC+Zz1eF8wHBP2puknhCgGptoA12nxtXoMtiRZ9O8zev TKz9vXAx3cZTr6Zh0yfQcy3bSxv2htr116mLyb2CEuXNzxBePsYBG09M+Z0OuvQcrNrt crps7UPgZ5rODWWuBGjY1g8NJ6+Z/TZ7CQl9lWNzP20BLsYEqdF4eaEUuBwze/eiLTrg X86w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=BDyIAIkz+outt0wjRZXFGz7XkAFPA/tTfRPsaqbeBic=; b=IVKITtfzN/cbLxZ/7BYSN8UjgklaPgALdBGvbWjB1M0dmDBcHwrLMFgxfUwr3KPyFk VzvgqnDp0YRNVrJvP1RQykx5KPawvWPkEttY29oxDx4EzgDdGMfZ/3HpcMkg+w4oTrTb JMudsiFN3D3bmLTx1M+40YKlqg8J6DZt/JhFH21Ey7Cn/FPu/+alPkxBxuTSVuC7CVWC 1LUUId4dmcbG3fXpc05bQ2b1XLZTSuFGJaMGDxo1/A/hjmebQ4lPEaKDTIIZEMMOdT6S 28/Qui3pm1/zL2cXyWKXbSQlvAnaw7eLsqzTT9dmJJc2KlGeSkgAyDehoa3jo+/kFJ8c 8o9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p23si3170942ejz.151.2020.06.24.06.14.34; Wed, 24 Jun 2020 06:14:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388686AbgFXNNq (ORCPT + 99 others); Wed, 24 Jun 2020 09:13:46 -0400 Received: from mail-ej1-f68.google.com ([209.85.218.68]:46210 "EHLO mail-ej1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388367AbgFXNNq (ORCPT ); Wed, 24 Jun 2020 09:13:46 -0400 Received: by mail-ej1-f68.google.com with SMTP id p20so2363055ejd.13; Wed, 24 Jun 2020 06:13:44 -0700 (PDT) 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; bh=BDyIAIkz+outt0wjRZXFGz7XkAFPA/tTfRPsaqbeBic=; b=cBoDk95Xr+/3SorCdmi317L0xPhuybVi2Gj+kAITdbJ+fXCnXFphYYW4v9MR86+/wH SQCxjmOaeBaoBe/DfLIxQ/BZVeidyamSI0Xn8q6p3o7zL8QgEXkds5McYsM+tT3ouXmc jvWO+m/R9IO74b22UDGPY20rbe9hZGNTFxLpkL5WiThlVd89C7sc1ZxvZ76dko5PDQG1 j1MCLl3K89h2z1Pp4YgC3Z1RACiA3MruyYXMUkK38jX7XE1mEv/fmKyRNb3r0OeG8LnK p9PDysVc0uPFZhHQbxuOxgR4NLk83gYvG0dzR8gkWqurdrW3/Eqitf7O7pFjdWuF55yo OdRA== X-Gm-Message-State: AOAM533KXijfBwXKl8bFvFjFROlIpzLMapfADTzEXvsb9ZNnTkju7jr1 N996DRO2GV7ONttBSZmBEkY= X-Received: by 2002:a17:906:ca56:: with SMTP id jx22mr11630669ejb.494.1593004424202; Wed, 24 Jun 2020 06:13:44 -0700 (PDT) Received: from pi3 ([194.230.155.235]) by smtp.googlemail.com with ESMTPSA id ss4sm15386027ejb.63.2020.06.24.06.13.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 06:13:43 -0700 (PDT) Date: Wed, 24 Jun 2020 15:13:41 +0200 From: Krzysztof Kozlowski To: Lukasz Luba Cc: Kamil Konieczny , Willy Wolff , Chanwoo Choi , MyungJoo Ham , Kyungmin Park , Kukjin Kim , linux-pm@vger.kernel.org, "linux-samsung-soc@vger.kernel.org" , linux-arm-kernel@lists.infradead.org, "linux-kernel@vger.kernel.org" Subject: Re: brocken devfreq simple_ondemand for Odroid XU3/4? Message-ID: <20200624131341.GA20905@pi3> References: <20200623164733.qbhua7b6cg2umafj@macmini.local> <20200623191129.GA4171@kozik-lap> <85f5a8c0-7d48-f2cd-3385-c56d662f2c88@arm.com> <828b0d63-4d01-48d6-5971-64855adebed2@samsung.com> <20200624120651.GA20813@pi3> <55772862-ff8f-1e1d-91ae-7b4d7c3be1b6@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <55772862-ff8f-1e1d-91ae-7b4d7c3be1b6@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 24, 2020 at 02:03:03PM +0100, Lukasz Luba wrote: > > > On 6/24/20 1:06 PM, Krzysztof Kozlowski wrote: > > My case was clearly showing wrong behavior. System was idle but not > > sleeping - network working, SSH connection ongoing. Therefore at least > > one CPU was not idle and could adjust the devfreq/DMC... but this did not > > happen. The system stayed for like a minute in 633 MHz OPP. > > > > Not-waking up idle processors - ok... so why not using power efficient > > workqueue? It is exactly for this purpose - wake up from time to time on > > whatever CPU to do the necessary job. > > IIRC I've done this experiment, still keeping in devfreq: > INIT_DEFERRABLE_WORK() > just applying patch [1]. It uses a system_wq which should > be the same as system_power_efficient_wq when > CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set (our case). > This wasn't solving the issue for the deferred work. That's > why the patch 2/2 following patch 1/2 [1] was needed. > > The deferred work uses TIMER_DEFERRABLE in it's initialization > and this is the problem. When the deferred work was queued on a CPU, > next that CPU went idle, the work was not migrated to some other CPU. > The former cpu is also not woken up according to the documentation [2]. Yes, you need either workqueue.power_efficient kernel param or CONFIG option to actually enable it. But at least it could then work on any CPU. Another solution is to use directly WQ_UNBOUND. > That's why Kamil's approach should be continue IMHO. It gives more > control over important devices like: bus, dmc, gpu, which utilization > does not strictly correspond to cpu utilization (which might be low or > even 0 and cpu put into idle). > > I think Kamil was pointing out also some other issues not only dmc > (buses probably), but I realized too late to help him. This should not be a configurable option. Why someone would prefer to use one over another and decide about this during build or run time? Instead it should be just *right* all the time. Always. Argument that we want to save power so we will not wake up any CPU is ridiculous if because of this system stays in high-power mode. If system is idle and memory going to be idle, someone should be woken up to save more power and slow down memory controller. If system is idle but memory going to be busy, the currently busy CPU (which performs some memory-intensive job) could do the job and ramp up the devfreq performance. Best regards, Krzysztof