From: Steven Rostedt <rostedt@goodmis.org> Date: 2016-03-02 15:14:15
Dear RT Folks,
This is the RT stable review cycle of patch 4.1.15-rt18-rc1.
Please scream at me if I messed something up. Please test the patches too.
The -rc release will be uploaded to kernel.org and will be deleted when
the final release is out. This is just a review release (or release candidate).
The pre-releases will not be pushed to the git repository, only the
final release is.
If all goes well, this patch will be converted to the next main release
on 3/7/2016.
Enjoy,
-- Steve
To build 4.1.15-rt18-rc1 directly, the following patches should be applied:
http://www.kernel.org/pub/linux/kernel/v3.x/linux-4.1.tar.xzhttp://www.kernel.org/pub/linux/kernel/v3.x/patch-4.1.15.xzhttp://www.kernel.org/pub/linux/kernel/projects/rt/4.1/patch-4.1.15-rt18-rc1.patch.xz
You can also build from 4.1.15-rt17 by applying the incremental patch:
http://www.kernel.org/pub/linux/kernel/projects/rt/4.1/incr/patch-4.1.15-rt17-rt18-rc1.patch.xz
Changes from 4.1.15-rt17:
---
Clark Williams (1):
rcu/torture: Comment out rcu_bh ops on PREEMPT_RT_FULL
Mike Galbraith (3):
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()
Sebastian Andrzej Siewior (13):
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
kernel/softirq: use cond_resched_rcu_qs() on -RT as well (run_ksoftirqd())
net/core: protect users of napi_alloc_cache against reentrance
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 4.1.15-rt18-rc1
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 | 5 +-
kernel/fork.c | 1 +
kernel/ptrace.c | 6 +-
kernel/rcu/rcutorture.c | 7 ++
kernel/sched/core.c | 54 +++++++++------
kernel/softirq.c | 116 +++++++++++++++++++++++++++-----
kernel/stop_machine.c | 40 +++--------
kernel/time/tick-broadcast-hrtimer.c | 1 +
kernel/trace/trace_irqsoff.c | 8 +--
localversion-rt | 2 +-
net/core/dev.c | 43 ++++++++++--
net/core/skbuff.c | 8 ++-
21 files changed, 261 insertions(+), 100 deletions(-)
From: Steven Rostedt <rostedt@goodmis.org> Date: 2016-03-02 15:09:18
4.1.15-rt18-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Yang Shi <redacted>
fsf2_lock_all() calls down_write_nest_lock() to acquire a rw_sem and check
a mutex, but down_write_nest_lock() is designed for two rw_sem accoring to the
comment in include/linux/rwsem.h. And, other than f2fs, it is just called in
mm/mmap.c with two rwsem.
So, it looks it is used wrongly by f2fs. And, it causes the below compile
warning on -rt kernel too.
In file included from fs/f2fs/xattr.c:25:0:
fs/f2fs/f2fs.h: In function 'f2fs_lock_all':
fs/f2fs/f2fs.h:962:34: warning: passing argument 2 of 'down_write_nest_lock' from
incompatible pointer type [-Wincompatible-pointer-types]
f2fs_down_write(&sbi->cp_rwsem, &sbi->cp_mutex);
^
The nest annotation was anyway bogus as nested annotations for lockdep are
only required if one nests two locks of the same lock class, which is not the
case here.
Signed-off-by: Yang Shi <redacted>
Cc: cm224.lee@samsung.com
Cc: chao2.yu@samsung.com
Cc: linaro-kernel@lists.linaro.org
Cc: linux-rt-users@vger.kernel.org
Cc: bigeasy@linutronix.de
Cc: rostedt@goodmis.org
Cc: linux-f2fs-devel@lists.sourceforge.net
Cc: linux-fsdevel@vger.kernel.org
Cc: jaegeuk@kernel.org
Link: http://lkml.kernel.org/r/1456532725-4126-1-git-send-email-yang.shi@linaro.org
Signed-off-by: Thomas Gleixner <redacted>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
fs/f2fs/f2fs.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
From: Steven Rostedt <rostedt@goodmis.org> Date: 2016-03-02 15:11:17
4.1.15-rt18-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Probably in the rebase onto v4.1 this check got moved into less commonly used
preempt_schedule_notrace(). This patch ensures that both functions use it.
Reported-by: Mike Galbraith <redacted>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/sched/core.c | 36 ++++++++++++++++++++++++++++--------
1 file changed, 28 insertions(+), 8 deletions(-)
From: Steven Rostedt <rostedt@goodmis.org> Date: 2016-03-02 15:11:19
4.1.15-rt18-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
A softirq on -RT can be preempted. That means one task is in
__dev_queue_xmit(), gets preempted and another task may enter
__dev_queue_xmit() aw well. netperf together with a bridge device
will then trigger the `recursion alert` because each task increments
the xmit_recursion variable which is per-CPU.
A virtual device like br0 is required to trigger this warning.
This patch moves the counter to per task instead per-CPU so it counts
the recursion properly on -RT.
Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
include/linux/netdevice.h | 9 +++++++++
include/linux/sched.h | 3 +++
net/core/dev.c | 41 ++++++++++++++++++++++++++++++++++++++---
3 files changed, 50 insertions(+), 3 deletions(-)
From: Steven Rostedt <rostedt@goodmis.org> Date: 2016-03-02 15:11:26
4.1.15-rt18-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
On -RT the code running in BH can not be moved to another CPU so CPU
local variable remain local. However the code can be preempted
and another task may enter BH accessing the same CPU using the same
napi_alloc_cache variable.
This patch ensures that each user of napi_alloc_cache uses a local lock.
Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
net/core/skbuff.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
From: Steven Rostedt <rostedt@goodmis.org> Date: 2016-03-02 15:12:10
4.1.15-rt18-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
In 7675104990ed ("sched: Implement lockless wake-queues") we gained
lockless wake-queues. -RT managed to lockup itself with those. There
could be multiple attempts for task X to enqueue it for a wakeup
_even_ if task X is already running.
The reason is that task X could be runnable but not yet on CPU. The the
task performing the wakeup did not leave the CPU it could performe
multiple wakeups.
With the proper timming task X could be running and enqueued for a
wakeup. If this happens while X is performing a fork() then its its
child will have a !NULL `wake_q` member copied.
This is not a problem as long as the child task does not participate in
lockless wakeups :)
Fixes: 7675104990ed ("sched: Implement lockless wake-queues")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/fork.c | 1 +
1 file changed, 1 insertion(+)
From: Steven Rostedt <rostedt@goodmis.org> Date: 2016-03-02 15:12:12
4.1.15-rt18-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Mike Galbraith <redacted>
DRM folks identified the spots, so use them.
Signed-off-by: Mike Galbraith <redacted>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-rt-users <redacted>
Signed-off-by: Thomas Gleixner <redacted>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
drivers/gpu/drm/i915/i915_irq.c | 2 ++
drivers/gpu/drm/radeon/radeon_display.c | 2 ++
2 files changed, 4 insertions(+)
@@ -676,6 +676,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)
@@ -727,6 +728,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);
@@ -1798,6 +1798,7 @@ int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, unsigned int flstructradeon_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)
@@ -1890,6 +1891,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;
From: Steven Rostedt <rostedt@goodmis.org> Date: 2016-03-02 15:12:14
4.1.15-rt18-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
preempt_disable() invokes preempt_count_add() which saves the caller in
current->preempt_disable_ip. It uses CALLER_ADDR1 which does not look for its
caller but for the parent of the caller. Which means we get the correct caller
for something like spin_lock() unless the architectures inlines those
invocations. It is always wrong for preempt_disable() or local_bh_disable().
This patch makes the function get_parent_ip() which tries CALLER_ADDR0,1,2 if
the former is a locking function. This seems to record the preempt_disable()
caller properly for preempt_disable() itself as well as for get_cpu_var() or
local_bh_disable().
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
include/linux/ftrace.h | 12 ++++++++++++
include/linux/sched.h | 2 --
kernel/sched/core.c | 14 ++------------
kernel/softirq.c | 4 ++--
4 files changed, 16 insertions(+), 16 deletions(-)
From: Steven Rostedt <rostedt@goodmis.org> Date: 2016-03-02 15:13:45
4.1.15-rt18-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Clark Williams <redacted>
RT has dropped support of rcu_bh, comment out in rcutorture.
Signed-off-by: Clark Williams <redacted>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <redacted>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/rcu/rcutorture.c | 7 +++++++
1 file changed, 7 insertions(+)
From: Steven Rostedt <rostedt@goodmis.org> Date: 2016-03-02 15:14:17
4.1.15-rt18-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
We unlock the lock while the interrupts are off. This isn't a problem
now but will get because the migrate_disable() + enable are not
symmetrical in regard to the status of interrupts.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/softirq.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
From: Steven Rostedt <rostedt@goodmis.org> Date: 2016-03-02 15:15:36
4.1.15-rt18-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
If the NET_RX uses up all of his budget it moves the following NAPI
invocations into the `ksoftirqd`. On -RT it does not do so. Instead it
rises the NET_RX softirq in its current context again.
In order to get closer to mainline's behaviour this patch provides
__raise_softirq_irqoff_ksoft() which raises the softirq in the ksoftird.
Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
include/linux/interrupt.h | 8 ++++++++
kernel/softirq.c | 21 +++++++++++++++++++++
net/core/dev.c | 2 +-
3 files changed, 30 insertions(+), 1 deletion(-)
From: Steven Rostedt <rostedt@goodmis.org> Date: 2016-03-02 15:15:38
4.1.15-rt18-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
The upstream changes were:
6047967 ksoftirqd: Use new cond_resched_rcu_qs() function
28423ad ksoftirqd: Enable IRQs and call cond_resched() before poking RCU
Reported-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/softirq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -30,7 +30,7 @@ struct cpu_stop_done {atomic_tnr_todo;/* nr left to execute */boolexecuted;/* actually executed? */intret;/* collected return value */-structtask_struct*waiter;/* woken when nr_todo reaches 0 */+structcompletioncompletion;/* 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 */
@@ -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);returndone.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);returndone.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);returndone.executed?done.ret:-ENOENT;}
From: Steven Rostedt <rostedt@goodmis.org> Date: 2016-03-02 15:16:44
4.1.15-rt18-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
With interrupts off it makes no sense to do the long path since we can't
leave the CPU anyway. Also we might end up in a recursion with lockdep.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/sched/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Steven Rostedt <rostedt@goodmis.org> Date: 2016-03-02 15:16:45
4.1.15-rt18-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
In the non-RT case the spin_lock_irq() here disables interrupts as well
as raw_spin_lock_irq(). So in the unlock case the interrupts are enabled
too early.
Reported-by: kernel test robot <redacted>
Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/ptrace.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
From: Steven Rostedt <rostedt@goodmis.org> Date: 2016-03-02 15:17:54
4.1.15-rt18-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
The softirqd runs in -RT with SCHED_FIFO (prio 1) and deals mostly with
timer wakeup which can not happen in hardirq context. The prio has been
risen from the normal SCHED_OTHER so the timer wakeup does not happen
too late.
With enough networking load it is possible that the system never goes
idle and schedules ksoftirqd and everything else with a higher priority.
One of the tasks left behind is one of RCU's threads and so we see stalls
and eventually run out of memory.
This patch moves the TIMER and HRTIMER softirqs out of the `ksoftirqd`
thread into its own `ktimersoftd`. The former can now run SCHED_OTHER
(same as mainline) and the latter at SCHED_FIFO due to the wakeups.
From networking point of view: The NAPI callback runs after the network
interrupt thread completes. If its run time takes too long the NAPI code
itself schedules the `ksoftirqd`. Here in the thread it can run at
SCHED_OTHER priority and it won't defer RCU anymore.
Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/softirq.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 74 insertions(+), 11 deletions(-)
@@ -171,6 +175,17 @@ static void wakeup_softirqd(void)wake_up_process(tsk);}+#ifdef CONFIG_PREEMPT_RT_FULL+staticvoidwakeup_timer_softirqd(void)+{+/* Interrupts are disabled: no need to stop preemption */+structtask_struct*tsk=__this_cpu_read(ktimer_softirqd);++if(tsk&&tsk->state!=TASK_RUNNING)+wake_up_process(tsk);+}+#endif+staticvoidhandle_softirq(unsignedintvec_nr){structsoftirq_action*h=softirq_vec+vec_nr;
@@ -628,16 +646,30 @@ static void do_raise_softirq_irqoff(unsigned int nr)*delegateittoksoftirqd.*/if(!in_irq()&¤t->softirq_nestcnt)-current->softirqs_raised|=(1U<<nr);-elseif(__this_cpu_read(ksoftirqd))-__this_cpu_read(ksoftirqd)->softirqs_raised|=(1U<<nr);+current->softirqs_raised|=mask;+elseif(!__this_cpu_read(ksoftirqd)||!__this_cpu_read(ktimer_softirqd))+return;++if(mask&TIMER_SOFTIRQS)+__this_cpu_read(ktimer_softirqd)->softirqs_raised|=mask;+else+__this_cpu_read(ksoftirqd)->softirqs_raised|=mask;+}++staticvoidwakeup_proper_softirq(unsignedintnr)+{+if((1UL<<nr)&TIMER_SOFTIRQS)+wakeup_timer_softirqd();+else+wakeup_softirqd();}+void__raise_softirq_irqoff(unsignedintnr){do_raise_softirq_irqoff(nr);if(!in_irq()&&!current->softirq_nestcnt)-wakeup_softirqd();+wakeup_proper_softirq(nr);}/*
@@ -663,7 +695,7 @@ void raise_softirq_irqoff(unsigned int nr)*raiseaWARN()iftheconditionismet.*/if(!current->softirq_nestcnt)-wakeup_softirqd();+wakeup_proper_softirq(nr);}staticinlineintksoftirqd_softirq_pending(void)
@@ -676,22 +708,37 @@ static inline void _local_bh_enable_nort(void) { }staticinlinevoidksoftirqd_set_sched_params(unsignedintcpu){+/* Take over all but timer pending softirqs when starting */+local_irq_disable();+current->softirqs_raised=local_softirq_pending()&~TIMER_SOFTIRQS;+local_irq_enable();+}++staticinlinevoidktimer_softirqd_set_sched_params(unsignedintcpu)+{structsched_paramparam={.sched_priority=1};sched_setscheduler(current,SCHED_FIFO,¶m);-/* Take over all pending softirqs when starting */++/* Take over timer pending softirqs when starting */local_irq_disable();-current->softirqs_raised=local_softirq_pending();+current->softirqs_raised=local_softirq_pending()&TIMER_SOFTIRQS;local_irq_enable();}-staticinlinevoidksoftirqd_clr_sched_params(unsignedintcpu,boolonline)+staticinlinevoidktimer_softirqd_clr_sched_params(unsignedintcpu,+boolonline){structsched_paramparam={.sched_priority=0};sched_setscheduler(current,SCHED_NORMAL,¶m);}+staticintktimer_softirqd_should_run(unsignedintcpu)+{+returncurrent->softirqs_raised;+}+#endif /* PREEMPT_RT_FULL *//**Enteraninterruptcontext.