aboutsummaryrefslogtreecommitdiff
path: root/include/linux/context_tracking_state.h
AgeCommit message (Collapse)AuthorFilesLines
2015-11-24context_tracking: Switch to new static_branch APIAndy Lutomirski1-2/+2
This is much less error-prone than the old code. Signed-off-by: Andy Lutomirski <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/812df7e64f120c5c7c08481f36a8caa9f53b2199.1447361906.git.luto@kernel.org Signed-off-by: Ingo Molnar <[email protected]>
2015-07-07context_tracking: Add ct_state() and CT_WARN_ON()Andy Lutomirski1-0/+1
This will let us sprinkle sanity checks around the kernel without making too much of a mess. Signed-off-by: Andy Lutomirski <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Kees Cook <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/5da41fb2ceb29eac671f427c67040401ba2a1fa0.1435952415.git.luto@kernel.org Signed-off-by: Ingo Molnar <[email protected]>
2015-05-07context_tracking: Protect against recursionFrederic Weisbecker1-0/+1
Context tracking recursion can happen when an exception triggers in the middle of a call to a context tracking probe. This special case can be caused by vmalloc faults. If an access to a memory area allocated by vmalloc happens in the middle of context_tracking_enter(), we may run into an endless fault loop because the exception in turn calls context_tracking_enter() which faults on the same vmalloc'ed memory, triggering an exception again, etc... Some rare crashes have been reported so lets protect against this with a recursion counter. Reported-by: Dave Jones <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]> Reviewed-by: Rik van Riel <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Chris Metcalf <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Rafael J . Wysocki <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
2015-03-09kvm,rcu,nohz: use RCU extended quiescent state when running KVM guestRik van Riel1-0/+1
The host kernel is not doing anything while the CPU is executing a KVM guest VCPU, so it can be marked as being in an extended quiescent state, identical to that used when running user space code. The only exception to that rule is when the host handles an interrupt, which is already handled by the irq code, which calls rcu_irq_enter and rcu_irq_exit. The guest_enter and guest_exit functions already switch vtime accounting independent of context tracking. Leave those calls where they are, instead of moving them into the context tracking code. Reviewed-by: Paul E. McKenney <[email protected]> Signed-off-by: Rik van Riel <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Will deacon <[email protected]> Cc: Marcelo Tosatti <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Luiz Capitulino <[email protected]> Cc: Paolo Bonzini <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]>
2015-03-09context_tracking: Add stub context_tracking_is_enabledRik van Riel1-0/+2
With code elsewhere doing something conditional on whether or not context tracking is enabled, we want a stub function that tells us context tracking is not enabled, when CONFIG_CONTEXT_TRACKING is not set. Reviewed-by: Paul E. McKenney <[email protected]> Signed-off-by: Rik van Riel <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Will deacon <[email protected]> Cc: Marcelo Tosatti <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Luiz Capitulino <[email protected]> Cc: Paolo Bonzini <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]>
2015-03-09context_tracking: Rename context symbols to prepare for transition stateFrederic Weisbecker1-3/+3
Current context tracking symbols are designed to express living state. As such they are prefixed with "IN_": IN_USER, IN_KERNEL. Now we are going to use these symbols to also express state transitions such as context_tracking_enter(IN_USER) or context_tracking_exit(IN_USER). But while the "IN_" prefix works well to express entering a context, it's confusing to depict a context exit: context_tracking_exit(IN_USER) could mean two things: 1) We are exiting the current context to enter user context. 2) We are exiting the user context We want 2) but the reviewer may be confused and understand 1) So lets disambiguate these symbols and rename them to CONTEXT_USER and CONTEXT_KERNEL. Acked-by: Rik van Riel <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Will deacon <[email protected]> Cc: Marcelo Tosatti <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Luiz Capitulino <[email protected]> Cc: Paolo Bonzini <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]>
2013-12-02context_tracking: Rename context_tracking_active() to ↵Frederic Weisbecker1-4/+5
context_tracking_cpu_is_enabled() We currently have a confusing couple of API naming with the existing context_tracking_active() and context_tracking_is_enabled(). Lets keep the latter one, context_tracking_is_enabled(), for global context tracking state check and use context_tracking_cpu_is_enabled() for local state check. Signed-off-by: Frederic Weisbecker <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Steven Rostedt <[email protected]>
2013-12-02context_tracking: Wrap static key check into more intuitive function nameFrederic Weisbecker1-0/+4
Use a function with a meaningful name to check the global context tracking state. static_key_false() is a bit confusing for reviewers. Signed-off-by: Frederic Weisbecker <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Steven Rostedt <[email protected]>
2013-08-14context_tracking: Split low level state headersFrederic Weisbecker1-0/+39
We plan to use the context tracking static key on inline vtime APIs. For this we need to include the context tracking headers from those of vtime. However vtime headers need to stay low level because they are included in hardirq.h that mostly contains standalone definitions. But context_tracking.h includes sched.h for a few task_struct references, therefore it wouldn't be sensible to include it from vtime.h To solve this, lets split the context tracking headers and move out the pure state definitions that only require a few low level headers. We can safely include that small part in vtime.h later. Signed-off-by: Frederic Weisbecker <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Li Zhong <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Kevin Hilman <[email protected]>