From: Oleksandr Natalenko Date: Mon, 23 May 2016 23:24:28 +0000 (-0700) Subject: rtsx_usb_ms: use schedule_timeout_idle() in polling loop X-Git-Tag: v4.7-rc1~70^2~39 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=a831979f855f1a19db1b3b194c5fab5e04ad26ff;p=linux.git rtsx_usb_ms: use schedule_timeout_idle() in polling loop First version of this patch has already been posted to LKML by Ben Hutchings ~6 months ago, but no further action were performed. Ben's original message: : rtsx_usb_ms creates a task that mostly sleeps, but tasks in : uninterruptible sleep still contribute to the load average (for : bug-compatibility with Unix). A load average of ~1 on a system that : should be idle is somewhat alarming. : : Change the sleep to be interruptible, but still ignore signals. References: https://bugs.debian.org/765717 Link: http://lkml.kernel.org/r/b49f95ae83057efa5d96f532803cba47@natalenko.name Signed-off-by: Oleksandr Natalenko Cc: Oleg Nesterov Cc: Ben Hutchings Cc: Lee Jones Cc: Wolfram Sang Cc: Roger Tseng Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/memstick/host/rtsx_usb_ms.c b/drivers/memstick/host/rtsx_usb_ms.c index 1105db2355d2..d34bc3530385 100644 --- a/drivers/memstick/host/rtsx_usb_ms.c +++ b/drivers/memstick/host/rtsx_usb_ms.c @@ -706,7 +706,7 @@ static int rtsx_usb_detect_ms_card(void *__host) if (host->eject) break; - msleep(1000); + schedule_timeout_idle(HZ); } complete(&host->detect_ms_exit);