[PATCH RFC v7 22/23] dept: Apply timeout consideration to dma fence wait

From
Byungchul Park <hidden>
Date
2023-01-09 04:05:30
Also in
dri-devel, linux-block, linux-fsdevel, linux-ide, linux-mm, lkml
Reply to
Byungchul Park, 2023-01-09
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the
consideration to dma fence wait.

Signed-off-by: Byungchul Park <redacted>
---
 drivers/dma-buf/dma-fence.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index dd190cf..ee9b350 100644
--- a/drivers/dma-buf/dma-fence.c
+++ b/drivers/dma-buf/dma-fence.c
@@ -783,7 +783,10 @@ struct default_wait_cb {
 	cb.task = current;
 	list_add(&cb.base.node, &fence->cb_list);
 
-	sdt_might_sleep_strong(NULL);
+	if (timeout == MAX_SCHEDULE_TIMEOUT)
+		sdt_might_sleep_strong(NULL);
+	else
+		sdt_might_sleep_strong_timeout(NULL);
 	while (!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags) && ret > 0) {
 		if (intr)
 			__set_current_state(TASK_INTERRUPTIBLE);
@@ -887,7 +890,10 @@ struct default_wait_cb {
 		}
 	}
 
-	sdt_might_sleep_strong(NULL);
+	if (timeout == MAX_SCHEDULE_TIMEOUT)
+		sdt_might_sleep_strong(NULL);
+	else
+		sdt_might_sleep_strong_timeout(NULL);
 	while (ret > 0) {
 		if (intr)
 			set_current_state(TASK_INTERRUPTIBLE);
-- 
1.9.1
Thread (47 messages) 47 messages, 7 authors, last reply 2023-01-21
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help