lkml.org 
[lkml]   [2014]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@ucw.cz>

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


\
 
 \ /
  Last update: 2014-11-13 15:41    [W:0.074 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site