Skip to content

Commit

Permalink
msm: Fix high load average from uninterruptible waits
Browse files Browse the repository at this point in the history
 * The load average on all MSMs is currently hovering at around 14
   due to uninterruptible waits in various places.
 * Convert these waits to interruptible waits to bring the load
   back down to zero at idle.

Change-Id: I14bad4af135b1594e235e2252cb484cb34d91054
Signed-off-by: franciscofranco <[email protected]>
Signed-off-by: tarun93 <[email protected]>
  • Loading branch information
hyperb1iss authored and tarunkapadia93 committed Nov 14, 2015
1 parent d114392 commit 5595f56
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-msm/rpm-smd.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ static void msm_rpm_smd_work(struct work_struct *work)
char buf[MAX_ERR_BUFFER_SIZE] = {0};

while (1) {
wait_for_completion(&data_ready);
wait_for_completion_interruptible(&data_ready);

spin_lock(&msm_rpm_data.smd_lock_read);
while (smd_is_pkt_avail(msm_rpm_data.ch_info)) {
Expand Down
4 changes: 2 additions & 2 deletions drivers/thermal/msm_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ static __ref int do_hotplug(void *data)
return -EINVAL;

while (!kthread_should_stop()) {
wait_for_completion(&hotplug_notify_complete);
wait_for_completion_interruptible(&hotplug_notify_complete);
INIT_COMPLETION(hotplug_notify_complete);
mask = 0;

Expand Down Expand Up @@ -1404,7 +1404,7 @@ static __ref int do_freq_mitigation(void *data)
uint32_t cpu = 0, max_freq_req = 0, min_freq_req = 0;

while (!kthread_should_stop()) {
wait_for_completion(&freq_mitigation_complete);
wait_for_completion_interruptible(&freq_mitigation_complete);
INIT_COMPLETION(freq_mitigation_complete);

get_online_cpus();
Expand Down
7 changes: 6 additions & 1 deletion drivers/video/msm/mdss/mdss_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1823,10 +1823,15 @@ static int __mdss_fb_display_thread(void *data)
mfd->index);

while (1) {
wait_event(mfd->commit_wait_q,
ret = wait_event_interruptible(mfd->commit_wait_q,
(atomic_read(&mfd->commits_pending) ||
kthread_should_stop()));

if (ret) {
pr_info("%s: interrupted", __func__);
continue;
}

if (kthread_should_stop())
break;

Expand Down

0 comments on commit 5595f56

Please sign in to comment.