Re: [Query] cpuidle functions cpuidle_install_idle_handler/cpuidle_uninstall_idle_handler

From: Mohammad Merajul Islam Molla
Date: Tue Aug 05 2014 - 04:55:53 EST


ping!

Since its been a while. Anyone has any comment on this? Should I go
ahead submit a patch?

--
Thanks,
-Meraj


On Thu, Jul 24, 2014 at 9:35 PM, Mohammad Merajul Islam Molla
<meraj.enigma@xxxxxxxxx> wrote:
> Hi
>
> In drivers/cpuidle/cpuidle.c, there are two functions
> cpuidle_install_idle_handler & cpuidle_uninstall_idle_handler.
> The names seem confusing to me as they don't install any handler,
> rather set 'initialized' variable to 1/0.
>
> In kernel version 3.0, these functions used to look as below where
> they installed and uninstalled some handler function (pm_idle) -
>
> void cpuidle_install_idle_handler(void)
> {
> if (enabled_devices && (pm_idle != cpuidle_idle_call)) {
> /* Make sure all changes finished before we switch
> to new idle */
> smp_wmb();
> pm_idle = cpuidle_idle_call;
> }
> }
>
> void cpuidle_uninstall_idle_handler(void)
> {
> if (enabled_devices && pm_idle_old && (pm_idle != pm_idle_old)) {
> pm_idle = pm_idle_old;
> cpuidle_kick_cpus();
> }
> }
>
> In recent kernel (3.16.0-rc6) , the code for the two mentioned
> functions looks as below -
>
> /**
> * cpuidle_install_idle_handler - installs the cpuidle idle loop handler
> */
> void cpuidle_install_idle_handler(void)
> {
> if (enabled_devices) {
> /* Make sure all changes finished before we switch to
> new idle */
> smp_wmb();
> initialized = 1;
> }
> }
>
> /**
> * cpuidle_uninstall_idle_handler - uninstalls the cpuidle idle loop
> handler
> */
> void cpuidle_uninstall_idle_handler(void)
> {
> if (enabled_devices) {
> initialized = 0;
> kick_all_cpus_sync();
> }
> }
>
> There is no idle handler (pm_idle) installed/uninstalled anymore.
>
> So should these functions be renamed now to something -
> cpuidle_initialize()/cpuidle_uninitialize()? Also, the comments
> should be removed?
>
>
> --
> Thanks,
> -Meraj
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/