From: Preeti U Murthy <preeti@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>,
Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: Lists linaro-kernel <linaro-kernel@lists.linaro.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
LKML <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 1/2] PPC: powernv: remove redundant cpuidle_idle_call()
Date: Mon, 10 Feb 2014 09:15:04 +0530 [thread overview]
Message-ID: <52F84B40.8090403@linux.vnet.ibm.com> (raw)
In-Reply-To: <20140207124140.GB9987@twins.programming.kicks-ass.net>
Hi Peter,
On 02/07/2014 06:11 PM, Peter Zijlstra wrote:
> On Fri, Feb 07, 2014 at 05:11:26PM +0530, Preeti U Murthy wrote:
>> But observe the idle state "snooze" on powerpc. The power that this idle
>> state saves is through the lowering of the thread priority of the CPU.
>> After it lowers the thread priority, it is done. It cannot
>> "wait_for_interrupts". It will exit my_idle(). It is now upto the
>> generic idle loop to increase the thread priority if the need_resched
>> flag is set. Only an interrupt routine can increase the thread priority.
>> Else we will need to do it explicitly. And in such states which have a
>> polling nature, the cpu will not receive a reschedule IPI.
>>
>> That is why in the snooze_loop() we poll on need_resched. If it is set
>> we up the priority of the thread using HMT_MEDIUM() and then exit the
>> my_idle() loop. In case of interrupts, the priority gets automatically
>> increased.
>
> You can poll without setting TS_POLLING/TIF_POLLING_NRFLAGS just fine
> and get the IPI if that is what you want.
>
> Depending on how horribly unprovisioned the thread gets at the lowest
> priority, that might actually be faster than polling and raising the
> prio whenever it does get ran.
So I am assuming you mean something like the below:
my_idle()
{
local_irq_enable();
/* Remove the setting of the polling flag */
HMT_low();
return index;
}
And then exit into the generic idle loop. But the issue I see here is
that the TS_POLLING/TIF_POLLING_NRFLAGS gets set immediately. So, if on
testing need_resched() immediately after this returns that the
TIF_NEED_RESCHED flag is set, the thread will exit at low priority right?
We could raise the priority of the thread in arch_cpu_idle_exit() soon
after setting the polling flag but that would mean for cases where the
TIF_NEED_RESCHED flag is not set we unnecessarily raise the priority of
the thread.
Thanks
Regards
Preeti U Murthy
>
next prev parent reply other threads:[~2014-02-10 3:48 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-06 14:16 [PATCH 1/2] PPC: powernv: remove redundant cpuidle_idle_call() Nicolas Pitre
2014-02-06 14:16 ` [PATCH 2/2] ARM64: " Nicolas Pitre
2014-02-06 14:20 ` Thomas Gleixner
2014-02-06 15:59 ` Preeti U Murthy
2014-02-06 16:09 ` Nicolas Pitre
2014-02-06 16:20 ` Daniel Lezcano
2014-02-07 9:50 ` Catalin Marinas
2014-02-06 14:20 ` [PATCH 1/2] PPC: " Thomas Gleixner
2014-02-06 15:56 ` Preeti U Murthy
2014-02-06 16:25 ` Daniel Lezcano
2014-02-06 16:49 ` Preeti U Murthy
2014-02-07 1:17 ` Nicolas Pitre
2014-02-07 5:27 ` Preeti U Murthy
2014-02-07 10:48 ` Nicolas Pitre
2014-02-07 11:41 ` Preeti U Murthy
2014-02-07 12:41 ` Peter Zijlstra
2014-02-10 3:45 ` Preeti U Murthy [this message]
2014-02-07 7:01 ` Preeti U Murthy
2014-02-07 9:45 ` Deepthi Dharwar
2014-02-07 11:00 ` Preeti U Murthy
2014-02-14 11:17 ` Preeti U Murthy
2014-02-14 11:25 ` Deepthi Dharwar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52F84B40.8090403@linux.vnet.ibm.com \
--to=preeti@linux.vnet.ibm.com \
--cc=daniel.lezcano@linaro.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mingo@redhat.com \
--cc=nicolas.pitre@linaro.org \
--cc=peterz@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).