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 <alakeshh@amazon.com>
Signed-off-by: Vallish Vaidyeshwara <vallish@amazon.com>
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
This commit is contained in:
Neil Horman 2017-11-15 07:33:47 -05:00 committed by Neil Horman
parent 85a8745308
commit 723c41c1ef

View file

@ -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;