From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Tejun Heo <htejun@gmail.com>
Cc: gregkh@suse.de, maneesh@in.ibm.com, dmitry.torokhov@gmail.com,
oneukum@suse.de, rpurdie@rpsys.net, James.Bottomley@SteelEye.com,
stern@rowland.harvard.edu, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org
Subject: Re: [PATCH 12/14 UPDATED] sysfs: implement sysfs_dirent active reference and immediate disconnect
Date: Wed, 11 Apr 2007 11:00:06 +0200 [thread overview]
Message-ID: <20070411110006.1007b209@gondolin.boeblingen.de.ibm.com> (raw)
In-Reply-To: <20070411041515.GA10619@htj.dyndns.org>
On Wed, 11 Apr 2007 13:15:15 +0900,
Tejun Heo <htejun@gmail.com> wrote:
> Cornelia, this should fix the problem you reported. It's caused by
> doing up_write() on sysfs_dirent which is used for readdir cursor
> which is not deactivated before being released.
> release_sysfs_dirent() is udpated such that it does
> down_write_trylock() on s_active before doing up_write(). This also
> covers error paths where allocated sysfs_dirent is put due to errors
> during initialization.
I can confirm that this fixes the problem I saw earlier. However, I now
have a new one:
1. Define virtunal ctcs 7000 and 7001: This
creates /sys/bus/ccw/devices/{0.0.7000,0.0.7001}.
2. Do echo 0.0.7000,0.0.7001 > /sys/bus/ccwgroup/drivers/ctc/group.
This creates /sys/bus/ccwgroup/devices/0.0.7000, which has the two ccw
devices from above as slave devices.
3. Detach virtual ctcs 7000 and 7001. This causes the subchannel
beneath 0.0.7000 resp. 0.0.7001 to be unregistered (from a workqueue)
which will in turn trigger an unregistration of ccw device 0.0.7000,
ccw group device 0.0.7000 and ccw device 0.0.7001. Now lockdep is
unhappy:
crw_info : CRW reports slct=0, oflw=0, chn=0, rsc=3, anc=1, erc=4, rsid=F
crw_info : CRW reports slct=0, oflw=0, chn=0, rsc=3, anc=1, erc=4, rsid=10
DEV: Unregistering device. ID = '0.0.000f'
bus css: remove device 0.0.000f
DEV: Unregistering device. ID = '0.0.7000'
bus ccw: remove device 0.0.7000
DEV: Unregistering device. ID = '0.0.7000'
bus ccwgroup: remove device 0.0.7000
=======================================================
[ INFO: possible circular locking dependency detected ]
2.6.21-rc6-ge666c753-dirty #54
-------------------------------------------------------
kslowcrw/64 is trying to acquire lock:
(&sch->reg_mutex){--..}, at: [<00000000004233b2>] mutex_lock+0x3e/0x4c
but task is already holding lock:
(&sd->s_active){----}, at: [<0000000000209578>] remove_dir+0xec/0x144
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&sd->s_active){----}:
[<0000000000156998>] __lock_acquire+0x1008/0x1124
[<0000000000156e9c>] lock_acquire+0x78/0xa8
[<000000000014fc96>] down_write+0x5a/0xa0
[<0000000000206f0a>] sysfs_hash_and_remove+0x112/0x15c
[<00000000002071a6>] sysfs_remove_file+0x32/0x40
[<00000000002a76bc>] device_remove_file+0x44/0x5c
[<00000000002a813a>] device_del+0x1ae/0x26c
[<00000000002a8236>] device_unregister+0x3e/0x58
[<00000000002f0bc0>] css_sch_device_unregister+0x3c/0x54
[<00000000002f174a>] css_evaluate_subchannel+0x266/0x3b8
[<00000000002f1976>] css_trigger_slow_path+0xda/0x154
[<0000000000144a6c>] run_workqueue+0x174/0x220
[<0000000000144d26>] worker_thread+0x116/0x164
[<000000000014ab9c>] kthread+0x158/0x160
[<0000000000107c3a>] kernel_thread_starter+0x6/0xc
[<0000000000107c34>] kernel_thread_starter+0x0/0xc
-> #0 (&sch->reg_mutex){--..}:
[<000000000015671c>] __lock_acquire+0xd8c/0x1124
[<0000000000156e9c>] lock_acquire+0x78/0xa8
[<0000000000423070>] __mutex_lock_slowpath+0xbc/0x3c0
[<00000000004233b2>] mutex_lock+0x3e/0x4c
[<00000000002f0bb6>] css_sch_device_unregister+0x32/0x54
[<00000000002f174a>] css_evaluate_subchannel+0x266/0x3b8
[<00000000002f1976>] css_trigger_slow_path+0xda/0x154
[<0000000000144a6c>] run_workqueue+0x174/0x220
[<0000000000144d26>] worker_thread+0x116/0x164
[<000000000014ab9c>] kthread+0x158/0x160
[<0000000000107c3a>] kernel_thread_starter+0x6/0xc
[<0000000000107c34>] kernel_thread_starter+0x0/0xc
other info that might help us debug this:
1 lock held by kslowcrw/64:
#0: (&sd->s_active){----}, at: [<0000000000209578>] remove_dir+0xec/0x144
stack backtrace:
0000000000000002 0000000000000002 0000000000000000 000000001fd1ba50
000000001fd1b9c8 00000000004bebf6 00000000004bebf6 0000000000103854
0000000000000000 0000000000000001 0000000000000000 0000000000602cb0
0000000000000000 000000001fd1ba10 000000001fd1b9b0 000000000000000e
000000000042a780 000000000010389e 000000001fd1b9b0 000000001fd1ba00
Call Trace:
([<00000000001037f4>] show_trace+0xf8/0xfc)
[<00000000001038ce>] show_stack+0xd6/0x100
[<0000000000103926>] dump_stack+0x2e/0x3c
[<0000000000154c6e>] print_circular_bug_tail+0x9e/0xb0
[<000000000015671c>] __lock_acquire+0xd8c/0x1124
[<0000000000156e9c>] lock_acquire+0x78/0xa8
[<0000000000423070>] __mutex_lock_slowpath+0xbc/0x3c0
[<00000000004233b2>] mutex_lock+0x3e/0x4c
[<00000000002f0bb6>] css_sch_device_unregister+0x32/0x54
[<00000000002f174a>] css_evaluate_subchannel+0x266/0x3b8
[<00000000002f1976>] css_trigger_slow_path+0xda/0x154
[<0000000000144a6c>] run_workqueue+0x174/0x220
[<0000000000144d26>] worker_thread+0x116/0x164
[<000000000014ab9c>] kthread+0x158/0x160
[<0000000000107c3a>] kernel_thread_starter+0x6/0xc
[<0000000000107c34>] kernel_thread_starter+0x0/0xc
INFO: lockdep is turned off.
DEV: Unregistering device. ID = '0.0.0010'
bus css: remove device 0.0.0010
DEV: Unregistering device. ID = '0.0.7001'
bus ccw: remove device 0.0.7001
(We use sch->reg_mutex to protect against concurrent
register/unregister of subchannels.)
I'll see whether I can figure out this one.
next prev parent reply other threads:[~2007-04-11 8:57 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-09 4:18 [PATCHSET #master] sysfs: make sysfs disconnect immediately on deletion, take 2 Tejun Heo
2007-04-09 4:18 ` [PATCH 05/14] sysfs: consolidate sysfs_dirent creation functions Tejun Heo
2007-04-09 4:18 ` [PATCH 02/14] sysfs: fix error handling in binattr write() Tejun Heo
2007-04-09 4:18 ` [PATCH 03/14] sysfs: move release_sysfs_dirent() to dir.c Tejun Heo
2007-04-09 4:18 ` [PATCH 01/14] sysfs: fix i_ino handling in sysfs Tejun Heo
2007-04-27 15:29 ` Eric Sandeen
2007-04-27 15:32 ` Greg KH
2007-04-27 16:04 ` Eric Sandeen
2007-04-09 4:18 ` [PATCH 04/14] sysfs: flatten cleanup paths in sysfs_add_link() and create_dir() Tejun Heo
2007-04-09 4:18 ` [PATCH 06/14] sysfs: add sysfs_dirent->s_parent Tejun Heo
2007-04-09 4:18 ` [PATCH 11/14] sysfs: implement bin_buffer Tejun Heo
2007-04-09 4:18 ` [PATCH 08/14] sysfs: make sysfs_dirent->s_element a union Tejun Heo
2007-04-09 4:18 ` [PATCH 07/14] sysfs: add sysfs_dirent->s_name Tejun Heo
2007-04-09 4:18 ` [PATCH 09/14] sysfs: implement kobj_sysfs_assoc_lock Tejun Heo
2007-04-09 4:18 ` [PATCH 10/14] sysfs: reimplement symlink using sysfs_dirent tree Tejun Heo
2007-04-09 4:18 ` [PATCH 14/14] sysfs: kill unnecessary attribute->owner Tejun Heo
2007-04-10 14:17 ` Cornelia Huck
2007-04-10 14:30 ` Cornelia Huck
2007-04-11 4:21 ` Tejun Heo
2007-04-11 4:25 ` [PATCH 14/14 UPDATED] " Tejun Heo
2007-04-09 4:18 ` [PATCH 13/14] sysfs: kill attribute file orphaning Tejun Heo
2007-04-09 4:18 ` [PATCH 12/14] sysfs: implement sysfs_dirent active reference and immediate disconnect Tejun Heo
2007-04-11 4:15 ` [PATCH 12/14 UPDATED] " Tejun Heo
2007-04-11 9:00 ` Cornelia Huck [this message]
2007-04-11 9:26 ` Tejun Heo
2007-04-11 9:32 ` Tejun Heo
2007-04-11 10:13 ` Tejun Heo
2007-04-11 10:26 ` Cornelia Huck
2007-04-12 7:18 ` Greg KH
2007-04-12 7:39 ` Greg KH
2007-04-10 14:44 ` [PATCHSET #master] sysfs: make sysfs disconnect immediately on deletion, take 2 Cornelia Huck
2007-04-11 4:18 ` Tejun Heo
2007-04-16 8:22 ` Maneesh Soni
2007-04-17 5:06 ` Tejun Heo
2007-04-17 12:42 ` Tejun Heo
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=20070411110006.1007b209@gondolin.boeblingen.de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=James.Bottomley@SteelEye.com \
--cc=akpm@linux-foundation.org \
--cc=dmitry.torokhov@gmail.com \
--cc=gregkh@suse.de \
--cc=htejun@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maneesh@in.ibm.com \
--cc=oneukum@suse.de \
--cc=rpurdie@rpsys.net \
--cc=stern@rowland.harvard.edu \
/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
all inboxes | Powered by JetHome®