linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RT 0/7] Linux 3.8.13.13-rt25-rc1
@ 2013-11-21 16:59 Steven Rostedt
  2013-11-21 16:59 ` [PATCH RT 1/7] genirq: Set the irq thread policy without checking CAP_SYS_NICE Steven Rostedt
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Steven Rostedt @ 2013-11-21 16:59 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior, John Kacur


Dear RT Folks,

This is the RT stable review cycle of patch 3.8.13.13-rt25-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 11/25/2013.

Enjoy,

-- Steve


To build 3.8.13.13-rt25-rc1 directly, the following patches should be applied:

  http://www.kernel.org/pub/linux/kernel/v3.x/linux-3.8.tar.xz

  http://www.kernel.org/pub/linux/kernel/v3.x/patch-3.8.13.13.xz

  http://www.kernel.org/pub/linux/kernel/projects/rt/3.8/patch-3.8.13.13-rt25-rc1.patch.xz

You can also build from 3.8.13.13-rt24 by applying the incremental patch:

http://www.kernel.org/pub/linux/kernel/projects/rt/3.8/incr/patch-3.8.13.13-rt24-rt25-rc1.patch.xz


Changes from 3.8.13.13-rt24:

---


Mike Galbraith (1):
      hwlat-detector: Don't ignore threshold module parameter

Sebastian Andrzej Siewior (2):
      mm/slub: do not rely on slab_cached passed to free_delayed()
      drm: remove preempt_disable() from drm_calc_vbltimestamp_from_scanoutpos()

Steven Rostedt (Red Hat) (1):
      Linux 3.8.13.13-rt25-rc1

Thomas Pfaff (1):
      genirq: Set the irq thread policy without checking CAP_SYS_NICE

Wolfram Sang (1):
      Kind of revert "powerpc: 52xx: provide a default in mpc52xx_irqhost_map()"

Yang Shi (1):
      mm/memcontrol: Don't call schedule_work_on in preemption disabled context

----
 arch/powerpc/platforms/52xx/mpc52xx_pic.c |  5 ++---
 drivers/gpu/drm/drm_irq.c                 |  7 -------
 drivers/misc/hwlat_detector.c             |  2 +-
 kernel/irq/manage.c                       |  2 +-
 localversion-rt                           |  2 +-
 mm/memcontrol.c                           |  4 ++--
 mm/slub.c                                 | 10 +++++-----
 7 files changed, 12 insertions(+), 20 deletions(-)

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

* [PATCH RT 1/7] genirq: Set the irq thread policy without checking CAP_SYS_NICE
  2013-11-21 16:59 [PATCH RT 0/7] Linux 3.8.13.13-rt25-rc1 Steven Rostedt
@ 2013-11-21 16:59 ` Steven Rostedt
  2013-11-21 16:59 ` [PATCH RT 2/7] Kind of revert "powerpc: 52xx: provide a default in mpc52xx_irqhost_map()" Steven Rostedt
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Steven Rostedt @ 2013-11-21 16:59 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Ivo Sieben, Thomas Pfaff

[-- Attachment #1: 0001-genirq-Set-the-irq-thread-policy-without-checking-CA.patch --]
[-- Type: text/plain, Size: 1505 bytes --]

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

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

From: Thomas Pfaff <tpfaff@pcs.com>

In commit ee23871389 ("genirq: Set irq thread to RT priority on
creation") we moved the assigment of the thread's priority from the
thread's function into __setup_irq(). That function may run in user
context for instance if the user opens an UART node and then driver
calls requests in the ->open() callback. That user may not have
CAP_SYS_NICE and so the irq thread won't run with the SCHED_OTHER
policy.

This patch uses sched_setscheduler_nocheck() so we omit the CAP_SYS_NICE
check which is otherwise required for the SCHED_OTHER policy.

Cc: Ivo Sieben <meltedpianoman@gmail.com>
Cc: stable@vger.kernel.org
Cc: stable-rt@vger.kernel.org
Signed-off-by: Thomas Pfaff <tpfaff@pcs.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
[bigeasy: rewrite the changelog]
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 kernel/irq/manage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index a3cf48e..a569b71 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1044,7 +1044,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
 			goto out_mput;
 		}
 
-		sched_setscheduler(t, SCHED_FIFO, &param);
+		sched_setscheduler_nocheck(t, SCHED_FIFO, &param);
 
 		/*
 		 * We keep the reference to the task struct even if
-- 
1.8.4.rc3



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

* [PATCH RT 2/7] Kind of revert "powerpc: 52xx: provide a default in mpc52xx_irqhost_map()"
  2013-11-21 16:59 [PATCH RT 0/7] Linux 3.8.13.13-rt25-rc1 Steven Rostedt
  2013-11-21 16:59 ` [PATCH RT 1/7] genirq: Set the irq thread policy without checking CAP_SYS_NICE Steven Rostedt
@ 2013-11-21 16:59 ` Steven Rostedt
  2013-11-21 16:59 ` [PATCH RT 3/7] hwlat-detector: Dont ignore threshold module parameter Steven Rostedt
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Steven Rostedt @ 2013-11-21 16:59 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Wolfram Sang, Anatolij Gustschin

[-- Attachment #1: 0002-Kind-of-revert-powerpc-52xx-provide-a-default-in-mpc.patch --]
[-- Type: text/plain, Size: 1764 bytes --]

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

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

From: Wolfram Sang <wsa@the-dreams.de>

This more or less reverts commit 6391f697d4892a6f233501beea553e13f7745a23.
Instead of adding an unneeded 'default', mark the variable to prevent
the false positive 'uninitialized var'. The other change (fixing the
printout) needs revert, too. We want to know WHICH critical irq failed,
not which level it had.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable-rt@vger.kernel.org
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 arch/powerpc/platforms/52xx/mpc52xx_pic.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
index b69221b..2898b73 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
@@ -340,7 +340,7 @@ static int mpc52xx_irqhost_map(struct irq_domain *h, unsigned int virq,
 {
 	int l1irq;
 	int l2irq;
-	struct irq_chip *irqchip;
+	struct irq_chip *uninitialized_var(irqchip);
 	void *hndlr;
 	int type;
 	u32 reg;
@@ -373,9 +373,8 @@ static int mpc52xx_irqhost_map(struct irq_domain *h, unsigned int virq,
 	case MPC52xx_IRQ_L1_PERP: irqchip = &mpc52xx_periph_irqchip; break;
 	case MPC52xx_IRQ_L1_SDMA: irqchip = &mpc52xx_sdma_irqchip; break;
 	case MPC52xx_IRQ_L1_CRIT:
-	default:
 		pr_warn("%s: Critical IRQ #%d is unsupported! Nopping it.\n",
-			__func__, l1irq);
+			__func__, l2irq);
 		irq_set_chip(virq, &no_irq_chip);
 		return 0;
 	}
-- 
1.8.4.rc3



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

* [PATCH RT 3/7] hwlat-detector: Dont ignore threshold module parameter
  2013-11-21 16:59 [PATCH RT 0/7] Linux 3.8.13.13-rt25-rc1 Steven Rostedt
  2013-11-21 16:59 ` [PATCH RT 1/7] genirq: Set the irq thread policy without checking CAP_SYS_NICE Steven Rostedt
  2013-11-21 16:59 ` [PATCH RT 2/7] Kind of revert "powerpc: 52xx: provide a default in mpc52xx_irqhost_map()" Steven Rostedt
@ 2013-11-21 16:59 ` Steven Rostedt
  2013-11-21 16:59 ` [PATCH RT 4/7] mm/slub: do not rely on slab_cached passed to free_delayed() Steven Rostedt
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Steven Rostedt @ 2013-11-21 16:59 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Mike Galbraith

[-- Attachment #1: 0003-hwlat-detector-Don-t-ignore-threshold-module-paramet.patch --]
[-- Type: text/plain, Size: 1098 bytes --]

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

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

From: Mike Galbraith <bitbucket@online.de>

If the user specified a threshold at module load time, use it.

Cc: stable-rt@vger.kernel.org
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Mike Galbraith <bitbucket@online.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/misc/hwlat_detector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/hwlat_detector.c b/drivers/misc/hwlat_detector.c
index 6f61d5f..d2676b8 100644
--- a/drivers/misc/hwlat_detector.c
+++ b/drivers/misc/hwlat_detector.c
@@ -413,7 +413,7 @@ static int init_stats(void)
 		goto out;
 
 	__reset_stats();
-	data.threshold = DEFAULT_LAT_THRESHOLD;	    /* threshold us */
+	data.threshold = threshold ?: DEFAULT_LAT_THRESHOLD;	    /* threshold us */
 	data.sample_window = DEFAULT_SAMPLE_WINDOW; /* window us */
 	data.sample_width = DEFAULT_SAMPLE_WIDTH;   /* width us */
 
-- 
1.8.4.rc3



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

* [PATCH RT 4/7] mm/slub: do not rely on slab_cached passed to free_delayed()
  2013-11-21 16:59 [PATCH RT 0/7] Linux 3.8.13.13-rt25-rc1 Steven Rostedt
                   ` (2 preceding siblings ...)
  2013-11-21 16:59 ` [PATCH RT 3/7] hwlat-detector: Dont ignore threshold module parameter Steven Rostedt
@ 2013-11-21 16:59 ` Steven Rostedt
  2013-11-21 16:59 ` [PATCH RT 5/7] mm/memcontrol: Dont call schedule_work_on in preemption disabled context Steven Rostedt
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Steven Rostedt @ 2013-11-21 16:59 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior, John Kacur

[-- Attachment #1: 0004-mm-slub-do-not-rely-on-slab_cached-passed-to-free_de.patch --]
[-- Type: text/plain, Size: 7026 bytes --]

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

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

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

You can get this backtrace:
| =============================================================================
| BUG dentry (Not tainted): Padding overwritten. 0xf15e1ec0-0xf15e1f1f
| -----------------------------------------------------------------------------
|
| Disabling lock debugging due to kernel taint
| INFO: Slab 0xf6f10b00 objects=21 used=0 fp=0xf15e0480 flags=0x2804080
| CPU: 6 PID: 1 Comm: systemd Tainted: G    B        3.10.17-rt12+ #197
| Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
|  f6f10b00 f6f10b00 f20a3be8 c149da9e f20a3c74 c110b0d6 c15e010c f6f10b00
|  00000015 00000000 f15e0480 02804080 64646150 20676e69 7265766f 74697277
|  2e6e6574 66783020 31653531 2d306365 31667830 66316535 00006631 00000046
| Call Trace:
|  [<c149da9e>] dump_stack+0x16/0x18
|  [<c110b0d6>] slab_err+0x76/0x80
|  [<c110c231>] ? deactivate_slab+0x3f1/0x4a0
|  [<c110c231>] ? deactivate_slab+0x3f1/0x4a0
|  [<c110b56f>] slab_pad_check.part.54+0xbf/0x150
|  [<c110ba04>] __free_slab+0x124/0x130
|  [<c149bb79>] ? __slab_alloc.constprop.69+0x27b/0x5d3
|  [<c110ba39>] free_delayed+0x29/0x40
|  [<c149bec5>] __slab_alloc.constprop.69+0x5c7/0x5d3
|  [<c1126062>] ? __d_alloc+0x22/0x150
|  [<c1126062>] ? __d_alloc+0x22/0x150
|  [<c11265b0>] ? __d_lookup_rcu+0x160/0x160
|  [<c110d912>] kmem_cache_alloc+0x162/0x190
|  [<c112668b>] ? __d_lookup+0xdb/0x1d0
|  [<c1126062>] ? __d_alloc+0x22/0x150
|  [<c1126062>] __d_alloc+0x22/0x150
|  [<c11261a5>] d_alloc+0x15/0x60
|  [<c111aec1>] lookup_dcache+0x71/0xa0
|  [<c111af0e>] __lookup_hash+0x1e/0x40
|  [<c111b374>] lookup_slow+0x34/0x90
|  [<c111c3c7>] link_path_walk+0x737/0x780
|  [<c111a3d4>] ? path_get+0x24/0x40
|  [<c111a3df>] ? path_get+0x2f/0x40
|  [<c111bfb2>] link_path_walk+0x322/0x780
|  [<c111e3ed>] path_openat.isra.54+0x7d/0x400
|  [<c111f32b>] do_filp_open+0x2b/0x70
|  [<c11110a2>] do_sys_open+0xe2/0x1b0
|  [<c14a319f>] ? restore_all+0xf/0xf
|  [<c102bb80>] ? vmalloc_sync_all+0x10/0x10
|  [<c1111192>] SyS_open+0x22/0x30
|  [<c14a393e>] sysenter_do_call+0x12/0x36
| Padding f15e1de0: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a  ZZZZZZZZZZZZZZZZ
| Padding f15e1df0: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a  ZZZZZZZZZZZZZZZZ
| Padding f15e1e00: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
| Padding f15e1e10: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
| Padding f15e1e20: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
| Padding f15e1e30: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
| Padding f15e1e40: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
| Padding f15e1e50: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
| Padding f15e1e60: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
| Padding f15e1e70: 6b 6b 6b 6b 6b 6b 6b a5 bb bb bb bb 80 01 5e f1  kkkkkkk.......^.
| Padding f15e1e80: 53 7e 0d c1 c3 bd 49 c1 12 d9 10 c1 53 7e 0d c1  S~....I.....S~..
| Padding f15e1e90: 60 7f 0d c1 e0 05 14 c1 ce d1 13 c1 96 d4 13 c1  `...............
| Padding f15e1ea0: e9 e0 13 c1 f7 48 17 c1 13 6a 17 c1 41 fb 17 c1  .....H...j..A...
| Padding f15e1eb0: 07 a4 11 c1 22 af 11 c1 74 b3 11 c1 06 d2 11 c1  ...."...t.......
| Padding f15e1ec0: c6 d2 11 c1 06 00 00 00 01 00 00 00 f3 dc fe ff  ................
| Padding f15e1ed0: 73 7e 0d c1 5d b4 49 c1 ec c4 10 c1 73 7e 0d c1  s~..].I.....s~..
| Padding f15e1ee0: 50 83 0d c1 79 09 14 c1 fd b9 13 c1 5a f2 13 c1  P...y.......Z...
| Padding f15e1ef0: 7b 1c 28 c1 03 20 28 c1 9e 25 28 c1 b3 26 28 c1  {.(.. (..%(..&(.
| Padding f15e1f00: f4 ab 34 c1 bc 89 30 c1 e5 0d 0a c1 c1 0f 0a c1  ..4...0.........
| Padding f15e1f10: ae 34 0a c1 00 00 00 00 00 00 00 00 f3 dc fe ff  .4..............
| FIX dentry: Restoring 0xf15e1de0-0xf15e1f1f=0x5a
|
| =============================================================================
| BUG dentry (Tainted: G    B       ): Redzone overwritten
| -----------------------------------------------------------------------------
|
| INFO: 0xf15e009c-0xf15e009f. First byte 0x96 instead of 0xbb
| INFO: Allocated in __ext4_get_inode_loc+0x3b7/0x460 age=1054261382 cpu=3239295485 pid=-1055657382
|  ext4_iget+0x63/0x9c0
|  ext4_lookup+0x71/0x180
|  lookup_real+0x17/0x40
|  do_last.isra.53+0x72b/0xbc0
|  path_openat.isra.54+0x9d/0x400
|  do_filp_open+0x2b/0x70
|  do_sys_open+0xe2/0x1b0
|  0x7
|  0x1
|  0xfffedcf2
|  mempool_free_slab+0x13/0x20
|  __slab_free+0x3d/0x3ae
|  kmem_cache_free+0x1bc/0x1d0
|  mempool_free_slab+0x13/0x20
|  mempool_free+0x40/0x90
|  bio_put+0x59/0x70
| INFO: Freed in blk_update_bidi_request+0x13/0x70 age=2779021993 cpu=1515870810 pid=1515870810
|  __blk_end_bidi_request+0x1e/0x50
|  __blk_end_request_all+0x23/0x40
|  virtblk_done+0xf4/0x260
|  vring_interrupt+0x2c/0x50
|  handle_irq_event_percpu+0x45/0x1f0
|  handle_irq_event+0x31/0x50
|  handle_edge_irq+0x6e/0x130
|  0x5
| INFO: Slab 0xf6f10b00 objects=21 used=0 fp=0xf15e0480 flags=0x2804080
| INFO: Object 0xf15e0000 @offset=0 fp=0xc113e0e9

If you try to free memory in irqs_disabled(). This is then added to the
slub_free_list list. The following allocation then might be from a
different kmem_cache. If the two caches have a different SLAB_DEBUG_FLAGS
then one might complain about bad bad marker which are actually not
used.

Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 mm/slub.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index f6871c5..7c925ae 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1427,13 +1427,13 @@ static void __free_slab(struct kmem_cache *s, struct page *page)
 	__free_memcg_kmem_pages(page, order);
 }
 
-static void free_delayed(struct kmem_cache *s, struct list_head *h)
+static void free_delayed(struct list_head *h)
 {
 	while(!list_empty(h)) {
 		struct page *page = list_first_entry(h, struct page, lru);
 
 		list_del(&page->lru);
-		__free_slab(s, page);
+		__free_slab(page->slab_cache, page);
 	}
 }
 
@@ -2004,7 +2004,7 @@ static int put_cpu_partial(struct kmem_cache *s, struct page *page, int drain)
 				list_splice_init(&f->list, &tofree);
 				raw_spin_unlock(&f->lock);
 				local_irq_restore(flags);
-				free_delayed(s, &tofree);
+				free_delayed(&tofree);
 				oldpage = NULL;
 				pobjects = 0;
 				pages = 0;
@@ -2081,7 +2081,7 @@ static void flush_all(struct kmem_cache *s)
 		raw_spin_lock_irq(&f->lock);
 		list_splice_init(&f->list, &tofree);
 		raw_spin_unlock_irq(&f->lock);
-		free_delayed(s, &tofree);
+		free_delayed(&tofree);
 	}
 }
 
@@ -2329,7 +2329,7 @@ out:
 	list_splice_init(&f->list, &tofree);
 	raw_spin_unlock(&f->lock);
 	local_irq_restore(flags);
-	free_delayed(s, &tofree);
+	free_delayed(&tofree);
 	return freelist;
 
 new_slab:
-- 
1.8.4.rc3



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

* [PATCH RT 5/7] mm/memcontrol: Dont call schedule_work_on in preemption disabled context
  2013-11-21 16:59 [PATCH RT 0/7] Linux 3.8.13.13-rt25-rc1 Steven Rostedt
                   ` (3 preceding siblings ...)
  2013-11-21 16:59 ` [PATCH RT 4/7] mm/slub: do not rely on slab_cached passed to free_delayed() Steven Rostedt
@ 2013-11-21 16:59 ` Steven Rostedt
  2013-11-21 16:59 ` [PATCH RT 6/7] drm: remove preempt_disable() from drm_calc_vbltimestamp_from_scanoutpos() Steven Rostedt
  2013-11-21 16:59 ` [PATCH RT 7/7] Linux 3.8.13.13-rt25-rc1 Steven Rostedt
  6 siblings, 0 replies; 8+ messages in thread
From: Steven Rostedt @ 2013-11-21 16:59 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Yang Shi

[-- Attachment #1: 0005-mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch --]
[-- Type: text/plain, Size: 2869 bytes --]

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

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

From: Yang Shi <yang.shi@windriver.com>

The following trace is triggered when running ltp oom test cases:

BUG: sleeping function called from invalid context at kernel/rtmutex.c:659
in_atomic(): 1, irqs_disabled(): 0, pid: 17188, name: oom03
Preemption disabled at:[<ffffffff8112ba70>] mem_cgroup_reclaim+0x90/0xe0

CPU: 2 PID: 17188 Comm: oom03 Not tainted 3.10.10-rt3 #2
Hardware name: Intel Corporation Calpella platform/MATXM-CORE-411-B, BIOS 4.6.3 08/18/2010
ffff88007684d730 ffff880070df9b58 ffffffff8169918d ffff880070df9b70
ffffffff8106db31 ffff88007688b4a0 ffff880070df9b88 ffffffff8169d9c0
ffff88007688b4a0 ffff880070df9bc8 ffffffff81059da1 0000000170df9bb0
Call Trace:
[<ffffffff8169918d>] dump_stack+0x19/0x1b
[<ffffffff8106db31>] __might_sleep+0xf1/0x170
[<ffffffff8169d9c0>] rt_spin_lock+0x20/0x50
[<ffffffff81059da1>] queue_work_on+0x61/0x100
[<ffffffff8112b361>] drain_all_stock+0xe1/0x1c0
[<ffffffff8112ba70>] mem_cgroup_reclaim+0x90/0xe0
[<ffffffff8112beda>] __mem_cgroup_try_charge+0x41a/0xc40
[<ffffffff810f1c91>] ? release_pages+0x1b1/0x1f0
[<ffffffff8106f200>] ? sched_exec+0x40/0xb0
[<ffffffff8112cc87>] mem_cgroup_charge_common+0x37/0x70
[<ffffffff8112e2c6>] mem_cgroup_newpage_charge+0x26/0x30
[<ffffffff8110af68>] handle_pte_fault+0x618/0x840
[<ffffffff8103ecf6>] ? unpin_current_cpu+0x16/0x70
[<ffffffff81070f94>] ? migrate_enable+0xd4/0x200
[<ffffffff8110cde5>] handle_mm_fault+0x145/0x1e0
[<ffffffff810301e1>] __do_page_fault+0x1a1/0x4c0
[<ffffffff8169c9eb>] ? preempt_schedule_irq+0x4b/0x70
[<ffffffff8169e3b7>] ? retint_kernel+0x37/0x40
[<ffffffff8103053e>] do_page_fault+0xe/0x10
[<ffffffff8169e4c2>] page_fault+0x22/0x30

So, to prevent schedule_work_on from being called in preempt disabled context,
replace the pair of get/put_cpu() to get/put_cpu_light().

Cc: stable-rt@vger.kernel.org
Signed-off-by: Yang Shi <yang.shi@windriver.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 mm/memcontrol.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 6b7ff19..1503ca3 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2283,7 +2283,7 @@ static void drain_all_stock(struct mem_cgroup *root_memcg, bool sync)
 
 	/* Notify other cpus that system-wide "drain" is running */
 	get_online_cpus();
-	curcpu = get_cpu();
+	curcpu = get_cpu_light();
 	for_each_online_cpu(cpu) {
 		struct memcg_stock_pcp *stock = &per_cpu(memcg_stock, cpu);
 		struct mem_cgroup *memcg;
@@ -2300,7 +2300,7 @@ static void drain_all_stock(struct mem_cgroup *root_memcg, bool sync)
 				schedule_work_on(cpu, &stock->work);
 		}
 	}
-	put_cpu();
+	put_cpu_light();
 
 	if (!sync)
 		goto out;
-- 
1.8.4.rc3



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

* [PATCH RT 6/7] drm: remove preempt_disable() from drm_calc_vbltimestamp_from_scanoutpos()
  2013-11-21 16:59 [PATCH RT 0/7] Linux 3.8.13.13-rt25-rc1 Steven Rostedt
                   ` (4 preceding siblings ...)
  2013-11-21 16:59 ` [PATCH RT 5/7] mm/memcontrol: Dont call schedule_work_on in preemption disabled context Steven Rostedt
@ 2013-11-21 16:59 ` Steven Rostedt
  2013-11-21 16:59 ` [PATCH RT 7/7] Linux 3.8.13.13-rt25-rc1 Steven Rostedt
  6 siblings, 0 replies; 8+ messages in thread
From: Steven Rostedt @ 2013-11-21 16:59 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Luis Claudio R. Goncalves

[-- Attachment #1: 0006-drm-remove-preempt_disable-from-drm_calc_vbltimestam.patch --]
[-- Type: text/plain, Size: 2995 bytes --]

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

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

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

Luis captured the following:

| BUG: sleeping function called from invalid context at kernel/rtmutex.c:659
| in_atomic(): 1, irqs_disabled(): 0, pid: 517, name: Xorg
| 2 locks held by Xorg/517:
|  #0:
|  (
| &dev->vbl_lock
| ){......}
| , at:
| [<ffffffffa0024c60>] drm_vblank_get+0x30/0x2b0 [drm]
|  #1:
|  (
| &dev->vblank_time_lock
| ){......}
| , at:
| [<ffffffffa0024ce1>] drm_vblank_get+0xb1/0x2b0 [drm]
| Preemption disabled at:
| [<ffffffffa008bc95>] i915_get_vblank_timestamp+0x45/0xa0 [i915]
| CPU: 3 PID: 517 Comm: Xorg Not tainted 3.10.10-rt7+ #5
| Call Trace:
|  [<ffffffff8164b790>] dump_stack+0x19/0x1b
|  [<ffffffff8107e62f>] __might_sleep+0xff/0x170
|  [<ffffffff81651ac4>] rt_spin_lock+0x24/0x60
|  [<ffffffffa0084e67>] i915_read32+0x27/0x170 [i915]
|  [<ffffffffa008a591>] i915_pipe_enabled+0x31/0x40 [i915]
|  [<ffffffffa008a6be>] i915_get_crtc_scanoutpos+0x3e/0x1b0 [i915]
|  [<ffffffffa00245d4>] drm_calc_vbltimestamp_from_scanoutpos+0xf4/0x430 [drm]
|  [<ffffffffa008bc95>] i915_get_vblank_timestamp+0x45/0xa0 [i915]
|  [<ffffffffa0024998>] drm_get_last_vbltimestamp+0x48/0x70 [drm]
|  [<ffffffffa0024db5>] drm_vblank_get+0x185/0x2b0 [drm]
|  [<ffffffffa0025d03>] drm_wait_vblank+0x83/0x5d0 [drm]
|  [<ffffffffa00212a2>] drm_ioctl+0x552/0x6a0 [drm]
|  [<ffffffff811a0095>] do_vfs_ioctl+0x325/0x5b0
|  [<ffffffff811a03a1>] SyS_ioctl+0x81/0xa0
|  [<ffffffff8165a342>] tracesys+0xdd/0xe2

After a longer thread it was decided to drop the preempt_disable()/
enable() invocations which were meant for -RT and Mario Kleiner looks
for a replacement.

Cc: stable-rt@vger.kernel.org
Reported-By: Luis Claudio R. Goncalves <lclaudio@uudg.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/gpu/drm/drm_irq.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 0f3cdda..fe7546e 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -624,11 +624,6 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc,
 	 * code gets preempted or delayed for some reason.
 	 */
 	for (i = 0; i < DRM_TIMESTAMP_MAXRETRIES; i++) {
-		/* Disable preemption to make it very likely to
-		 * succeed in the first iteration even on PREEMPT_RT kernel.
-		 */
-		preempt_disable();
-
 		/* Get system timestamp before query. */
 		stime = ktime_get();
 
@@ -640,8 +635,6 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc,
 		if (!drm_timestamp_monotonic)
 			mono_time_offset = ktime_get_monotonic_offset();
 
-		preempt_enable();
-
 		/* Return as no-op if scanout query unsupported or failed. */
 		if (!(vbl_status & DRM_SCANOUTPOS_VALID)) {
 			DRM_DEBUG("crtc %d : scanoutpos query failed [%d].\n",
-- 
1.8.4.rc3



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

* [PATCH RT 7/7] Linux 3.8.13.13-rt25-rc1
  2013-11-21 16:59 [PATCH RT 0/7] Linux 3.8.13.13-rt25-rc1 Steven Rostedt
                   ` (5 preceding siblings ...)
  2013-11-21 16:59 ` [PATCH RT 6/7] drm: remove preempt_disable() from drm_calc_vbltimestamp_from_scanoutpos() Steven Rostedt
@ 2013-11-21 16:59 ` Steven Rostedt
  6 siblings, 0 replies; 8+ messages in thread
From: Steven Rostedt @ 2013-11-21 16:59 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior, John Kacur

[-- Attachment #1: 0007-Linux-3.8.13.13-rt25-rc1.patch --]
[-- Type: text/plain, Size: 410 bytes --]

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

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

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

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

diff --git a/localversion-rt b/localversion-rt
index b2111a2..792cb5f 100644
--- a/localversion-rt
+++ b/localversion-rt
@@ -1 +1 @@
--rt24
+-rt25-rc1
-- 
1.8.4.rc3



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

end of thread, other threads:[~2013-11-21 17:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-21 16:59 [PATCH RT 0/7] Linux 3.8.13.13-rt25-rc1 Steven Rostedt
2013-11-21 16:59 ` [PATCH RT 1/7] genirq: Set the irq thread policy without checking CAP_SYS_NICE Steven Rostedt
2013-11-21 16:59 ` [PATCH RT 2/7] Kind of revert "powerpc: 52xx: provide a default in mpc52xx_irqhost_map()" Steven Rostedt
2013-11-21 16:59 ` [PATCH RT 3/7] hwlat-detector: Dont ignore threshold module parameter Steven Rostedt
2013-11-21 16:59 ` [PATCH RT 4/7] mm/slub: do not rely on slab_cached passed to free_delayed() Steven Rostedt
2013-11-21 16:59 ` [PATCH RT 5/7] mm/memcontrol: Dont call schedule_work_on in preemption disabled context Steven Rostedt
2013-11-21 16:59 ` [PATCH RT 6/7] drm: remove preempt_disable() from drm_calc_vbltimestamp_from_scanoutpos() Steven Rostedt
2013-11-21 16:59 ` [PATCH RT 7/7] Linux 3.8.13.13-rt25-rc1 Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).