From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751803Ab3JUS4I (ORCPT ); Mon, 21 Oct 2013 14:56:08 -0400 Received: from mail-ee0-f41.google.com ([74.125.83.41]:33573 "EHLO mail-ee0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751141Ab3JUS4G (ORCPT ); Mon, 21 Oct 2013 14:56:06 -0400 Date: Mon, 21 Oct 2013 21:54:09 +0300 From: Sergey Senozhatsky To: "Rafael J. Wysocki" , "Srivatsa S. Bhat" Cc: Toshi Kani , Thomas Gleixner , Frederic Weisbecker , Tejun Heo , linux-kernel@vger.kernel.org Subject: [LOCKDEP] cpu_add_remove_lock/console_lock possible circular locking dependency detected Message-ID: <20131021185409.GA2408@swordfish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.22 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, during systemctl suspend: [ 3261.011172] ====================================================== [ 3261.011173] [ INFO: possible circular locking dependency detected ] [ 3261.011176] 3.12.0-rc6-dbg-00003-g0df651a-dirty #1981 Not tainted [ 3261.011177] ------------------------------------------------------- [ 3261.011179] systemd-sleep/9549 is trying to acquire lock: [ 3261.011194] (cpu_add_remove_lock){+.+.+.}, at: [] disable_nonboot_cpus+0x24/0x130 [ 3261.011195] but task is already holding lock: [ 3261.011202] (console_lock){+.+.+.}, at: [] suspend_console+0x26/0x40 [ 3261.011203] which lock already depends on the new lock. [ 3261.011204] the existing dependency chain (in reverse order) is: [ 3261.011208] -> #2 (console_lock){+.+.+.}: [ 3261.011213] [] lock_acquire+0xa4/0x200 [ 3261.011216] [] console_lock+0x77/0x80 [ 3261.011219] [] console_cpu_notify+0x31/0x40 [ 3261.011225] [] notifier_call_chain+0x5d/0x110 [ 3261.011228] [] __raw_notifier_call_chain+0xe/0x10 [ 3261.011231] [] cpu_notify+0x23/0x50 [ 3261.011235] [] cpu_notify_nofail+0xe/0x20 [ 3261.011241] [] _cpu_down+0x1ad/0x330 [ 3261.011244] [] cpu_down+0x36/0x50 [ 3261.011252] [] cpu_subsys_offline+0x1d/0x30 [ 3261.011255] [] device_offline+0x95/0xc0 [ 3261.011258] [] online_store+0x40/0x90 [ 3261.011264] [] dev_attr_store+0x18/0x30 [ 3261.011270] [] sysfs_write_file+0xdb/0x150 [ 3261.011274] [] vfs_write+0xbd/0x1e0 [ 3261.011277] [] SyS_write+0x4c/0xa0 [ 3261.011284] [] tracesys+0xd4/0xd9 [ 3261.011287] -> #1 (cpu_hotplug.lock){+.+.+.}: [ 3261.011290] [] lock_acquire+0xa4/0x200 [ 3261.011293] [] mutex_lock_nested+0x67/0x570 [ 3261.011297] [] cpu_hotplug_begin+0x2b/0x60 [ 3261.011300] [] _cpu_up+0x2e/0x180 [ 3261.011303] [] cpu_up+0x59/0x80 [ 3261.011309] [] smp_init+0x66/0x97 [ 3261.011314] [] kernel_init_freeable+0x84/0x196 [ 3261.011317] [] kernel_init+0xe/0x180 [ 3261.011321] [] ret_from_fork+0x7c/0xb0 [ 3261.011325] -> #0 (cpu_add_remove_lock){+.+.+.}: [ 3261.011328] [] __lock_acquire+0x19d0/0x1f40 [ 3261.011331] [] lock_acquire+0xa4/0x200 [ 3261.011334] [] mutex_lock_nested+0x67/0x570 [ 3261.011337] [] disable_nonboot_cpus+0x24/0x130 [ 3261.011342] [] suspend_devices_and_enter+0x1d5/0x660 [ 3261.011346] [] pm_suspend+0x1d2/0x240 [ 3261.011349] [] state_store+0x79/0xf0 [ 3261.011356] [] kobj_attr_store+0xf/0x20 [ 3261.011360] [] sysfs_write_file+0xdb/0x150 [ 3261.011362] [] vfs_write+0xbd/0x1e0 [ 3261.011365] [] SyS_write+0x4c/0xa0 [ 3261.011368] [] tracesys+0xd4/0xd9 [ 3261.011369] other info that might help us debug this: [ 3261.011374] Chain exists of: cpu_add_remove_lock --> cpu_hotplug.lock --> console_lock [ 3261.011375] Possible unsafe locking scenario: [ 3261.011376] CPU0 CPU1 [ 3261.011377] ---- ---- [ 3261.011379] lock(console_lock); [ 3261.011381] lock(cpu_hotplug.lock); [ 3261.011384] lock(console_lock); [ 3261.011386] lock(cpu_add_remove_lock); [ 3261.011387] *** DEADLOCK *** [ 3261.011388] 6 locks held by systemd-sleep/9549: [ 3261.011395] #0: (sb_writers#6){.+.+.+}, at: [] vfs_write+0x1bb/0x1e0 [ 3261.011402] #1: (&buffer->mutex){+.+.+.}, at: [] sysfs_write_file+0x3c/0x150 [ 3261.011409] #2: (s_active#111){.+.+.+}, at: [] sysfs_write_file+0xc3/0x150 [ 3261.011415] #3: (pm_mutex){+.+.+.}, at: [] pm_suspend+0x32/0x240 [ 3261.011423] #4: (acpi_scan_lock){+.+.+.}, at: [] acpi_scan_lock_acquire+0x17/0x19 [ 3261.011429] #5: (console_lock){+.+.+.}, at: [] suspend_console+0x26/0x40 [ 3261.011430] stack backtrace: [ 3261.011433] CPU: 0 PID: 9549 Comm: systemd-sleep Not tainted 3.12.0-rc6-dbg-00003-g0df651a-dirty #1981 [ 3261.011435] Hardware name: Acer Aspire 5741G /Aspire 5741G , BIOS V1.20 02/08/2011 [ 3261.011440] ffffffff821f3c60 ffff880148cd7bc8 ffffffff816250a0 ffffffff821f29d0 [ 3261.011444] ffff880148cd7c08 ffffffff81621c06 ffff880093c18ff0 ffff880093c19748 [ 3261.011448] 42606a03548d23a1 ffff880093c19720 ffff880093c18ff0 ffff880093c19748 [ 3261.011450] Call Trace: [ 3261.011454] [] dump_stack+0x4e/0x82 [ 3261.011459] [] print_circular_bug+0x2b4/0x31d [ 3261.011462] [] __lock_acquire+0x19d0/0x1f40 [ 3261.011467] [] ? walk_system_ram_range+0x5c/0x140 [ 3261.011471] [] lock_acquire+0xa4/0x200 [ 3261.011475] [] ? disable_nonboot_cpus+0x24/0x130 [ 3261.011478] [] ? disable_nonboot_cpus+0x24/0x130 [ 3261.011481] [] mutex_lock_nested+0x67/0x570 [ 3261.011485] [] ? disable_nonboot_cpus+0x24/0x130 [ 3261.011488] [] ? mutex_unlock+0xe/0x10 [ 3261.011493] [] ? acpi_os_get_iomem+0x4c/0x54 [ 3261.011497] [] disable_nonboot_cpus+0x24/0x130 [ 3261.011501] [] suspend_devices_and_enter+0x1d5/0x660 [ 3261.011505] [] ? printk+0x54/0x56 [ 3261.011508] [] pm_suspend+0x1d2/0x240 [ 3261.011512] [] state_store+0x79/0xf0 [ 3261.011516] [] kobj_attr_store+0xf/0x20 [ 3261.011520] [] sysfs_write_file+0xdb/0x150 [ 3261.011523] [] vfs_write+0xbd/0x1e0 [ 3261.011528] [] ? fget_light+0x320/0x4b0 [ 3261.011531] [] SyS_write+0x4c/0xa0 [ 3261.011535] [] tracesys+0xd4/0xd9 [ 3261.011537] Disabling non-boot CPUs ... [ 3261.013327] smpboot: CPU 1 is now offline [ 3261.116887] smpboot: CPU 2 is now offline [ 3261.220932] smpboot: CPU 3 is now offline -ss