From b906e6e0768a840bef1e362de5bb159a5ad73a29 Mon Sep 17 00:00:00 2001 From: Tao Zeng Date: Mon, 8 Jul 2019 10:36:26 +0800 Subject: [PATCH] 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) [] task_tick_rt+0x0/0x120 [] pick_next_task_rt+0x1cc/0x1e4 [] __schedule+0x598/0x91c [] schedule+0x64/0xc4 [] schedule_timeout+0x1dc/0x47c [] __migration_entry_wait+0x168/0x194 ~~~~~blocked here [] migration_entry_wait+0x50/0x54 [] do_swap_page+0x404/0x4e8 [] handle_mm_fault+0x1ec/0xa60 [] do_page_fault+0x2d4/0x3a8 [] do_PrefetchAbort+0x48/0xb0 [] ret_from_exception+0x0/0x34 Solution: using usleep_range instead of schedule_timeout Verify: t905x Change-Id: I908022b747ad921b5863af377291abdf06672f15 Signed-off-by: Tao Zeng --- mm/migrate.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index bdee2bab18e7..42d98ab8e9b9 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -41,6 +41,9 @@ #include #include #include +#ifdef CONFIG_AMLOGIC_CMA +#include +#endif #include @@ -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 }