lkml.org 
[lkml]   [2020]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v6 04/10] PM / EM: add support for other devices than CPUs in Energy Model
Date

Lukasz Luba writes:

> +/**
> + * em_dev_unregister_perf_domain() - Unregister Energy Model
> (EM) for a device
> + * @dev : Device for which the EM is registered
> + *
> + * Try to unregister the EM for the specified device (it checks
> current
> + * reference counter). The EM for CPUs will not be freed.
> + */
> +void em_dev_unregister_perf_domain(struct device *dev)
> +{
> + struct em_device *em_dev, *tmp;
> +
> + if (IS_ERR_OR_NULL(dev))
> + return;
> +
> + /* We don't support freeing CPU structures in hotplug */
> + if (_is_cpu_device(dev)) {
> + dev_dbg_once(dev, "EM: the structures are not going to be
> removed\n");
> + return;
> + }
> +
> + mutex_lock(&em_pd_mutex);
> +
> + if (list_empty(&em_pd_dev_list)) {
> + mutex_unlock(&em_pd_mutex);
> + return;
> + }
> +
> + list_for_each_entry_safe(em_dev, tmp, &em_pd_dev_list,
> em_dev_list) {
> + if (em_dev->dev == dev) {
> + kref_put(&em_dev->kref, _em_release);
> + break;
> + }
> + }
> +
> + mutex_unlock(&em_pd_mutex);
> +}
> +EXPORT_SYMBOL_GPL(em_dev_unregister_perf_domain);

Ok, so em_dev_unregister_perf_domain() does not support the CPU
device
and a subsequent em_register_perf_domain() will fail with EEXIST.

Is there a way to unregister/change the CPU's energy model during
runtime without restarting the whole system?

\
 
 \ /
  Last update: 2020-04-10 13:13    [W:0.186 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site