Re: [PATCH 4/7] devfreq: change var name used in time statistics

From: Chanwoo Choi
Date: Wed Nov 13 2019 - 04:29:42 EST


Hi,

Actually, it just change the variable name. I don't want to
change the name without any behavior improvement. Frankly,
we might make the many patches to rename the some variables
on various subsystem and driver. But, It is not necessary
if there are any critical beneficial.

Rather than just changing the name, it is more important to keep
the history. And devfreq is not cpufreq. There are no any reason
to follow the cpufreq for variable name.

So, Not ack of this patch. Thanks.

Regards,
Chanwoo Choi


On 11/13/19 6:13 PM, Kamil Konieczny wrote:
> Change var name used in time statistics from last_stat_updated to
> last_time. This will make it shorter and similar to cpufreq_stats.
>
> Signed-off-by: Kamil Konieczny <k.konieczny@xxxxxxxxxxx>
> ---
> drivers/devfreq/devfreq.c | 12 ++++++------
> include/linux/devfreq.h | 4 ++--
> 2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index 0a88055d1362..6e5a17f4c92c 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -165,7 +165,7 @@ int devfreq_update_status(struct devfreq *devfreq, unsigned long freq)
> /* Immediately exit if previous_freq is not initialized yet. */
> if (!devfreq->previous_freq) {
> spin_lock(&devfreq->stats_lock);
> - devfreq->last_stat_updated = cur_time;
> + devfreq->last_time = cur_time;
> spin_unlock(&devfreq->stats_lock);
> return 0;
> }
> @@ -179,7 +179,7 @@ int devfreq_update_status(struct devfreq *devfreq, unsigned long freq)
> }
>
> devfreq->time_in_state[prev_lev] +=
> - cur_time - devfreq->last_stat_updated;
> + cur_time - devfreq->last_time;
> lev = devfreq_get_freq_level(devfreq, freq);
> if (lev < 0) {
> ret = lev;
> @@ -193,7 +193,7 @@ int devfreq_update_status(struct devfreq *devfreq, unsigned long freq)
> }
>
> out:
> - devfreq->last_stat_updated = cur_time;
> + devfreq->last_time = cur_time;
> spin_unlock(&devfreq->stats_lock);
> return ret;
> }
> @@ -485,7 +485,7 @@ void devfreq_monitor_resume(struct devfreq *devfreq)
> msecs_to_jiffies(devfreq->profile->polling_ms));
>
> spin_lock(&devfreq->stats_lock);
> - devfreq->last_stat_updated = get_jiffies_64();
> + devfreq->last_time = get_jiffies_64();
> spin_unlock(&devfreq->stats_lock);
> devfreq->stop_polling = false;
>
> @@ -714,7 +714,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
> goto err_devfreq;
> }
>
> - devfreq->last_stat_updated = get_jiffies_64();
> + devfreq->last_time = get_jiffies_64();
> spin_lock_init(&devfreq->stats_lock);
>
> srcu_init_notifier_head(&devfreq->transition_notifier_list);
> @@ -1452,7 +1452,7 @@ static void defvreq_stats_clear_table(struct devfreq *devfreq)
> spin_lock(&devfreq->stats_lock);
> memset(devfreq->time_in_state, 0, count * sizeof(u64));
> memset(devfreq->trans_table, 0, count * count * sizeof(int));
> - devfreq->last_stat_updated = get_jiffies_64();
> + devfreq->last_time = get_jiffies_64();
> devfreq->total_trans = 0;
> spin_unlock(&devfreq->stats_lock);
> }
> diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
> index a344e0be99f3..2ddf25993f7d 100644
> --- a/include/linux/devfreq.h
> +++ b/include/linux/devfreq.h
> @@ -134,7 +134,7 @@ struct devfreq_dev_profile {
> * @total_trans: Number of devfreq transitions
> * @trans_table: Statistics of devfreq transitions
> * @time_in_state: Statistics of devfreq states
> - * @last_stat_updated: The last time stat updated
> + * @last_time: The last time stats were updated
> * @stats_lock: Lock protecting trans_table, time_in_state, last_time
> * and total_trans used for statistics
> * @transition_notifier_list: list head of DEVFREQ_TRANSITION_NOTIFIER notifier
> @@ -177,7 +177,7 @@ struct devfreq {
> unsigned int total_trans;
> unsigned int *trans_table;
> u64 *time_in_state;
> - unsigned long long last_stat_updated;
> + unsigned long long last_time;
> spinlock_t stats_lock;
>
> struct srcu_notifier_head transition_notifier_list;
>