From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755873AbZEJPWg (ORCPT ); Sun, 10 May 2009 11:22:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753573AbZEJPW1 (ORCPT ); Sun, 10 May 2009 11:22:27 -0400 Received: from mail-gx0-f166.google.com ([209.85.217.166]:51980 "EHLO mail-gx0-f166.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751523AbZEJPW0 (ORCPT ); Sun, 10 May 2009 11:22:26 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=ZNgsyFZZXl3ki/63/Y1r3+BJTK47E83/JU64Wv3rTS904JSEWgN6Cf30RpNrg5ogjq 9VNI4hYlVspqLFqVPKTIbyLldxPWaN65LuJYpF88aLeklzF5Hk0FQxo+VnSr+LPnyzvv vnlL6ochKkjqAn6BA//r1PAWC1dNmKJ5mnfzU= MIME-Version: 1.0 Date: Mon, 11 May 2009 00:22:26 +0900 X-Google-Sender-Auth: b6035aa5d3439ef8 Message-ID: <2f11576a0905100822y5507a9f7m6f9aa0fcc05ac18@mail.gmail.com> Subject: lockdep warnings: cpufreq ondemand gorvernor possibly circular locking From: KOSAKI Motohiro To: LKML , Mathieu Desnoyers , Greg KH , Ingo Molnar , "Rafael J. Wysocki" , Ben Slusky , Dave Jones , Chris Wright , Andrew Morton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi my box output following warnings. it seems regression by commit 7ccc7608b836e58fbacf65ee4f8eefa288e86fac. A: work -> do_dbs_timer() -> cpu_policy_rwsem B: store() -> cpu_policy_rwsem -> cpufreq_governor_dbs() -> work ======================================================= nd cpu frequency[ INFO: possible circular locking dependency detected ] scaling: 2.6.30-rc4-mm1 #26 ------------------------------------------------------- K99cpuspeed/227488 is trying to acquire lock: (&(&dbs_info->work)->work){+.+...}, at: [] __cancel_work_timer+0xde/0x227 but task is already holding lock: (dbs_mutex){+.+.+.}, at: [] cpufreq_governor_dbs+0x241/0x2d2 [cpufreq_ondemand] which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (dbs_mutex){+.+.+.}: [] __lock_acquire+0xa9d/0xc33 [] lock_acquire+0xc1/0xe5 [] __mutex_lock_common+0x4d/0x34c [] mutex_lock_nested+0x3a/0x3f [] cpufreq_governor_dbs+0x8b/0x2d2 [cpufreq_ondemand] [] __cpufreq_governor+0xa7/0xe4 [] __cpufreq_set_policy+0x19a/0x216 [] store_scaling_governor+0x1ec/0x228 [] store+0x67/0x8c [] sysfs_write_file+0xe9/0x11e [] vfs_write+0xb0/0x10a [] sys_write+0x4c/0x74 [] system_call_fastpath+0x16/0x1b [] 0xffffffffffffffff -> #1 (&per_cpu(cpu_policy_rwsem, cpu)){+++++.}: [] __lock_acquire+0xa9d/0xc33 [] lock_acquire+0xc1/0xe5 [] down_write+0x4d/0x81 [] lock_policy_rwsem_write+0x4d/0x7d [] do_dbs_timer+0x64/0x284 [cpufreq_ondemand] [] worker_thread+0x205/0x318 [] kthread+0x8d/0x95 [] child_rip+0xa/0x20 [] 0xffffffffffffffff -> #0 (&(&dbs_info->work)->work){+.+...}: [] __lock_acquire+0x991/0xc33 [] lock_acquire+0xc1/0xe5 [] __cancel_work_timer+0x117/0x227 [] cancel_delayed_work_sync+0x12/0x14 [] cpufreq_governor_dbs+0x254/0x2d2 [cpufreq_ondemand] [] __cpufreq_governor+0xa7/0xe4 [] __cpufreq_set_policy+0x184/0x216 [] store_scaling_governor+0x1ec/0x228 [] store+0x67/0x8c [] sysfs_write_file+0xe9/0x11e [] vfs_write+0xb0/0x10a [] sys_write+0x4c/0x74 [] system_call_fastpath+0x16/0x1b [] 0xffffffffffffffff other info that might help us debug this: 3 locks held by K99cpuspeed/227488: #0: (&buffer->mutex){+.+.+.}, at: [] sysfs_write_file+0x3d/0x11e #1: (&per_cpu(cpu_policy_rwsem, cpu)){+++++.}, at: [] lock_policy_rwsem_write+0x4d/0x7d #2: (dbs_mutex){+.+.+.}, at: [] cpufreq_governor_dbs+0x241/0x2d2 [cpufreq_ondemand] stack backtrace: Pid: 227488, comm: K99cpuspeed Not tainted 2.6.30-rc4-mm1 #26 Call Trace: [] print_circular_bug_tail+0x71/0x7c [] __lock_acquire+0x991/0xc33 [] ? lock_timer_base+0x2b/0x4f [] lock_acquire+0xc1/0xe5 [] ? __cancel_work_timer+0xde/0x227 [] __cancel_work_timer+0x117/0x227 [] ? __cancel_work_timer+0xde/0x227 [] ? mark_held_locks+0x4d/0x6b [] ? __mutex_lock_common+0x302/0x34c [] ? cpufreq_governor_dbs+0x241/0x2d2 [cpufreq_ondemand] [] ? mark_held_locks+0x4d/0x6b [] ? cpufreq_governor_dbs+0x241/0x2d2 [cpufreq_ondemand] [] ? ftrace_call+0x5/0x2b [] cancel_delayed_work_sync+0x12/0x14 [] cpufreq_governor_dbs+0x254/0x2d2 [cpufreq_ondemand] [] ? up_read+0x2b/0x2f [] __cpufreq_governor+0xa7/0xe4 [] __cpufreq_set_policy+0x184/0x216 [] store_scaling_governor+0x1ec/0x228 [] ? handle_update+0x0/0x39 [] store+0x67/0x8c [] sysfs_write_file+0xe9/0x11e [] vfs_write+0xb0/0x10a [] sys_write+0x4c/0x74 [] system_call_fastpath+0x16/0x1b [ OK ] Sending all processes th