[PATCH 27/29] dept: Apply timeout consideration to swait APIs

Gwan-gyeong Mun gwan-gyeong.mun at intel.com
Sun Nov 20 10:04:07 UTC 2022


From: Byungchul Park <byungchul.park at lge.com>

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

Worth noting that sdt_wait_prepare*() can be called mutiple times and
only the last call would actually affect Dept's behavior.

Signed-off-by: Byungchul Park <byungchul.park at lge.com>
Signed-off-by: Gwan-gyeong Mun <gwan-gyeong.mun at intel.com>
---
 include/linux/swait.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/swait.h b/include/linux/swait.h
index 8080b29d7af0..2c82a72852a7 100644
--- a/include/linux/swait.h
+++ b/include/linux/swait.h
@@ -169,6 +169,9 @@ extern void finish_swait(struct swait_queue_head *q, struct swait_queue *wait);
 	for (;;) {							\
 		long __int = prepare_to_swait_event(&wq, &__wait, state);\
 									\
+		if (!__int && (state) & TASK_NORMAL && (ret))		\
+			sdt_wait_prepare_timeout(&(wq).dmap);		\
+									\
 		if (condition)						\
 			break;						\
 									\
-- 
2.37.1



More information about the Intel-gfx-trybot mailing list