Commit 0829422
committed
slab: determine barn status racily outside of lock
The possibility of many barn operations is determined by the current
number of full or empty sheaves. Taking the barn->lock just to find out
that e.g. there are no empty sheaves results in unnecessary overhead and
lock contention. Thus perform these checks outside of the lock with a
data_race() annotated variable read and fail quickly without taking the
lock.
Checks for sheaf availability that racily succeed have to be obviously
repeated under the lock for correctness, but we can skip repeating
checks if there are too many sheaves on the given list as the limits
don't need to be strict.
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Harry Yoo <harry.yoo@oracle.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>1 parent 3c1ea5c commit 0829422
1 file changed
+20
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2801 | 2801 | | |
2802 | 2802 | | |
2803 | 2803 | | |
| 2804 | + | |
| 2805 | + | |
| 2806 | + | |
2804 | 2807 | | |
2805 | 2808 | | |
2806 | | - | |
| 2809 | + | |
2807 | 2810 | | |
2808 | 2811 | | |
2809 | 2812 | | |
| |||
2850 | 2853 | | |
2851 | 2854 | | |
2852 | 2855 | | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
2853 | 2859 | | |
2854 | 2860 | | |
2855 | 2861 | | |
| |||
2880 | 2886 | | |
2881 | 2887 | | |
2882 | 2888 | | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
2883 | 2892 | | |
2884 | 2893 | | |
2885 | | - | |
| 2894 | + | |
2886 | 2895 | | |
2887 | 2896 | | |
2888 | 2897 | | |
| |||
2906 | 2915 | | |
2907 | 2916 | | |
2908 | 2917 | | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
| 2922 | + | |
| 2923 | + | |
2909 | 2924 | | |
2910 | 2925 | | |
2911 | | - | |
2912 | | - | |
2913 | | - | |
2914 | | - | |
2915 | | - | |
| 2926 | + | |
2916 | 2927 | | |
2917 | 2928 | | |
2918 | 2929 | | |
2919 | 2930 | | |
2920 | 2931 | | |
2921 | 2932 | | |
| 2933 | + | |
| 2934 | + | |
2922 | 2935 | | |
2923 | 2936 | | |
2924 | 2937 | | |
| |||
0 commit comments