File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -2881,22 +2881,25 @@ static noinline void free_debug_processing(
2881
2881
set_freepointer (s , tail , prior );
2882
2882
slab -> freelist = head ;
2883
2883
2884
- /* Do we need to remove the slab from full or partial list? */
2884
+ /*
2885
+ * If the slab is empty, and node's partial list is full,
2886
+ * it should be discarded anyway no matter it's on full or
2887
+ * partial list.
2888
+ */
2889
+ if (slab -> inuse == 0 && n -> nr_partial >= s -> min_partial )
2890
+ slab_free = slab ;
2891
+
2885
2892
if (!prior ) {
2893
+ /* was on full list */
2886
2894
remove_full (s , n , slab );
2887
- } else if (slab -> inuse == 0 &&
2888
- n -> nr_partial >= s -> min_partial ) {
2895
+ if (!slab_free ) {
2896
+ add_partial (n , slab , DEACTIVATE_TO_TAIL );
2897
+ stat (s , FREE_ADD_PARTIAL );
2898
+ }
2899
+ } else if (slab_free ) {
2889
2900
remove_partial (n , slab );
2890
2901
stat (s , FREE_REMOVE_PARTIAL );
2891
2902
}
2892
-
2893
- /* Do we need to discard the slab or add to partial list? */
2894
- if (slab -> inuse == 0 && n -> nr_partial >= s -> min_partial ) {
2895
- slab_free = slab ;
2896
- } else if (!prior ) {
2897
- add_partial (n , slab , DEACTIVATE_TO_TAIL );
2898
- stat (s , FREE_ADD_PARTIAL );
2899
- }
2900
2903
}
2901
2904
2902
2905
if (slab_free ) {
You can’t perform that action at this time.
0 commit comments