lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100914160729.C9A1.A69D9226@jp.fujitsu.com>
Date:	Tue, 14 Sep 2010 16:27:44 +0900 (JST)
From:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	kosaki.motohiro@...fujitsu.com, Tejun Heo <tj@...nel.org>,
	linux-kernel@...r.kernel.org
Subject: Re: lockdep warning: events vs. bd_mutex

> [  464.602109] -> #3 (&bdev->bd_mutex){+.+.+.}:
> [  464.602109]        [<ffffffff8106dad4>] lock_acquire+0xe3/0x110
> [  464.602109]        [<ffffffff813f5b5b>] __mutex_lock_common+0x4b/0x35e
> [  464.602109]        [<ffffffff813f5f32>] mutex_lock_nested+0x3e/0x43
> [  464.602109]        [<ffffffff8111d7df>] revalidate_disk+0x4b/0x73		// grab bd_mutex
> [  464.602109]        [<ffffffff812a969f>] sd_rescan+0x27/0x34
> [  464.602109]        [<ffffffff812a1be6>] scsi_rescan_device+0x82/0x98
> [  464.602109]        [<ffffffff812b53e5>] ata_scsi_dev_rescan+0x8d/0xf4	// on system_wq
> [  464.602109]        [<ffffffff810558b0>] process_one_work+0x232/0x399
> [  464.602109]        [<ffffffff8105759a>] worker_thread+0x13b/0x251
> [  464.602109]        [<ffffffff8105ace8>] kthread+0x82/0x8a
> [  464.602109]        [<ffffffff81003a64>] kernel_thread_helper+0x4/0x10

ata_scsi_dev_rescan() was invoked by schedule_work() from ata_eh_revalidate_and_attach().
IOW, it use system_wq.

> [  464.602109] -> #0 (events){+.+.+.}:
> [  464.602109]        [<ffffffff8106d6e9>] __lock_acquire+0xa30/0xd38
> [  464.602109]        [<ffffffff8106dad4>] lock_acquire+0xe3/0x110
> [  464.602109]        [<ffffffff810567e7>] flush_work+0xfc/0x143		// wait system_wq
> [  464.602109]        [<ffffffff81056903>] schedule_on_each_cpu+0xd5/0x115
> [  464.602109]        [<ffffffff810c6f06>] lru_add_drain_all+0x15/0x17
> [  464.602109]        [<ffffffff81118b93>] invalidate_bdev+0x2d/0x3f
> [  464.602109]        [<ffffffff8111d16c>] __invalidate_device+0x48/0x53
> [  464.602109]        [<ffffffff811ebf1d>] invalidate_partition+0x2d/0x42
> [  464.602109]        [<ffffffff8114ac31>] rescan_partitions+0x63/0x40e
> [  464.602109]        [<ffffffff8111e2f0>] __blkdev_get+0x269/0x32f		// grab bd_mutex
> [  464.602109]        [<ffffffff8111e3c6>] blkdev_get+0x10/0x12
> [  464.602109]        [<ffffffff8114a35d>] register_disk+0xdc/0x13f
> [  464.602109]        [<ffffffff811eb5f0>] add_disk+0xaf/0x10b
> [  464.602109]        [<ffffffff812abd2b>] sd_probe_async+0x129/0x1cd
> [  464.602109]        [<ffffffff81061847>] async_run_entry_fn+0xa8/0x15b
> [  464.602109]        [<ffffffff810558b0>] process_one_work+0x232/0x399
> [  464.602109]        [<ffffffff8105759a>] worker_thread+0x13b/0x251
> [  464.602109]        [<ffffffff8105ace8>] kthread+0x82/0x8a
> [  464.602109]        [<ffffffff81003a64>] kernel_thread_helper+0x4/0x10

lru_add_drain_all() wait system_wq.


Probably we have four choice.
 1) simple revert buggy patch (I don't know how much serious original issue)
 2) ata_scsi_dev_rescan() doesn't use system_wq
 3) lru_add_drain_all() doesn't use system_wq
 4) make IPI version lru_add_drain_all()

I'd like to hear Tejun's opinion.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ