[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1646377603-19730-25-git-send-email-byungchul.park@lge.com>
Date: Fri, 4 Mar 2022 16:06:43 +0900
From: Byungchul Park <byungchul.park@....com>
To: torvalds@...ux-foundation.org
Cc: damien.lemoal@...nsource.wdc.com, linux-ide@...r.kernel.org,
adilger.kernel@...ger.ca, linux-ext4@...r.kernel.org,
mingo@...hat.com, linux-kernel@...r.kernel.org,
peterz@...radead.org, will@...nel.org, tglx@...utronix.de,
rostedt@...dmis.org, joel@...lfernandes.org, sashal@...nel.org,
daniel.vetter@...ll.ch, chris@...is-wilson.co.uk,
duyuyang@...il.com, johannes.berg@...el.com, tj@...nel.org,
tytso@....edu, willy@...radead.org, david@...morbit.com,
amir73il@...il.com, bfields@...ldses.org,
gregkh@...uxfoundation.org, kernel-team@....com,
linux-mm@...ck.org, akpm@...ux-foundation.org, mhocko@...nel.org,
minchan@...nel.org, hannes@...xchg.org, vdavydov.dev@...il.com,
sj@...nel.org, jglisse@...hat.com, dennis@...nel.org, cl@...ux.com,
penberg@...nel.org, rientjes@...gle.com, vbabka@...e.cz,
ngupta@...are.org, linux-block@...r.kernel.org,
paolo.valente@...aro.org, josef@...icpanda.com,
linux-fsdevel@...r.kernel.org, viro@...iv.linux.org.uk,
jack@...e.cz, jack@...e.com, jlayton@...nel.org,
dan.j.williams@...el.com, hch@...radead.org, djwong@...nel.org,
dri-devel@...ts.freedesktop.org, airlied@...ux.ie,
rodrigosiqueiramelo@...il.com, melissa.srw@...il.com,
hamohammed.sa@...il.com
Subject: [PATCH v4 24/24] dept: Disable Dept on that map once it's been handled until next turn
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@....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
Powered by blists - more mailing lists