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 24/24] dept: Disable Dept on that map once it's been handled until next turn
Date
Dept works with waits preceeding an event, that might lead a deadlock.
Once the event has been handled, it's hard to ensure further waits
actually contibute to deadlock until next turn, which will start when
a sleep associated with that map happens.

So let Dept start tracking dependency when a sleep happens and stop
tracking dependency once the event e.i. wake up, has been handled.

Signed-off-by: Byungchul Park <byungchul.park@lge.com>
---
kernel/dependency/dept.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/kernel/dependency/dept.c b/kernel/dependency/dept.c
index cc1b3a3..1c91db8 100644
--- a/kernel/dependency/dept.c
+++ b/kernel/dependency/dept.c
@@ -2325,6 +2325,12 @@ void dept_event(struct dept_map *m, unsigned long e_f, unsigned long ip,
do_event((void *)m, c, READ_ONCE(m->wgen), ip);
pop_ecxt((void *)m);
}
+
+ /*
+ * Keep the map diabled until the next sleep.
+ */
+ WRITE_ONCE(m->wgen, 0);
+
dept_exit(flags);
}
EXPORT_SYMBOL_GPL(dept_event);
@@ -2447,6 +2453,11 @@ void dept_event_split_map(struct dept_map_each *me,
pop_ecxt((void *)me);
}

+ /*
+ * Keep the map diabled until the next sleep.
+ */
+ WRITE_ONCE(me->wgen, 0);
+
dept_exit(flags);
}
EXPORT_SYMBOL_GPL(dept_event_split_map);
--
1.9.1
\
 
 \ /
  Last update: 2022-03-04 08:09    [W:0.204 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site