Skip to contentSkip to conversation

timer: Add __sched to msleep() and msleep_interruptible()

PATCH In review Yoshihiro YUNOMAE 1 participant 2 messages Nov 11, 2013 – Nov 26, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 timer: Add __sched to msleep() and msleep_interruptible()

Add __sched to msleep() and msleep_interruptible() for avoiding to show these functions in WCHAN. If a driver calls msleep() or msleep_interruptible() in a lot of places, users cannot understand that the driver might sleep which functions execute msleep() or msleep_interruptible(). So, by applying this patch, users can confirm the function calling msleep() or msleep_interruptible() from WCHAN.

---
 kernel/timer.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/timer.c +2 -2
index 6582b82..cc1470f 100644
@@ -1660,7 +1660,7 @@ void __init init_timers(void)
  * msleep - sleep safely even with waitqueue interruptions
  * @msecs: Time in milliseconds to sleep for
  */
-void msleep(unsigned int msecs)
+void __sched msleep(unsigned int msecs)
 {
 	unsigned long timeout = msecs_to_jiffies(msecs) + 1;
 
@@ -1674,7 +1674,7 @@ EXPORT_SYMBOL(msleep);
  * msleep_interruptible - sleep waiting for signals
  * @msecs: Time in milliseconds to sleep for
  */
-unsigned long msleep_interruptible(unsigned int msecs)
+unsigned long __sched msleep_interruptible(unsigned int msecs)
 {
 	unsigned long timeout = msecs_to_jiffies(msecs) + 1;
 
#1 lore raw

Hi,

Would you review this patch?

Thanks,
Yoshihiro YUNOMAE

Quoted 43 lines · Yoshihiro YUNOMAE

Add __sched to msleep() and msleep_interruptible() for avoiding to show these functions in WCHAN. If a driver calls msleep() or msleep_interruptible() in a lot of places, users cannot understand that the driver might sleep which functions execute msleep() or msleep_interruptible(). So, by applying this patch, users can confirm the function calling msleep() or msleep_interruptible() from WCHAN.

---
  kernel/timer.c |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
kernel/timer.c +2 -3
index 6582b82..cc1470f 100644
@@ -1660,7 +1660,7 @@ void __init init_timers(void)
   * msleep - sleep safely even with waitqueue interruptions
   * @msecs: Time in milliseconds to sleep for
   */
-void msleep(unsigned int msecs)
+void __sched msleep(unsigned int msecs)
  {
  	unsigned long timeout = msecs_to_jiffies(msecs) + 1;
 
@@ -1674,7 +1674,7 @@ EXPORT_SYMBOL(msleep);
   * msleep_interruptible - sleep waiting for signals
   * @msecs: Time in milliseconds to sleep for
   */
-unsigned long msleep_interruptible(unsigned int msecs)
+unsigned long __sched msleep_interruptible(unsigned int msecs)
  {
  	unsigned long timeout = msecs_to_jiffies(msecs) + 1;
 
 
--

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 4 lines
Yoshihiro YUNOMAE
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: [email protected]