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:	Tue, 11 Oct 2011 15:07:10 +0530
From:	"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
CC:	Tejun Heo <tj@...nel.org>, rjw@...k.pl, bp@...64.org, pavel@....cz,
	len.brown@...el.com, mingo@...e.hu, akpm@...ux-foundation.org,
	suresh.b.siddha@...el.com, lucas.demarchi@...fusion.mobi,
	rusty@...tcorp.com.au, rdunlap@...otime.net,
	vatsa@...ux.vnet.ibm.com, ashok.raj@...el.com,
	tigran@...azian.fsnet.co.uk, tglx@...utronix.de, hpa@...or.com,
	linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-doc@...r.kernel.org
Subject: Re: [PATCH v2 2/3] Mutually exclude cpu online and suspend/hibernate

On 10/11/2011 02:48 PM, Peter Zijlstra wrote:
> On Mon, 2011-10-10 at 10:00 -0700, Tejun Heo wrote:
> 
>> On Mon, Oct 10, 2011 at 06:15:20PM +0530, Srivatsa S. Bhat wrote:
>>> Would it be better to hook into the suspend/hibernate notifiers and
>>> use them to exclude cpu hotplug from suspend/hibernate, instead of
>>> trying to take pm_mutex lock like this?
>>
>> If this change is determined to be necessary, I think it would be
>> better to make it explicit.  Exclusion through callbacks often makes
>> the locking just more obscure.
> 
> Agreed.
> 

That change is not exactly necessary. I was only wondering if that would be
a cleaner way of dealing with this problem, in the sense that instead of
making this look like a workaround to some bug, we could make it look well-
designed - the PM notifies that its going to suspend/hibernate; so whoever
wants to take actions is free to do so - and it so happens that the cpu
hotplug wants to get mutually excluded from suspend/hibernate and it
implements that exclusion ie., disables further cpu hotplug from happening
till suspend/hibernate is complete and blocks suspend/hibernate till it is
done with an ongoing cpu hotplug operation. And then the suspend/hibernate
continues normally, after returning from the notification path...

But now I see that, apart from probably making the locking more obscure, it
has another disadvantage: the code will get bloated unnecessarily, considering:

    - defining a callback for suspend/hibernate notifier in the cpu hotplug
      code
    - registering/unregistering it with the PM code
    - then implementing the mutual exclusion in that callback

And this current patchset achieves the same end goal without bloating the
code and without obscuring the locking.

So, probably its not worth hooking into the notifiers after all...
Hence we can go with this patchset itself.

-- 
Regards,
Srivatsa S. Bhat  <srivatsa.bhat@...ux.vnet.ibm.com>
Linux Technology Center,
IBM India Systems and Technology Lab
--
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