Re: [RFC][PATCH -mm 4/7] Freezer: Introduce freezer-firendly waiting macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm

[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux