Messages in this thread | | | Date | Thu, 13 Nov 2014 15:03:26 +0100 | From | Pavel Machek <> | 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@ucw.cz>
Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
| |