linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Galbraith <umgwanakikbuti@gmail.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	linux-rt-users <linux-rt-users@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: [rfc patch] hotplug: Call mmdrop_delayed() in sched_cpu_dying() if PREEMPT_RT_FULL
Date: Thu, 20 Oct 2016 11:34:03 +0200	[thread overview]
Message-ID: <1476956043.18007.15.camel@gmail.com> (raw)
In-Reply-To: <20161006085228.jl6rpszdp5c2p2nr@linutronix.de>

My 64 core box just passed an hour running Steven's hotplug stress
script along with stockfish and futextests (tip-rt.today w. hotplug
hacks you saw a while back), and seems content to just keep on grinding
away.  Without it, box quickly becomes a doorstop.

[  634.896901] BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:931
[  634.896902] in_atomic(): 1, irqs_disabled(): 1, pid: 104, name: migration/6
[  634.896902] no locks held by migration/6/104.
[  634.896903] irq event stamp: 1208518
[  634.896907] hardirqs last  enabled at (1208517): [<ffffffff816de46c>] _raw_spin_unlock_irqrestore+0x8c/0xa0
[  634.896910] hardirqs last disabled at (1208518): [<ffffffff81146055>] multi_cpu_stop+0xc5/0x110
[  634.896912] softirqs last  enabled at (0): [<ffffffff81075dd2>] copy_process.part.32+0x672/0x1fc0
[  634.896913] softirqs last disabled at (0): [<          (null)>]           (null)
[  634.896914] Preemption disabled at:[<ffffffff8114629c>] cpu_stopper_thread+0x8c/0x120
[  634.896914] 
[  634.896915] CPU: 6 PID: 104 Comm: migration/6 Tainted: G            E   4.8.2-rt1-rt_debug #23
[  634.896916] Hardware name: MEDION MS-7848/MS-7848, BIOS M7848W08.20C 09/23/2013
[  634.896918]  0000000000000000 ffff880176fb3c40 ffffffff8139c04d 0000000000000000
[  634.896919]  ffff880176fa8000 ffff880176fb3c68 ffffffff810a8102 ffffffff81c29cc0
[  634.896919]  ffff8803fc825640 ffff8803fc825640 ffff880176fb3c88 ffffffff816de754
[  634.896920] Call Trace:
[  634.896923]  [<ffffffff8139c04d>] dump_stack+0x85/0xc8
[  634.896924]  [<ffffffff810a8102>] ___might_sleep+0x152/0x250
[  634.896926]  [<ffffffff816de754>] rt_spin_lock+0x24/0x80
[  634.896928]  [<ffffffff810d67f9>] ? __lock_is_held+0x49/0x70
[  634.896929]  [<ffffffff810623ee>] pgd_free+0x1e/0xb0
[  634.896930]  [<ffffffff81074877>] __mmdrop+0x27/0xd0
[  634.896932]  [<ffffffff810b4a0d>] sched_cpu_dying+0x24d/0x2c0
[  634.896933]  [<ffffffff810b47c0>] ? sched_cpu_starting+0x60/0x60
[  634.896934]  [<ffffffff81079864>] cpuhp_invoke_callback+0xd4/0x350
[  634.896935]  [<ffffffff81079e56>] take_cpu_down+0x86/0xd0
[  634.896936]  [<ffffffff81146060>] multi_cpu_stop+0xd0/0x110
[  634.896937]  [<ffffffff81145f90>] ? cpu_stop_queue_work+0x90/0x90
[  634.896938]  [<ffffffff811462a2>] cpu_stopper_thread+0x92/0x120
[  634.896940]  [<ffffffff810a50fe>] smpboot_thread_fn+0x1de/0x360
[  634.896941]  [<ffffffff810a4f20>] ? smpboot_update_cpumask_percpu_thread+0x130/0x130
[  634.896942]  [<ffffffff810a093f>] kthread+0xef/0x110
[  634.896944]  [<ffffffff816df16f>] ret_from_fork+0x1f/0x40
[  634.896945]  [<ffffffff810a0850>] ? kthread_park+0x60/0x60
[  634.896970] smpboot: CPU 6 is now offline

Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com>
---
 kernel/sched/core.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -7569,6 +7569,9 @@ int sched_cpu_dying(unsigned int cpu)
 	nohz_balance_exit_idle(cpu);
 	hrtick_clear(rq);
 	if (per_cpu(idle_last_mm, cpu)) {
+	if (IS_ENABLED(CONFIG_PREEMPT_RT_FULL))
+		mmdrop_delayed(per_cpu(idle_last_mm, cpu));
+	else
 		mmdrop(per_cpu(idle_last_mm, cpu));
 		per_cpu(idle_last_mm, cpu) = NULL;
 	}

  parent reply	other threads:[~2016-10-20  9:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-06  8:52 [ANNOUNCE] 4.8-rt1 Sebastian Andrzej Siewior
2016-10-16  3:08 ` [patch] ftrace: Fix latency trace header alignment Mike Galbraith
2016-10-17 13:23   ` Sebastian Andrzej Siewior
2016-10-16  3:11 ` [patch] drivers,connector: Protect send_msg() with a local lock for RT Mike Galbraith
2016-10-17 14:16   ` Sebastian Andrzej Siewior
2016-10-16  3:14 ` [patch] drivers/zram: Don't disable preemption in zcomp_stream_get/put() Mike Galbraith
2016-10-17 14:24   ` Sebastian Andrzej Siewior
2016-10-17 16:19     ` Mike Galbraith
2016-10-17 16:29       ` Sebastian Andrzej Siewior
2016-10-17 17:18         ` Mike Galbraith
2016-10-17 17:46           ` Mike Galbraith
2016-10-19 15:56     ` [patch v2] " Mike Galbraith
2016-10-19 16:54       ` Sebastian Andrzej Siewior
2016-10-20  2:59         ` Mike Galbraith
2016-10-20 11:02       ` Sebastian Andrzej Siewior
2016-10-16  3:18 ` [patch ]mm/zs_malloc: Fix bit spinlock replacement Mike Galbraith
2016-10-17 15:15   ` Sebastian Andrzej Siewior
2016-10-17 16:12     ` Mike Galbraith
2016-10-19 15:50   ` [patch v2 ] mm/zs_malloc: " Mike Galbraith
2016-10-20 10:59     ` Sebastian Andrzej Siewior
2016-10-20  9:34 ` Mike Galbraith [this message]
2016-10-20 11:21   ` [rfc patch] hotplug: Call mmdrop_delayed() in sched_cpu_dying() if PREEMPT_RT_FULL Sebastian Andrzej Siewior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1476956043.18007.15.camel@gmail.com \
    --to=umgwanakikbuti@gmail.com \
    --cc=bigeasy@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).