From: "tip-bot2 for Thomas Gleixner" <tip-bot2@linutronix.de> To: linux-tip-commits@vger.kernel.org Cc: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@kernel.org>, "Paul E. McKenney" <paulmck@kernel.org>, x86 <x86@kernel.org>, LKML <linux-kernel@vger.kernel.org> Subject: [tip: x86/entry] rcu: Provide rcu_irq_exit_check_preempt() Date: Wed, 27 May 2020 08:12:01 -0000 Message-ID: <159056712180.17951.11617155731989917506.tip-bot2@tip-bot2> (raw) In-Reply-To: <20200521202117.089709607@linutronix.de> The following commit has been merged into the x86/entry branch of tip: Commit-ID: 07325d4a90d2d84de45cc07b134fd0f023dbb971 Gitweb: https://git.kernel.org/tip/07325d4a90d2d84de45cc07b134fd0f023dbb971 Author: Thomas Gleixner <tglx@linutronix.de> AuthorDate: Thu, 21 May 2020 22:05:16 +02:00 Committer: Ingo Molnar <mingo@kernel.org> CommitterDate: Tue, 26 May 2020 19:05:11 +02:00 rcu: Provide rcu_irq_exit_check_preempt() Provide a debug check which can be invoked from exception return to kernel mode before an attempt is made to schedule. Warn if RCU is not ready for this. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Paul E. McKenney <paulmck@kernel.org> Link: https://lore.kernel.org/r/20200521202117.089709607@linutronix.de --- include/linux/rcutiny.h | 1 + include/linux/rcutree.h | 6 ++++++ kernel/rcu/tree.c | 18 ++++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index c869fb2..8512cae 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h @@ -72,6 +72,7 @@ static inline void rcu_irq_exit_irqson(void) { } static inline void rcu_irq_enter_irqson(void) { } static inline void rcu_irq_exit(void) { } static inline void rcu_irq_exit_preempt(void) { } +static inline void rcu_irq_exit_check_preempt(void) { } static inline void exit_rcu(void) { } static inline bool rcu_preempt_need_deferred_qs(struct task_struct *t) { diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 9366fa4..d5cc9d6 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h @@ -51,6 +51,12 @@ void rcu_irq_exit_preempt(void); void rcu_irq_enter_irqson(void); void rcu_irq_exit_irqson(void); +#ifdef CONFIG_PROVE_RCU +void rcu_irq_exit_check_preempt(void); +#else +static inline void rcu_irq_exit_check_preempt(void) { } +#endif + void exit_rcu(void); void rcu_scheduler_starting(void); diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index b7f8c49..d8e9dbb 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -765,6 +765,24 @@ void rcu_irq_exit_preempt(void) "RCU in extended quiescent state!"); } +#ifdef CONFIG_PROVE_RCU +/** + * rcu_irq_exit_check_preempt - Validate that scheduling is possible + */ +void rcu_irq_exit_check_preempt(void) +{ + lockdep_assert_irqs_disabled(); + + RCU_LOCKDEP_WARN(__this_cpu_read(rcu_data.dynticks_nesting) <= 0, + "RCU dynticks_nesting counter underflow/zero!"); + RCU_LOCKDEP_WARN(__this_cpu_read(rcu_data.dynticks_nmi_nesting) != + DYNTICK_IRQ_NONIDLE, + "Bad RCU dynticks_nmi_nesting counter\n"); + RCU_LOCKDEP_WARN(rcu_dynticks_curr_cpu_in_eqs(), + "RCU in extended quiescent state!"); +} +#endif /* #ifdef CONFIG_PROVE_RCU */ + /* * Wrapper for rcu_irq_exit() where interrupts are enabled. *
next prev parent reply index Thread overview: 132+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-21 20:05 [patch V9 00/39] x86/entry: Rework leftovers (was part V) Thomas Gleixner 2020-05-21 20:05 ` [patch V9 01/39] nmi, tracing: Make hardware latency tracing noinstr safe Thomas Gleixner 2020-05-27 8:12 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 02/39] rcu: Abstract out rcu_irq_enter_check_tick() from rcu_nmi_enter() Thomas Gleixner 2020-05-21 21:03 ` Paul E. McKenney 2020-05-21 21:25 ` Thomas Gleixner 2020-05-26 8:14 ` Ingo Molnar 2020-05-26 15:34 ` Paul E. McKenney 2020-05-27 8:12 ` [tip: x86/entry] " tip-bot2 for Paul E. McKenney 2020-05-21 20:05 ` [patch V9 03/39] rcu: Provide rcu_irq_exit_check_preempt() Thomas Gleixner 2020-05-27 8:12 ` tip-bot2 for Thomas Gleixner [this message] 2020-05-21 20:05 ` [patch V9 04/39] x86/entry: Provide idtentry_entry/exit_cond_rcu() Thomas Gleixner 2020-05-21 21:06 ` Paul E. McKenney 2020-05-26 8:23 ` Ingo Molnar 2020-05-26 8:58 ` Thomas Gleixner 2020-05-21 20:05 ` [patch V9 05/39] x86/entry: Provide idtentry_enter/exit_user() Thomas Gleixner 2020-05-27 8:12 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 06/39] x86/idtentry: Switch to conditional RCU handling Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 07/39] x86/entry: Cleanup idtentry_enter/exit() leftovers Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] x86/entry: Clean up " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 08/39] genirq: Provide irq_enter/exit_rcu() Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 09/39] genirq: Provide __irq_enter/exit_raw() Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 10/39] x86/entry: Provide helpers for execute on irqstack Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] x86/entry: Provide helpers for executing on the irqstack tip-bot2 for Thomas Gleixner 2020-06-05 17:18 ` [patch V9 10/39] x86/entry: Provide helpers for execute on irqstack Qian Cai 2020-06-05 17:36 ` Peter Zijlstra 2020-06-05 17:52 ` Qian Cai 2020-06-07 11:59 ` Thomas Gleixner 2020-06-07 18:27 ` Qian Cai 2020-06-08 16:01 ` Qian Cai 2020-06-08 22:20 ` Thomas Gleixner 2020-06-09 2:32 ` Qian Cai 2020-06-09 20:33 ` Thomas Gleixner 2020-06-09 20:50 ` Thomas Gleixner 2020-06-10 12:38 ` Qian Cai 2020-06-10 19:38 ` Thomas Gleixner 2020-06-13 13:55 ` Qian Cai 2020-06-13 14:03 ` Thomas Gleixner 2020-06-13 21:41 ` Qian Cai 2020-06-14 8:59 ` Thomas Gleixner 2020-05-21 20:05 ` [patch V9 11/39] x86/entry/64: Move do_softirq_own_stack() to C Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 12/39] x86/entry: Split out idtentry_exit_cond_resched() Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 13/39] x86/entry: Switch XEN/PV hypercall entry to IDTENTRY Thomas Gleixner 2020-05-22 18:32 ` [patch V9-1 " Thomas Gleixner 2020-05-26 7:44 ` Jürgen Groß 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 14/39] x86/entry/64: Simplify idtentry_body Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 15/39] x86/entry: Switch page fault exception to IDTENTRY_RAW Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 16/39] x86/entry: Remove the transition leftovers Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 17/39] x86/entry: Change exit path of xen_failsafe_callback Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 18/39] x86/entry/64: Remove error_exit Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] x86/entry/64: Remove error_exit() tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 19/39] x86/entry/32: Remove common_exception Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] x86/entry/32: Remove common_exception() tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 20/39] x86/irq: Use generic irq_regs implementation Thomas Gleixner 2020-05-26 18:39 ` damian 2020-05-28 9:50 ` Thomas Gleixner 2020-05-28 20:20 ` damian 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 21/39] x86/irq: Convey vector as argument and not in ptregs Thomas Gleixner 2020-05-22 19:34 ` Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-08-24 17:29 ` [patch V9 21/39] " Alexander Graf 2020-08-25 10:28 ` Thomas Gleixner 2020-08-25 23:17 ` Alexander Graf 2020-08-25 23:41 ` Andy Lutomirski 2020-08-26 0:04 ` Alexander Graf 2020-08-26 1:03 ` Brian Gerst 2020-08-26 0:55 ` Thomas Gleixner 2020-05-21 20:05 ` [patch V9 22/39] x86/irq: Rework handle_irq() for 64bit Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] x86/irq: Rework handle_irq() for 64-bit tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 23/39] x86/entry: Add IRQENTRY_IRQ macro Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 24/39] x86/entry: Use idtentry for interrupts Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 25/39] x86/entry: Provide IDTENTRY_SYSVEC Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 26/39] x86/entry: Convert APIC interrupts to IDTENTRY_SYSVEC Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 27/39] x86/entry: Convert SMP system vectors " Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 28/39] x86/entry: Convert various system vectors Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 29/39] x86/entry: Convert KVM vectors to IDTENTRY_SYSVEC* Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 30/39] x86/entry: Convert various hypervisor vectors to IDTENTRY_SYSVEC Thomas Gleixner 2020-05-26 9:29 ` Wei Liu 2020-05-27 1:46 ` Boqun Feng 2020-05-27 8:38 ` Wei Liu 2020-05-27 12:09 ` Wei Liu 2020-05-27 23:06 ` Boqun Feng 2020-05-27 12:30 ` Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 31/39] x86/entry: Convert XEN hypercall vector " Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 32/39] x86/entry: Convert reschedule interrupt to IDTENTRY_SYSVEC_SIMPLE Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 33/39] x86/entry: Remove the apic/BUILD interrupt leftovers Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 34/39] x86/entry/64: Remove IRQ stack switching ASM Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 35/39] x86/entry: Make enter_from_user_mode() static Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 36/39] x86/entry/32: Remove redundant irq disable code Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 37/39] x86/entry/64: Remove TRACE_IRQS_*_DEBUG Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 38/39] x86/entry: Move paranoid irq tracing out of ASM code Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-21 20:05 ` [patch V9 39/39] x86/entry: Remove the TRACE_IRQS cruft Thomas Gleixner 2020-05-27 8:11 ` [tip: x86/entry] " tip-bot2 for Thomas Gleixner 2020-05-22 7:20 ` [patch V9 00/39] x86/entry: Rework leftovers (was part V) Andrew Cooper 2020-05-22 21:17 ` Peter Zijlstra 2020-06-03 19:18 ` Andrew Cooper 2020-06-04 13:25 ` Peter Zijlstra 2020-06-04 13:29 ` Paolo Bonzini 2020-06-04 13:35 ` Peter Zijlstra 2020-06-04 15:42 ` Andy Lutomirski 2020-06-04 15:55 ` Peter Zijlstra 2020-05-22 14:26 ` Boris Ostrovsky 2020-05-22 17:47 ` Thomas Gleixner 2020-05-22 18:08 ` Thomas Gleixner 2020-05-26 4:33 ` Andy Lutomirski
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=159056712180.17951.11617155731989917506.tip-bot2@tip-bot2 \ --to=tip-bot2@linutronix.de \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-tip-commits@vger.kernel.org \ --cc=mingo@kernel.org \ --cc=paulmck@kernel.org \ --cc=tglx@linutronix.de \ --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
LKML Archive on lore.kernel.org Archives are clonable: git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git git clone --mirror https://lore.kernel.org/lkml/9 lkml/git/9.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \ linux-kernel@vger.kernel.org public-inbox-index lkml Example config snippet for mirrors Newsgroup available over NNTP: nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel AGPL code for this site: git clone https://public-inbox.org/public-inbox.git