[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230809134837.GM212435@hirez.programming.kicks-ass.net>
Date: Wed, 9 Aug 2023 15:48:37 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Mihai Carabas <mihai.carabas@...cle.com>
Cc: Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Kees Cook <keescook@...omium.org>,
Petr Mladek <pmladek@...e.com>,
Ard Biesheuvel <ardb@...nel.org>,
Sami Tolvanen <samitolvanen@...gle.com>,
Nicholas Piggin <npiggin@...il.com>,
Juerg Haefliger <juerg.haefliger@...onical.com>,
Mickaël Salaün <mic@...ikod.net>,
Joao Martins <joao.m.martins@...cle.com>,
Arnd Bergmann <arnd@...db.de>,
Ankur Arora <ankur.a.arora@...cle.com>,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
kvm@...r.kernel.org, linux-pm@...r.kernel.org
Subject: Re: [PATCH] Enable haltpoll for arm64
On Wed, Aug 09, 2023 at 02:39:34PM +0300, Mihai Carabas wrote:
> Joao Martins (7):
> cpuidle-haltpoll: Make boot_option_idle_override check X86 specific
> x86: Move ARCH_HAS_CPU_RELAX to arch
> x86/kvm: Move haltpoll_want() to be arch defined
> governors/haltpoll: Drop kvm_para_available() check
> arm64: Select ARCH_HAS_CPU_RELAX
> arm64: Define TIF_POLLING_NRFLAG
> cpuidle-haltpoll: ARM64 support
You have far too many SOB's on some or all of these patches.
Using poll_state as is on arm64 seems sub-optimal, would not something
like the below make sense?
---
diff --git a/drivers/cpuidle/poll_state.c b/drivers/cpuidle/poll_state.c
index 9b6d90a72601..9ab40198b042 100644
--- a/drivers/cpuidle/poll_state.c
+++ b/drivers/cpuidle/poll_state.c
@@ -27,7 +27,11 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev,
limit = cpuidle_poll_time(drv, dev);
while (!need_resched()) {
- cpu_relax();
+
+ smp_cond_load_relaxed(current_thread_info()->flags,
+ (VAL & TIF_NEED_RESCHED) ||
+ (loop_count++ >= POLL_IDLE_RELAX_COUNT));
+
if (loop_count++ < POLL_IDLE_RELAX_COUNT)
continue;
Powered by blists - more mailing lists