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] [day] [month] [year] [list]
Date:	Thu, 13 Nov 2014 15:03:26 +0100
From:	Pavel Machek <pavel@....cz>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	len.brown@...el.com, linux-kernel@...r.kernel.org,
	tglx@...utronix.de, mingo@...nel.org,
	torvalds@...ux-foundation.org, rjw@...ysocki.net, hpa@...or.com,
	linux-tip-commits@...r.kernel.org
Subject: Re: [tip:sched/core] sched/wait: Reimplement wait_event_freezable()

Hi!

> > Did you test it with suspend/hibernation? Because I can't really see
> > how it works.
> 
> It calls try_to_freeze() after each schedule(). But no, I've not
> actually tried.
> 
> If we're stuck in the schedule, waiting for the event, freeze_task()
> will wake us up and then we'll find freeing() true and call into
> __refrigerator().
> 
> If we're not stuck in schedule() we're running and the freezer
> can see us running and will wait for us to hit another freeze point.

Ok, let me try it here.

> > > +#define __wait_event_freezable(wq, condition)				\
> > > +	___wait_event(wq, condition, TASK_INTERRUPTIBLE, 0, 0,		\
> > > +			    schedule(); try_to_freeze())
> > > +
> 
> > _Three_ underscores. And two underscore version exists, too,
> > fortunately it at least has different number of arguments.
> 
> Hehe, yeah, there was a discount on underscores that day. The double
> underscore variants can be used in code along with the no underscores
> variants. The tripple one is implementation goo.

Lets see, add 5 underscore variant, and we have contestant for
obfuscated C code contest...

Anyway, it seems it works for me (tested suspend, not hibernation).

Test-by: Pavel Machek <pavel@....cz>

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
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