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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090520131823.GA14933@redhat.com>
Date:	Wed, 20 May 2009 15:18:23 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc:	Ingo Molnar <mingo@...e.hu>,
	Zdenek Kabelac <zdenek.kabelac@...il.com>,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: INFO: possible circular locking dependency at
	cleanup_workqueue_thread

On 05/20, Peter Zijlstra wrote:
>
> > > =======================================================
> > > [ INFO: possible circular locking dependency detected ]
> > > 2.6.30-rc5-00097-gd665355 #59
> > > -------------------------------------------------------
> > > pm-suspend/12129 is trying to acquire lock:
> > >  (events){+.+.+.}, at: [<ffffffff80259496>] cleanup_workqueue_thread+0x26/0xd0
> > >
> > > but task is already holding lock:
> > >  (cpu_add_remove_lock){+.+.+.}, at: [<ffffffff80246e57>]
> > > cpu_maps_update_begin+0x17/0x20
> > >
> > > which lock already depends on the new lock.
> > >
> > >
> > > the existing dependency chain (in reverse order) is:
> > >
> > > -> #5 (cpu_add_remove_lock){+.+.+.}:
> > >        [<ffffffff80271a64>] __lock_acquire+0xc64/0x10a0
> > >        [<ffffffff80271f38>] lock_acquire+0x98/0x140
> > >        [<ffffffff8054e78c>] __mutex_lock_common+0x4c/0x3b0
> > >        [<ffffffff8054ebf6>] mutex_lock_nested+0x46/0x60
> > >        [<ffffffff80246e57>] cpu_maps_update_begin+0x17/0x20
> > >        [<ffffffff80259c33>] __create_workqueue_key+0xc3/0x250
> > >        [<ffffffff80287b20>] stop_machine_create+0x40/0xb0
> > >        [<ffffffff8027a784>] sys_delete_module+0x84/0x270
> > >        [<ffffffff8020c15b>] system_call_fastpath+0x16/0x1b
> > >        [<ffffffffffffffff>] 0xffffffffffffffff
>
> Oleg, why does __create_workqueue_key() require cpu_maps_update_begin()?
> Wouldn't get_online_cpus() be enough to freeze the online cpus?

Yes, get_online_cpus() pins online CPUs. But CPU_POST_DEAD calls
cleanup_workqueue_thread() without cpu_hotplug.lock, this means
that create/destroy can race with cpu_down().

We can avoid cpu_add_remove_lock, but then we have to add another
lock to protect workqueues, cpu_populated_map, etc.

> Breaking the setup_lock -> cpu_add_remove_lock dependency seems
> sufficient.

Hmm. What do you mean? Afaics setup_lock -> cpu_add_remove_lock
is not a problem?

Oleg.

--
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