Commit c4accde
Kent Overstreet
bcachefs: Ensure srcu lock is not held too long
The SRCU read lock that btree_trans takes exists to make it safe for
bch2_trans_relock() to deref pointers to btree nodes/key cache items we
don't have locked, but as a side effect it blocks reclaim from freeing
those items.
Thus, it's important to not hold it for too long: we need to
differentiate between bch2_trans_unlock() calls that will be only for a
short duration, and ones that will be for an unbounded duration.
This introduces bch2_trans_unlock_long(), to be used mainly by the data
move paths.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>1 parent 6dfa10a commit c4accde
4 files changed
Lines changed: 40 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1109 | 1109 | | |
1110 | 1110 | | |
1111 | 1111 | | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
1112 | 1115 | | |
1113 | 1116 | | |
1114 | 1117 | | |
| |||
2830 | 2833 | | |
2831 | 2834 | | |
2832 | 2835 | | |
2833 | | - | |
| 2836 | + | |
2834 | 2837 | | |
2835 | | - | |
2836 | | - | |
| 2838 | + | |
| 2839 | + | |
| 2840 | + | |
2837 | 2841 | | |
2838 | | - | |
2839 | | - | |
2840 | | - | |
| 2842 | + | |
| 2843 | + | |
| 2844 | + | |
2841 | 2845 | | |
2842 | | - | |
2843 | | - | |
2844 | | - | |
| 2846 | + | |
| 2847 | + | |
| 2848 | + | |
| 2849 | + | |
| 2850 | + | |
| 2851 | + | |
| 2852 | + | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
| 2856 | + | |
| 2857 | + | |
2845 | 2858 | | |
2846 | 2859 | | |
2847 | 2860 | | |
| |||
2895 | 2908 | | |
2896 | 2909 | | |
2897 | 2910 | | |
2898 | | - | |
2899 | | - | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
2900 | 2914 | | |
2901 | 2915 | | |
2902 | 2916 | | |
| |||
2981 | 2995 | | |
2982 | 2996 | | |
2983 | 2997 | | |
2984 | | - | |
| 2998 | + | |
2985 | 2999 | | |
| 3000 | + | |
2986 | 3001 | | |
2987 | 3002 | | |
2988 | 3003 | | |
| |||
3059 | 3074 | | |
3060 | 3075 | | |
3061 | 3076 | | |
3062 | | - | |
| 3077 | + | |
| 3078 | + | |
3063 | 3079 | | |
3064 | 3080 | | |
3065 | 3081 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| 277 | + | |
277 | 278 | | |
278 | 279 | | |
279 | 280 | | |
| |||
579 | 580 | | |
580 | 581 | | |
581 | 582 | | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
582 | 586 | | |
583 | 587 | | |
584 | 588 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
756 | 762 | | |
757 | 763 | | |
758 | 764 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| 429 | + | |
429 | 430 | | |
430 | 431 | | |
431 | 432 | | |
| |||
0 commit comments