aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
...
* Hook into hrtimer to report large latenciesBjoern Brandenburg2017-05-26
|
* Patch hrtimer_wakeup() callback to record RELEASE overheadBjoern Brandenburg2017-05-26
|
* Patch hrtimer_wakeup() callback to record RELEASE_LATENCYBjoern Brandenburg2017-05-26
| | | | | | Record interrupt latency for tasks that use nanosleep or some other interface that ends up using a hrtimer_sleeper struct to trigger the wakeup of the task when the next job is released.
* Hook into kernel/exit.c to force exiting RT tasks into best-effort modeBjoern Brandenburg2017-05-26
|
* Protect LITMUS^RT tasks from re-nicingBjoern Brandenburg2017-05-26
| | | | | 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 Brandenburg2017-05-26
| | | | This patch fixes a BUG_ON() in litmus/preempt.c.
* Hook into SCHED_DEADLINE to protect LITMUS^RT tasksBjoern Brandenburg2017-05-26
| | | | | SCHED_DEADLINE should not preempt LITMUS^RT tasks, as the LITMUS^RT scheduling class is positioned above the SCHED_DEADLINE policy.
* Hook into rt scheduling class to protect LITMUS^RT tasksBjoern Brandenburg2017-05-26
| | | | | | The rt scheduling class thinks it's the highest-priority scheduling class around, next to SCHED_DEADLINE. 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 Brandenburg2017-05-26
|
* Hook into finish_switch()Bjoern Brandenburg2017-05-26
| | | | To keep track of stack usage and to notify plugin, if necessary.
* Reset SCHED_LITMUS scheduling class on forkBjoern Brandenburg2017-05-26
|
* Block sched_setaffinity() for SCHED_LITMUS tasksBjoern Brandenburg2017-05-26
|
* Disable cut-to-CFS optimization in Linux schedulerBjoern Brandenburg2017-05-26
| | | | | Global plugins require that the plugin be called even if there currently is no real-time task executing on the local core.
* Hook into fork(), exec(), and exit()Bjoern Brandenburg2017-05-26
| | | | | Allow LITMUS^RT to do some work when a process is created or terminated.
* Integrate LITMUS^RT scheduling class with sched_setschedulerBjoern Brandenburg2017-05-26
|
* Integrate LITMUS^RT with try_to_wake_up() pathBjoern Brandenburg2017-05-26
|
* Make LITMUS^RT scheduling class the highest-priority scheduling classBjoern Brandenburg2017-05-26
| | | | | | Needs to be above stop_machine_class for legacy reasons; the main plugins were developed before stop_machine_class was introduced and assume that they are the highest-priority scheduling class.
* Add LITMUS^RT scheduling class in kernel/sched/MakefileBjoern Brandenburg2017-05-26
|
* Introduce LITMUS^RT runqueue dummy into struct rqBjoern Brandenburg2017-05-26
|
* Hookup sched_trace_XXX() tracing in Linux schedulerBjoern Brandenburg2017-05-26
| | | | This patch adds context switch tracing to the main Linux scheduler.
* Augment rt_task() with is_realtime()Bjoern Brandenburg2017-05-26
| | | | | | | | | | | 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 __schedule() to set litmus_preemption_in_progressBjoern Brandenburg2017-05-26
|
* Call sched_state_task_picked() from pick_next_task_stop()Bjoern Brandenburg2017-05-26
| | | | | 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 Brandenburg2017-05-26
| | | | Track when a processor is going to schedule "soon".
* Add LITMUS^RT core implementationBjoern Brandenburg2017-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Squashed changes: LITMUS^RT Core: add get_current_budget() system call Allow userspace to figure out the used-up and remaining budget of a task. Adds deadline field to control page and updates it when setting up jobs for release. Adds control page deadline offset ftdev: respect O_NONBLOCK flag in ftdev_read() Don't block if userspace wants to go on doing something else. Export job release time and job sequence number in ctrl page Add alternate complete_job() default implementation Let jobs sleep like regular Linux tasks by suspending and waking them with a one-shot timer. Plugins can opt into using this implementation instead of the classic complete_job() implementation (or custom implementations). Fix RCU locking in sys_get_rt_task_param() sys_get_rt_task_param() is rarely used and apparently attracted some bitrot. Free before setting NULL to prevent memory leak Add hrtimer_start_on() support This patch replaces the previous implementation of hrtimer_start_on() by now using smp_call_function_single_async() to arm hrtimers on remote CPUs. Expose LITMUS^RT system calls via control page ioctl() Rationale: make LITMUS^RT ops available in a way that does not create merge conflicts each time we rebase LITMUS^RT on top of a new kernel version. This also helps with portability to different architectures, as we no longer need to patch each architecture's syscall table. Pick non-zero syscall ID start range To avoid interfering with Linux's magic reserved IOCTL numbers Don't preempt before time check in sleep_until_next_release() Avoid preempting jobs that are about to go to sleep soon anyway. LITMUS^RT proc: fix wrong memset() TRACE(): add TRACE_WARN_ON() helper Useful to replace BUG_ON() and WARN_ON() with a non-fatal TRACE()-based equivalent. Add void* plugin_state pointer to task_struct LITMUS^RT: split task admission into two functions Plugin interface: add fork_task() callback LITMUS^RT: Enable plugins to permit RT tasks to fork one-shot complete_job(): set completed flag This could race with a SIGSTOP or some other forced suspension, but we'll let plugins handle this, should they actually care. FP: add list-based ready queue LITMUS^RT core: add should_wait_for_stack() callback Allow plugins to give up when waiting for a stack to become available. LITMUS^RT core: add next_became_invalid() callback LITMUS^RT core: add post-migration validation callback LITMUS^RT core: be more careful when pull-migrating tasks Close more race windows and give plugins a chance to validate tasks after they have been migrated. Add KConfig options for timer latency warnings Add reservation creation API to plugin interface & syscalls LITMUS^RT syscall: expose sys_reservation_create() via ioctl() Add reservation configuration types to rt_param.h Add basic generic reservation-based scheduling infrastructure Switch to aligned quanta by default. For first-time users, aligned quanta is likely what's expected. LITMUS^RT core: keep track of time of last suspension This information is needed to insert ST_COMPLETION records for sporadic tasks. add fields for clock_nanosleep() support Need to communicate the intended wake-up time to the plugin wake-up handler. LITMUS^RT core: add generic handler for sporadic job arrivals In particular, check if a job arrival is triggered from a clock_nanosleep() call. add litmus->task_change_params() callback to plugin interface Will be used by adaptive C-EDF. Call litmus->task_change_params() from sys_set_rt_task_param() Move trace point definition to litmus/litmus.c If !CONFIG_SCHED_TASK_TRACE, but CONFIG_SCHED_LITMUS_TRACEPOINT, then we still need to define the tracepoint structures. This patch should be integrated with the earlier sched_task_trace.c patches during one of the next major rebasing efforts. LITMUS^RT scheduling class: mark enqueued task as present Remove unistd_*.h rebase fix: update to new hrtimer API The new API is actually nicer and cleaner. rebase fix: call lockdep_unpin_lock(&rq->lock, cookie) The LITMUS^RT scheduling class should also do the LOCKDEP dance. LITMUS^RT core: break out non-preemptive flag defs Not every file including litmus.h needs to know this. LITMUS^RT core: don't include debug_trace.h in litmus.h Including debug_trace.h introduces the TRACE() macro, which causes symbol clashes in some (rather obscure) drivers. LITMUS^RT core: add litmus_preemption_in_progress flags Used to communicate that a preemption is in progress. Set by the scheduler; read by the plugins. LITMUS^RT core: revise is_current_running() macro
* IRQ tracing: clarify use of per-core countersBjoern Brandenburg2017-05-26
| | | | | | | Make it a bit more obvious what these counters are used for and how. Question for future work: can we return to using only a single per-core counter?
* Add object descriptor table to Linux's task_structBjoern Brandenburg2017-05-26
| | | | | This table is similar to a file descriptor table. It keeps track of which "objects" (locks) a real-time task holds a handle to.
* Add tracepoint supportBjoern Brandenburg2017-05-26
| | | | | | | This patch integrates LITMUS^RT's sched_trace_XXX() macros with Linux's notion of tracepoints. This is useful to visualize schedules in kernel shark and similar tools. Historically, LITMUS^RT's sched_trace predates Linux's tracepoint infrastructure.
* Add schedule tracing supportBjoern Brandenburg2017-05-26
| | | | | | | | | | | | This patch introduces the sched_trace infrastructure, which in principle allows tracing the generated schedule. However, this patch does not yet integrate the callbacks with the kernel. sched_trace: record exec_time in ST_COMPLETION records sched_trace: add sched_trace_last_suspension_as_completion() New tracepoint for tracing the completion of sporadic jobs.
* Feather-Trace: write interrupt counts to control pageBjoern Brandenburg2017-05-26
| | | | | This patch exports the interrupt counter to userspace via the control page.
* Feather-Trace: use proper definition of is_realtime()Bjoern Brandenburg2017-05-26
| | | | Remove dummy implementation of is_realtime() in trace.c.
* Introduce main LITMUS^RT headerBjoern Brandenburg2017-05-26
| | | | | This patch adds a basic litmus/litmus.h, which is required for basic LITMUS^RT infrastructure to compile.
* Extend task_struct with rt_paramBjoern Brandenburg2017-05-26
| | | | This patch adds the PCB extensions required for LITMUS^RT.
* Add TRACE() debug tracing supportBjoern Brandenburg2017-05-26
| | | | | | | This patch adds the infrastructure for the TRACE() debug macro. Conflicts: kernel/printk.c
* Add object list to inodesBjoern Brandenburg2017-05-26
| | | | | | | This patch adds a list of arbitrary objects to inodes. This is used by LITMUS^RT's locking API to attach lock objects to inodes (which represent namespaces in Linux's locking API).
* Add SCHED, SCHED2, and CXS overhead tracepointsBjoern Brandenburg2017-05-26
| | | | | | | 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 Brandenburg2017-05-26
| | | | | | | | | | | | | | | | This patch hooks up Feather-Trace's ft_irq_fired() handler with Linux's interrupt handling infrastructure. IRQ tracing: ft_irq_fired() only if irq_enter() was skipped On x86, the rescheduling IPI path already calls irq_enter(), which calls ft_irq_fired(), so we don't have to do it again. IRQ tracing: don't count softirqs Only triggered by irq_exit(), which implies that we called irq_enter(), which means that we already traced the current hard IRQ.
* arm: rescheduling handler IPI does not call irq_enter()Bjoern Brandenburg2017-05-26
|
* x86: note that the rescheduling IPI handler calls irq_enterBjoern Brandenburg2017-05-26
| | | | We need different IRQ tracing on x86 and arm/arm64...
* Feather-Trace: add LITMUS^RT overhead tracing infrastructureBjoern Brandenburg2017-05-26
| | | | | | | | | | | | | | | | | | | | | | | This patch adds the main infrastructure for tracing overheads in LITMUS^RT. It does not yet introduce any tracepoints into the kernel. Add new overhead tracing event IDs XCALL_{START,END} -- cross-CPU function calls SEND_XCALL_{START,END} -- cross-CPU function call latency SCHED_TIMER_{START,END} -- any additional, plugin-specific scheduling timer TIMER_LATENCY -- latency of plugin-specific timer Feather-Trace: Add macros for message-passing timestamps Add timestamp tracing macros that reverse on which cores the timestamps are recorded. This intended to reduce tracing contention if some cores receive a lot of messages. These macros are useful for plugins based on message-passing such as the (non-mainline) G-EDF-MP. Feather-Trace: convert timestamps to atomic_t - patch by Namhoon Kim (UNC)
* Feather-Trace: add generic ftdev device driverBjoern Brandenburg2017-05-26
| | | | | | | This patch adds the ftdev device driver, which is used to export samples collected with Feather-Trace to userspace. Feather-Trace: convert device driver to atomic_t - patch by Namhoon Kim (UNC)
* Feather-Trace: add x86 binary rewriting implementationBjoern Brandenburg2017-05-26
| | | | | This patch adds the x86-specific implementation of Feather-Trace triggers that works by rewriting jump instructions.
* Feather-Trace: add platform independent implementationBjoern Brandenburg2017-05-26
| | | | | | | | | | | This patch adds the simple fallback implementation and creates dummy hooks in the x86 and ARM Kconfig files. Feather-Buffer: convert to atomic_t Feather-Trace: remove custom atomic ops - patch by Namhoon Kim (UNC). Feather-Trace: switch to correct portable atomics header - thanks Andrea Bastoni
* Add LITMUS^RT directoryBjoern Brandenburg2017-05-26
| | | | Hookup litmus/ with kernel and add extra version.
* Linux 4.9.30Greg Kroah-Hartman2017-05-25
|
* drm/i915/gvt: Disable access to stolen memory as a guestChris Wilson2017-05-25
| | | | | | | | | | | | | | | | | | commit 04a68a35ce6d7b54749989f943993020f48fed62 upstream. Explicitly disable stolen memory when running as a guest in a virtual machine, since the memory is not mediated between clients and reserved entirely for the host. The actual size should be reported as zero, but like every other quirk we want to tell the user what is happening. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99028 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Zhenyu Wang <zhenyuw@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20161109103905.17860-1-chris@chris-wilson.co.uk Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* drivers: char: mem: Check for address space wraparound with mmap()Julius Werner2017-05-25
| | | | | | | | | | | | | | | | | | commit b299cde245b0b76c977f4291162cf668e087b408 upstream. /dev/mem currently allows mmap() mappings that wrap around the end of the physical address space, which should probably be illegal. It circumvents the existing STRICT_DEVMEM permission check because the loop immediately terminates (as the start address is already higher than the end address). On the x86_64 architecture it will then cause a panic (from the BUG(start >= end) in arch/x86/mm/pat.c:reserve_memtype()). This patch adds an explicit check to make sure offset + size will not wrap around in the physical address type. Signed-off-by: Julius Werner <jwerner@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* nfsd: encoders mustn't use unitialized values in error casesJ. Bruce Fields2017-05-25
| | | | | | | | | | | | | | | | | | commit f961e3f2acae94b727380c0b74e2d3954d0edf79 upstream. In error cases, lgp->lg_layout_type may be out of bounds; so we shouldn't be using it until after the check of nfserr. This was seen to crash nfsd threads when the server receives a LAYOUTGET request with a large layout type. GETDEVICEINFO has the same problem. Reported-by: Ari Kauppi <Ari.Kauppi@synopsys.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* nfsd: fix undefined behavior in nfsd4_layout_verifyAri Kauppi2017-05-25
| | | | | | | | | | | | | | | | | | | | | commit b550a32e60a4941994b437a8d662432a486235a5 upstream. UBSAN: Undefined behaviour in fs/nfsd/nfs4proc.c:1262:34 shift exponent 128 is too large for 32-bit type 'int' Depending on compiler+architecture, this may cause the check for layout_type to succeed for overly large values (which seems to be the case with amd64). The large value will be later used in de-referencing nfsd4_layout_ops for function pointers. Reported-by: Jani Tuovila <tuovila@synopsys.com> Signed-off-by: Ari Kauppi <ari@synopsys.com> [colin.king@canonical.com: use LAYOUT_TYPE_MAX instead of 32] Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* NFS: Use GFP_NOIO for two allocations in writebackBenjamin Coddington2017-05-25
| | | | | | | | | | | | | commit ae97aa524ef495b6276fd26f5d5449fb22975d7c upstream. Prevent a deadlock that can occur if we wait on allocations that try to write back our pages. Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Fixes: 00bfa30abe869 ("NFS: Create a common pgio_alloc and pgio_release...") Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>