All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RT 00/13] Linux 3.18.91-rt98-rc1
@ 2018-01-17 15:14 Steven Rostedt
  2018-01-17 15:14 ` [PATCH RT 01/13] rtmutex: Make lock_killable work Steven Rostedt
                   ` (12 more replies)
  0 siblings, 13 replies; 16+ messages in thread
From: Steven Rostedt @ 2018-01-17 15:14 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Julia Cartwright, Daniel Wagner,
	tom.zanussi, Alex Shi


Dear RT Folks,

This is the RT stable review cycle of patch 3.18.91-rt98-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 1/19/2018.

Enjoy,

-- Steve


To build 3.18.91-rt98-rc1 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.91.xz

  http://www.kernel.org/pub/linux/kernel/projects/rt/3.18/patch-3.18.91-rt98-rc1.patch.xz

You can also build from 3.18.91-rt97 by applying the incremental patch:

http://www.kernel.org/pub/linux/kernel/projects/rt/3.18/incr/patch-3.18.91-rt97-rt98-rc1.patch.xz


Changes from 3.18.91-rt97:

---


Alex Shi (1):
      cpu_pm: replace raw_notifier to atomic_notifier

Mike Galbraith (1):
      kernel/hrtimer/hotplug: don't wake ktimersoftd while holding the hrtimer base lock

Mikulas Patocka (1):
      locking/rt-mutex: fix deadlock in device mapper / block-IO

Sebastian Andrzej Siewior (7):
      random: avoid preempt_disable()ed section
      fs: convert two more BH_Uptodate_Lock related bitspinlocks
      md/raid5: do not disable interrupts
      Revert "fs: jbd2: pull your plug when waiting for space"
      kernel/hrtimer: migrate deferred timer on CPU down
      rt/locking: allow recursive local_trylock()
      net: use trylock in icmp_sk

Steven Rostedt (VMware) (1):
      Linux 3.18.91-rt98-rc1

Thomas Gleixner (2):
      rtmutex: Make lock_killable work
      sched: Prevent task state corruption by spurious lock wakeup

----
 drivers/char/random.c     | 10 ++++++----
 drivers/md/raid5.c        |  4 ++--
 fs/ext4/page-io.c         |  6 ++----
 fs/jbd2/checkpoint.c      |  2 --
 include/linux/locallock.h |  9 +++++++++
 kernel/cpu_pm.c           | 43 ++++++-------------------------------------
 kernel/locking/rtmutex.c  | 44 +++++++++++++++++++++++++++-----------------
 kernel/sched/core.c       |  2 +-
 kernel/time/hrtimer.c     | 20 ++++++++++++++++----
 localversion-rt           |  2 +-
 net/ipv4/icmp.c           |  6 +++++-
 11 files changed, 75 insertions(+), 73 deletions(-)

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH RT 01/13] rtmutex: Make lock_killable work
  2018-01-17 15:14 [PATCH RT 00/13] Linux 3.18.91-rt98-rc1 Steven Rostedt
@ 2018-01-17 15:14 ` Steven Rostedt
  2018-01-17 15:14 ` [PATCH RT 02/13] random: avoid preempt_disable()ed section Steven Rostedt
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Steven Rostedt @ 2018-01-17 15:14 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Julia Cartwright, Daniel Wagner,
	tom.zanussi, Alex Shi, rt-stable

[-- Attachment #1: 0001-rtmutex-Make-lock_killable-work.patch --]
[-- Type: text/plain, Size: 1439 bytes --]

3.18.91-rt98-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Thomas Gleixner <tglx@linutronix.de>

Locking an rt mutex killable does not work because signal handling is
restricted to TASK_INTERRUPTIBLE.

Use signal_pending_state() unconditionaly.

Cc: rt-stable@vger.kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/locking/rtmutex.c | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
index 8d950b4521fc..da35f7ef5324 100644
--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -1532,18 +1532,13 @@ __rt_mutex_slowlock(struct rt_mutex *lock, int state,
 		if (try_to_take_rt_mutex(lock, current, waiter))
 			break;
 
-		/*
-		 * TASK_INTERRUPTIBLE checks for signals and
-		 * timeout. Ignored otherwise.
-		 */
-		if (unlikely(state == TASK_INTERRUPTIBLE)) {
-			/* Signal pending? */
-			if (signal_pending(current))
-				ret = -EINTR;
-			if (timeout && !timeout->task)
-				ret = -ETIMEDOUT;
-			if (ret)
-				break;
+		if (timeout && !timeout->task) {
+			ret = -ETIMEDOUT;
+			break;
+		}
+		if (signal_pending_state(state, current)) {
+			ret = -EINTR;
+			break;
 		}
 
 		if (ww_ctx && ww_ctx->acquired > 0) {
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH RT 02/13] random: avoid preempt_disable()ed section
  2018-01-17 15:14 [PATCH RT 00/13] Linux 3.18.91-rt98-rc1 Steven Rostedt
  2018-01-17 15:14 ` [PATCH RT 01/13] rtmutex: Make lock_killable work Steven Rostedt
@ 2018-01-17 15:14 ` Steven Rostedt
  2018-01-17 15:14 ` [PATCH RT 03/13] sched: Prevent task state corruption by spurious lock wakeup Steven Rostedt
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Steven Rostedt @ 2018-01-17 15:14 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Julia Cartwright, Daniel Wagner,
	tom.zanussi, Alex Shi

[-- Attachment #1: 0002-random-avoid-preempt_disable-ed-section.patch --]
[-- Type: text/plain, Size: 2158 bytes --]

3.18.91-rt98-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

extract_crng() will use sleeping locks while in a preempt_disable()
section due to get_cpu_var().
Work around it with local_locks.

Cc: stable-rt@vger.kernel.org # where it applies to
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 drivers/char/random.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/char/random.c b/drivers/char/random.c
index acb8e7c218d1..06c4b06fcea0 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -260,6 +260,7 @@
 #include <linux/irq.h>
 #include <linux/syscalls.h>
 #include <linux/completion.h>
+#include <linux/locallock.h>
 
 #include <asm/processor.h>
 #include <asm/uaccess.h>
@@ -1712,6 +1713,7 @@ int random_int_secret_init(void)
 
 static DEFINE_PER_CPU(__u32 [MD5_DIGEST_WORDS], get_random_int_hash)
 		__aligned(sizeof(unsigned long));
+static DEFINE_LOCAL_IRQ_LOCK(hash_entropy_int_lock);
 
 /*
  * Get a random word for internal kernel use only. Similar to urandom but
@@ -1727,12 +1729,12 @@ unsigned int get_random_int(void)
 	if (arch_get_random_int(&ret))
 		return ret;
 
-	hash = get_cpu_var(get_random_int_hash);
+	hash = get_locked_var(hash_entropy_int_lock, get_random_int_hash);
 
 	hash[0] += current->pid + jiffies + random_get_entropy();
 	md5_transform(hash, random_int_secret);
 	ret = hash[0];
-	put_cpu_var(get_random_int_hash);
+	put_locked_var(hash_entropy_int_lock, get_random_int_hash);
 
 	return ret;
 }
@@ -1749,12 +1751,12 @@ unsigned long get_random_long(void)
 	if (arch_get_random_long(&ret))
 		return ret;
 
-	hash = get_cpu_var(get_random_int_hash);
+	hash = get_locked_var(hash_entropy_int_lock, get_random_int_hash);
 
 	hash[0] += current->pid + jiffies + random_get_entropy();
 	md5_transform(hash, random_int_secret);
 	ret = *(unsigned long *)hash;
-	put_cpu_var(get_random_int_hash);
+	put_locked_var(hash_entropy_int_lock, get_random_int_hash);
 
 	return ret;
 }
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH RT 03/13] sched: Prevent task state corruption by spurious lock wakeup
  2018-01-17 15:14 [PATCH RT 00/13] Linux 3.18.91-rt98-rc1 Steven Rostedt
  2018-01-17 15:14 ` [PATCH RT 01/13] rtmutex: Make lock_killable work Steven Rostedt
  2018-01-17 15:14 ` [PATCH RT 02/13] random: avoid preempt_disable()ed section Steven Rostedt
@ 2018-01-17 15:14 ` Steven Rostedt
  2018-01-17 15:14 ` [PATCH RT 04/13] fs: convert two more BH_Uptodate_Lock related bitspinlocks Steven Rostedt
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Steven Rostedt @ 2018-01-17 15:14 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Julia Cartwright, Daniel Wagner,
	tom.zanussi, Alex Shi, stable-rt, Mathias Koehrer, David Hauck

[-- Attachment #1: 0003-sched-Prevent-task-state-corruption-by-spurious-lock.patch --]
[-- Type: text/plain, Size: 2756 bytes --]

3.18.91-rt98-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Thomas Gleixner <tglx@linutronix.de>

Mathias and others reported GDB failures on RT.

The following scenario leads to task state corruption:

CPU0						CPU1

T1->state = TASK_XXX;
spin_lock(&lock)
  rt_spin_lock_slowlock(&lock->rtmutex)
    raw_spin_lock(&rtm->wait_lock);
    T1->saved_state = current->state;
    T1->state = TASK_UNINTERRUPTIBLE;
						spin_unlock(&lock)
    task_blocks_on_rt_mutex(rtm)  		  rt_spin_lock_slowunlock(&lock->rtmutex)
      queue_waiter(rtm)				    raw_spin_lock(&rtm->wait_lock);
      pi_chain_walk(rtm)
        raw_spin_unlock(&rtm->wait_lock);
						    wake_top_waiter(T1)

      raw_spin_lock(&rtm->wait_lock);

    for (;;) {
      if (__try_to_take_rt_mutex())  <- Succeeds
        break;
      ...
    }

    T1->state = T1->saved_state;
						     try_to_wake_up(T1)
						       ttwu_do_wakeup(T1)
						         T1->state = TASK_RUNNING;

In most cases this is harmless because waiting for some event, which is the
usual reason for TASK_[UN]INTERRUPTIBLE has to be safe against other forms
of spurious wakeups anyway.

But in case of TASK_TRACED this is actually fatal, because the task loses
the TASK_TRACED state. In consequence it fails to consume SIGSTOP which was
sent from the debugger and actually delivers SIGSTOP to the task which
breaks the ptrace mechanics and brings the debugger into an unexpected
state.

The TASK_TRACED state should prevent getting there due to the state
matching logic in try_to_wake_up(). But that's not true because
wake_up_lock_sleeper() uses TASK_ALL as state mask. That's bogus because
lock sleepers always use TASK_UNINTERRUPTIBLE, so the wakeup should use
that as well.

The cure is way simpler as figuring it out:

Change the mask used in wake_up_lock_sleeper() from TASK_ALL to
TASK_UNINTERRUPTIBLE.

Cc: stable-rt@vger.kernel.org
Reported-by: Mathias Koehrer <mathias.koehrer@etas.com>
Reported-by: David Hauck <davidh@netacquire.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 2532e4f2d075..b606f31e5034 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1923,7 +1923,7 @@ EXPORT_SYMBOL(wake_up_process);
  */
 int wake_up_lock_sleeper(struct task_struct *p)
 {
-	return try_to_wake_up(p, TASK_ALL, WF_LOCK_SLEEPER);
+	return try_to_wake_up(p, TASK_UNINTERRUPTIBLE, WF_LOCK_SLEEPER);
 }
 
 int wake_up_state(struct task_struct *p, unsigned int state)
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH RT 04/13] fs: convert two more BH_Uptodate_Lock related bitspinlocks
  2018-01-17 15:14 [PATCH RT 00/13] Linux 3.18.91-rt98-rc1 Steven Rostedt
                   ` (2 preceding siblings ...)
  2018-01-17 15:14 ` [PATCH RT 03/13] sched: Prevent task state corruption by spurious lock wakeup Steven Rostedt
@ 2018-01-17 15:14 ` Steven Rostedt
  2018-01-17 15:14 ` [PATCH RT 05/13] md/raid5: do not disable interrupts Steven Rostedt
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Steven Rostedt @ 2018-01-17 15:14 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Julia Cartwright, Daniel Wagner,
	tom.zanussi, Alex Shi, stable-rt

[-- Attachment #1: 0004-fs-convert-two-more-BH_Uptodate_Lock-related-bitspin.patch --]
[-- Type: text/plain, Size: 1483 bytes --]

3.18.91-rt98-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

We convert all BH_Uptodate_Lock based bit-spinlocks to use
bh_uptodate_lock_irqsave() instead. Those two were introduced after the
initial change in -RT and were not noticed before.

Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 fs/ext4/page-io.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
index b24a2541a9ba..662c027417ff 100644
--- a/fs/ext4/page-io.c
+++ b/fs/ext4/page-io.c
@@ -87,8 +87,7 @@ static void ext4_finish_bio(struct bio *bio)
 		 * We check all buffers in the page under BH_Uptodate_Lock
 		 * to avoid races with other end io clearing async_write flags
 		 */
-		local_irq_save(flags);
-		bit_spin_lock(BH_Uptodate_Lock, &head->b_state);
+		flags = bh_uptodate_lock_irqsave(head);
 		do {
 			if (bh_offset(bh) < bio_start ||
 			    bh_offset(bh) + bh->b_size > bio_end) {
@@ -100,8 +99,7 @@ static void ext4_finish_bio(struct bio *bio)
 			if (error)
 				buffer_io_error(bh);
 		} while ((bh = bh->b_this_page) != head);
-		bit_spin_unlock(BH_Uptodate_Lock, &head->b_state);
-		local_irq_restore(flags);
+		bh_uptodate_unlock_irqrestore(head, flags);
 		if (!under_io)
 			end_page_writeback(page);
 	}
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH RT 05/13] md/raid5: do not disable interrupts
  2018-01-17 15:14 [PATCH RT 00/13] Linux 3.18.91-rt98-rc1 Steven Rostedt
                   ` (3 preceding siblings ...)
  2018-01-17 15:14 ` [PATCH RT 04/13] fs: convert two more BH_Uptodate_Lock related bitspinlocks Steven Rostedt
@ 2018-01-17 15:14 ` Steven Rostedt
  2018-01-17 15:14 ` [PATCH RT 06/13] locking/rt-mutex: fix deadlock in device mapper / block-IO Steven Rostedt
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Steven Rostedt @ 2018-01-17 15:14 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Julia Cartwright, Daniel Wagner,
	tom.zanussi, Alex Shi, stable-rt

[-- Attachment #1: 0005-md-raid5-do-not-disable-interrupts.patch --]
[-- Type: text/plain, Size: 1882 bytes --]

3.18.91-rt98-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

|BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:974
|in_atomic(): 0, irqs_disabled(): 1, pid: 2992, name: lvm
|CPU: 2 PID: 2992 Comm: lvm Not tainted 4.13.10-rt3+ #54
|Call Trace:
| dump_stack+0x4f/0x65
| ___might_sleep+0xfc/0x150
| atomic_dec_and_spin_lock+0x3c/0x80
| raid5_release_stripe+0x73/0x110
| grow_one_stripe+0xce/0xf0
| setup_conf+0x841/0xaa0
| raid5_run+0x7e7/0xa40
| md_run+0x515/0xaf0
| raid_ctr+0x147d/0x25e0
| dm_table_add_target+0x155/0x320
| table_load+0x103/0x320
| ctl_ioctl+0x1d9/0x510
| dm_ctl_ioctl+0x9/0x10
| do_vfs_ioctl+0x8e/0x670
| SyS_ioctl+0x3c/0x70
| entry_SYSCALL_64_fastpath+0x17/0x98

The interrupts were disabled because ->device_lock is taken with
interrupts disabled.

Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 drivers/md/raid5.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 6a97d9e930c8..c206ed033542 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -433,7 +433,7 @@ static void release_stripe(struct stripe_head *sh)
 		md_wakeup_thread(conf->mddev->thread);
 	return;
 slow_path:
-	local_irq_save(flags);
+	local_irq_save_nort(flags);
 	/* we are ok here if STRIPE_ON_RELEASE_LIST is set or not */
 	if (atomic_dec_and_lock(&sh->count, &conf->device_lock)) {
 		INIT_LIST_HEAD(&list);
@@ -442,7 +442,7 @@ slow_path:
 		spin_unlock(&conf->device_lock);
 		release_inactive_stripe_list(conf, &list, hash);
 	}
-	local_irq_restore(flags);
+	local_irq_restore_nort(flags);
 }
 
 static inline void remove_hash(struct stripe_head *sh)
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH RT 06/13] locking/rt-mutex: fix deadlock in device mapper / block-IO
  2018-01-17 15:14 [PATCH RT 00/13] Linux 3.18.91-rt98-rc1 Steven Rostedt
                   ` (4 preceding siblings ...)
  2018-01-17 15:14 ` [PATCH RT 05/13] md/raid5: do not disable interrupts Steven Rostedt
@ 2018-01-17 15:14 ` Steven Rostedt
  2018-01-17 15:14 ` [PATCH RT 07/13] Revert "fs: jbd2: pull your plug when waiting for space" Steven Rostedt
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Steven Rostedt @ 2018-01-17 15:14 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Julia Cartwright, Daniel Wagner,
	tom.zanussi, Alex Shi, stable-rt, Mikulas Patocka

[-- Attachment #1: 0006-locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch --]
[-- Type: text/plain, Size: 3196 bytes --]

3.18.91-rt98-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Mikulas Patocka <mpatocka@redhat.com>

When some block device driver creates a bio and submits it to another
block device driver, the bio is added to current->bio_list (in order to
avoid unbounded recursion).

However, this queuing of bios can cause deadlocks, in order to avoid them,
device mapper registers a function flush_current_bio_list. This function
is called when device mapper driver blocks. It redirects bios queued on
current->bio_list to helper workqueues, so that these bios can proceed
even if the driver is blocked.

The problem with CONFIG_PREEMPT_RT_FULL is that when the device mapper
driver blocks, it won't call flush_current_bio_list (because
tsk_is_pi_blocked returns true in sched_submit_work), so deadlocks in
block device stack can happen.

Note that we can't call blk_schedule_flush_plug if tsk_is_pi_blocked
returns true - that would cause
BUG_ON(rt_mutex_real_waiter(task->pi_blocked_on)) in
task_blocks_on_rt_mutex when flush_current_bio_list attempts to take a
spinlock.

So the proper fix is to call blk_schedule_flush_plug in rt_mutex_fastlock,
when fast acquire failed and when the task is about to block.

CC: stable-rt@vger.kernel.org
[bigeasy: The deadlock is not device-mapper specific, it can also occur
          in plain EXT4]
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/locking/rtmutex.c | 25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
index da35f7ef5324..d58780b59583 100644
--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -22,6 +22,7 @@
 #include <linux/sched/deadline.h>
 #include <linux/timer.h>
 #include <linux/ww_mutex.h>
+#include <linux/blkdev.h>
 
 #include "rtmutex_common.h"
 
@@ -1843,9 +1844,19 @@ rt_mutex_fastlock(struct rt_mutex *lock, int state,
 	if (likely(rt_mutex_cmpxchg(lock, NULL, current))) {
 		rt_mutex_deadlock_account_lock(lock, current);
 		return 0;
-	} else
-		return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK,
-			      ww_ctx);
+	}
+
+	/*
+	 * If rt_mutex blocks, the function sched_submit_work will not call
+	 * blk_schedule_flush_plug (because tsk_is_pi_blocked would be true).
+	 * We must call blk_schedule_flush_plug here, if we don't call it,
+	 * a deadlock in device mapper may happen.
+	 */
+	if (unlikely(blk_needs_flush_plug(current)))
+		blk_schedule_flush_plug(current);
+
+	return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK,
+		      ww_ctx);
 }
 
 static inline int
@@ -1862,8 +1873,12 @@ rt_mutex_timed_fastlock(struct rt_mutex *lock, int state,
 	    likely(rt_mutex_cmpxchg(lock, NULL, current))) {
 		rt_mutex_deadlock_account_lock(lock, current);
 		return 0;
-	} else
-		return slowfn(lock, state, timeout, chwalk, ww_ctx);
+	}
+
+	if (unlikely(blk_needs_flush_plug(current)))
+		blk_schedule_flush_plug(current);
+
+	return slowfn(lock, state, timeout, chwalk, ww_ctx);
 }
 
 static inline int
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH RT 07/13] Revert "fs: jbd2: pull your plug when waiting for space"
  2018-01-17 15:14 [PATCH RT 00/13] Linux 3.18.91-rt98-rc1 Steven Rostedt
                   ` (5 preceding siblings ...)
  2018-01-17 15:14 ` [PATCH RT 06/13] locking/rt-mutex: fix deadlock in device mapper / block-IO Steven Rostedt
@ 2018-01-17 15:14 ` Steven Rostedt
  2018-01-17 15:46   ` Sebastian Andrzej Siewior
  2018-01-17 15:14 ` [PATCH RT 08/13] cpu_pm: replace raw_notifier to atomic_notifier Steven Rostedt
                   ` (5 subsequent siblings)
  12 siblings, 1 reply; 16+ messages in thread
From: Steven Rostedt @ 2018-01-17 15:14 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Julia Cartwright, Daniel Wagner,
	tom.zanussi, Alex Shi, stable-rt

[-- Attachment #1: 0007-Revert-fs-jbd2-pull-your-plug-when-waiting-for-space.patch --]
[-- Type: text/plain, Size: 1045 bytes --]

3.18.91-rt98-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

This reverts commit "fs: jbd2: pull your plug when waiting for space".
This was a duct-tape fix which shouldn't be needed since commit
"locking/rt-mutex: fix deadlock in device mapper / block-IO".

Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 fs/jbd2/checkpoint.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c
index 78c1545a3fab..8c44654ce274 100644
--- a/fs/jbd2/checkpoint.c
+++ b/fs/jbd2/checkpoint.c
@@ -116,8 +116,6 @@ void __jbd2_log_wait_for_space(journal_t *journal)
 	nblocks = jbd2_space_needed(journal);
 	while (jbd2_log_space_left(journal) < nblocks) {
 		write_unlock(&journal->j_state_lock);
-		if (current->plug)
-			io_schedule();
 		mutex_lock(&journal->j_checkpoint_mutex);
 
 		/*
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH RT 08/13] cpu_pm: replace raw_notifier to atomic_notifier
  2018-01-17 15:14 [PATCH RT 00/13] Linux 3.18.91-rt98-rc1 Steven Rostedt
                   ` (6 preceding siblings ...)
  2018-01-17 15:14 ` [PATCH RT 07/13] Revert "fs: jbd2: pull your plug when waiting for space" Steven Rostedt
@ 2018-01-17 15:14 ` Steven Rostedt
  2018-01-17 15:14 ` [PATCH RT 09/13] kernel/hrtimer: migrate deferred timer on CPU down Steven Rostedt
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Steven Rostedt @ 2018-01-17 15:14 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Julia Cartwright, Daniel Wagner,
	tom.zanussi, Alex Shi, Anders Roxell, Rik van Riel,
	Rafael J. Wysocki, Daniel Lezcano

[-- Attachment #1: 0008-cpu_pm-replace-raw_notifier-to-atomic_notifier.patch --]
[-- Type: text/plain, Size: 5652 bytes --]

3.18.91-rt98-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Alex Shi <alex.shi@linaro.org>

This patch replace a rwlock and raw notifier by atomic notifier which
protected by spin_lock and rcu.

The first to reason to have this replace is due to a 'scheduling while
 atomic' bug of RT kernel on arm/arm64 platform. On arm/arm64, rwlock
cpu_pm_notifier_lock in cpu_pm cause a potential schedule after irq
disable in idle call chain:

cpu_startup_entry
  cpu_idle_loop
    local_irq_disable()
    cpuidle_idle_call
      call_cpuidle
        cpuidle_enter
          cpuidle_enter_state
            ->enter :arm_enter_idle_state
              cpu_pm_enter/exit
                CPU_PM_CPU_IDLE_ENTER
                  read_lock(&cpu_pm_notifier_lock); <-- sleep in idle
                     __rt_spin_lock();
                        schedule();

The kernel panic is here:
[    4.609601] BUG: scheduling while atomic: swapper/1/0/0x00000002
[    4.609608] [<ffff0000086fae70>] arm_enter_idle_state+0x18/0x70
[    4.609614] Modules linked in:
[    4.609615] [<ffff0000086f9298>] cpuidle_enter_state+0xf0/0x218
[    4.609620] [<ffff0000086f93f8>] cpuidle_enter+0x18/0x20
[    4.609626] Preemption disabled at:
[    4.609627] [<ffff0000080fa234>] call_cpuidle+0x24/0x40
[    4.609635] [<ffff000008882fa4>] schedule_preempt_disabled+0x1c/0x28
[    4.609639] [<ffff0000080fa49c>] cpu_startup_entry+0x154/0x1f8
[    4.609645] [<ffff00000808e004>] secondary_start_kernel+0x15c/0x1a0

Daniel Lezcano said this notification is needed on arm/arm64 platforms.
Sebastian suggested using atomic_notifier instead of rwlock, which is not
only removing the sleeping in idle, but also getting better latency
improvement.

This patch passed Fengguang's 0day testing.

Signed-off-by: Alex Shi <alex.shi@linaro.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Anders Roxell <anders.roxell@linaro.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: linux-rt-users <linux-rt-users@vger.kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/cpu_pm.c | 43 ++++++-------------------------------------
 1 file changed, 6 insertions(+), 37 deletions(-)

diff --git a/kernel/cpu_pm.c b/kernel/cpu_pm.c
index 9656a3c36503..9da42f83ee03 100644
--- a/kernel/cpu_pm.c
+++ b/kernel/cpu_pm.c
@@ -22,14 +22,13 @@
 #include <linux/spinlock.h>
 #include <linux/syscore_ops.h>
 
-static DEFINE_RWLOCK(cpu_pm_notifier_lock);
-static RAW_NOTIFIER_HEAD(cpu_pm_notifier_chain);
+static ATOMIC_NOTIFIER_HEAD(cpu_pm_notifier_chain);
 
 static int cpu_pm_notify(enum cpu_pm_event event, int nr_to_call, int *nr_calls)
 {
 	int ret;
 
-	ret = __raw_notifier_call_chain(&cpu_pm_notifier_chain, event, NULL,
+	ret = __atomic_notifier_call_chain(&cpu_pm_notifier_chain, event, NULL,
 		nr_to_call, nr_calls);
 
 	return notifier_to_errno(ret);
@@ -47,14 +46,7 @@ static int cpu_pm_notify(enum cpu_pm_event event, int nr_to_call, int *nr_calls)
  */
 int cpu_pm_register_notifier(struct notifier_block *nb)
 {
-	unsigned long flags;
-	int ret;
-
-	write_lock_irqsave(&cpu_pm_notifier_lock, flags);
-	ret = raw_notifier_chain_register(&cpu_pm_notifier_chain, nb);
-	write_unlock_irqrestore(&cpu_pm_notifier_lock, flags);
-
-	return ret;
+	return atomic_notifier_chain_register(&cpu_pm_notifier_chain, nb);
 }
 EXPORT_SYMBOL_GPL(cpu_pm_register_notifier);
 
@@ -69,14 +61,7 @@ EXPORT_SYMBOL_GPL(cpu_pm_register_notifier);
  */
 int cpu_pm_unregister_notifier(struct notifier_block *nb)
 {
-	unsigned long flags;
-	int ret;
-
-	write_lock_irqsave(&cpu_pm_notifier_lock, flags);
-	ret = raw_notifier_chain_unregister(&cpu_pm_notifier_chain, nb);
-	write_unlock_irqrestore(&cpu_pm_notifier_lock, flags);
-
-	return ret;
+	return atomic_notifier_chain_unregister(&cpu_pm_notifier_chain, nb);
 }
 EXPORT_SYMBOL_GPL(cpu_pm_unregister_notifier);
 
@@ -100,7 +85,6 @@ int cpu_pm_enter(void)
 	int nr_calls;
 	int ret = 0;
 
-	read_lock(&cpu_pm_notifier_lock);
 	ret = cpu_pm_notify(CPU_PM_ENTER, -1, &nr_calls);
 	if (ret)
 		/*
@@ -108,7 +92,6 @@ int cpu_pm_enter(void)
 		 * PM entry who are notified earlier to prepare for it.
 		 */
 		cpu_pm_notify(CPU_PM_ENTER_FAILED, nr_calls - 1, NULL);
-	read_unlock(&cpu_pm_notifier_lock);
 
 	return ret;
 }
@@ -128,13 +111,7 @@ EXPORT_SYMBOL_GPL(cpu_pm_enter);
  */
 int cpu_pm_exit(void)
 {
-	int ret;
-
-	read_lock(&cpu_pm_notifier_lock);
-	ret = cpu_pm_notify(CPU_PM_EXIT, -1, NULL);
-	read_unlock(&cpu_pm_notifier_lock);
-
-	return ret;
+	return cpu_pm_notify(CPU_PM_EXIT, -1, NULL);
 }
 EXPORT_SYMBOL_GPL(cpu_pm_exit);
 
@@ -159,7 +136,6 @@ int cpu_cluster_pm_enter(void)
 	int nr_calls;
 	int ret = 0;
 
-	read_lock(&cpu_pm_notifier_lock);
 	ret = cpu_pm_notify(CPU_CLUSTER_PM_ENTER, -1, &nr_calls);
 	if (ret)
 		/*
@@ -167,7 +143,6 @@ int cpu_cluster_pm_enter(void)
 		 * PM entry who are notified earlier to prepare for it.
 		 */
 		cpu_pm_notify(CPU_CLUSTER_PM_ENTER_FAILED, nr_calls - 1, NULL);
-	read_unlock(&cpu_pm_notifier_lock);
 
 	return ret;
 }
@@ -190,13 +165,7 @@ EXPORT_SYMBOL_GPL(cpu_cluster_pm_enter);
  */
 int cpu_cluster_pm_exit(void)
 {
-	int ret;
-
-	read_lock(&cpu_pm_notifier_lock);
-	ret = cpu_pm_notify(CPU_CLUSTER_PM_EXIT, -1, NULL);
-	read_unlock(&cpu_pm_notifier_lock);
-
-	return ret;
+	return cpu_pm_notify(CPU_CLUSTER_PM_EXIT, -1, NULL);
 }
 EXPORT_SYMBOL_GPL(cpu_cluster_pm_exit);
 
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH RT 09/13] kernel/hrtimer: migrate deferred timer on CPU down
  2018-01-17 15:14 [PATCH RT 00/13] Linux 3.18.91-rt98-rc1 Steven Rostedt
                   ` (7 preceding siblings ...)
  2018-01-17 15:14 ` [PATCH RT 08/13] cpu_pm: replace raw_notifier to atomic_notifier Steven Rostedt
@ 2018-01-17 15:14 ` Steven Rostedt
  2018-01-17 15:14 ` [PATCH RT 10/13] kernel/hrtimer/hotplug: dont wake ktimersoftd while holding the hrtimer base lock Steven Rostedt
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Steven Rostedt @ 2018-01-17 15:14 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Julia Cartwright, Daniel Wagner,
	tom.zanussi, Alex Shi, stable-rt, Mike Galbraith

[-- Attachment #1: 0009-kernel-hrtimer-migrate-deferred-timer-on-CPU-down.patch --]
[-- Type: text/plain, Size: 1373 bytes --]

3.18.91-rt98-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

hrtimers, which were deferred to the softirq context, and expire between
softirq shutdown and hrtimer migration are dangling around. If the CPU
goes back up the list head will be initialized and this corrupts the
timer's list. It will remain unnoticed until a hrtimer_cancel().
This moves those timers so they will expire.

Cc: stable-rt@vger.kernel.org
Reported-by: Mike Galbraith <efault@gmx.de>
Tested-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/time/hrtimer.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 2c1597d2bd6d..2e869c707628 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1959,6 +1959,11 @@ static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
 		/* Clear the migration state bit */
 		timer->state &= ~HRTIMER_STATE_MIGRATE;
 	}
+#ifdef CONFIG_PREEMPT_RT_BASE
+	list_splice_tail(&old_base->expired, &new_base->expired);
+	if (!list_empty(&new_base->expired))
+		raise_softirq_irqoff(HRTIMER_SOFTIRQ);
+#endif
 }
 
 static void migrate_hrtimers(int scpu)
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH RT 10/13] kernel/hrtimer/hotplug: dont wake ktimersoftd while holding the hrtimer base lock
  2018-01-17 15:14 [PATCH RT 00/13] Linux 3.18.91-rt98-rc1 Steven Rostedt
                   ` (8 preceding siblings ...)
  2018-01-17 15:14 ` [PATCH RT 09/13] kernel/hrtimer: migrate deferred timer on CPU down Steven Rostedt
@ 2018-01-17 15:14 ` Steven Rostedt
  2018-01-17 15:14 ` [PATCH RT 11/13] rt/locking: allow recursive local_trylock() Steven Rostedt
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Steven Rostedt @ 2018-01-17 15:14 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Julia Cartwright, Daniel Wagner,
	tom.zanussi, Alex Shi, Mike Galbraith

[-- Attachment #1: 0010-kernel-hrtimer-hotplug-don-t-wake-ktimersoftd-while-.patch --]
[-- Type: text/plain, Size: 2371 bytes --]

3.18.91-rt98-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Mike Galbraith <efault@gmx.de>

kernel/hrtimer: don't wakeup a process while holding the hrtimer base lock
missed a path, namely hrtimers_dead_cpu() -> migrate_hrtimer_list().  Defer
raising softirq until after base lock has been released there as well.

Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/time/hrtimer.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 2e869c707628..1e7c0c9b0e77 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1928,7 +1928,7 @@ static void init_hrtimers_cpu(int cpu)
 
 #ifdef CONFIG_HOTPLUG_CPU
 
-static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
+static int migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
 				struct hrtimer_clock_base *new_base)
 {
 	struct hrtimer *timer;
@@ -1961,15 +1961,19 @@ static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
 	}
 #ifdef CONFIG_PREEMPT_RT_BASE
 	list_splice_tail(&old_base->expired, &new_base->expired);
-	if (!list_empty(&new_base->expired))
-		raise_softirq_irqoff(HRTIMER_SOFTIRQ);
+	/*
+	 * Tell the caller to raise HRTIMER_SOFTIRQ.  We can't safely
+	 * acquire ktimersoftd->pi_lock while the base lock is held.
+	 */
+	return !list_empty(&new_base->expired);
 #endif
+	return 0;
 }
 
 static void migrate_hrtimers(int scpu)
 {
 	struct hrtimer_cpu_base *old_base, *new_base;
-	int i;
+	int i, raise = 0;
 
 	BUG_ON(cpu_online(scpu));
 	tick_cancel_sched_timer(scpu);
@@ -1985,13 +1989,16 @@ static void migrate_hrtimers(int scpu)
 	raw_spin_lock_nested(&old_base->lock, SINGLE_DEPTH_NESTING);
 
 	for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
-		migrate_hrtimer_list(&old_base->clock_base[i],
-				     &new_base->clock_base[i]);
+		raise |= migrate_hrtimer_list(&old_base->clock_base[i],
+					      &new_base->clock_base[i]);
 	}
 
 	raw_spin_unlock(&old_base->lock);
 	raw_spin_unlock(&new_base->lock);
 
+	if (raise)
+		raise_softirq_irqoff(HRTIMER_SOFTIRQ);
+
 	/* Check, if we got expired work to do */
 	__hrtimer_peek_ahead_timers();
 	local_irq_enable();
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH RT 11/13] rt/locking: allow recursive local_trylock()
  2018-01-17 15:14 [PATCH RT 00/13] Linux 3.18.91-rt98-rc1 Steven Rostedt
                   ` (9 preceding siblings ...)
  2018-01-17 15:14 ` [PATCH RT 10/13] kernel/hrtimer/hotplug: dont wake ktimersoftd while holding the hrtimer base lock Steven Rostedt
@ 2018-01-17 15:14 ` Steven Rostedt
  2018-01-17 15:14 ` [PATCH RT 12/13] net: use trylock in icmp_sk Steven Rostedt
  2018-01-17 15:14 ` [PATCH RT 13/13] Linux 3.18.91-rt98-rc1 Steven Rostedt
  12 siblings, 0 replies; 16+ messages in thread
From: Steven Rostedt @ 2018-01-17 15:14 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Julia Cartwright, Daniel Wagner,
	tom.zanussi, Alex Shi, stable-rt

[-- Attachment #1: 0011-rt-locking-allow-recursive-local_trylock.patch --]
[-- Type: text/plain, Size: 1337 bytes --]

3.18.91-rt98-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

required for following networking patch which does recursive try-lock.
While at it, add the !RT version of it because it did not yet exist.

Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/linux/locallock.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/linux/locallock.h b/include/linux/locallock.h
index 015271ff8ec8..930ec941c2c0 100644
--- a/include/linux/locallock.h
+++ b/include/linux/locallock.h
@@ -77,6 +77,9 @@ static inline int __local_trylock(struct local_irq_lock *lv)
 		lv->owner = current;
 		lv->nestcnt = 1;
 		return 1;
+	} else if (lv->owner == current) {
+		lv->nestcnt++;
+		return 1;
 	}
 	return 0;
 }
@@ -250,6 +253,12 @@ static inline int __local_unlock_irqrestore(struct local_irq_lock *lv,
 
 static inline void local_irq_lock_init(int lvar) { }
 
+#define local_trylock(lvar)					\
+	({							\
+		preempt_disable();				\
+		1;						\
+	})
+
 #define local_lock(lvar)			preempt_disable()
 #define local_unlock(lvar)			preempt_enable()
 #define local_lock_irq(lvar)			local_irq_disable()
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH RT 12/13] net: use trylock in icmp_sk
  2018-01-17 15:14 [PATCH RT 00/13] Linux 3.18.91-rt98-rc1 Steven Rostedt
                   ` (10 preceding siblings ...)
  2018-01-17 15:14 ` [PATCH RT 11/13] rt/locking: allow recursive local_trylock() Steven Rostedt
@ 2018-01-17 15:14 ` Steven Rostedt
  2018-01-17 15:14 ` [PATCH RT 13/13] Linux 3.18.91-rt98-rc1 Steven Rostedt
  12 siblings, 0 replies; 16+ messages in thread
From: Steven Rostedt @ 2018-01-17 15:14 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Julia Cartwright, Daniel Wagner,
	tom.zanussi, Alex Shi, stable-rt

[-- Attachment #1: 0012-net-use-trylock-in-icmp_sk.patch --]
[-- Type: text/plain, Size: 968 bytes --]

3.18.91-rt98-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

The locking path can be recursive (same as for sk->sk_lock.slock) and
therefore we need a trylock version for the locallock, too.

Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 net/ipv4/icmp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 76b11e3e2b95..434eef536092 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -218,7 +218,11 @@ static inline struct sock *icmp_xmit_lock(struct net *net)
 
 	local_bh_disable();
 
-	local_lock(icmp_sk_lock);
+	if (!local_trylock(icmp_sk_lock)) {
+		local_bh_enable();
+		return NULL;
+	}
+
 	sk = icmp_sk(net);
 
 	if (unlikely(!spin_trylock(&sk->sk_lock.slock))) {
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH RT 13/13] Linux 3.18.91-rt98-rc1
  2018-01-17 15:14 [PATCH RT 00/13] Linux 3.18.91-rt98-rc1 Steven Rostedt
                   ` (11 preceding siblings ...)
  2018-01-17 15:14 ` [PATCH RT 12/13] net: use trylock in icmp_sk Steven Rostedt
@ 2018-01-17 15:14 ` Steven Rostedt
  12 siblings, 0 replies; 16+ messages in thread
From: Steven Rostedt @ 2018-01-17 15:14 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Julia Cartwright, Daniel Wagner,
	tom.zanussi, Alex Shi

[-- Attachment #1: 0013-Linux-3.18.91-rt98-rc1.patch --]
[-- Type: text/plain, Size: 412 bytes --]

3.18.91-rt98-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

---
 localversion-rt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/localversion-rt b/localversion-rt
index f5eca15b92de..195e539be979 100644
--- a/localversion-rt
+++ b/localversion-rt
@@ -1 +1 @@
--rt97
+-rt98-rc1
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH RT 07/13] Revert "fs: jbd2: pull your plug when waiting for space"
  2018-01-17 15:14 ` [PATCH RT 07/13] Revert "fs: jbd2: pull your plug when waiting for space" Steven Rostedt
@ 2018-01-17 15:46   ` Sebastian Andrzej Siewior
  2018-01-17 17:13     ` Steven Rostedt
  0 siblings, 1 reply; 16+ messages in thread
From: Sebastian Andrzej Siewior @ 2018-01-17 15:46 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: linux-kernel, linux-rt-users, Thomas Gleixner, Carsten Emde,
	John Kacur, Paul Gortmaker, Julia Cartwright, Daniel Wagner,
	tom.zanussi, Alex Shi, stable-rt

On 2018-01-17 10:14:11 [-0500], Steven Rostedt wrote:
> 3.18.91-rt98-rc1 stable review patch.
> If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> 
> This reverts commit "fs: jbd2: pull your plug when waiting for space".
> This was a duct-tape fix which shouldn't be needed since commit
> "locking/rt-mutex: fix deadlock in device mapper / block-IO".
> 
> Cc: stable-rt@vger.kernel.org
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

you could also revert 3b5cf23e6b87 ("fs, jbd: pull your plug when
waiting for space") which is the same thing but for ext3/jbd.

The code was removed at some point so I did not revert in my tree.

Sebastian

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH RT 07/13] Revert "fs: jbd2: pull your plug when waiting for space"
  2018-01-17 15:46   ` Sebastian Andrzej Siewior
@ 2018-01-17 17:13     ` Steven Rostedt
  0 siblings, 0 replies; 16+ messages in thread
From: Steven Rostedt @ 2018-01-17 17:13 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: linux-kernel, linux-rt-users, Thomas Gleixner, Carsten Emde,
	John Kacur, Paul Gortmaker, Julia Cartwright, Daniel Wagner,
	tom.zanussi, Alex Shi, stable-rt

On Wed, 17 Jan 2018 16:46:44 +0100
Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:

> On 2018-01-17 10:14:11 [-0500], Steven Rostedt wrote:
> > 3.18.91-rt98-rc1 stable review patch.
> > If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> > 
> > This reverts commit "fs: jbd2: pull your plug when waiting for space".
> > This was a duct-tape fix which shouldn't be needed since commit
> > "locking/rt-mutex: fix deadlock in device mapper / block-IO".
> > 
> > Cc: stable-rt@vger.kernel.org
> > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> > Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>  
> 
> you could also revert 3b5cf23e6b87 ("fs, jbd: pull your plug when
> waiting for space") which is the same thing but for ext3/jbd.
> 
> The code was removed at some point so I did not revert in my tree.
> 

Great! That can be one of the first things Tom does when he takes over
3.18-rt :-)

-- Steve

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-01-17 17:13 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-17 15:14 [PATCH RT 00/13] Linux 3.18.91-rt98-rc1 Steven Rostedt
2018-01-17 15:14 ` [PATCH RT 01/13] rtmutex: Make lock_killable work Steven Rostedt
2018-01-17 15:14 ` [PATCH RT 02/13] random: avoid preempt_disable()ed section Steven Rostedt
2018-01-17 15:14 ` [PATCH RT 03/13] sched: Prevent task state corruption by spurious lock wakeup Steven Rostedt
2018-01-17 15:14 ` [PATCH RT 04/13] fs: convert two more BH_Uptodate_Lock related bitspinlocks Steven Rostedt
2018-01-17 15:14 ` [PATCH RT 05/13] md/raid5: do not disable interrupts Steven Rostedt
2018-01-17 15:14 ` [PATCH RT 06/13] locking/rt-mutex: fix deadlock in device mapper / block-IO Steven Rostedt
2018-01-17 15:14 ` [PATCH RT 07/13] Revert "fs: jbd2: pull your plug when waiting for space" Steven Rostedt
2018-01-17 15:46   ` Sebastian Andrzej Siewior
2018-01-17 17:13     ` Steven Rostedt
2018-01-17 15:14 ` [PATCH RT 08/13] cpu_pm: replace raw_notifier to atomic_notifier Steven Rostedt
2018-01-17 15:14 ` [PATCH RT 09/13] kernel/hrtimer: migrate deferred timer on CPU down Steven Rostedt
2018-01-17 15:14 ` [PATCH RT 10/13] kernel/hrtimer/hotplug: dont wake ktimersoftd while holding the hrtimer base lock Steven Rostedt
2018-01-17 15:14 ` [PATCH RT 11/13] rt/locking: allow recursive local_trylock() Steven Rostedt
2018-01-17 15:14 ` [PATCH RT 12/13] net: use trylock in icmp_sk Steven Rostedt
2018-01-17 15:14 ` [PATCH RT 13/13] Linux 3.18.91-rt98-rc1 Steven Rostedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.