All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Luba <l.luba@partner.samsung.com>
To: myungjoo.ham@samsung.com,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	"tkjos@google.com" <tkjos@google.com>,
	"joel@joelfernandes.org" <joel@joelfernandes.org>,
	"chris.diamand@arm.com" <chris.diamand@arm.com>,
	"mka@chromium.org" <mka@chromium.org>,
	"rostedt@goodmis.org" <rostedt@goodmis.org>,
	"mingo@redhat.com" <mingo@redhat.com>
Subject: Re: [PATCH v3 5/7] drivers: devfreq: add longer polling interval in idle
Date: Fri, 22 Feb 2019 17:03:02 +0100	[thread overview]
Message-ID: <dbde3366-a115-3fe0-abb4-65ef0d8b760d@partner.samsung.com> (raw)
In-Reply-To: <20190221055601epcms1p7b87bba9a878683453f7e46c84ed032b9@epcms1p7>

Hi MyungJoo,

On 2/21/19 6:56 AM, MyungJoo Ham wrote:
>>>
>>> There are some requirements that you need to consider:
>>>
>>> Is 30% really applicable to ALL devfreq devices?
>> The 30% load while the device is on lowest OPP is to filter some noise.
>> It might be tunable over sysfs for each device if you like.
>>>       - What if some devices do not want such behaviors?
>> They can set polling_idle_ms and polling_ms the same value.
>>>       - What if some devices want different values (change behavors)?
>> Need of sysfs tunable here.
>>>       - What if some manufactures want different default values?
>> Like above (sysfs).
>>>       - What if some devices want to let the framework know that it's in idle?
>> There might be a filed in devfreq->state which could handle this.
>>>       - What if some other kernel context, device (drivers),
>>>       or userspace process want to notify that it's no more idling?This issue is more related to the new movement in the 'interconnect'
>> development. They have a goal for this kind of interactions and QoS
>> between devices or their clients. In devfreq it would be possible
>> to tackle this, but would require a lot of changes (notification chain,
>> state machines in devices,
>>
>>>
>>> As mentioned in the internal thread (tizen.org),
>>> I'm not convinced by the idea of assuming that a device can be considered "idling"
>>> if it has simply "low" utilization.
>>>
>>> You are going to deteriorate the UI response time of mobile devices significantly.
>> Current devfreq wake-up also does not guarantee that, maybe on a single
>> CPU platform does.
> 
> Yes, the current devfreq does not enhance UI response time in the sense
> that it would keep the same reponse time anyway.
> 
> However, your current approach will surely deteriorate it by lengthen
> the polling latency.
> 
> For mobile and wearable devices, in many cases I've been witnessing,
> the device idles right before the user's input (launching an app,
> scrolling messages or web pages, or press a play button).
> For mitigation, we often relay UI inputs to DVFS mechanisms so that
> we either increase frequency for any UI inputs for a short period or
> shorten the polling latency for a short period.
> When a highly user-interactive device is idling or operating a low frequency,
> we should assume that it's going to be highly performing anytime;
> loosening the checking period is not a good solution in that sense
> although it is probable for servers or workstations.
> But, I don't think servers/workstations do care power consumption of
> DVFS checking loops anyway.
It is not just mobiles or servers (I agree servers are not in scope).
Devices like TVs, set-top-boxes, IP cameras, car IVI, they might care
about DVFS, but they do not have batteries (maybe a big car battery...).
They probably have more than 1 CPU and have some accelerators, which
they might register devfreq devices.
> 
> 
> 
>>
>> I will try to address your and Chanwoo's comments that the devfreq still
>> needs deferred polling in some platforms.
>> Would it be OK if we have two options: deferred and delayed work while
>> registering a wakeup for a device?
>> That would be a function like: polling_mode_init(devfreq) instead of
>> simple INIT_DEFERRED_WORK(), which will check the device's preference.
>> The device driver could set a filed in 'polling_mode' to enum:
>> POWER_EFFICIENT or RELIABLE_INTERVAL. For compatibility with old drivers
>> where the polling_mode = 0, SYSTEM_DEFAULT_POLLING_MODE (which is one
>> of these two) would be used.
>> Then the two-phase-polling-interval from this patch could only be used
>> for the RELIABLE_INTERVAL configuration or even dropped.
> 
> One thing I want to add is: let's not over-complicate it.
> Do you have any experimental results on how much power is saved by doing this?
> (and user response time losses)
No I don't have such results. Maybe it is not even worth to add this
two-phase-polling because the polling using DELAYED does not increase
the power consumption too much. Like for the device mentioned above.

Simplest first step.
What would you say to add just the possibility of choosing between:
INIT_DEFERRED_WORK() and INIT_DELAYED_WORK() in runtime via sysfs?
There would be also Kconfig which sets default.
No additional code for different custom polling modes.

Regards,
Lukasz
> 
> 
> Cheers,
> MyungJoo
> 
> 
> 

      reply	other threads:[~2019-02-22 16:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190212222422eucas1p1624203db4db3e495035820dea542e23a@eucas1p1.samsung.com>
2019-02-12 22:23 ` [PATCH v3 0/7] drivers: devfreq: fix and optimize workqueue mechanism Lukasz Luba
     [not found]   ` <CGME20190212222430eucas1p1ad7992e29d224790c1e20ef7442e62fe@eucas1p1.samsung.com>
2019-02-12 22:23     ` [PATCH v3 1/7] drivers: devfreq: change deferred work into delayed Lukasz Luba
2019-02-14  4:10       ` Chanwoo Choi
     [not found]   ` <CGME20190212222431eucas1p1697607e6536a90283cf7dad37fa74dbb@eucas1p1.samsung.com>
2019-02-12 22:23     ` [PATCH v3 2/7] drivers: devfreq: change devfreq workqueue mechanism Lukasz Luba
2019-02-14  4:11       ` Chanwoo Choi
     [not found]   ` <CGME20190212222433eucas1p264602d67a916c644c7eb5012932fc17a@eucas1p2.samsung.com>
2019-02-12 22:23     ` [PATCH v3 3/7] Kconfig: drivers: devfreq: add default idle polling Lukasz Luba
     [not found]   ` <CGME20190212222434eucas1p134dcdce827df19704c698fd6452b0a06@eucas1p1.samsung.com>
2019-02-12 22:23     ` [PATCH v3 4/7] include: devfreq: add polling_idle_ms to 'profile' Lukasz Luba
2019-02-14  4:51       ` Chanwoo Choi
     [not found]   ` <CGME20190212222436eucas1p21eebc80796406787a2ebf9a84ee5b868@eucas1p2.samsung.com>
2019-02-12 22:23     ` [PATCH v3 5/7] drivers: devfreq: add longer polling interval in idle Lukasz Luba
     [not found]   ` <CGME20190212222437eucas1p198db6fca1f1ba3056d93c57327dd48ed@eucas1p1.samsung.com>
2019-02-12 22:23     ` [PATCH v3 6/7] trace: events: add devfreq trace event file Lukasz Luba
2019-02-12 23:14       ` Steven Rostedt
2019-02-13 13:35         ` Lukasz Luba
2019-02-14  5:01           ` Chanwoo Choi
2019-02-13 13:56       ` Steven Rostedt
2019-02-13 14:37         ` Lukasz Luba
     [not found]   ` <CGME20190212222438eucas1p27e020c2b36f2e5a2188e4df6fb18488b@eucas1p2.samsung.com>
2019-02-12 22:23     ` [PATCH v3 7/7] drivers: devfreq: add tracing for scheduling work Lukasz Luba
2019-02-14  4:57       ` Chanwoo Choi
2019-02-13  0:18   ` [PATCH v3 0/7] drivers: devfreq: fix and optimize workqueue mechanism Chanwoo Choi
2019-02-13 11:14     ` Lukasz Luba
2019-02-13 14:52       ` Lukasz Luba
2019-02-14  0:41       ` Chanwoo Choi
     [not found]   ` <CGME20190212222436eucas1p21eebc80796406787a2ebf9a84ee5b868@epcms1p3>
2019-02-18  4:33     ` [PATCH v3 5/7] drivers: devfreq: add longer polling interval in idle MyungJoo Ham
2019-02-19  8:33       ` Lukasz Luba
     [not found]       ` <CGME20190212222436eucas1p21eebc80796406787a2ebf9a84ee5b868@epcms1p7>
2019-02-21  5:56         ` MyungJoo Ham
2019-02-22 16:03           ` Lukasz Luba [this message]

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=dbde3366-a115-3fe0-abb4-65ef0d8b760d@partner.samsung.com \
    --to=l.luba@partner.samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=chris.diamand@arm.com \
    --cc=cw00.choi@samsung.com \
    --cc=joel@joelfernandes.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mingo@redhat.com \
    --cc=mka@chromium.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=rostedt@goodmis.org \
    --cc=s.nawrocki@samsung.com \
    --cc=tkjos@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.