lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Mon, 15 Sep 2014 14:22:00 +0530 From: Preeti U Murthy <preeti@...ux.vnet.ibm.com> To: Michael Ellerman <mpe@...erman.id.au> CC: mikey@...ling.org, linux-pm@...r.kernel.org, rjw@...ysocki.net, linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org Subject: Re: [PATCH] cpuidle/powernv: Enter fastsleep on checking if deep idle states are allowed On 09/15/2014 12:29 PM, Michael Ellerman wrote: > On Fri, 2014-09-12 at 16:31 +0530, Preeti U Murthy wrote: >> Today the procfs interface /proc/sys/kernel/powersave-nap is used to control >> entry into deep idle states beyond snooze. Check for the value of this >> parameter before entering fastsleep. We already do this check for nap in >> power7_idle(). >> >> Signed-off-by: Preeti U Murthy <preeti@...ux.vnet.ibm.com> >> --- >> >> drivers/cpuidle/cpuidle-powernv.c | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/drivers/cpuidle/cpuidle-powernv.c b/drivers/cpuidle/cpuidle-powernv.c >> index a64be57..b8ba52e 100644 >> --- a/drivers/cpuidle/cpuidle-powernv.c >> +++ b/drivers/cpuidle/cpuidle-powernv.c >> @@ -69,6 +69,12 @@ static int fastsleep_loop(struct cpuidle_device *dev, >> unsigned long old_lpcr = mfspr(SPRN_LPCR); >> unsigned long new_lpcr; >> >> + /* >> + * Verify if snooze is the only valid cpuidle state >> + */ >> + if (!(powersave_nap > 0)) >> + return index; >> + >> if (unlikely(system_state < SYSTEM_RUNNING)) >> return index; > > Doesn't the above mean we are just going to keep trying to go into fastsleep > again and again? Or does the idle code work out that it didn't work based on > the fact that we didn't sleep for the right period? Thats right. The idle code figures that its judgment to enter fastsleep was not correct and applies a correction factor to its future decisions . This correction factor is intended to influence the cpuidle governor's decision on choosing an idle state for the cpu based on the history of wakeups. Hence a shallower idle state will be chosen here on in the above circumstance. > > We were talking about getting rid of powersave_nap altogether, but I think we > decided we couldn't, I forget. Isn't this a helpful knob to disable cpuidle at runtime? Currently we check the value of powersave_nap before entering both nap and fastsleep. Regards Preeti U Murthy > > cheers > > > _______________________________________________ > Linuxppc-dev mailing list > Linuxppc-dev@...ts.ozlabs.org > https://lists.ozlabs.org/listinfo/linuxppc-dev > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists