sched: change sleep api for __migration_entry_wait [1/1]
authorTao Zeng <tao.zeng@amlogic.com>
Mon, 8 Jul 2019 02:36:26 +0000 (10:36 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Mon, 15 Jul 2019 02:53:55 +0000 (19:53 -0700)
commit38a37f0acc122217b3de0c00532b2eb5bd9a1fe0
treeba3d7172ce969219089a071807bf29f57b37c674
parent63b802f6d1ba37ff7e6bd488da3b3b0a899761ff
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>
mm/migrate.c