OSDN Git Service

sched/fair: prevent possible infinite loop in sched_group_energy
authorChris Redpath <chris.redpath@arm.com>
Wed, 24 Jan 2018 09:25:24 +0000 (09:25 +0000)
committerTodd Kjos <tkjos@google.com>
Sat, 10 Feb 2018 00:51:49 +0000 (00:51 +0000)
commit78d59f1aea624e2ac110773ac7bedd9d44b343b8
tree3b930ae764ca26f626f32454fbbd356310a12623
parent0e9bcc1e0a16cde2514e19b744401f8d7c110cc9
sched/fair: prevent possible infinite loop in sched_group_energy

There is a race between hotplug and energy_diff which might result
in endless loop in sched_group_energy. When this happens, the end
condition cannot be detected.

We can store how many CPUs we need to visit at the beginning, and
bail out of the energy calculation if we visit more cpus than expected.

Bug: 72311797 72202633
Change-Id: I8dda75468ee1570da4071cd8165ef5131a8205d8
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
kernel/sched/fair.c