Since we have all the fundamental to handle recursive read locks, we now add them into the dependency graph.
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -2808,16 +2808,6 @@ check_prev_add(struct task_struct *curr, struct held_lock *prev, · 2807 unmodified lines | |||
| 2808 | if (!check_irq_usage(curr, prev, next)) | 2808 | if (!check_irq_usage(curr, prev, next)) |
| 2809 | return 0; | 2809 | return 0; |
| 2810 | 2810 | ||
| 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; | ||
| 2821 | /* | 2811 | /* |
| 2822 | * Is the <prev> -> <next> dependency already present? | 2812 | * Is the <prev> -> <next> dependency already present? |
| 2823 | * | 2813 | * |
| @@ -2935,13 +2925,8 @@ check_prevs_add(struct task_struct *curr, struct held_lock *next) · 111 unmodified lines | |||
| 2935 | u16 distance = curr->lockdep_depth - depth + 1; | 2925 | u16 distance = curr->lockdep_depth - depth + 1; |
| 2936 | hlock = curr->held_locks + depth - 1; | 2926 | hlock = curr->held_locks + depth - 1; |
| 2937 | 2927 | ||
| 2938 | /* | 2928 | if (hlock->check) { |
| 2939 | * Only non-recursive-read entries get new dependencies | 2929 | int ret = check_prev_add(curr, hlock, next, distance, &trace); |
| 2940 | * added: | ||
| 2941 | */ | ||
| 2942 | if (hlock->read != 2 && hlock->check) { | ||
| 2943 | int ret = check_prev_add(curr, hlock, next, distance, | ||
| 2944 | &trace); | ||
| 2945 | if (!ret) | 2930 | if (!ret) |
| 2946 | return 0; | 2931 | return 0; |
| 2947 | 2932 | ||