[lkml]   [2015]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH -v5 6/5] context_tracking: fix exception_enter when already in IN_KERNEL
If exception_enter happens when already in IN_KERNEL state, the
code still calls context_tracking_exit, which ends up in
rcu_eqs_exit_common, which explodes with a WARN_ON when it is
called in a situation where dynticks are not enabled.

This can be avoided by having exception_enter only switch to
IN_KERNEL state if the current state is not already IN_KERNEL.

Signed-off-by: Rik van Riel <>
Reported-by: Luiz Capitulino <>
Frederic, you will want this "bonus" patch, too :)

Thanks to Luiz for finding this one. Whatever I was running did not
trigger this issue...

include/linux/context_tracking.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h
index b65fd1420e53..9da230406e8c 100644
--- a/include/linux/context_tracking.h
+++ b/include/linux/context_tracking.h
@@ -37,7 +37,8 @@ static inline enum ctx_state exception_enter(void)
return 0;

prev_ctx = this_cpu_read(context_tracking.state);
- context_tracking_exit(prev_ctx);
+ if (prev_ctx != IN_KERNEL)
+ context_tracking_exit(prev_ctx);

return prev_ctx;

 \ /
  Last update: 2015-02-11 21:21    [W:0.135 / U:0.776 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site