summaryrefslogtreecommitdiff
authorTao Zeng <tao.zeng@amlogic.com>2019-07-08 02:36:26 (GMT)
committer Tao Zeng <tao.zeng@amlogic.com>2019-07-15 02:53:55 (GMT)
commit38a37f0acc122217b3de0c00532b2eb5bd9a1fe0 (patch)
treeba3d7172ce969219089a071807bf29f57b37c674
parent63b802f6d1ba37ff7e6bd488da3b3b0a899761ff (diff)
downloadcommon-38a37f0acc122217b3de0c00532b2eb5bd9a1fe0.zip
common-38a37f0acc122217b3de0c00532b2eb5bd9a1fe0.tar.gz
common-38a37f0acc122217b3de0c00532b2eb5bd9a1fe0.tar.bz2
sched: change sleep api for __migration_entry_wait [1/1]
PD#TV-7519 Problem: schedule_timeout did not really make task sleep. It will cause rt thread bug when this thread is waiting for a cma page migrated: sched: RT throttling activated for rt_rq eaf671b8 (cpu 1) potential CPU hogs: btu message loo (4253) [<c037d5b8>] task_tick_rt+0x0/0x120 [<c037d914>] pick_next_task_rt+0x1cc/0x1e4 [<c0fa8534>] __schedule+0x598/0x91c [<c0fa891c>] schedule+0x64/0xc4 [<c0fac134>] schedule_timeout+0x1dc/0x47c [<c0493ba4>] __migration_entry_wait+0x168/0x194 ~~~~~blocked here [<c0493c20>] migration_entry_wait+0x50/0x54 [<c0473008>] do_swap_page+0x404/0x4e8 [<c047357c>] handle_mm_fault+0x1ec/0xa60 [<c031a2f0>] do_page_fault+0x2d4/0x3a8 [<c0301408>] do_PrefetchAbort+0x48/0xb0 [<c030f78c>] ret_from_exception+0x0/0x34 Solution: using usleep_range instead of schedule_timeout Verify: t905x Change-Id: I908022b747ad921b5863af377291abdf06672f15 Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Diffstat
-rw-r--r--mm/migrate.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index bdee2ba..42d98ab 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -41,6 +41,9 @@
#include <linux/page_idle.h>
#include <linux/page_owner.h>
#include <linux/ptrace.h>
+#ifdef CONFIG_AMLOGIC_CMA
+#include <linux/delay.h>
+#endif
#include <asm/tlbflush.h>
@@ -348,7 +351,7 @@ out:
pte_unmap_unlock(ptep, ptl);
#ifdef CONFIG_AMLOGIC_CMA
if (need_wait)
- schedule_timeout(1);
+ usleep_range(1000, 1100);
#endif
}