lkml.org 
[lkml]   [2023]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v8 16/25] dept: Apply sdt_might_sleep_{start,end}() to dma fence wait
Date
Makes Dept able to track dma fence waits.

Signed-off-by: Byungchul Park <max.byungchul.park@gmail.com>
---
drivers/dma-buf/dma-fence.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index 406b4e2..1db4bc0 100644
--- a/drivers/dma-buf/dma-fence.c
+++ b/drivers/dma-buf/dma-fence.c
@@ -16,6 +16,7 @@
#include <linux/dma-fence.h>
#include <linux/sched/signal.h>
#include <linux/seq_file.h>
+#include <linux/dept_sdt.h>

#define CREATE_TRACE_POINTS
#include <trace/events/dma_fence.h>
@@ -782,6 +783,7 @@ struct default_wait_cb {
cb.task = current;
list_add(&cb.base.node, &fence->cb_list);

+ sdt_might_sleep_start(NULL);
while (!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags) && ret > 0) {
if (intr)
__set_current_state(TASK_INTERRUPTIBLE);
@@ -795,6 +797,7 @@ struct default_wait_cb {
if (ret > 0 && intr && signal_pending(current))
ret = -ERESTARTSYS;
}
+ sdt_might_sleep_end();

if (!list_empty(&cb.base.node))
list_del(&cb.base.node);
@@ -884,6 +887,7 @@ struct default_wait_cb {
}
}

+ sdt_might_sleep_start(NULL);
while (ret > 0) {
if (intr)
set_current_state(TASK_INTERRUPTIBLE);
@@ -898,6 +902,7 @@ struct default_wait_cb {
if (ret > 0 && intr && signal_pending(current))
ret = -ERESTARTSYS;
}
+ sdt_might_sleep_end();

__set_current_state(TASK_RUNNING);

--
1.9.1
\
 
 \ /
  Last update: 2023-03-26 23:57    [W:0.207 / U:1.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site