cpuidle: Remove unnecessary TIF_NR_POLLING clear/TIF_NEED_RESCHED folding
cover cpuidle: Remove unnecessary TIF_NR_POLLING clear/TIF_NEED_RESCHED folding
Hi Rafael,
Those are cpuidle patches that you acked from a previous posting. I figured they would be best routed through you so I'm reposting those strict cpuidle bits from the series.
Thanks.
Frederic Weisbecker (2):
cpuidle: Remove unnecessary current_clr_polling_and_test() from
haltpoll
cpuidle: Remove unnecessary current_clr_polling() on poll_idle()
drivers/cpuidle/cpuidle-haltpoll.c | 5 +---- drivers/cpuidle/poll_state.c | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-)
Signature · 1 line
2.42.1
PATCH 1/2 cpuidle: Remove unnecessary current_clr_polling_and_test() from haltpoll
When cpuidle drivers ->enter() callback are called, the TIF_NR_POLLING flag is cleared already and TIF_NEED_RESCHED checked by call_cpuidle().
Therefore calling current_clr_polling_and_test() is redundant here and further setting of TIF_NEED_RESCHED will result in an IPI and thus an idle loop exit. This call can be safely removed.
--- drivers/cpuidle/cpuidle-haltpoll.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/cpuidle/cpuidle-haltpoll.c +1 -4
@@ -28,11 +28,8 @@ static enum cpuhp_state haltpoll_hp_state;static int default_enter_idle (struct cpuidle_device *dev,struct cpuidle_driver *drv,int index) { -if (current_clr_polling_and_test ()) { -local_irq_enable (); -return index; - }arch_cpu_idle (); +return index; }
Signature · 1 line
2.42.1
PATCH 2/2 cpuidle: Remove unnecessary current_clr_polling() on poll_idle()
In reply to Frederic WeisbeckerThere is no point in clearing TIF_NR_POLLING and folding TIF_NEED_RESCHED upon poll_idle() exit because cpuidle_idle_call() is going to set again TIF_NR_POLLING anyway. Also if TIF_NEED_RESCHED is set, it will be folded and TIF_NR_POLLING will be cleared at the end of do_idle().
--- drivers/cpuidle/poll_state.c | 2 -- 1 file changed, 2 deletions(-)
drivers/cpuidle/poll_state.c +0 -2
@@ -40,8 +40,6 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev, }raw_local_irq_disable (); -current_clr_polling (); -return index; }
Signature · 1 line
2.42.1
Re: [PATCH 2/2] cpuidle: Remove unnecessary current_clr_polling() on poll_idle()
Quoted 7 lines · Frederic Weisbecker
There is no point in clearing
TIF_NR_POLLINGand foldingTIF_NEED_RESCHEDuponpoll_idle()exit becausecpuidle_idle_call()is going to set againTIF_NR_POLLINGanyway. Also ifTIF_NEED_RESCHEDis set, it will be folded andTIF_NR_POLLINGwill be cleared at the end ofdo_idle().Signed-off-by Frederic Weisbecker <[email protected]>
Please discard this one, I'm taking a new way to deal with that.
Thanks.
Quoted 20 lines
--- drivers/cpuidle/poll_state.c | 2 -- 1 file changed, 2 deletions(-)drivers/cpuidle/poll_state.c +0
-2@@ -40,8 +40,6 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev, }raw_local_irq_disable (); -current_clr_polling (); -return index; }Signature · 1 line
2.42.1