[PATCH v15 28/43] dept: suppress reports with classes that have been already reported

Byungchul Park byungchul at sk.com
Tue May 13 10:07:15 UTC 2025


Each different chain implies its own dependency problem, that is worth
being reported.  However, generating similar reports mutiple times
should be suppressed.

To avoid that, suppress reports with classes that have been already
reported.

Signed-off-by: Byungchul Park <byungchul at sk.com>
---
 include/linux/dept.h     |  6 ++++++
 kernel/dependency/dept.c | 10 ++++++++++
 2 files changed, 16 insertions(+)

diff --git a/include/linux/dept.h b/include/linux/dept.h
index 551168220954..b1e5a1ec6763 100644
--- a/include/linux/dept.h
+++ b/include/linux/dept.h
@@ -107,6 +107,12 @@ struct dept_class {
 			 * not an explicit map
 			 */
 			bool		sched_map;
+
+			/*
+			 * for avoiding this class involved in report
+			 * more than once
+			 */
+			bool		reported;
 		};
 	};
 };
diff --git a/kernel/dependency/dept.c b/kernel/dependency/dept.c
index 278194093108..8bea64bab379 100644
--- a/kernel/dependency/dept.c
+++ b/kernel/dependency/dept.c
@@ -501,6 +501,7 @@ static void initialize_class(struct dept_class *c)
 		iw->touched = false;
 	}
 	c->bfs_gen = 0U;
+	c->reported = false;
 
 	INIT_LIST_HEAD(&c->all_node);
 	INIT_LIST_HEAD(&c->dep_head);
@@ -913,6 +914,12 @@ static void print_circle(struct dept_class *c)
 	dump_stack();
 
 	dept_outworld_exit();
+
+	do {
+		tc->reported = true;
+		tc = fc;
+		fc = fc->bfs_parent;
+	} while (tc != c);
 }
 
 /*
@@ -1225,6 +1232,9 @@ static enum bfs_ret cb_check_dl(void *node, void *in, void **out)
 	struct dept_class *cur = (struct dept_class *)node;
 	struct dept_dep *new = (struct dept_dep *)in;
 
+	if (cur->reported)
+		return BFS_SKIP;
+
 	if (cur == dep_fc(new)) {
 		print_circle(dep_tc(new));
 		return BFS_DONE;
-- 
2.17.1



More information about the dri-devel mailing list