From 8defdd1135e2ce86885973b86ee1797c6cebc3a0 Mon Sep 17 00:00:00 2001 From: Gang Deng Date: Thu, 16 Sep 2021 12:38:04 +0800 Subject: [PATCH] anolis: mm, kidled: skip node which has none memory fix #36834759 Or the vmalloc() will print a warn message when the alloc size equals zero, and kidled stop working. Signed-off-by: Gang Deng Reviewed-by: zhongjiang-ali Reviewed-by: Xu Yu --- mm/kidled.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mm/kidled.c b/mm/kidled.c index 78abc078489043..00f282b9a46231 100644 --- a/mm/kidled.c +++ b/mm/kidled.c @@ -400,6 +400,10 @@ static bool kidled_scan_node(pg_data_t *pgdat, #ifdef KIDLED_AGE_NOT_IN_PAGE_FLAGS if (unlikely(!pgdat->node_page_age)) { + /* This node has none memory, skip it. */ + if (!pgdat->node_spanned_pages) + return true; + pgdat->node_page_age = vzalloc(pgdat->node_spanned_pages); if (unlikely(!pgdat->node_page_age)) return false;