linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Linux PM <linux-pm@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Tero Kristo <t-kristo@ti.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Ramesh Thomas <ramesh.thomas@intel.com>,
	Alex Shi <alex.shi@linaro.org>
Subject: Re: [RFT][PATCH v2 1/2] PM / domains: Rework governor code to be more consistent
Date: Mon, 6 Nov 2017 13:44:37 +0100	[thread overview]
Message-ID: <CAPDyKFpCZov7nJVijToJ7k_YJb_CKAeScpRC5KhrZ8qdiDFSVg@mail.gmail.com> (raw)
In-Reply-To: <CAJZ5v0jmeqxZyws_hS8T8pZdHK2p3kzzAA4-jaJw9+v9gv1DRQ@mail.gmail.com>

[...]

>>>  static int dev_update_qos_constraint(struct device *dev, void *data)
>>>  {
>>>         s64 *constraint_ns_p = data;
>>> -       s32 constraint_ns = -1;
>>> -
>>> -       if (dev->power.subsys_data && dev->power.subsys_data->domain_data)
>>> -               constraint_ns = dev_gpd_data(dev)->td.effective_constraint_ns;
>>> +       s64 constraint_ns;
>>>
>>> -       if (constraint_ns < 0) {
>>> -               constraint_ns = dev_pm_qos_read_value(dev);
>>> -               constraint_ns *= NSEC_PER_USEC;
>>> -       }
>>> -       if (constraint_ns == 0)
>>> +       if (!dev->power.subsys_data || !dev->power.subsys_data->domain_data)
>>>                 return 0;
>>>
>>>         /*
>>> -        * constraint_ns cannot be negative here, because the device has been
>>> -        * suspended.
>>> +        * Only take suspend-time QoS constraints of devices into account,
>>> +        * because constraints updated after the device has been suspended are
>>> +        * not guaranteed to be taken into account anyway.  In order for them
>>> +        * to take effect, the device has to be resumed and suspended again.
>>>          */
>>
>> This means a change in behavior, because earlier we took into account
>> QoS values for child devices that were not attached to a genpd.
>
> OK
>
> I have overlooked it or rather have forgotten about that.
>
>> Is there any reason you think we should change this, or is it just
>> something you overlooked here?
>>
>> I understand, that if the QoS constraint has been updated after such
>> child device has been suspended, it's tricky to take a correct
>> decision.
>
> Right, but if they are not in a domain, the best we can do is to look
> at the current value.
>
>> To really solve this, we would either have to register a QoS notifier
>> for all children devices that has its parent attached to a genpd, or
>> always runtime resume devices before updating QoS constraints.
>>
>> Non of these options is perfect, so perhaps we should consider a "best
>> effort" approach instead? Whatever that may be.
>
> I think best effort makes most sense.

Okay!

>
> So I guess I'll simply evaluate dev_pm_qos_read_value(dev) if
> subsys_data or subsys_data->domain_data is not there.

Yes.

However, if it returns -1, what value should you pick? 0?

>
> Of course, that doesn't apply to the code in __default_power_down_ok()
> as that only takes device in the domain into account anyway.

Yep, agree!

Kind regards
Uffe

  reply	other threads:[~2017-11-06 12:44 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01 23:00 [RFT][PATCH 0/2] PM / QoS: Device resume latency framework fix Rafael J. Wysocki
2017-11-01 23:01 ` [RFT][PATCH 1/2] PM / domains: Rework governor code to be more consistent Rafael J. Wysocki
2017-11-03  7:05   ` Ramesh Thomas
2017-11-03  7:51     ` Rafael J. Wysocki
2017-11-01 23:03 ` [RFT][PATCH 2/2] PM / QoS: Fix device resume latency framework Rafael J. Wysocki
2017-11-03  7:43   ` Ramesh Thomas
2017-11-03  7:58     ` Rafael J. Wysocki
2017-11-03 10:38       ` Rafael J. Wysocki
2017-11-03 11:42 ` [RFT][PATCH v2 0/2] PM / QoS: Device resume latency framework fix Rafael J. Wysocki
2017-11-03 11:47   ` [RFT][PATCH v2 1/2] PM / domains: Rework governor code to be more consistent Rafael J. Wysocki
2017-11-04  2:34     ` Ramesh Thomas
2017-11-04 11:24       ` Rafael J. Wysocki
2017-11-06  7:47         ` Ramesh Thomas
2017-11-06 12:10     ` Ulf Hansson
2017-11-06 12:34       ` Rafael J. Wysocki
2017-11-06 12:44         ` Ulf Hansson [this message]
2017-11-06 12:49           ` Rafael J. Wysocki
2017-11-06 14:38             ` Ulf Hansson
2017-11-06 23:07               ` Rafael J. Wysocki
2017-11-03 11:50   ` [RFT][PATCH v2 2/2] PM / QoS: Fix device resume latency framework Rafael J. Wysocki
2017-11-03 16:39     ` Reinette Chatre
2017-11-04  2:28       ` Ramesh Thomas
2017-11-04 11:30         ` Rafael J. Wysocki
2017-11-04 11:58           ` Rafael J. Wysocki
2017-11-04 11:28       ` Rafael J. Wysocki
2017-11-04  2:38     ` Ramesh Thomas
2017-11-04 12:34     ` [RFT][Update][PATCH " Rafael J. Wysocki
2017-11-06 17:47       ` Reinette Chatre
2017-11-07  1:07         ` Rafael J. Wysocki
2017-11-06 13:46   ` [RFT][PATCH v2 0/2] PM / QoS: Device resume latency framework fix Geert Uytterhoeven
2017-11-07  1:08     ` Rafael J. Wysocki
2017-11-08  9:09       ` Tero Kristo
2017-11-07  1:17   ` [PATCH v3 " Rafael J. Wysocki
2017-11-07  1:23     ` [PATCH v3 1/2] PM / domains: Rework governor code to be more consistent Rafael J. Wysocki
2017-11-07  5:05       ` Ramesh Thomas
2017-11-07 10:22         ` Rafael J. Wysocki
2017-11-07 23:24           ` Ramesh Thomas
2017-11-10  7:49       ` Ulf Hansson
2017-11-07  1:27     ` [PATCH v3 2/2] PM / QoS: Fix device resume latency framework Rafael J. Wysocki
2017-11-07  4:33       ` Ramesh Thomas
2017-11-07 10:12         ` Rafael J. Wysocki
2017-11-07 10:33       ` [PATCH v4 " Rafael J. Wysocki
2017-11-07 23:15         ` Ramesh Thomas
2017-11-08  0:09           ` Rafael J. Wysocki
2017-11-10  7:49         ` Ulf Hansson
2017-11-10  8:03         ` Geert Uytterhoeven

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=CAPDyKFpCZov7nJVijToJ7k_YJb_CKAeScpRC5KhrZ8qdiDFSVg@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=alex.shi@linaro.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=ramesh.thomas@intel.com \
    --cc=reinette.chatre@intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=t-kristo@ti.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;
as well as URLs for NNTP newsgroup(s).