* [PATCH 0/2] cpuidle: Remove unnecessary TIF_NR_POLLING clear/TIF_NEED_RESCHED folding
@ 2023-11-13 22:03 Frederic Weisbecker
2023-11-13 22:03 ` [PATCH 1/2] cpuidle: Remove unnecessary current_clr_polling_and_test() from haltpoll Frederic Weisbecker
2023-11-13 22:03 ` [PATCH 2/2] cpuidle: Remove unnecessary current_clr_polling() on poll_idle() Frederic Weisbecker
0 siblings, 2 replies; 4+ messages in thread
From: Frederic Weisbecker @ 2023-11-13 22:03 UTC (permalink / raw)
To: Rafael J . Wysocki; +Cc: LKML, Frederic Weisbecker, Daniel Lezcano, linux-pm
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(-)
--
2.42.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] cpuidle: Remove unnecessary current_clr_polling_and_test() from haltpoll
2023-11-13 22:03 [PATCH 0/2] cpuidle: Remove unnecessary TIF_NR_POLLING clear/TIF_NEED_RESCHED folding Frederic Weisbecker
@ 2023-11-13 22:03 ` Frederic Weisbecker
2023-11-13 22:03 ` [PATCH 2/2] cpuidle: Remove unnecessary current_clr_polling() on poll_idle() Frederic Weisbecker
1 sibling, 0 replies; 4+ messages in thread
From: Frederic Weisbecker @ 2023-11-13 22:03 UTC (permalink / raw)
To: Rafael J . Wysocki
Cc: LKML, Frederic Weisbecker, Daniel Lezcano, linux-pm,
Marcelo Tosatti
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.
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
drivers/cpuidle/cpuidle-haltpoll.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/cpuidle/cpuidle-haltpoll.c b/drivers/cpuidle/cpuidle-haltpoll.c
index e66df22f9695..b641bc535102 100644
--- a/drivers/cpuidle/cpuidle-haltpoll.c
+++ b/drivers/cpuidle/cpuidle-haltpoll.c
@@ -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;
}
--
2.42.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] cpuidle: Remove unnecessary current_clr_polling() on poll_idle()
2023-11-13 22:03 [PATCH 0/2] cpuidle: Remove unnecessary TIF_NR_POLLING clear/TIF_NEED_RESCHED folding Frederic Weisbecker
2023-11-13 22:03 ` [PATCH 1/2] cpuidle: Remove unnecessary current_clr_polling_and_test() from haltpoll Frederic Weisbecker
@ 2023-11-13 22:03 ` Frederic Weisbecker
2023-11-22 21:01 ` Frederic Weisbecker
1 sibling, 1 reply; 4+ messages in thread
From: Frederic Weisbecker @ 2023-11-13 22:03 UTC (permalink / raw)
To: Rafael J . Wysocki; +Cc: LKML, Frederic Weisbecker, Daniel Lezcano, linux-pm
There 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().
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
drivers/cpuidle/poll_state.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/cpuidle/poll_state.c b/drivers/cpuidle/poll_state.c
index 9b6d90a72601..d5cb3eb85a54 100644
--- a/drivers/cpuidle/poll_state.c
+++ b/drivers/cpuidle/poll_state.c
@@ -40,8 +40,6 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev,
}
raw_local_irq_disable();
- current_clr_polling();
-
return index;
}
--
2.42.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] cpuidle: Remove unnecessary current_clr_polling() on poll_idle()
2023-11-13 22:03 ` [PATCH 2/2] cpuidle: Remove unnecessary current_clr_polling() on poll_idle() Frederic Weisbecker
@ 2023-11-22 21:01 ` Frederic Weisbecker
0 siblings, 0 replies; 4+ messages in thread
From: Frederic Weisbecker @ 2023-11-22 21:01 UTC (permalink / raw)
To: Rafael J . Wysocki; +Cc: LKML, Daniel Lezcano, linux-pm
Le Mon, Nov 13, 2023 at 05:03:26PM -0500, Frederic Weisbecker a écrit :
> There 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().
>
> Acked-by: Rafael J. Wysocki <rafael@kernel.org>
> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Please discard this one, I'm taking a new way to deal with that.
Thanks.
> ---
> drivers/cpuidle/poll_state.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/cpuidle/poll_state.c b/drivers/cpuidle/poll_state.c
> index 9b6d90a72601..d5cb3eb85a54 100644
> --- a/drivers/cpuidle/poll_state.c
> +++ b/drivers/cpuidle/poll_state.c
> @@ -40,8 +40,6 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev,
> }
> raw_local_irq_disable();
>
> - current_clr_polling();
> -
> return index;
> }
>
> --
> 2.42.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-11-22 21:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-13 22:03 [PATCH 0/2] cpuidle: Remove unnecessary TIF_NR_POLLING clear/TIF_NEED_RESCHED folding Frederic Weisbecker
2023-11-13 22:03 ` [PATCH 1/2] cpuidle: Remove unnecessary current_clr_polling_and_test() from haltpoll Frederic Weisbecker
2023-11-13 22:03 ` [PATCH 2/2] cpuidle: Remove unnecessary current_clr_polling() on poll_idle() Frederic Weisbecker
2023-11-22 21:01 ` Frederic Weisbecker
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).