msm: mpdecision: wait at least 100ms between cpu hotremoves

To avoid spending a lot of time at once in the cpu hotremove
path, do not perform multiple hotremoves back to back.

Change-Id: I78a643f73718e4e08786193c71bbe2237aa790d2
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
(cherry picked from commit 9c0aa035f7aeac1b1039125bf27d51d11861fa03)
This commit is contained in:
Steve Muckle 2012-10-15 16:17:55 -07:00 committed by Stephen Boyd
parent b84423dc28
commit b4f38f5378

View file

@ -123,6 +123,7 @@ static struct hp_latency hp_latencies;
static unsigned long last_nr;
static int num_present_hundreds;
static ktime_t last_down_time;
#define RQ_AVG_INSIGNIFICANT_BITS 3
static bool ok_to_update_tz(int nr, int last_nr)
@ -380,14 +381,15 @@ restart:
}
}
for_each_possible_cpu(cpu) {
if (!(atomic_read(&msm_mpd.algo_cpu_mask) & (1 << cpu))
&& cpu_online(cpu)) {
bring_down_cpu(cpu);
if (!cpu_online(cpu))
goto restart;
}
}
if (ktime_to_ns(ktime_sub(ktime_get(), last_down_time)) >
100 * NSEC_PER_MSEC)
for_each_possible_cpu(cpu)
if (!(atomic_read(&msm_mpd.algo_cpu_mask) &
(1 << cpu)) && cpu_online(cpu)) {
bring_down_cpu(cpu);
last_down_time = ktime_get();
break;
}
msm_mpd.hpupdate = HPUPDATE_WAITING;
}