mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frank Rowand <frank.rowand@am.sony.com>
To: Steven Rostedt <rostedt@goodmis.org>, <tglx@linutronix.de>,
	<chris.pringle@miranda.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-rt-users <linux-rt-users@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Carsten Emde <C.Emde@osadl.org>, John Kacur <jkacur@redhat.com>
Subject: Re: [PATCH RT 05/12] slab: Prevent local lock deadlock
Date: Thu, 26 Jul 2012 17:15:23 -0700	[thread overview]
Message-ID: <5011DD9B.1030901@am.sony.com> (raw)
In-Reply-To: <20120718223957.856443728@goodmis.org>

On 07/18/12 15:39, Steven Rostedt wrote:
> From: Thomas Gleixner <tglx@linutronix.de>
> 
> On RT we avoid the cross cpu function calls and take the per cpu local
> locks instead. Now the code missed that taking the local lock on the
> cpu which runs the code must use the proper local lock functions and
> not a simple spin_lock(). Otherwise it deadlocks later when trying to
> acquire the local lock with the proper function.
> 
> Reported-and-tested-by: Chris Pringle <chris.pringle@miranda.com>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
>  mm/slab.c |   26 ++++++++++++++++++++++----
>  1 file changed, 22 insertions(+), 4 deletions(-)


This patch leads to a warning during boot on the ARM pandaboard:

[    0.225097] Brought up 2 CPUs
[    0.225097] SMP: Total of 2 processors activated (2007.19 BogoMIPS).
[    0.225952] 
[    0.225982] =============================================
[    0.225982] [ INFO: possible recursive locking detected ]
[    0.225982] 3.0.36-rt58 #1
[    0.225982] ---------------------------------------------
[    0.225982] swapper/0/1 is trying to acquire lock:
[    0.226013]  (&per_cpu(slab_lock, __cpu).lock){+.+...}, at: [<c0147544>] do_ccupdate_local+0x18/0x44
[    0.226043] 
[    0.226043] but task is already holding lock:
[    0.226043]  (&per_cpu(slab_lock, __cpu).lock){+.+...}, at: [<c014737c>] lock_slab_on+0x48/0x134
[    0.226074] 
[    0.226074] other info that might help us debug this:
[    0.226074]  Possible unsafe locking scenario:
[    0.226074] 
[    0.226074]        CPU0
[    0.226074]        ----
[    0.226074]   lock(&per_cpu(slab_lock, __cpu).lock);
[    0.226104]   lock(&per_cpu(slab_lock, __cpu).lock);
[    0.226104] 
[    0.226104]  *** DEADLOCK ***
[    0.226104] 
[    0.226104]  May be due to missing lock nesting notation
[    0.226104] 
[    0.226104] 2 locks held by swapper/0/1:
[    0.226135]  #0:  (cache_chain_mutex){+.+.+.}, at: [<c014a618>] kmem_cache_create+0x74/0x4bc
[    0.226135]  #1:  (&per_cpu(slab_lock, __cpu).lock){+.+...}, at: [<c014737c>] lock_slab_on+0x48/0x134
[    0.226165] 
[    0.226165] stack backtrace:
[    0.226196] [<c00681f8>] (unwind_backtrace+0x0/0xf0) from [<c00da918>] (__lock_acquire+0x1984/0x1ce8)
[    0.226196] [<c00da918>] (__lock_acquire+0x1984/0x1ce8) from [<c00db29c>] (lock_acquire+0x100/0x120)
[    0.226226] [<c00db29c>] (lock_acquire+0x100/0x120) from [<c0485c10>] (rt_spin_lock+0x4c/0x5c)
[    0.226257] [<c0485c10>] (rt_spin_lock+0x4c/0x5c) from [<c0147544>] (do_ccupdate_local+0x18/0x44)
[    0.226257] [<c0147544>] (do_ccupdate_local+0x18/0x44) from [<c01476e8>] (slab_on_each_cpu+0x2c/0x64)
[    0.226287] [<c01476e8>] (slab_on_each_cpu+0x2c/0x64) from [<c0149c70>] (do_tune_cpucache+0xd8/0x3e8)
[    0.226287] [<c0149c70>] (do_tune_cpucache+0xd8/0x3e8) from [<c014a154>] (enable_cpucache+0x50/0xcc)
[    0.226318] [<c014a154>] (enable_cpucache+0x50/0xcc) from [<c014a974>] (kmem_cache_create+0x3d0/0x4bc)
[    0.226318] [<c014a974>] (kmem_cache_create+0x3d0/0x4bc) from [<c0021e54>] (init_tmpfs+0x3c/0xe8)
[    0.226348] [<c0021e54>] (init_tmpfs+0x3c/0xe8) from [<c00083b4>] (kernel_init+0x80/0x150)
[    0.226379] [<c00083b4>] (kernel_init+0x80/0x150) from [<c0061e30>] (kernel_thread_exit+0x0/0x8)
[    0.239776] omap_hwmod: _populate_mpu_rt_base found no _mpu_rt_va for emif_fw
[    0.239776] omap_hwmod: _populate_mpu_rt_base found no _mpu_rt_va for l3_instr



Config is from arch/arm/configs/omap2plus_defconfig
plus:

   CONFIG_USB_EHCI_HCD=y
   CONFIG_USB_NET_SMSC95XX=y
   CONFIG_PREEMPT_RT_FULL=y


-Frank


  reply	other threads:[~2012-07-27  0:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-18 22:39 [PATCH RT 00/12] [ANNOUNCE] 3.0.36-rt58-rc1 stable review Steven Rostedt
2012-07-18 22:39 ` [PATCH RT 01/12] Latency histogramms: Cope with backwards running local trace clock Steven Rostedt
2012-07-18 22:39 ` [PATCH RT 02/12] Latency histograms: Adjust timer, if already elapsed when programmed Steven Rostedt
2012-07-18 22:39 ` [PATCH RT 03/12] Disable RT_GROUP_SCHED in PREEMPT_RT_FULL Steven Rostedt
2012-07-18 22:39 ` [PATCH RT 04/12] Latency histograms: Detect another yet overlooked sharedprio condition Steven Rostedt
2012-07-18 22:39 ` [PATCH RT 05/12] slab: Prevent local lock deadlock Steven Rostedt
2012-07-27  0:15   ` Frank Rowand [this message]
2012-07-31  1:22     ` Steven Rostedt
2012-07-31  2:22       ` Frank Rowand
2012-07-31  2:32         ` Steven Rostedt
2012-07-31 19:00           ` Frank Rowand
2012-07-31 19:11             ` Steven Rostedt
2012-07-31 21:52               ` Frank Rowand
2012-07-18 22:39 ` [PATCH RT 06/12] fs, jbd: pull your plug when waiting for space Steven Rostedt
2012-07-18 22:39 ` [PATCH RT 07/12] perf: Make swevent hrtimer run in irq instead of softirq Steven Rostedt
2012-07-18 22:39 ` [PATCH RT 08/12] cpu/rt: Rework cpu down for PREEMPT_RT Steven Rostedt
2012-07-18 22:39 ` [PATCH RT 09/12] cpu/rt: Fix cpu_hotplug variable initialization Steven Rostedt
2012-07-18 22:39 ` [PATCH RT 10/12] workqueue: Revert workqueue: Fix PF_THREAD_BOUND abuse Steven Rostedt
2012-07-18 22:39 ` [PATCH RT 11/12] workqueue: Revert workqueue: Fix cpuhotplug trainwreck Steven Rostedt
2012-07-18 22:39 ` [PATCH RT 12/12] Linux 3.0.36-rt58-rc1 Steven Rostedt
2012-07-19  4:00 ` [PATCH RT 00/12] [ANNOUNCE] 3.0.36-rt58-rc1 stable review Mike Galbraith
2012-07-19 13:05   ` Steven Rostedt
2012-07-19 13:51     ` Mike Galbraith
2012-07-19 14:02       ` Steven Rostedt
2012-07-20  3:49         ` Mike Galbraith
  -- strict thread matches above, loose matches on Subject: below --
2012-07-17 15:31 [PATCH RT 00/12] [ANNOUNCE] 3.4.4-rt14-rc2 " Steven Rostedt
2012-07-17 15:31 ` [PATCH RT 05/12] slab: Prevent local lock deadlock Steven Rostedt

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=5011DD9B.1030901@am.sony.com \
    --to=frank.rowand@am.sony.com \
    --cc=C.Emde@osadl.org \
    --cc=chris.pringle@miranda.com \
    --cc=jkacur@redhat.com \
    --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

Powered by JetHome