PM / devfreq: cache the last call to get_dev_status()
Quoted 7 lines
The return value of
get_dev_status()can be reused. Cache it so that other parts of the kernel can reuse it instead of having to call the same function again.Cc MyungJoo Ham <[email protected]>Cc Kyungmin Park <[email protected]>Signed-off-by Javi Merino <[email protected]>
Your patch introduces build errors if you try to compile governors as modules. Please fix it.
And..
Review
Quoted 4 lines
(quoted diff) +4
-0+int devfreq_update_stats(struct devfreq *df) +{ + return df->profile->get_dev_status(df->dev.parent, &df->last_status); +}
This seems a good candidate for a macro or a static inline function.
Modifications in governor_simpleondemand.c looks good.
Please add some explanations at the definition of devfreq_update_stats() as well in devfreq.c
Cheers,
MyungJoo.
Quoted 10 lines · MyungJoo Ham
Quoted 7 lines
The return value of
get_dev_status()can be reused. Cache it so that other parts of the kernel can reuse it instead of having to call the same function again.Cc MyungJoo Ham <[email protected]>Cc Kyungmin Park <[email protected]>Signed-off-by Javi Merino <[email protected]>Your patch introduces build errors if you try to compile governors as modules. Please fix it.
Ok, with your suggestion to make devfreq_update_stats() a static inline function this will be solved. Sorry for that.
Quoted 6 lines
And..
Review
Quoted 4 lines
(quoted diff) +4
-0+int devfreq_update_stats(struct devfreq *df) +{ + return df->profile->get_dev_status(df->dev.parent, &df->last_status); +}This seems a good candidate for a macro or a static inline function.
I'll turn it into a static inline function in <linux/devfreq.h>
Quoted 1 line
Modifications in
governor_simpleondemand.clooks good.
Ok, so you are happy with this only working for that governor?
Quoted 2 lines
Please add some explanations at the definition of
devfreq_update_stats()as well indevfreq.c
I'll add kerneldoc for it. Cheers,
Javi