From 723c41c1ef609dfe3829e536f2748903e9ab62ed Mon Sep 17 00:00:00 2001 From: Neil Horman Date: Wed, 15 Nov 2017 07:33:47 -0500 Subject: [PATCH] Fix min_load to pick actual min load across all objects find_overloaded_objs() calls gather_load_stats() to get stats across all objects to help migrate overloaded IRQ's. There is a bug in gather_load_stats() to pick min_load across all objects when the first object's load is 0. Eg with 2 objects: obj1->load = 0 and obj2->load = 5000 During first iteration, info->min_load will be 0. However during second iteration, info->min_load will be 5000. This flaw in the logic doesn't allow IRQ's to be migrated as it ends up picking the overloaded core as the one with min load. Reviewed-by: Alakesh Haloi Signed-off-by: Vallish Vaidyeshwara Signed-off-by: Neil Horman --- irqlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/irqlist.c b/irqlist.c index f727e3d..95ccc7a 100644 --- a/irqlist.c +++ b/irqlist.c @@ -55,7 +55,7 @@ static void gather_load_stats(struct topo_obj *obj, void *data) { struct load_balance_info *info = data; - if (info->min_load == 0 || obj->load < info->min_load) + if (info->load_sources == 0 || obj->load < info->min_load) info->min_load = obj->load; info->total_load += obj->load; info->load_sources += 1;