Thread (27 messages) 27 messages, 5 authors, 2024-08-13

Re: [PATCH v6 01/10] cpuidle/poll_state: poll via smp_cond_load_relaxed()

From: Ankur Arora <hidden>
Date: 2024-08-12 22:37:05
Also in: kvm, linux-pm, lkml

Christoph Lameter (Ampere) [off-list ref] writes:
On Fri, 26 Jul 2024, Ankur Arora wrote:
quoted
diff --git a/drivers/cpuidle/poll_state.c b/drivers/cpuidle/poll_state.c
index 9b6d90a72601..532e4ed19e0f 100644
--- a/drivers/cpuidle/poll_state.c
+++ b/drivers/cpuidle/poll_state.c
@@ -21,21 +21,21 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev,
	raw_local_irq_enable();
	if (!current_set_polling_and_test()) {
-		unsigned int loop_count = 0;
+		unsigned int loop_count;
		u64 limit;
loop_count is only used in the while loop below. So the declaration could be
placed below the while.
That's a good idea. Will fix.
quoted
		limit = cpuidle_poll_time(drv, dev);

		while (!need_resched()) {
-			cpu_relax();
-			if (loop_count++ < POLL_IDLE_RELAX_COUNT)
-				continue;
-
			loop_count = 0;
			if (local_clock_noinstr() - time_start > limit) {
				dev->poll_time_limit = true;
				break;
			}
Looks ok otherwise

Reviewed-by: Christoph Lameter <redacted>
Thanks for the review.

--
ankur
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help