huteng.ht 1379f5c758 use schedule_timeout_uninterruptible in nv_sleep_ms()
nv_sleep_ms() function sets current process to TASK_INTERRUPTIBLE and call
schedule_timeout() in a while loop until less than a jiffie remains. It retains
in the loop regardless of whether signal is received. What's worse, process in
TASK_INTERRUPTIBLE state with pending signal would be set back to TASK_RUNNING
in __schedule() function, thus it would be rescheduled again and again, never
get into sleep state.

For example, processes calling nv_pci_remove() to remove a device which is still
in use would stuck in the sleep-check loop until usage_count down do zero.
Once SIGKILL received, it would remain in TASK_RUNNING, leading to a CPU usage
at 100%.

Instead, use schedule_timeout_uninterruptible() to substitute the while loop in
nv_sleep_ms(). The process would not be woken up only when the requested timeout
has expired.

Signed-off-by: huteng.ht <huteng.ht@bytedance.com>
2022-11-25 13:58:43 +08:00
..
2022-11-10 08:39:33 -08:00
2022-11-10 08:39:33 -08:00
2022-11-10 08:39:33 -08:00
2022-11-10 08:39:33 -08:00
2022-11-10 08:39:33 -08:00
2022-05-09 13:18:59 -07:00
2022-11-10 08:39:33 -08:00
2022-10-10 14:59:24 -07:00
2022-05-09 13:18:59 -07:00
2022-11-10 08:39:33 -08:00
2022-05-09 13:18:59 -07:00