]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
lockdep: Add recursive read locks into dependency graph
authorBoqun Feng <boqun.feng@gmail.com>
Fri, 7 Aug 2020 07:42:31 +0000 (15:42 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 26 Aug 2020 10:42:06 +0000 (12:42 +0200)
Since we have all the fundamental to handle recursive read locks, we now
add them into the dependency graph.

Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200807074238.1632519-13-boqun.feng@gmail.com
kernel/locking/lockdep.c

index 6644974a4f5a1cd6d422091918948da312a9a4be..b87766e080f5df7deffcc5aff7ce585a9921a8eb 100644 (file)
@@ -2808,16 +2808,6 @@ check_prev_add(struct task_struct *curr, struct held_lock *prev,
        if (!check_irq_usage(curr, prev, next))
                return 0;
 
-       /*
-        * For recursive read-locks we do all the dependency checks,
-        * but we dont store read-triggered dependencies (only
-        * write-triggered dependencies). This ensures that only the
-        * write-side dependencies matter, and that if for example a
-        * write-lock never takes any other locks, then the reads are
-        * equivalent to a NOP.
-        */
-       if (next->read == 2 || prev->read == 2)
-               return 1;
        /*
         * Is the <prev> -> <next> dependency already present?
         *
@@ -2935,13 +2925,8 @@ check_prevs_add(struct task_struct *curr, struct held_lock *next)
                u16 distance = curr->lockdep_depth - depth + 1;
                hlock = curr->held_locks + depth - 1;
 
-               /*
-                * Only non-recursive-read entries get new dependencies
-                * added:
-                */
-               if (hlock->read != 2 && hlock->check) {
-                       int ret = check_prev_add(curr, hlock, next, distance,
-                                                &trace);
+               if (hlock->check) {
+                       int ret = check_prev_add(curr, hlock, next, distance, &trace);
                        if (!ret)
                                return 0;