From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleg Nesterov Subject: Re: [RFC][PATCH -mm 4/7] Freezer: Introduce freezer-firendly waiting macros Date: Thu, 12 Jul 2007 03:02:49 +0400 Message-ID: <20070711230249.GA310@tv-sign.ru> References: <200707120006.50095.rjw@sisk.pl> <200707120013.32672.rjw@sisk.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <200707120013.32672.rjw@sisk.pl> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org To: "Rafael J. Wysocki" Cc: Matthew Garrett , pm list , Pavel Machek , Miklos Szeredi List-Id: linux-pm@vger.kernel.org On 07/12, Rafael J. Wysocki wrote: > > +#define wait_event_freezable(wq, condition) \ > +({ \ > + int __ret; \ > + do { \ > + __ret = wait_event_interruptible(wq, \ > + (condition) || freezing(current)); \ > + try_to_freeze(); \ > + } while (!(condition)); \ > + __ret; \ > +}) This is still not right in general, I believe. It will spin if the caller is signalled. You changed the freezer, but kthread can use signals anyway. It returns only when "condition" is true, so the "__ret" is meaningless. Oleg.