[PATCH RFC v7 20/23] dept: Apply timeout consideration to waitqueue wait

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

 



Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the
consideration to waitqueue wait, assuming an input 'ret' in
___wait_event() macro is used as a timeout value.

Signed-off-by: Byungchul Park <byungchul.park@xxxxxxx>
---
 include/linux/wait.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/wait.h b/include/linux/wait.h
index ede466c..87888ee 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -304,7 +304,10 @@ static inline void wake_up_pollfree(struct wait_queue_head *wq_head)
 	struct wait_queue_entry __wq_entry;					\
 	long __ret = ret;	/* explicit shadow */				\
 										\
-	sdt_might_sleep_weak(NULL);						\
+	if (!__ret || __ret == MAX_SCHEDULE_TIMEOUT)				\
+		sdt_might_sleep_weak(NULL);					\
+	else									\
+		sdt_might_sleep_weak_timeout(NULL);				\
 	init_wait_entry(&__wq_entry, exclusive ? WQ_FLAG_EXCLUSIVE : 0);	\
 	for (;;) {								\
 		long __int = prepare_to_wait_event(&wq_head, &__wq_entry, state);\
-- 
1.9.1





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux