[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <097594b4-fb9a-0c3a-b673-03f092066e68@linaro.org>
Date: Sun, 25 Feb 2018 00:01:08 +0100
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: Vincent Guittot <vincent.guittot@...aro.org>
Cc: Eduardo Valentin <edubezval@...il.com>,
Kevin Wangtao <kevin.wangtao@...aro.org>,
Leo Yan <leo.yan@...aro.org>,
Amit Kachhap <amit.kachhap@...il.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
Javi Merino <javi.merino@...nel.org>,
Zhang Rui <rui.zhang@...el.com>,
Daniel Thompson <daniel.thompson@...aro.org>,
"open list:THERMAL" <linux-pm@...r.kernel.org>,
Viresh Kumar <viresh.kumar@...aro.org>
Subject: Re: [PATCH V2 6/7] thermal/drivers/cpu_cooling: Introduce the cpu
idle cooling driver
On 23/02/2018 16:26, Vincent Guittot wrote:
> Hi Daniel,
>
> On 21 February 2018 at 16:29, Daniel Lezcano <daniel.lezcano@...aro.org> wrote:
>> +
>> +/**
>> + * struct cpuidle_cooling_device - data for the idle cooling device
>> + * @cdev: a pointer to a struct thermal_cooling_device
>> + * @cpumask: a cpumask containing the CPU managed by the cooling device
>> + * @timer: a hrtimer giving the tempo for the idle injection cycles
>> + * @kref: a kernel refcount on this structure
>> + * @count: an atomic to keep track of the last task exiting the idle cycle
>> + * @idle_cycle: an integer defining the duration of the idle injection
>> + * @state: an normalized integer giving the state of the cooling device
>> + */
>> +struct cpuidle_cooling_device {
>> + struct thermal_cooling_device *cdev;
>> + struct cpumask *cpumask;
>> + struct list_head node;
>> + struct hrtimer timer;
>> + struct kref kref;
>> + atomic_t count;
>> + unsigned int idle_cycle;
>> + unsigned int state;
>> +};
>> +
>> +/**
>> + * @tsk: an array of pointer to the idle injection tasks
>> + * @waitq: the waiq for the idle injection tasks
>> + */
>> +struct cpuidle_cooling_tsk {
>> + struct task_struct *tsk;
>> + wait_queue_head_t waitq;
>
> Why are you creating one wait_queue_head_t per cpu instead of one per
> cooling device and then save a pointer in the per cpu struct
> cpuidle_cooling_tsk ?
> Then, you can use wake_up_interruptible_all() to wake up all threads
> instead of using for_each_cpu ... wake_up_process() loop in
> cpuidle_cooling_wakeup() ?
Yes, that should do the trick. I will give it a try.
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
Powered by blists - more mailing lists