Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.4.1 /kernel/sched.c

Filename:/kernel/sched.c
Lines Added:12
Lines Deleted:36
Also changed in: (Previous) 2.4.1-pre12  2.4.1-pre11  2.4.1-pre10  2.4.1-pre9  2.4.1-pre8  2.4.1-pre6 
(Following) 2.4.1-ac1  2.4.1-ac2  2.4.1-ac3  2.4.1-ac4  2.4.1-ac5  2.4.1-ac6 

Location
[  2.4.1
  [  kernel
     o  sched.c

Patch

diff -u --recursive --new-file v2.4.0/linux/kernel/sched.c linux/kernel/sched.c
--- v2.4.0/linux/kernel/sched.c   Thu Jan  4 13:50:38 2001
+++ linux/kernel/sched.c   Mon Jan 15 13:08:15 2001
@@ -690,19 +690,15 @@
 }
 
 static inline void __wake_up_common (wait_queue_head_t *q, unsigned int mode,
-                 unsigned int wq_mode, const int sync)
+                  int nr_exclusive, const int sync)
 {
    struct list_head *tmp, *head;
-   struct task_struct *p, *best_exclusive;
+   struct task_struct *p;
    unsigned long flags;
-   int best_cpu, irq;
 
    if (!q)
       goto out;
 
-   best_cpu = smp_processor_id();
-   irq = in_interrupt();
-   best_exclusive = NULL;
    wq_write_lock_irqsave(&q->lock, flags);
 
 #if WAITQUEUE_DEBUG
@@ -730,47 +726,27 @@
 #if WAITQUEUE_DEBUG
          curr->__waker = (long)__builtin_return_address(0);
 #endif
-         /*
-          * If waking up from an interrupt context then
-          * prefer processes which are affine to this
-          * CPU.
-          */
-         if (irq && (curr->flags & wq_mode & WQ_FLAG_EXCLUSIVE)) {
-            if (!best_exclusive)
-               best_exclusive = p;
-            if (p->processor == best_cpu) {
-               best_exclusive = p;
-               break;
-            }
-         } else {
-            if (sync)
-               wake_up_process_synchronous(p);
-            else
-               wake_up_process(p);
-            if (curr->flags & wq_mode & WQ_FLAG_EXCLUSIVE)
-               break;
-         }
+         if (sync)
+            wake_up_process_synchronous(p);
+         else
+            wake_up_process(p);
+         if ((curr->flags & WQ_FLAG_EXCLUSIVE) && !--nr_exclusive)
+            break;
       }
    }
-   if (best_exclusive) {
-      if (sync)
-         wake_up_process_synchronous(best_exclusive);
-      else
-         wake_up_process(best_exclusive);
-   }
    wq_write_unlock_irqrestore(&q->lock, flags);
 out:
    return;
 }
 
-void __wake_up(wait_queue_head_t *q, unsigned int mode, unsigned int wq_mode)
+void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr)
 {
-   __wake_up_common(q, mode, wq_mode, 0);
+   __wake_up_common(q, mode, nr, 0);
 }
 
-void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, unsigned int wq_mode)
+void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr)
 {
-   __wake_up_common(q, mode, wq_mode, 1);
+   __wake_up_common(q, mode, nr, 1);
 }
 
 #define   SLEEP_ON_VAR            \


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.