History

lockdep: Add recursive read locks into dependency graph

Since we have all the fundamental to handle recursive read locks, we now add them into the dependency graph.

Boqun Feng committed 6 years ago

Commit 621c9da1 parent f08e3881 file · +2 −17Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/locking/lockdep.c+2−17
@@ -2808,16 +2808,6 @@ check_prev_add(struct task_struct *curr, struct held_lock *prev, · 2807 unmodified lines
28082808 if (!check_irq_usage(curr, prev, next))
28092809 return 0;
28102810
2811− /*
2812− * For recursive read-locks we do all the dependency checks,
2813− * but we dont store read-triggered dependencies (only
2814− * write-triggered dependencies). This ensures that only the
2815− * write-side dependencies matter, and that if for example a
2816− * write-lock never takes any other locks, then the reads are
2817− * equivalent to a NOP.
2818− */
2819− if (next->read == 2 || prev->read == 2)
2820− return 1;
28212811 /*
28222812 * Is the <prev> -> <next> dependency already present?
28232813 *
@@ -2935,13 +2925,8 @@ check_prevs_add(struct task_struct *curr, struct held_lock *next) · 111 unmodified lines
29352925 u16 distance = curr->lockdep_depth - depth + 1;
29362926 hlock = curr->held_locks + depth - 1;
29372927
2938− /*
2939− * Only non-recursive-read entries get new dependencies
2940− * added:
2941− */
2942− if (hlock->read != 2 && hlock->check) {
2943− int ret = check_prev_add(curr, hlock, next, distance,
2944− &trace);
2928+ if (hlock->check) {
2929+ int ret = check_prev_add(curr, hlock, next, distance, &trace);
29452930 if (!ret)
29462931 return 0;
29472932

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t