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:	Fri, 30 Aug 2013 18:35:12 -0600
From:	Toshi Kani <toshi.kani@...com>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
Cc:	ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Linux PM list <linux-pm@...r.kernel.org>,
	Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>,
	linux-mm@...ck.org
Subject: Re: [PATCH 3/3] PM / hibernate / memory hotplug: Rework mutual
 exclusion

On Sat, 2013-08-31 at 02:39 +0200, Rafael J. Wysocki wrote:
> On Friday, August 30, 2013 06:23:19 PM Toshi Kani wrote:
> > On Thu, 2013-08-29 at 23:18 +0200, Rafael J. Wysocki wrote:
> > > From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> > > 
> > > Since all of the memory hotplug operations have to be carried out
> > > under device_hotplug_lock, they won't need to acquire pm_mutex if
> > > device_hotplug_lock is held around hibernation.
> > > 
> > > For this reason, make the hibernation code acquire
> > > device_hotplug_lock after freezing user space processes and
> > > release it before thawing them.  At the same tim drop the
> > > lock_system_sleep() and unlock_system_sleep() calls from
> > > lock_memory_hotplug() and unlock_memory_hotplug(), respectively.
> > > 
> > > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> > > ---
> > >  kernel/power/hibernate.c |    4 ++++
> > >  kernel/power/user.c      |    2 ++
> > >  mm/memory_hotplug.c      |    4 ----
> > >  3 files changed, 6 insertions(+), 4 deletions(-)
> > > 
> > > Index: linux-pm/kernel/power/hibernate.c
> > > ===================================================================
> > > --- linux-pm.orig/kernel/power/hibernate.c
> > > +++ linux-pm/kernel/power/hibernate.c
> > > @@ -652,6 +652,7 @@ int hibernate(void)
> > >  	if (error)
> > >  		goto Exit;
> > >  
> > > +	lock_device_hotplug();
> > 
> > Since hibernate() can be called from sysfs, do you think the tool may
> > see this as a circular dependency with p_active again?  This shouldn't
> > be a problem in practice, though.
> 
> /sys/power/state isn't a device attribute even and is never removed, so it
> would be very sad and disappointing if lockdep reported that as a circular
> dependency.  The deadlock is surely not possible here anyway.

Agreed.  The code looks good otherwise, and this is a nice cleanup.  If
it is OK to ignore the possible warning from the tool (which I do not
know the rule here), feel free to add my ack to patch 2/3 and 3/3 as
well.

Thanks,
-Toshi


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