aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/DocBook/kernel-hacking.tmpl10
-rw-r--r--include/linux/wait.h11
-rw-r--r--kernel/sched/core.c46
3 files changed, 0 insertions, 67 deletions
diff --git a/Documentation/DocBook/kernel-hacking.tmpl b/Documentation/DocBook/kernel-hacking.tmpl
index d0758b241b23..bd9015d10cff 100644
--- a/Documentation/DocBook/kernel-hacking.tmpl
+++ b/Documentation/DocBook/kernel-hacking.tmpl
@@ -850,16 +850,6 @@ printk(KERN_INFO "my ip: %pI4\n", &ipaddress);
850 <returnvalue>-ERESTARTSYS</returnvalue> if a signal is received. 850 <returnvalue>-ERESTARTSYS</returnvalue> if a signal is received.
851 The <function>wait_event()</function> version ignores signals. 851 The <function>wait_event()</function> version ignores signals.
852 </para> 852 </para>
853 <para>
854 Do not use the <function>sleep_on()</function> function family -
855 it is very easy to accidentally introduce races; almost certainly
856 one of the <function>wait_event()</function> family will do, or a
857 loop around <function>schedule_timeout()</function>. If you choose
858 to loop around <function>schedule_timeout()</function> remember
859 you must set the task state (with
860 <function>set_current_state()</function>) on each iteration to avoid
861 busy-looping.
862 </para>
863 853
864 </sect1> 854 </sect1>
865 855
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 559044c79232..e7d9d9ed14f5 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -803,17 +803,6 @@ do { \
803 __ret; \ 803 __ret; \
804}) 804})
805 805
806
807/*
808 * These are the old interfaces to sleep waiting for an event.
809 * They are racy. DO NOT use them, use the wait_event* interfaces above.
810 * We plan to remove these interfaces.
811 */
812extern void sleep_on(wait_queue_head_t *q);
813extern long sleep_on_timeout(wait_queue_head_t *q, signed long timeout);
814extern void interruptible_sleep_on(wait_queue_head_t *q);
815extern long interruptible_sleep_on_timeout(wait_queue_head_t *q, signed long timeout);
816
817/* 806/*
818 * Waitqueues which are removed from the waitqueue_head at wakeup time 807 * Waitqueues which are removed from the waitqueue_head at wakeup time
819 */ 808 */
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 1d1b87b36778..0ff3f34bc7e3 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2845,52 +2845,6 @@ int default_wake_function(wait_queue_t *curr, unsigned mode, int wake_flags,
2845} 2845}
2846EXPORT_SYMBOL(default_wake_function); 2846EXPORT_SYMBOL(default_wake_function);
2847 2847
2848static long __sched
2849sleep_on_common(wait_queue_head_t *q, int state, long timeout)
2850{
2851 unsigned long flags;
2852 wait_queue_t wait;
2853
2854 init_waitqueue_entry(&wait, current);
2855
2856 __set_current_state(state);
2857
2858 spin_lock_irqsave(&q->lock, flags);
2859 __add_wait_queue(q, &wait);
2860 spin_unlock(&q->lock);
2861 timeout = schedule_timeout(timeout);
2862 spin_lock_irq(&q->lock);
2863 __remove_wait_queue(q, &wait);
2864 spin_unlock_irqrestore(&q->lock, flags);
2865
2866 return timeout;
2867}
2868
2869void __sched interruptible_sleep_on(wait_queue_head_t *q)
2870{
2871 sleep_on_common(q, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
2872}
2873EXPORT_SYMBOL(interruptible_sleep_on);
2874
2875long __sched
2876interruptible_sleep_on_timeout(wait_queue_head_t *q, long timeout)
2877{
2878 return sleep_on_common(q, TASK_INTERRUPTIBLE, timeout);
2879}
2880EXPORT_SYMBOL(interruptible_sleep_on_timeout);
2881
2882void __sched sleep_on(wait_queue_head_t *q)
2883{
2884 sleep_on_common(q, TASK_UNINTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
2885}
2886EXPORT_SYMBOL(sleep_on);
2887
2888long __sched sleep_on_timeout(wait_queue_head_t *q, long timeout)
2889{
2890 return sleep_on_common(q, TASK_UNINTERRUPTIBLE, timeout);
2891}
2892EXPORT_SYMBOL(sleep_on_timeout);
2893
2894#ifdef CONFIG_RT_MUTEXES 2848#ifdef CONFIG_RT_MUTEXES
2895 2849
2896/* 2850/*