From: Hongru Zhang Use per-migratetype counts instead of list_empty() helps reduce a few cpu instructions. Signed-off-by: Hongru Zhang --- mm/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/internal.h b/mm/internal.h index 1561fc2ff5b8..7759f8fdf445 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -954,7 +954,7 @@ int find_suitable_fallback(struct free_area *area, unsigned int order, static inline bool free_area_empty(struct free_area *area, int migratetype) { - return list_empty(&area->free_list[migratetype]); + return !READ_ONCE(area->mt_nr_free[migratetype]); } /* mm/util.c */ -- 2.43.0