aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
Commit message (Collapse)AuthorAge
* Move wakeup transition to TASK_RUNNING to pluginGlenn Elliott2014-03-07
| | | | | | This patch moves the task state transition to TASK_RUNNING for task wakup to the plugin, when the ready queue lock has been acquired.
* Fix logic bug in GPUSync modifications.Glenn Elliott2014-03-03
|
* Add nvidia tasklet and workqueue tracingGlenn Elliott2014-03-03
| | | | | This patch adds calls to trace tasklet/workqueue releases, begin-execution, and end-execution events.
* Update/cleanup lockdep to support nested locksGlenn Elliott2014-03-03
| | | | | | | | | This patch modifies lockdep to support nested locking protocols--specifically allow keys allocated in dynamic memory. We need to allow spinlocks to be acquired in a nested fashion without triggering complaints from lockdep. This is needed to support chained/transitive priority inheritance.
* Fix compilation bug when GPUs and klmirqd are usedGlenn Elliott2014-03-03
| | | | | A few definitions were missing or misplaced. This patch puts them in the right places.
* Add more robust budget tracking/enforcement.Glenn Elliott2014-03-03
| | | | | | | | This patch adds more feature-rich budget tracking/enforcement features. Budget tracking is now controlled by a state machine. Each task can elect to use a different budget policy. Hooks are in place to implement bandwidth inheritance (BWI) and virtually exclusive resources.
* Add auxiliary task support.Glenn Elliott2014-03-03
| | | | | | | | | | Auxiliary tasks helper threads to real-time tasks. These helper tasks may inherit the priority of the real-time task(s) in the process only if that real-time task is blocked/suspended (and it is not suspending because the job has completed). Otherwise, these threads are scheduled with a default priority greater than normal Linux threads, but lower than any other real-time task, including klmirqd threads.
* Add klmirqd interrupt handling (w/ GPU support)Glenn Elliott2014-03-03
| | | | | | | | | | This patch adds klmirqd, which can be used to implement real-time threaded interrupt handling and workqueue handling. Patch includes added hooks into Linux's interrrupt/tasklet/workqueue implementations. This patch also includes interrupt handling and work queue handling for GPU tasklets and work_structs.
* hrtimer: Ignore hrtimer requeue when not in CB.Glenn Elliott2014-03-03
| | | | | | | | | | | | This patch removes a BUG_ON in the hrtimer root callback. Allows the hook to be called when not actually in the callback state. A BUG_ON forbid this state when a timer needed to be rearmed. Instead, we just ignore the rearm gracefully. This feature is needed for budget enforcement under bandwidth-inheritance.
* Postpone deallocation of LITMUS^RT per-task state in sched_setscheduler()Bjoern Brandenburg2014-01-13
|
* Make LITMUS^RT the highest-priority scheduling class againBjoern Brandenburg2014-01-13
| | | | | | | | | | | | The existing LITMUS^RT code assumes that it is called as the highest-priority scheduling class (this was true before stock Linux gained stop_sched_class). The port to 3.10 changed this, which can result in rare crashes. This patch makes LITMUS^RT the top scheduling class again. Having higher priority than stop_sched_class makes no real sense, but this was the case in 3.0 also and is required for the existing code to work correctly.
* Force LITMUS^RT tasks to become regular Linux tasks before exitingBjoern Brandenburg2014-01-13
| | | | | | This reduces the number of ways in which a real-time task can exit to one (via sched_setscheduler), which makes it easier to avoid nasty corner cases.
* Protect LITMUS^RT tasks from re-nicingBjoern Brandenburg2013-08-07
| | | | | Assigning a nice value to LITMUS^RT tasks is meaningless. Bail out early.
* Don't call set_tsk_need_resched() on remote LITMUS^RT taskBjoern Brandenburg2013-08-07
| | | | | This patch fixes a BUG_ON() in litmus/preempt.c:33 reported by Felipe Cerqueira & Manohar Vanga.
* Hook into rt scheduling class to protect LITMUS^RT tasksBjoern Brandenburg2013-08-07
| | | | | | The rt scheduling class thinks it's the highest-priority scheduling class around. It is not in LITMUS^RT. Don't go preempting remote cores that run SCHED_LITMUS tasks.
* Don't trigger load balancer in scheduler tick for LITMUS^RTBjoern Brandenburg2013-08-07
|
* Cache 'prev' in LITMUS^RT runqueueBjoern Brandenburg2013-08-07
| | | | | | LITMUS^RT plugins like to know who 'prev' is. pick_next_task() doesn't expose that info, so we just cache prev in the runqueue. Could robably be replaced by looking at 'current' instead.
* Hook into finish_switch()Bjoern Brandenburg2013-08-07
| | | | To keep track of stack usage and to notify plugin, if necessary.
* Reset SCHED_LITMUS scheduling class on forkBjoern Brandenburg2013-08-07
|
* Block sched_setaffinity() for SCHED_LITMUS tasksBjoern Brandenburg2013-08-07
|
* Integrate LITMUS^RT scheduling class with sched_setschedulerBjoern Brandenburg2013-08-07
|
* Disable cut-to-CFS optimization in Linux schedulerBjoern Brandenburg2013-08-07
| | | | | Global plugins require that the plugin be called even if there currently is no real-time task executing on the local core.
* Integrate LITMUS^RT with try_to_wake_up() pathBjoern Brandenburg2013-08-07
|
* Splice LITMUS^RT scheduling class into scheduler hierarchy above rt classBjoern Brandenburg2013-08-07
| | | | | Below stop_machine tasks, as such tasks never arise during normal operation.
* Call LITMUS^RT tick function from Linux tickBjoern Brandenburg2013-08-07
|
* Add LITMUS^RT scheduling class in kernel/sched/MakefileBjoern Brandenburg2013-08-07
|
* Introduce LITMUS^RT runqueue dummy into struct rqBjoern Brandenburg2013-08-07
|
* Integrate SRP ceiling blocking callback with Linux schedulerBjoern Brandenburg2013-08-07
| | | | Check whether a suspension is required at end of schedule().
* Hookup sched_trace_XXX() tracing in Linux schedulerBjoern Brandenburg2013-08-07
| | | | This patch adds context switch tracing to the main Linux scheduler.
* Augment rt_task() with is_realtime()Bjoern Brandenburg2013-08-07
| | | | | | | | | | | Whenever the kernel checks for rt_task() to avoid delaying real-time tasks, we want it to also not delay LITMUS^RT tasks. Hence, most calls to rt_task() should be matched by an equivalent call to is_realtime(). Notably, this affects the implementations of select() and nanosleep(), which use timer_slack_ns when setting up timers for non-real-time tasks.
* Hook into fork(), exec(), and exit()Felipe Cerqueira2013-08-07
| | | | | Allow LITMUS^RT to do some work when a process is created or terminated.
* Call sched_state_task_picked() from pick_next_task_stop()Bjoern Brandenburg2013-08-07
| | | | | Otherwise, the scheduler state machine becomes confused (and goes into a rescheduling loop) when stop-machine is triggered.
* Integrate preemption state machine with Linux schedulerBjoern Brandenburg2013-08-07
| | | | Track when a processor is going to schedule "soon".
* Add LITMUS^RT core implementationBjoern Brandenburg2013-08-07
| | | | | | | | | | | | | This patch adds the core of LITMUS^RT: - library functionality (heaps, rt_domain, prioritization, etc.) - budget enforcement logic - job management - system call backends - virtual devices (control page, etc.) - scheduler plugin API (and dummy plugin) This code compiles, but is not yet integrated with the rest of Linux.
* Add hrtimer_start_on() supportFelipe Cerqueira2013-08-07
| | | | | | This patch adds hrtimer_start_on(), which allows arming timers on remote CPUs. This is needed to avoided timer interrupts on "shielded" CPUs and is also useful for implementing semi-partitioned schedulers.
* Add TRACE() debug tracing supportBjoern Brandenburg2013-08-07
| | | | This patch adds the infrastructure for the TRACE() debug macro.
* Add quantum aligment codeFelipe Cerqueira2013-08-07
| | | | Enable staggered ticks for PD^2.
* Add SCHED, SCHED2, TICK, and CXS overhead tracepointsBjoern Brandenburg2013-08-07
| | | | | | | This patch integrates the overhead tracepoints into the Linux scheduler that are compatible with plain vanilla Linux (i.e., not specific to LITMUS^RT plugins). This can be used to measure the overheads of an otherwise unmodified kernel.
* Integrate ft_irq_fired() with LinuxBjoern Brandenburg2013-08-07
| | | | | This patch hooks up Feather-Trace's ft_irq_fired() handler with Linux's interrupt handling infrastructure.
* tracing: Remove locking trace_types_lock from tracing_reset_all_online_cpus()Steven Rostedt (Red Hat)2013-08-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 09d8091c024ec88d1541d93eb8ddb2bd5cf10c39 upstream. Commit a82274151af "tracing: Protect ftrace_trace_arrays list in trace_events.c" added taking the trace_types_lock mutex in trace_events.c as there were several locations that needed it for protection. Unfortunately, it also encapsulated a call to tracing_reset_all_online_cpus() which also takes the trace_types_lock, causing a deadlock. This happens when a module has tracepoints and has been traced. When the module is removed, the trace events module notifier will grab the trace_types_lock, do a bunch of clean ups, and also clears the buffer by calling tracing_reset_all_online_cpus. This doesn't happen often which explains why it wasn't caught right away. Commit a82274151af was marked for stable, which means this must be sent to stable too. Link: http://lkml.kernel.org/r/51EEC646.7070306@broadcom.com Reported-by: Arend van Spril <arend@broadcom.com> Tested-by: Arend van Spriel <arend@broadcom.com> Cc: Alexander Z Lam <azl@google.com> Cc: Vaibhav Nagarnaik <vnagarnaik@google.com> Cc: David Sharp <dhsharp@google.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tracing: Kill the unbalanced tr->ref++ in tracing_buffers_open()Oleg Nesterov2013-08-04
| | | | | | | | | | | | | | | | | | | | | | | | commit e70e78e3c83b536730e31231dd9b979768d8df3c upstream. tracing_buffers_open() does trace_array_get() and then it wrongly inrcements tr->ref again under trace_types_lock. This means that every caller leaks trace_array: # cd /sys/kernel/debug/tracing/ # mkdir instances/X # true < instances/X/per_cpu/cpu0/trace_pipe_raw # rmdir instances/X rmdir: failed to remove `instances/X': Device or resource busy Link: http://lkml.kernel.org/r/20130719153644.GA18899@redhat.com Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tracing: Miscellaneous fixes for trace_array ref countingAlexander Z Lam2013-08-04
| | | | | | | | | | | | | | | | | commit f77d09a384676bde6445413949d9d2c508ff3e62 upstream. Some error paths did not handle ref counting properly, and some trace files need ref counting. Link: http://lkml.kernel.org/r/1374171524-11948-1-git-send-email-azl@google.com Signed-off-by: Alexander Z Lam <azl@google.com> Cc: Vaibhav Nagarnaik <vnagarnaik@google.com> Cc: David Sharp <dhsharp@google.com> Cc: Alexander Z Lam <lambchop468@gmail.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tracing: Fix error handling to ensure instances can always be removedAlexander Z Lam2013-08-04
| | | | | | | | | | | | | | | | | | | | commit 609e85a70bcd0eedf4ec60639dbcfb1ab011e054 upstream. Remove debugfs directories for tracing instances during creation if an error occurs causing the trace_array for that instance to not be added to ftrace_trace_arrays. If the directory continues to exist after the error, it cannot be removed because the respective trace_array is not in ftrace_trace_arrays. Link: http://lkml.kernel.org/r/1373502874-1706-2-git-send-email-azl@google.com Signed-off-by: Alexander Z Lam <azl@google.com> Cc: Vaibhav Nagarnaik <vnagarnaik@google.com> Cc: David Sharp <dhsharp@google.com> Cc: Alexander Z Lam <lambchop468@gmail.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* hrtimers: Move SMP function call to thread contextThomas Gleixner2013-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 5ec2481b7b47a4005bb446d176e5d0257400c77d upstream. smp_call_function_* must not be called from softirq context. But clock_was_set() which calls on_each_cpu() is called from softirq context to implement a delayed clock_was_set() for the timer interrupt handler. Though that almost never gets invoked. A recent change in the resume code uses the softirq based delayed clock_was_set to support Xens resume mechanism. linux-next contains a new warning which warns if smp_call_function_* is called from softirq context which gets triggered by that Xen change. Fix this by moving the delayed clock_was_set() call to a work context. Reported-and-tested-by: Artem Savkov <artem.savkov@gmail.com> Reported-by: Sasha Levin <sasha.levin@oracle.com> Cc: David Vrabel <david.vrabel@citrix.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: H. Peter Anvin <hpa@zytor.com>, Cc: Konrad Wilk <konrad.wilk@oracle.com> Cc: John Stultz <john.stultz@linaro.org> Cc: xen-devel@lists.xen.org Cc: stable@vger.kernel.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* PM / Sleep: avoid 'autosleep' in shutdown progressLiu ShuoX2013-07-28
| | | | | | | | | | | | | | | | | | | | | | | | commit e5248a111bf4048a9f3fab1a9c94c4630a10592a upstream. Prevent automatic system suspend from happening during system shutdown by making try_to_suspend() check system_state and return immediately if it is not SYSTEM_RUNNING. This prevents the following breakage from happening (scenario from Zhang Yanmin): Kernel starts shutdown and calls all device driver's shutdown callback. When a driver's shutdown is called, the last wakelock is released and suspend-to-ram starts. However, as some driver's shut down callbacks already shut down devices and disabled runtime pm, the suspend-to-ram calls driver's suspend callback without noticing that device is already off and causes crash. [rjw: Changelog] Signed-off-by: Liu ShuoX <shuox.liu@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tracing: Add trace_array_get/put() to event handlingSteven Rostedt (Red Hat)2013-07-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 8e2e2fa47129532a30cff6c25a47078dc97d9260 upstream. Commit a695cb58162 "tracing: Prevent deleting instances when they are being read" tried to fix a race between deleting a trace instance and reading contents of a trace file. But it wasn't good enough. The following could crash the kernel: # cd /sys/kernel/debug/tracing/instances # ( while :; do mkdir foo; rmdir foo; done ) & # ( while :; do echo 1 > foo/events/sched/sched_switch 2> /dev/null; done ) & Luckily this can only be done by root user, but it should be fixed regardless. The problem is that a delete of the file can happen after the write to the event is opened, but before the enabling happens. The solution is to make sure the trace_array is available before succeeding in opening for write, and incerment the ref counter while opened. Now the instance can be deleted when the events are writing to the buffer, but the deletion of the instance will disable all events before the instance is actually deleted. Reported-by: Alexander Lam <azl@google.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tracing: Fix race between deleting buffer and setting eventsSteven Rostedt (Red Hat)2013-07-25
| | | | | | | | | | | | | | | | | commit 2a6c24afab70dbcfee49f4c76e1511eec1a3298b upstream. While analyzing the code, I discovered that there's a potential race between deleting a trace instance and setting events. There are a few races that can occur if events are being traced as the buffer is being deleted. Mostly the problem comes with freeing the descriptor used by the trace event callback. To prevent problems like this, the events are disabled before the buffer is deleted. The problem with the current solution is that the event_mutex is let go between disabling the events and freeing the files, which means that the events could be enabled again while the freeing takes place. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tracing: Get trace_array ref counts when accessing trace filesSteven Rostedt (Red Hat)2013-07-25
| | | | | | | | | | | | commit 7b85af63034818e43aee6c1d7bf1c7c6796a9073 upstream. When a trace file is opened that may access a trace array, it must increment its ref count to prevent it from being deleted. Reported-by: Alexander Lam <azl@google.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tracing: Add trace_array_get/put() to handle instance refs betterSteven Rostedt (Red Hat)2013-07-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit ff451961a8b2a17667a7bfa39c86fb9b351445db upstream. Commit a695cb58162 "tracing: Prevent deleting instances when they are being read" tried to fix a race between deleting a trace instance and reading contents of a trace file. But it wasn't good enough. The following could crash the kernel: # cd /sys/kernel/debug/tracing/instances # ( while :; do mkdir foo; rmdir foo; done ) & # ( while :; do cat foo/trace &> /dev/null; done ) & Luckily this can only be done by root user, but it should be fixed regardless. The problem is that a delete of the file can happen after the reader starts to open the file but before it grabs the trace_types_mutex. The solution is to validate the trace array before using it. If the trace array does not exist in the list of trace arrays, then it returns -ENODEV. There's a possibility that a trace_array could be deleted and a new one created and the open would open its file instead. But that is very minor as it will just return the data of the new trace array, it may confuse the user but it will not crash the system. As this can only be done by root anyway, the race will only occur if root is deleting what its trying to read at the same time. Reported-by: Alexander Lam <azl@google.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tracing: Protect ftrace_trace_arrays list in trace_events.cAlexander Z Lam2013-07-25
| | | | | | | | | | | | | | | | | commit a82274151af2b075163e3c42c828529dee311487 upstream. There are multiple places where the ftrace_trace_arrays list is accessed in trace_events.c without the trace_types_lock held. Link: http://lkml.kernel.org/r/1372732674-22726-1-git-send-email-azl@google.com Signed-off-by: Alexander Z Lam <azl@google.com> Cc: Vaibhav Nagarnaik <vnagarnaik@google.com> Cc: David Sharp <dhsharp@google.com> Cc: Alexander Z Lam <lambchop468@gmail.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>