lkml.org 
[lkml]   [2022]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v4 23/24] dept: Let it work with real sleeps in __schedule()
Date
Dept commits the staged wait in __schedule() even if the corresponding
wake_up() has already woken up the task. Which means Dept considers the
case as a sleep. This would help Dept work for stronger detection but
also leads false positives.

It'd be better to let Dept work only with real sleeps conservatively for
now. So did it.

Signed-off-by: Byungchul Park <byungchul.park@lge.com>
---
kernel/sched/core.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 6a422aa..2ec7cf8 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6192,7 +6192,12 @@ static void __sched notrace __schedule(unsigned int sched_mode)
local_irq_disable();
rcu_note_context_switch(!!sched_mode);

- if (sched_mode == SM_NONE)
+ /*
+ * Skip the commit if the current task does not actually go to
+ * sleep.
+ */
+ if (READ_ONCE(prev->__state) & TASK_NORMAL &&
+ sched_mode == SM_NONE)
dept_ask_event_wait_commit(_RET_IP_);

/*
--
1.9.1
\
 
 \ /
  Last update: 2022-03-04 08:09    [W:0.182 / U:0.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site