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]
Date:	Thu, 06 Feb 2014 16:38:01 +0530
From:	"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
To:	ego@...ux.vnet.ibm.com
CC:	paulus@...ba.org, oleg@...hat.com, rusty@...tcorp.com.au,
	peterz@...radead.org, tglx@...utronix.de,
	akpm@...ux-foundation.org, mingo@...nel.org,
	paulmck@...ux.vnet.ibm.com, tj@...nel.org, walken@...gle.com,
	linux@....linux.org.uk, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 00/51] CPU hotplug: Fix issues with callback registration

On 02/06/2014 04:34 PM, Srivatsa S. Bhat wrote:
> On 02/06/2014 03:08 PM, Gautham R Shenoy wrote:
>> Hi,
>>
>> On Thu, Feb 06, 2014 at 03:34:36AM +0530, Srivatsa S. Bhat wrote:
>>> Hi,
>>>
[...]
>> Couple of comments:
>>
>> Right now, cpu_add_remove_lock is being used to 
>> 1) Serialize the cpu-hotplug writers.
>>
>> 2) Serialize accesses to cpu_present/possible_map.
>>
>> 3) Serialize updates to the cpu_chain (the cpu hotplug notifier chain).  
>>
>>    - This is necessary to ensure that registration of notifiers and
>>      invocation of CPU_POST_DEAD notifications don't race with each
>>      other.  Else we could have used get/put_online_cpus() in
>>      register_cpu_notifier() and this patch series wouldn't have been
>>      necessary.
>>
>> 4) Bulk cpu-hotplug (disable/enable_non_boot_cpus), but this is a
>> special case of 1).
>>
>> CPU_POST_DEAD notification, is invoked with the cpu_hotplug.lock
>> dropped. This was necessary for subsystems which would be waiting for
>> some other thread to finish some work, and that other thread could
>> invoke get_online_cpus(). If CPU_POST_DEAD notification were issued
>> without dropping the cpu_hotplug.lock, this would lead to a deadlock
>> as the notifier would be left stuck waiting for the thread which is
>> blocked in get_online_cpus().
>>
>> It was introduced to ensure that multithreaded workqueues can safely
>> use get_online_cpus() [https://lkml.org/lkml/2008/6/29/121].
>>
>> As of now, only two subsystems use this notification and workqueues is
>> _not_ one of them!
>>   * arch/x86/kernel/cpu/mcheck/mce.c:mce_cpu_callback()
>>   * drivers/cpufreq/cpufreq.c:cpufreq_cpu_callback()
>> I haven't yet audited these two cases to see if they really need this
>> to be handled in CPU_POST_DEAD or if they can be handled in CPU_DEAD.
>>
> 
> Well, cpufreq had a legitimate need to use POST_DEAD to avoid the
> deadlock described in commit 1aee40ac9c. However, there had been some
> discussion some time ago about reorganizing the cpufreq's hotplug callback
> so as to move most (but not all) of its work outside of POST_DEAD [1].

Forgot to give the link.. Here it is:
http://article.gmane.org/gmane.linux.kernel/1571276

Regards,
Srivatsa S. Bhat

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