mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: Robin Murphy <robin.murphy@arm.com>, Qiang Yu <yuq825@gmail.com>
Cc: lima@lists.freedesktop.org, David Airlie <airlied@linux.ie>,
	Christian Hewitt <christianshewitt@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm/lima: Use delayed timer as default in devfreq profile
Date: Thu, 4 Feb 2021 14:23:56 +0000	[thread overview]
Message-ID: <deb2c075-4177-d487-b1cd-1c60790ca625@arm.com> (raw)
In-Reply-To: <0afa6299-1c35-ab98-702e-8dcd168bcaac@arm.com>



On 2/4/21 1:39 PM, Robin Murphy wrote:
> On 2021-02-03 02:01, Qiang Yu wrote:
>> On Tue, Feb 2, 2021 at 10:02 PM Lukasz Luba <lukasz.luba@arm.com> wrote:
>>>
>>>
>>>
>>> On 2/2/21 1:01 AM, Qiang Yu wrote:
>>>> Hi Lukasz,
>>>>
>>>> Thanks for the explanation. So the deferred timer option makes a 
>>>> mistake that
>>>> when GPU goes from idle to busy for only one poll periodic, in this
>>>> case 50ms, right?
>>>
>>> Not exactly. Driver sets the polling interval to 50ms (in this case)
>>> because it needs ~3-frame average load (in 60fps). I have discovered the
>>> issue quite recently that on systems with 2 CPUs or more, the devfreq
>>> core is not monitoring the devices even for seconds. Therefore, we might
>>> end up with quite big amount of work that GPU is doing, but we don't
>>> know about it. Devfreq core didn't check <- timer didn't fired. Then
>>> suddenly that CPU, which had the deferred timer registered last time,
>>> is waking up and timer triggers to check our device. We get the stats,
>>> but they might be showing load from 1sec not 50ms. We feed them into
>>> governor. Governor sees the new load, but was tested and configured for
>>> 50ms, so it might try to rise the frequency to max. The GPU work might
>>> be already lower and there is no need for such freq. Then the CPU goes
>>> idle again, so no devfreq core check for next e.g. 1sec, but the
>>> frequency stays at max OPP and we burn power.
>>>
>>> So, it's completely unreliable. We might stuck at min frequency and
>>> suffer the frame drops, or sometimes stuck to max freq and burn more
>>> power when there is no such need.
>>>
>>> Similar for thermal governor, which is confused by this old stats and
>>> long period stats, longer than 50ms.
>>>
>>> Stats from last e.g. ~1sec tells you nothing about real recent GPU
>>> workload.
>> Oh, right, I missed this case.
>>
>>>
>>>> But delayed timer will wakeup CPU every 50ms even when system is 
>>>> idle, will this
>>>> cause more power consumption for the case like phone suspend?
>>>
>>> No, in case of phone suspend it won't increase the power consumption.
>>> The device won't be woken up, it will stay in suspend.
>> I mean the CPU is waked up frequently by timer when phone suspend,
>> not the whole device (like the display).
>>
>> Seems it's better to have deferred timer when device is suspended for
>> power saving,
>> and delayed timer when device in working state. User knows this and
>> can use sysfs
>> to change it.
> 
> Doesn't devfreq_suspend_device() already cancel any timer work either 
> way in that case?

Correct, the governor should pause the monitoring mechanism (and timer).

Regards,
Lukasz

  reply	other threads:[~2021-02-04 14:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-27 10:51 Lukasz Luba
2021-01-30 13:51 ` Qiang Yu
2021-02-01  9:53   ` Lukasz Luba
2021-02-02  1:01     ` Qiang Yu
2021-02-02 14:02       ` Lukasz Luba
2021-02-03  2:01         ` Qiang Yu
2021-02-04 13:39           ` Robin Murphy
2021-02-04 14:23             ` Lukasz Luba [this message]
2021-02-07 13:11               ` Qiang Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=deb2c075-4177-d487-b1cd-1c60790ca625@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=airlied@linux.ie \
    --cc=christianshewitt@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lima@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=yuq825@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®