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: <20111121164006.GB15314@google.com>
Date:	Mon, 21 Nov 2011 08:40:06 -0800
From:	Tejun Heo <tj@...nel.org>
To:	"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
Cc:	"Rafael J. Wysocki" <rjw@...k.pl>, pavel@....cz, lenb@...nel.org,
	ak@...ux.intel.com, linux-kernel@...r.kernel.org,
	linux-pm@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH v3] PM/Memory-hotplug: Avoid task freezing failures

Hello, Srivatsa.

On Mon, Nov 21, 2011 at 10:06:39AM +0530, Srivatsa S. Bhat wrote:
> void lock_system_sleep(void)
> {
> 	/* simplified freezer_do_not_count() */
> 	current->flags |= PF_FREEZER_SKIP;
> 
> 	mutex_lock(&pm_mutex);
> 
> }
> 
> void unlock_system_sleep(void)
> {
> 	mutex_unlock(&pm_mutex);
> 
> 	/* simplified freezer_count() */
> 	current->flags &= ~PF_FREEZER_SKIP;
> 
> }
> 
> We probably don't want the restriction that freezer_do_not_count() and
> freezer_count() work only for userspace tasks. So I have open coded
> the relevant parts of those functions here.
> 
> I haven't tested this solution yet. Let me know if this solution looks
> good and I'll send it out as a patch after testing and analyzing some
> corner cases, if any.

Ooh ooh, I definitely like this one much better.  Oleg did something
similar w/ wait_event_freezekillable() too.  On related notes,

* I think it would be better to remove direct access to pm_mutex and
  use [un]lock_system_sleep() universally.  I don't think hinging it
  on CONFIG_HIBERNATE_CALLBACKS buys us anything.

* In the longer term, we should be able to toggle PF_NOFREEZE instead
  as SKIP doesn't mean anything different.  We'll probably need a
  better API tho.  But for now SKIP should work fine.

Thank you.

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