From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Andrzej Siewior Subject: Re: Hung task for proc_cgroup_show Date: Mon, 21 Dec 2015 18:59:51 +0100 Message-ID: <20151221175951.GA6714@linutronix.de> References: <20150714150016.GC21820@linutronix.de> <20151211161450.GA6720@linutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: Linux RT Users To: Christoph Mathys Return-path: Received: from www.linutronix.de ([62.245.132.108]:50476 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750965AbbLUR7x (ORCPT ); Mon, 21 Dec 2015 12:59:53 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-rt-users-owner@vger.kernel.org List-ID: * Christoph Mathys | 2015-12-21 10:49:41 [+0100]: >When testing on another computer I got a BUG from the same general area: If you can reproduce this then the following patch should fix it: --- Subject: [PATCH] kernel/rcu: use swait for sync_rcu_preempt_exp_wq __schedule() invokes rcu_note_context_switch() with preemption disabled: |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:917 |in_atomic(): 1, irqs_disabled(): 0, pid: 3329, name: init |2 locks held by init/3329: | #0: (&mm->mmap_sem){++++++}, at: [] __do_page_fault+0x12e/0x5f0 | #1: (ptlock_ptr(page)#2){+.+...}, at: [] do_read_fault.isra.66+0xaf/0x2d0 |CPU: 1 PID: 3329 Comm: init Tainted: G E 3.18.24-realtime-1-rt22 #1 |Call Trace: | [] rt_spin_lock+0x24/0x60 | [] __wake_up+0x29/0x60 | [] rcu_report_exp_rnp.isra.64+0xb4/0xc0 | [] rcu_read_unlock_special+0x1fb/0x250 | [] rcu_note_context_switch+0x1e4/0x420 | [] __schedule+0x56/0x8a0 | [] preempt_schedule_irq+0x44/0x80 | [] check_int_off+0x11/0x1e | [] filemap_map_pages+0x188/0x270 | [] do_read_fault.isra.66+0x1ba/0x2d0 | [] handle_mm_fault+0x5ef/0xec0 | [] __do_page_fault+0x192/0x5f0 | [] do_page_fault+0xc/0x10 | [] page_fault+0x22/0x30 | [] getname_flags+0xb5/0x1a0 | [] getname+0x12/0x20 | [] do_sys_open+0xfd/0x220 | [] ? trace_hardirqs_on_caller+0xfd/0x1c0 | [] SyS_open+0x1e/0x20 | [] system_call_fastpath+0x16/0x1b Reported-by: Christoph Mathys Signed-off-by: Sebastian Andrzej Siewior --- kernel/rcu/tree_plugin.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 54da8f44d586..1cbeb0aa79e2 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -527,7 +527,7 @@ void synchronize_rcu(void) } EXPORT_SYMBOL_GPL(synchronize_rcu); -static DECLARE_WAIT_QUEUE_HEAD(sync_rcu_preempt_exp_wq); +static DEFINE_SWAIT_HEAD(sync_rcu_preempt_exp_wq); static unsigned long sync_rcu_preempt_exp_count; static DEFINE_MUTEX(sync_rcu_preempt_exp_mutex); @@ -584,7 +584,7 @@ static void rcu_report_exp_rnp(struct rcu_state *rsp, struct rcu_node *rnp, raw_spin_unlock_irqrestore(&rnp->lock, flags); if (wake) { smp_mb(); /* EGP done before wake_up(). */ - wake_up(&sync_rcu_preempt_exp_wq); + swait_wake(&sync_rcu_preempt_exp_wq); } break; } @@ -759,7 +759,7 @@ void synchronize_rcu_expedited(void) /* Wait for snapshotted ->blkd_tasks lists to drain. */ rnp = rcu_get_root(rsp); - wait_event(sync_rcu_preempt_exp_wq, + swait_event(sync_rcu_preempt_exp_wq, sync_rcu_preempt_exp_done(rnp)); /* Clean up and exit. */ -- 2.6.4 Sebastian