Skip to contentSkip to conversation

4.14.170-rt75

ANNOUNCE Tom Zanussi 1 participant 1 message Mar 5, 2020

Subsystems (12)
lore
Share & tools
lore
#0 lore raw

Hello RT Folks!

I'm pleased to announce the 4.14.170-rt75 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: v4.14-rt
Head SHA1: 0e16752bdd50bea7991924098b0922eb2a62794b

Or to build 4.14.170-rt75 directly, the following patches should be applied:

https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.14.tar.xz

https://www.kernel.org/pub/linux/kernel/v4.x/patch-4.14.170.xz

https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/patch-4.14.170-rt75.patch.xz

You can also build from 4.14.170-rt74 by applying the incremental patch:

https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/incr/patch-4.14.170-rt74-rt75.patch.xz

Enjoy!

Tom

Changes from v4.14.170-rt74:
---

Daniel Wagner (1):
lib/smp_processor_id: Adjust check_preemption_disabled()

Joe Korty (1):
Fix wrong-variable use in irq_set_affinity_notifier

Julien Grall (1):
lib/ubsan: Don't seralize UBSAN report

Juri Lelli (1):
sched/deadline: Ensure inactive_timer runs in hardirq context

Liu Haitao (1):
kmemleak: Change the lock of kmemleak_object to raw_spinlock_t

Peter Zijlstra (1):

      locking/rtmutex: Clean ->pi_blocked_on in the error case

Scott Wood (7):
sched: migrate_dis/enable: Use sleeping_lock…() to annotate sleeping points
sched: __set_cpus_allowed_ptr: Check cpus_mask, not cpus_ptr
sched: Remove dead __migrate_disabled() check
sched: migrate disable: Protect cpus_ptr with lock
sched: migrate_enable: Use select_fallback_rq()
sched: Lazy migrate_disable processing
sched: migrate_enable: Use stop_one_cpu_nowait()

Sebastian Andrzej Siewior (8):
i2c: exynos5: Remove IRQF_ONESHOT
i2c: hix5hd2: Remove IRQF_ONESHOT
x86: preempt: Check preemption level before looking at lazy-preempt
futex: Make the futex_hash_bucket spinlock_t again and bring back its old state Revert "ARM: Initialize split page table locks for vector page"
locking: Make spinlock_t and rwlock_t a RCU section on RT sched/core: migrate_enable() must access takedown_cpu_task on !HOTPLUG_CPU
sched: migrate_enable: Busy loop until the migration request is completed

Tom Zanussi (1):

      Linux 4.14.170-rt75

Waiman Long (1):
lib/smp_processor_id: Don't use cpumask_equal()
---
arch/arm/kernel/process.c | 24 ----

 arch/x86/include/asm/preempt.h   |   2 +
 drivers/i2c/busses/i2c-exynos5.c |   4 +-
 drivers/i2c/busses/i2c-hix5hd2.c |   3 +-
 include/linux/cpu.h              |   4 -
 include/linux/init_task.h        |   9 ++
 include/linux/sched.h            |  11 +-
 include/linux/stop_machine.h     |   2 +
 kernel/cpu.c                     | 103 +++++++----------
 kernel/futex.c                   | 231 ++++++++++++++++++++++-----------------
 kernel/irq/manage.c              |   2 +-
 kernel/locking/rtmutex.c         | 114 +++++++++++++++----
 kernel/locking/rtmutex_common.h  |   3 +
 kernel/locking/rwlock-rt.c       |   6 +
 kernel/sched/core.c              | 211 +++++++++++++++--------------------
 kernel/sched/deadline.c          |   4 +-
 kernel/sched/sched.h             |   4 +
 kernel/stop_machine.c            |   7 +-
 lib/smp_processor_id.c           |   7 +-
 lib/ubsan.c                      |  76 +++++--------
 localversion-rt                  |   2 +-
 mm/kmemleak.c                    |  72 ++++++------
 22 files changed, 461 insertions(+), 440 deletions(-)

---

arch/arm/kernel/process.c +0 -24
index cf4e1452d4b4..d96714e1858c 100644
@@ -325,30 +325,6 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
 }
 
 #ifdef CONFIG_MMU
-/*
- * CONFIG_SPLIT_PTLOCK_CPUS results in a page->ptl lock.  If the lock is not
- * initialized by pgtable_page_ctor() then a coredump of the vector page will
- * fail.
- */
-static int __init vectors_user_mapping_init_page(void)
-{
-	struct page *page;
-	unsigned long addr = 0xffff0000;
-	pgd_t *pgd;
-	pud_t *pud;
-	pmd_t *pmd;
-
-	pgd = pgd_offset_k(addr);
-	pud = pud_offset(pgd, addr);
-	pmd = pmd_offset(pud, addr);
-	page = pmd_page(*(pmd));
-
-	pgtable_page_ctor(page);
-
-	return 0;
-}
-late_initcall(vectors_user_mapping_init_page);
-
 #ifdef CONFIG_KUSER_HELPERS
 /*
  * The vectors page is always readable from user space for the
arch/x86/include/asm/preempt.h +2 -0
index f66708779274..afa0e42ccdd1 100644
@@ -96,6 +96,8 @@ static __always_inline bool __preempt_count_dec_and_test(void)
 	if (____preempt_count_dec_and_test())
 		return true;
 #ifdef CONFIG_PREEMPT_LAZY
+	if (preempt_count())
+		return false;
 	if (current_thread_info()->preempt_lazy_count)
 		return false;
 	return test_thread_flag(TIF_NEED_RESCHED_LAZY);
drivers/i2c/busses/i2c-exynos5.c +1 -3
index 3855e0b11877..ec490eaac6f7 100644
@@ -758,9 +758,7 @@ static int exynos5_i2c_probe(struct platform_device *pdev)
 	}
 
 	ret = devm_request_irq(&pdev->dev, i2c->irq, exynos5_i2c_irq,
-				IRQF_NO_SUSPEND | IRQF_ONESHOT,
-				dev_name(&pdev->dev), i2c);
-
+			       IRQF_NO_SUSPEND, dev_name(&pdev->dev), i2c);
 	if (ret != 0) {
 		dev_err(&pdev->dev, "cannot request HS-I2C IRQ %d\n", i2c->irq);
 		goto err_clk;
drivers/i2c/busses/i2c-hix5hd2.c +1 -2
index bb68957d3da5..76c1a207ccc1 100644
@@ -464,8 +464,7 @@ static int hix5hd2_i2c_probe(struct platform_device *pdev)
 	hix5hd2_i2c_init(priv);
 
 	ret = devm_request_irq(&pdev->dev, irq, hix5hd2_i2c_irq,
-			       IRQF_NO_SUSPEND | IRQF_ONESHOT,
-			       dev_name(&pdev->dev), priv);
+			       IRQF_NO_SUSPEND, dev_name(&pdev->dev), priv);
 	if (ret != 0) {
 		dev_err(&pdev->dev, "cannot request HS-I2C IRQ %d\n", irq);
 		goto err_clk;
include/linux/cpu.h +0 -4
index 580c1b5bee1e..0cb481727feb 100644
@@ -127,8 +127,6 @@ extern void cpu_hotplug_disable(void);
 extern void cpu_hotplug_enable(void);
 void clear_tasks_mm_cpumask(int cpu);
 int cpu_down(unsigned int cpu);
-extern void pin_current_cpu(void);
-extern void unpin_current_cpu(void);
 
 #else /* CONFIG_HOTPLUG_CPU */
 
@@ -139,8 +137,6 @@ static inline void cpus_read_unlock(void) { }
 static inline void lockdep_assert_cpus_held(void) { }
 static inline void cpu_hotplug_disable(void) { }
 static inline void cpu_hotplug_enable(void) { }
-static inline void pin_current_cpu(void) { }
-static inline void unpin_current_cpu(void) { }
 
 #endif	/* !CONFIG_HOTPLUG_CPU */
 
include/linux/init_task.h +9 -0
index ee3ff961b84c..3f7aa4dc7e1f 100644
@@ -225,6 +225,14 @@ extern struct cred init_cred;
 #define INIT_TASK_SECURITY
 #endif
 
+#if defined(CONFIG_SMP) && defined(CONFIG_PREEMPT_RT_BASE) &&		\
+    defined(CONFIG_SCHED_DEBUG)
+# define INIT_LAZY_MIGRATE(tsk)						\
+	.pinned_on_cpu	= -1,
+#else
+# define INIT_LAZY_MIGRATE(tsk)
+#endif
+
 /*
  *  INIT_TASK is used to set up the first task table, touch at
  * your own risk!. Base=0, limit=0x1fffff (=2MB)
@@ -243,6 +251,7 @@ extern struct cred init_cred;
 	.cpus_ptr	= &tsk.cpus_mask,				\
 	.cpus_mask	= CPU_MASK_ALL,					\
 	.nr_cpus_allowed= NR_CPUS,					\
+	INIT_LAZY_MIGRATE(tsk)						\
 	.mm		= NULL,						\
 	.active_mm	= &init_mm,					\
 	.restart_block = {						\
include/linux/sched.h +6 -5
index 2bf136617d19..6e3eded72d8e 100644
@@ -229,6 +229,8 @@ extern void io_schedule_finish(int token);
 extern long io_schedule_timeout(long timeout);
 extern void io_schedule(void);
 
+int cpu_nr_pinned(int cpu);
+
 /**
  * struct prev_cputime - snapshot of system and user cputime
  * @utime: time spent in user mode
@@ -628,16 +630,13 @@ struct task_struct {
 	cpumask_t			cpus_mask;
 #if defined(CONFIG_SMP) && defined(CONFIG_PREEMPT_RT_BASE)
 	int				migrate_disable;
-	int				migrate_disable_update;
-	int				pinned_on_cpu;
+	bool				migrate_disable_scheduled;
 # ifdef CONFIG_SCHED_DEBUG
-	int				migrate_disable_atomic;
+	int				pinned_on_cpu;
 # endif
-
 #elif !defined(CONFIG_SMP) && defined(CONFIG_PREEMPT_RT_BASE)
 # ifdef CONFIG_SCHED_DEBUG
 	int				migrate_disable;
-	int				migrate_disable_atomic;
 # endif
 #endif
 #ifdef CONFIG_PREEMPT_RT_FULL
@@ -1883,4 +1882,6 @@ extern long sched_getaffinity(pid_t pid, struct cpumask *mask);
 #define TASK_SIZE_OF(tsk)	TASK_SIZE
 #endif
 
+extern struct task_struct *takedown_cpu_task;
+
 #endif
include/linux/stop_machine.h +2 -0
index 6d3635c86dbe..82fc686ddd9e 100644
@@ -26,6 +26,8 @@ struct cpu_stop_work {
 	cpu_stop_fn_t		fn;
 	void			*arg;
 	struct cpu_stop_done	*done;
+	/* Did not run due to disabled stopper; for nowait debug checks */
+	bool			disabled;
 };
 
 int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg);
kernel/cpu.c +40 -63

148 lines not on this page · raw message

kernel/futex.c +132 -99

519 lines not on this page · raw message

kernel/irq/manage.c +1 -1
index 071691963f7b..12702d48aaa3 100644
@@ -353,7 +353,7 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify)
 
 	if (old_notify) {
 #ifdef CONFIG_PREEMPT_RT_BASE
-		kthread_cancel_work_sync(&notify->work);
+		kthread_cancel_work_sync(&old_notify->work);
 #else
 		cancel_work_sync(&old_notify->work);
 #endif
kernel/locking/rtmutex.c +90 -24

228 lines not on this page · raw message

kernel/locking/rtmutex_common.h +3 -0
index 2f6662d052d6..2a157c78e18c 100644
@@ -131,6 +131,9 @@ enum rtmutex_chainwalk {
 /*
  * PI-futex support (proxy locking functions, etc.):
  */
+#define PI_WAKEUP_INPROGRESS	((struct rt_mutex_waiter *) 1)
+#define PI_REQUEUE_INPROGRESS	((struct rt_mutex_waiter *) 2)
+
 extern struct task_struct *rt_mutex_next_owner(struct rt_mutex *lock);
 extern void rt_mutex_init_proxy_locked(struct rt_mutex *lock,
 				       struct task_struct *proxy_owner);
kernel/locking/rwlock-rt.c +6 -0
index c3b91205161c..0ae8c62ea832 100644
@@ -310,6 +310,7 @@ int __lockfunc rt_read_trylock(rwlock_t *rwlock)
 	ret = do_read_rt_trylock(rwlock);
 	if (ret) {
 		rwlock_acquire_read(&rwlock->dep_map, 0, 1, _RET_IP_);
+		rcu_read_lock();
 	} else {
 		migrate_enable();
 		sleeping_lock_dec();
@@ -327,6 +328,7 @@ int __lockfunc rt_write_trylock(rwlock_t *rwlock)
 	ret = do_write_rt_trylock(rwlock);
 	if (ret) {
 		rwlock_acquire(&rwlock->dep_map, 0, 1, _RET_IP_);
+		rcu_read_lock();
 	} else {
 		migrate_enable();
 		sleeping_lock_dec();
@@ -338,6 +340,7 @@ EXPORT_SYMBOL(rt_write_trylock);
 void __lockfunc rt_read_lock(rwlock_t *rwlock)
 {
 	sleeping_lock_inc();
+	rcu_read_lock();
 	migrate_disable();
 	rwlock_acquire_read(&rwlock->dep_map, 0, 0, _RET_IP_);
 	do_read_rt_lock(rwlock);
@@ -347,6 +350,7 @@ EXPORT_SYMBOL(rt_read_lock);
 void __lockfunc rt_write_lock(rwlock_t *rwlock)
 {
 	sleeping_lock_inc();
+	rcu_read_lock();
 	migrate_disable();
 	rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_);
 	do_write_rt_lock(rwlock);
@@ -358,6 +362,7 @@ void __lockfunc rt_read_unlock(rwlock_t *rwlock)
 	rwlock_release(&rwlock->dep_map, 1, _RET_IP_);
 	do_read_rt_unlock(rwlock);
 	migrate_enable();
+	rcu_read_unlock();
 	sleeping_lock_dec();
 }
 EXPORT_SYMBOL(rt_read_unlock);
@@ -367,6 +372,7 @@ void __lockfunc rt_write_unlock(rwlock_t *rwlock)
 	rwlock_release(&rwlock->dep_map, 1, _RET_IP_);
 	do_write_rt_unlock(rwlock);
 	migrate_enable();
+	rcu_read_unlock();
 	sleeping_lock_dec();
 }
 EXPORT_SYMBOL(rt_write_unlock);
kernel/sched/core.c +87 -124

350 lines not on this page · raw message

kernel/sched/deadline.c +2 -2
index eb68f7fb8a36..7b04e54bea01 100644
@@ -252,7 +252,7 @@ static void task_non_contending(struct task_struct *p)
 
 	dl_se->dl_non_contending = 1;
 	get_task_struct(p);
-	hrtimer_start(timer, ns_to_ktime(zerolag_time), HRTIMER_MODE_REL);
+	hrtimer_start(timer, ns_to_ktime(zerolag_time), HRTIMER_MODE_REL_HARD);
 }
 
 static void task_contending(struct sched_dl_entity *dl_se, int flags)
@@ -1234,7 +1234,7 @@ void init_dl_inactive_task_timer(struct sched_dl_entity *dl_se)
 {
 	struct hrtimer *timer = &dl_se->inactive_timer;
 
-	hrtimer_init(timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	hrtimer_init(timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD);
 	timer->function = inactive_task_timer;
 }
 
kernel/sched/sched.h +4 -0
index 4ec44bcf7d6d..04c41c997a0e 100644
@@ -811,6 +811,10 @@ struct rq {
 	/* Must be inspected within a rcu lock section */
 	struct cpuidle_state *idle_state;
 #endif
+
+#if defined(CONFIG_PREEMPT_RT_BASE) && defined(CONFIG_SMP)
+	int			nr_pinned;
+#endif
 };
 
 static inline int cpu_of(struct rq *rq)
kernel/stop_machine.c +5 -2
index 56f2f2e01229..0e2fc590ba88 100644
@@ -86,8 +86,11 @@ static bool cpu_stop_queue_work(unsigned int cpu, struct cpu_stop_work *work)
 	enabled = stopper->enabled;
 	if (enabled)
 		__cpu_stop_queue_work(stopper, work, &wakeq);
-	else if (work->done)
-		cpu_stop_signal_done(work->done);
+	else {
+		work->disabled = true;
+		if (work->done)
+			cpu_stop_signal_done(work->done);
+	}
 	raw_spin_unlock_irqrestore(&stopper->lock, flags);
 
 	wake_up_q(&wakeq);
lib/smp_processor_id.c +6 -1
index 6f4a4ae881c8..3ceb2cc1516b 100644
@@ -23,7 +23,12 @@ notrace static unsigned int check_preemption_disabled(const char *what1,
 	 * Kernel threads bound to a single CPU can safely use
 	 * smp_processor_id():
 	 */
-	if (cpumask_equal(current->cpus_ptr, cpumask_of(this_cpu)))
+#if defined(CONFIG_PREEMPT_RT_BASE) && (defined(CONFIG_SMP) || defined(CONFIG_SCHED_DEBUG))
+	if (current->migrate_disable)
+		goto out;
+#endif
+
+	if (current->nr_cpus_allowed == 1)
 		goto out;
 
 	/*
lib/ubsan.c +27 -49

270 lines not on this page · raw message

localversion-rt +1 -1
index 7d028f4a9e56..54e7da6f49fb 100644
@@ -1 +1 @@
--rt74
+-rt75
mm/kmemleak.c +36 -36

236 lines not on this page · raw message