From: Peter Zijlstra <peterz@infradead.org>
To: rjw@rjwysocki.net, bp@alien8.de
Cc: x86@kernel.org, tony.luck@intel.com, lenb@kernel.org,
daniel.lezcano@linaro.org, linux-kernel@vger.kernel.org,
linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org,
ulf.hansson@linaro.org, paulmck@kernel.org, tglx@linutronix.de,
naresh.kamboju@linaro.org, peterz@infradead.org
Subject: [RFC][PATCH 2/4] acpi: Use CPUIDLE_FLAG_TLB_FLUSHED
Date: Tue, 15 Sep 2020 12:31:59 +0200 [thread overview]
Message-ID: <20200915103806.348668768@infradead.org> (raw)
In-Reply-To: 20200915103157.345404192@infradead.org
Make acpi_processor_idle() use the generic TLB flushing code.
This again removes RCU usage after rcu_idle_enter().
(XXX make every C3 invalidate TLBs, not just C3-BM)
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
arch/ia64/include/asm/acpi.h | 2 --
arch/x86/include/asm/acpi.h | 2 --
drivers/acpi/processor_idle.c | 10 +++++-----
3 files changed, 5 insertions(+), 9 deletions(-)
--- a/arch/ia64/include/asm/acpi.h
+++ b/arch/ia64/include/asm/acpi.h
@@ -74,8 +74,6 @@ static inline void arch_acpi_set_pdc_bit
buf[2] |= ACPI_PDC_EST_CAPABILITY_SMP;
}
-#define acpi_unlazy_tlb(x)
-
#ifdef CONFIG_ACPI_NUMA
extern cpumask_t early_cpu_possible_map;
#define for_each_possible_early_cpu(cpu) \
--- a/arch/x86/include/asm/acpi.h
+++ b/arch/x86/include/asm/acpi.h
@@ -159,8 +159,6 @@ static inline u64 x86_default_get_root_p
extern int x86_acpi_numa_init(void);
#endif /* CONFIG_ACPI_NUMA */
-#define acpi_unlazy_tlb(x) leave_mm(x)
-
#ifdef CONFIG_ACPI_APEI
static inline pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr)
{
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -565,8 +565,6 @@ static DEFINE_RAW_SPINLOCK(c3_lock);
static void acpi_idle_enter_bm(struct acpi_processor *pr,
struct acpi_processor_cx *cx)
{
- acpi_unlazy_tlb(smp_processor_id());
-
/*
* disable bus master
* bm_check implies we need ARB_DIS
@@ -666,6 +664,7 @@ static int acpi_processor_setup_cpuidle_
max_cstate = 1;
for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) {
+ state = &acpi_idle_driver.states[count];
cx = &pr->power.states[i];
if (!cx->valid)
@@ -673,10 +672,11 @@ static int acpi_processor_setup_cpuidle_
per_cpu(acpi_cstate[count], dev->cpu) = cx;
- if (lapic_timer_needs_broadcast(pr, cx)) {
- state = &acpi_idle_driver.states[count];
+ if (lapic_timer_needs_broadcast(pr, cx))
state->flags |= CPUIDLE_FLAG_TIMER_STOP;
- }
+
+ if (cx->type == ACPI_STATE_C3)
+ state->flags |= CPUIDLE_FLAG_TLB_FLUSHED;
count++;
if (count == CPUIDLE_STATE_MAX)
next prev parent reply other threads:[~2020-09-15 10:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-15 10:31 [RFC][PATCH 0/4] Fix up ACPI processor idle vs RCU Peter Zijlstra
2020-09-15 10:31 ` [RFC][PATCH 1/4] acpi: Use CPUIDLE_FLAG_TIMER_STOP Peter Zijlstra
2020-09-15 16:26 ` Rafael J. Wysocki
2020-09-16 15:42 ` peterz
2020-09-16 16:01 ` Borislav Petkov
2020-09-16 17:38 ` Rafael J. Wysocki
2020-09-16 17:38 ` Rafael J. Wysocki
2020-09-22 3:26 ` Guenter Roeck
2020-09-22 19:03 ` Rafael J. Wysocki
2020-09-15 10:31 ` Peter Zijlstra [this message]
2020-09-15 10:32 ` [RFC][PATCH 3/4] cpuidle: Allow cpuidle drivers to take over RCU-idle Peter Zijlstra
2020-09-15 13:20 ` Ulf Hansson
2020-09-15 10:32 ` [RFC][PATCH 4/4] acpi: Take over RCU-idle for C3-BM idle Peter Zijlstra
2020-09-21 9:12 ` Sven Joachim
2020-09-21 10:37 ` [PATCH] rcu/tree: Export rcu_idle_{enter,exit} to module Borislav Petkov
2020-09-21 12:15 ` Rafael J. Wysocki
2020-09-21 13:32 ` Paul E. McKenney
2020-09-21 13:38 ` Rafael J. Wysocki
2020-09-25 15:20 ` [RFC][PATCH 4/4] acpi: Take over RCU-idle for C3-BM idle Guenter Roeck
2020-09-25 15:24 ` Rafael J. Wysocki
2020-09-25 15:29 ` Paul E. McKenney
2020-09-15 18:31 ` [RFC][PATCH 0/4] Fix up ACPI processor idle vs RCU Borislav Petkov
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=20200915103806.348668768@infradead.org \
--to=peterz@infradead.org \
--cc=bp@alien8.de \
--cc=daniel.lezcano@linaro.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=naresh.kamboju@linaro.org \
--cc=paulmck@kernel.org \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=ulf.hansson@linaro.org \
--cc=x86@kernel.org \
/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).