3.18.27-rt27
Subsystems (17)
Steven Rostedt
maintainerDear RT Folks,
I'm pleased to announce the 3.18.27-rt27 stable release.
You can get this release via the git tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-stable-rt.git
branch: v3.18-rt
Head SHA1: a69d68687e04e6f5e9b79a5ac8dacc9d86f195c7
Or to build 3.18.27-rt27 directly, the following patches should be applied:
http://www.kernel.org/pub/linux/kernel/v3.x/linux-3.18.tar.xz
http://www.kernel.org/pub/linux/kernel/v3.x/patch-3.18.27.xz
http://www.kernel.org/pub/linux/kernel/projects/rt/3.18/patch-3.18.27-rt27.patch.xz
You can also build from 3.18.27-rt26 by applying the incremental patch:
http://www.kernel.org/pub/linux/kernel/projects/rt/3.18/incr/patch-3.18.27-rt26-rt27.patch.xz
Enjoy,
-- Steve
Changes from v3.18.27-rt26:
---
Clark Williams (1):
rcu/torture: Comment out rcu_bh ops on PREEMPT_RT_FULL
Mike Galbraith (4):
sched,rt: __always_inline preemptible_lazy() drm,radeon,i915: Use preempt_disable/enable_rt() where recommended drm,i915: Use local_lock/unlock_irq() in intel_pipe_update_start/end()
tracing: Fix probe_wakeup_latency_hist_start() prototype
Sebastian Andrzej Siewior (11):
sched: reset task's lockless wake-queues on fork()
ptrace: don't open IRQs in ptrace_freeze_traced() too early
net: move xmit_recursion to per-task variable on -RT
preempt-lazy: Add the lazy-preemption check to preempt_schedule()
softirq: split timer softirqs out of ksoftirqd
net: provide a way to delegate processing a softirq to ksoftirqd
latencyhist: disable jump-labels
kernel: migrate_disable() do fastpath in atomic & irqs-off
kernel: softirq: unlock with irqs on
kernel/stop_machine: partly revert "stop_machine: Use raw spinlocks"
kernel: sched: Fix preempt_disable_ip recodring for preempt_disable()
Steven Rostedt (Red Hat) (1):
Linux 3.18.27-rt27
Thomas Gleixner (1):
tick/broadcast: Make broadcast hrtimer irqsafe
Yang Shi (3):
arm64: replace read_lock to rcu lock in call_step_hook
trace: Use rcuidle version for preemptoff_hist trace point
f2fs: Mutex can't be used by down_write_nest_lock()
----
arch/Kconfig | 1 + arch/arm64/kernel/debug-monitors.c | 21 +++--- drivers/gpu/drm/i915/i915_irq.c | 2 + drivers/gpu/drm/i915/intel_sprite.c | 11 ++-- drivers/gpu/drm/radeon/radeon_display.c | 2 + fs/f2fs/f2fs.h | 4 +- include/linux/ftrace.h | 12 ++++ include/linux/interrupt.h | 8 +++ include/linux/netdevice.h | 9 +++ include/linux/sched.h | 3 +- include/trace/events/hist.h | 1 + kernel/fork.c | 1 + kernel/ptrace.c | 6 +- kernel/rcu/rcutorture.c | 7 ++ kernel/sched/core.c | 52 ++++++++------- kernel/softirq.c | 112 ++++++++++++++++++++++++++++---- kernel/stop_machine.c | 40 +++--------- kernel/time/tick-broadcast-hrtimer.c | 1 + kernel/trace/latency_hist.c | 4 +- kernel/trace/trace_irqsoff.c | 8 +-- localversion-rt | 2 +- net/core/dev.c | 43 ++++++++++-- 22 files changed, 251 insertions(+), 99 deletions(-)
---------------------------
arch/Kconfig +1 -0
@@ -50,6 +50,7 @@ config KPROBES config JUMP_LABEL bool "Optimize very unlikely/likely branches" depends on HAVE_ARCH_JUMP_LABEL + depends on (!INTERRUPT_OFF_HIST && !PREEMPT_OFF_HIST && !WAKEUP_LATENCY_HIST && !MISSED_TIMER_OFFSETS_HIST) help This option enables a transparent branch optimization that makes certain almost-always-true or almost-always-false branch
arch/arm64/kernel/debug-monitors.c +11 -10
@@ -184,20 +184,21 @@ static void clear_regs_spsr_ss(struct pt_regs *regs)/* EL1 Single Step Handler hooks */ static LIST_HEAD (step_hook); -static DEFINE_RWLOCK (step_hook_lock); +static DEFINE_SPINLOCK (step_hook_lock);void register_step_hook (struct step_hook *hook) { -write_lock (&step_hook_lock); -list_add (&hook->node, &step_hook); -write_unlock (&step_hook_lock); +spin_lock (&step_hook_lock); +list_add_rcu (&hook->node, &step_hook); +spin_unlock (&step_hook_lock); }void unregister_step_hook (struct step_hook *hook) { -write_lock (&step_hook_lock); -list_del (&hook->node); -write_unlock (&step_hook_lock); +spin_lock (&step_hook_lock); +list_del_rcu (&hook->node); +spin_unlock (&step_hook_lock); +synchronize_rcu (); }/*
@@ -211,15 +212,15 @@ static int call_step_hook(struct pt_regs *regs, unsigned int esr)struct step_hook *hook;int retval =DBG_HOOK_ERROR ; -read_lock (&step_hook_lock); +rcu_read_lock (); -list_for_each_entry (hook, &step_hook, node) { +list_for_each_entry_rcu (hook, &step_hook, node) { retval = hook->fn (regs, esr);if (retval ==DBG_HOOK_HANDLED )break ; } -read_unlock (&step_hook_lock); +rcu_read_unlock ();return retval; }
drivers/gpu/drm/i915/i915_irq.c +2 -0
@@ -943,6 +943,7 @@ static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,spin_lock_irqsave (&dev_priv->uncore.lock, irqflags);/* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ +preempt_disable_rt ();/* Get optional system timestamp before query. */ if (stime)
@@ -994,6 +995,7 @@ static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, *etime =ktime_get ();/* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */ +preempt_enable_rt ();spin_unlock_irqrestore (&dev_priv->uncore.lock, irqflags);
drivers/gpu/drm/i915/intel_sprite.c +7 -4
@@ -36,6 +36,7 @@#include "intel_drv.h" #include <drm/i915_drm.h> #include "i915_drv.h" +#include <linux/locallock.h> static int usecs_to_scanlines (const struct drm_display_mode *mode,int usecs) {
@@ -46,6 +47,8 @@ static int usecs_to_scanlines(const struct drm_display_mode *mode, int usecs)return DIV_ROUND_UP (usecs * mode->crtc_clock,1000 * mode->crtc_htotal); } +static DEFINE_LOCAL_IRQ_LOCK (pipe_update_lock); +static bool intel_pipe_update_start (struct intel_crtc *crtc,uint32_t *start_vbl_count) {struct drm_device *dev = crtc->base.dev;
@@ -72,7 +75,7 @@ static bool intel_pipe_update_start(struct intel_crtc *crtc, uint32_t *start_vblif (WARN_ON (drm_vblank_get (dev, pipe)))return false; -local_irq_disable (); +local_lock_irq (pipe_update_lock);trace_i915_pipe_update_start (crtc, min, max);
@@ -94,11 +97,11 @@ static bool intel_pipe_update_start(struct intel_crtc *crtc, uint32_t *start_vblbreak ; } -local_irq_enable (); +local_unlock_irq (pipe_update_lock); timeout =schedule_timeout (timeout); -local_irq_disable (); +local_lock_irq (pipe_update_lock); }finish_wait (wq, &wait);
@@ -120,7 +123,7 @@ static void intel_pipe_update_end(struct intel_crtc *crtc, u32 start_vbl_count)trace_i915_pipe_update_end (crtc, end_vbl_count); -local_irq_enable (); +local_unlock_irq (pipe_update_lock);if (start_vbl_count != end_vbl_count) DRM_ERROR("Atomic update failure on pipe %c (start=%u end=%u)\n",
drivers/gpu/drm/radeon/radeon_display.c +2 -0
@@ -1784,6 +1784,7 @@ int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, unsigned int flstruct radeon_device *rdev = dev->dev_private;/* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ +preempt_disable_rt ();/* Get optional system timestamp before query. */ if (stime)
@@ -1876,6 +1877,7 @@ int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, unsigned int fl *etime =ktime_get ();/* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */ +preempt_enable_rt ();/* Decode into vertical and horizontal scanout position. */ *vpos = position &0x1fff ;
fs/f2fs/f2fs.h +1 -3
@@ -22,7 +22,6 @@#ifdef CONFIG_F2FS_CHECK_FS #define f2fs_bug_on (sbi, condition) BUG_ON(condition) -#define f2fs_down_write (x, y) down_write_nest_lock(x, y)#else #define f2fs_bug_on (sbi, condition) \ do { \
@@ -31,7 +30,6 @@ sbi->need_fsck = true; \ } \ } while (0) -#define f2fs_down_write (x, y) down_write(x)#endif /*
@@ -699,7 +697,7 @@ static inline void f2fs_unlock_op(struct f2fs_sb_info *sbi)static inline void f2fs_lock_all (struct f2fs_sb_info *sbi) { -f2fs_down_write (&sbi->cp_rwsem, &sbi->cp_mutex); +down_write (&sbi->cp_rwsem); }static inline void f2fs_unlock_all (struct f2fs_sb_info *sbi)
include/linux/ftrace.h +12 -0
@@ -643,6 +643,18 @@ static inline void __ftrace_enabled_restore(int enabled)#define CALLER_ADDR5 ((unsigned long)ftrace_return_address(5))#define CALLER_ADDR6 ((unsigned long)ftrace_return_address(6)) +static inline unsigned long get_lock_parent_ip (void ) +{ +unsigned long addr =CALLER_ADDR0 ; + +if (!in_lock_functions (addr)) +return addr; + addr =CALLER_ADDR1 ; +if (!in_lock_functions (addr)) +return addr; +return CALLER_ADDR2 ; +} +#ifdef CONFIG_IRQSOFF_TRACER extern void time_hardirqs_on (unsigned long a0,unsigned long a1);extern void time_hardirqs_off (unsigned long a0,unsigned long a1);
include/linux/interrupt.h +8 -0
@@ -444,6 +444,14 @@ extern void thread_do_softirq(void);extern void open_softirq (int nr,void (*action)(struct softirq_action *));extern void softirq_init (void );extern void __raise_softirq_irqoff (unsigned int nr); +#ifdef CONFIG_PREEMPT_RT_FULL +extern void __raise_softirq_irqoff_ksoft (unsigned int nr); +#else +static inline void __raise_softirq_irqoff_ksoft (unsigned int nr) +{ +__raise_softirq_irqoff (nr); +} +#endif extern void raise_softirq_irqoff (unsigned int nr);extern void raise_softirq (unsigned int nr);
include/linux/netdevice.h +9 -0
@@ -2130,11 +2130,20 @@ void netdev_freemem(struct net_device *dev);void synchronize_net (void );int init_dummy_netdev (struct net_device *dev); +#ifdef CONFIG_PREEMPT_RT_FULL +static inline int dev_recursion_level (void ) +{ +return current->xmit_recursion; +} + +#else +DECLARE_PER_CPU (int, xmit_recursion);static inline int dev_recursion_level (void ) {return this_cpu_read (xmit_recursion); } +#endif struct net_device *dev_get_by_index (struct net *net,int ifindex);struct net_device *__dev_get_by_index (struct net *net,int ifindex);
include/linux/sched.h +1 -2
@@ -178,8 +178,6 @@ extern void get_iowait_load(unsigned long *nr_waiters, unsigned long *load);extern void calc_global_load (unsigned long ticks);extern void update_cpu_load_nohz (void ); -extern unsigned long get_parent_ip (unsigned long addr); -extern void dump_cpu_task (int cpu);struct seq_file ;
@@ -1523,6 +1521,7 @@ struct task_struct {struct mutex_waiter *blocked_on;#endif #ifdef CONFIG_PREEMPT_RT_FULL +int xmit_recursion;int pagefault_disabled;#endif #ifdef CONFIG_TRACE_IRQFLAGS
include/trace/events/hist.h +1 -0
@@ -9,6 +9,7 @@#if !defined(CONFIG_PREEMPT_OFF_HIST ) && !defined(CONFIG_INTERRUPT_OFF_HIST )#define trace_preemptirqsoff_hist (a, b) +#define trace_preemptirqsoff_hist_rcuidle (a, b)#else TRACE_EVENT(preemptirqsoff_hist,
kernel/fork.c +1 -0
@@ -364,6 +364,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)#endif tsk->splice_pipe =NULL ; tsk->task_frag.page =NULL ; + tsk->wake_q.next =NULL ;account_kernel_stack (ti,1 );
kernel/ptrace.c +4 -2
@@ -129,12 +129,14 @@ static bool ptrace_freeze_traced(struct task_struct *task)spin_lock_irq (&task->sighand->siglock);if (task_is_traced (task) && !__fatal_signal_pending (task)) { -raw_spin_lock_irq (&task->pi_lock); +unsigned long flags; + +raw_spin_lock_irqsave (&task->pi_lock, flags);if (task->state & __TASK_TRACED) task->state = __TASK_TRACED;else task->saved_state = __TASK_TRACED; -raw_spin_unlock_irq (&task->pi_lock); +raw_spin_unlock_irqrestore (&task->pi_lock, flags); ret = true; }spin_unlock_irq (&task->sighand->siglock);
kernel/rcu/rcutorture.c +7 -0
@@ -392,6 +392,7 @@ static struct rcu_torture_ops rcu_ops = { .name = "rcu" }; +#ifndef CONFIG_PREEMPT_RT_FULL /* * Definitions for rcu_bh torture testing. */
@@ -435,6 +436,12 @@ static struct rcu_torture_ops rcu_bh_ops = { .name = "rcu_bh" }; +#else +static struct rcu_torture_ops rcu_bh_ops = { + .ttype =INVALID_RCU_FLAVOR , +}; +#endif +/* * Don't even think about trying any of these in real life!!! * The names includes "busted", and they really means it!
kernel/sched/core.c +30 -22
95 lines not on this page · raw message
kernel/softirq.c +99 -13
209 lines not on this page · raw message
kernel/stop_machine.c +8 -32
@@ -30,7 +30,7 @@ struct cpu_stop_done {atomic_t nr_todo;/* nr left to execute */ bool executed;/* actually executed? */ int ret;/* collected return value */ -struct task_struct *waiter;/* woken when nr_todo reaches 0 */ +struct completion completion;/* fired if nr_todo reaches 0 */ };/* the actual stopper, one per every possible cpu, enabled on online cpus */
@@ -56,7 +56,7 @@ static void cpu_stop_init_done(struct cpu_stop_done *done, unsigned int nr_todo) {memset (done,0 ,sizeof (*done));atomic_set (&done->nr_todo, nr_todo); - done->waiter = current; +init_completion (&done->completion); }/* signal completion unless @done is NULL */
@@ -65,10 +65,8 @@ static void cpu_stop_signal_done(struct cpu_stop_done *done, bool executed)if (done) {if (executed) done->executed = true; -if (atomic_dec_and_test (&done->nr_todo)) { -wake_up_process (done->waiter); - done->waiter =NULL ; - } +if (atomic_dec_and_test (&done->nr_todo)) +complete (&done->completion); } }
@@ -91,22 +89,6 @@ static void cpu_stop_queue_work(unsigned int cpu, struct cpu_stop_work *work)raw_spin_unlock_irqrestore (&stopper->lock, flags); } -static void wait_for_stop_done (struct cpu_stop_done *done) -{ -set_current_state (TASK_UNINTERRUPTIBLE ); -while (atomic_read (&done->nr_todo)) { -schedule (); -set_current_state (TASK_UNINTERRUPTIBLE ); - } -/* -* We need to wait until cpu_stop_signal_done() has cleared -* done->waiter. -*/ -while (done->waiter) -cpu_relax (); -set_current_state (TASK_RUNNING ); -} -/** * stop_one_cpu - stop a cpu * @cpu: cpu to stop
@@ -138,7 +120,7 @@ int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg)cpu_stop_init_done (&done,1 );cpu_stop_queue_work (cpu, &work); -wait_for_stop_done (&done); +wait_for_completion (&done.completion);return done.executed ? done.ret : -ENOENT ; }
@@ -315,7 +297,7 @@ int stop_two_cpus(unsigned int cpu1, unsigned int cpu2, cpu_stop_fn_t fn, void *lg_local_unlock (&stop_cpus_lock);preempt_enable_nort (); -wait_for_stop_done (&done); +wait_for_completion (&done.completion);return done.executed ? done.ret : -ENOENT ; }
@@ -380,7 +362,7 @@ static int __stop_cpus(const struct cpumask *cpumask,cpu_stop_init_done (&done,cpumask_weight (cpumask));queue_stop_cpus_work (cpumask, fn, arg, &done, false); -wait_for_stop_done (&done); +wait_for_completion (&done.completion);return done.executed ? done.ret : -ENOENT ; }
@@ -511,13 +493,7 @@ repeat:kallsyms_lookup ((unsigned long )fn,NULL ,NULL ,NULL , ksym_buf), arg); -/* -* Make sure that the wakeup and setting done->waiter -* to NULL is atomic. -*/ -local_irq_disable ();cpu_stop_signal_done (done, true); -local_irq_enable (); goto repeat; } }
@@ -676,7 +652,7 @@ int stop_machine_from_inactive_cpu(int (*fn)(void *), void *data, ret =multi_cpu_stop (&msdata);/* Busy wait for completion. */ -while (atomic_read (&done.nr_todo)) +while (!completion_done (&done.completion))cpu_relax ();mutex_unlock (&stop_cpus_mutex);
kernel/time/tick-broadcast-hrtimer.c +1 -0
@@ -109,5 +109,6 @@ void tick_setup_hrtimer_broadcast(void) {hrtimer_init (&bctimer,CLOCK_MONOTONIC ,HRTIMER_MODE_ABS ); bctimer.function = bc_handler; + bctimer.irqsafe = true;clockevents_register_device (&ce_broadcast_hrtimer); }
kernel/trace/latency_hist.c +2 -2
@@ -115,7 +115,7 @@ static DEFINE_PER_CPU(struct hist_data, wakeup_latency_hist_sharedprio);static char *wakeup_latency_hist_dir ="wakeup" ;static char *wakeup_latency_hist_dir_sharedprio ="sharedprio" ; static notrace void probe_wakeup_latency_hist_start(void *v, -struct task_struct *p,int success); +struct task_struct *p); static notrace void probe_wakeup_latency_hist_stop(void *v,struct task_struct *prev,struct task_struct *next); static notrace void probe_sched_migrate_task(void *,
@@ -869,7 +869,7 @@ static notrace void probe_sched_migrate_task(void *v, struct task_struct *task, } static notrace void probe_wakeup_latency_hist_start(void *v, -struct task_struct *p,int success) +struct task_struct *p) {unsigned long flags;struct task_struct *curr = current;
kernel/trace/trace_irqsoff.c +4 -4
@@ -436,13 +436,13 @@ void start_critical_timings(void) {if (preempt_trace () ||irq_trace ())start_critical_timing (CALLER_ADDR0 ,CALLER_ADDR1 ); -trace_preemptirqsoff_hist (TRACE_START ,1 ); +trace_preemptirqsoff_hist_rcuidle (TRACE_START ,1 ); }EXPORT_SYMBOL_GPL (start_critical_timings);void stop_critical_timings (void ) { -trace_preemptirqsoff_hist (TRACE_STOP ,0 ); +trace_preemptirqsoff_hist_rcuidle (TRACE_STOP ,0 );if (preempt_trace () ||irq_trace ())stop_critical_timing (CALLER_ADDR0 ,CALLER_ADDR1 ); }
@@ -487,7 +487,7 @@ inline void print_irqtrace_events(struct task_struct *curr)*/ void trace_hardirqs_on (void ) { -trace_preemptirqsoff_hist (IRQS_ON ,0 ); +trace_preemptirqsoff_hist_rcuidle (IRQS_ON ,0 );if (!preempt_trace () &&irq_trace ())stop_critical_timing (CALLER_ADDR0 ,CALLER_ADDR1 ); }
@@ -497,7 +497,7 @@ void trace_hardirqs_off(void) {if (!preempt_trace () &&irq_trace ())start_critical_timing (CALLER_ADDR0 ,CALLER_ADDR1 ); -trace_preemptirqsoff_hist (IRQS_OFF ,1 ); +trace_preemptirqsoff_hist_rcuidle (IRQS_OFF ,1 ); }EXPORT_SYMBOL (trace_hardirqs_off);
localversion-rt +1 -1
@@ -1 +1 @@ --rt26 +-rt27
net/core/dev.c +39 -4
71 lines not on this page · raw message