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(
28812881 set_freepointer (s , tail , prior );
28822882 slab -> freelist = head ;
28832883
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+
28852892 if (!prior ) {
2893+ /* was on full list */
28862894 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 ) {
28892900 remove_partial (n , slab );
28902901 stat (s , FREE_REMOVE_PARTIAL );
28912902 }
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- }
29002903 }
29012904
29022905 if (slab_free ) {
You can’t perform that action at this time.
0 commit comments