[patch-2.4.0-test1-ac19] hash_process(p) inline

From: Tigran Aivazian (tigran@veritas.com)
Date: Thu Jun 15 2000 - 09:45:24 EST


Hi Alan,

I observed assymetry between having both hash_pid() and unhash_pid() but
only unhash_process() and no hash_process(). This is fixed by the patch
below.

regards,
Tigran

diff -urN linux/include/linux/sched.h work/include/linux/sched.h
--- linux/include/linux/sched.h Wed Jun 14 13:38:34 2000
+++ work/include/linux/sched.h Thu Jun 15 15:39:31 2000
@@ -830,6 +830,15 @@
         return (p->run_list.next != NULL);
 }
 
+static inline void hash_process(struct task_struct *p)
+{
+ write_lock_irq(&tasklist_lock);
+ SET_LINKS(p);
+ hash_pid(p);
+ nr_threads++;
+ write_unlock_irq(&tasklist_lock);
+}
+
 static inline void unhash_process(struct task_struct *p)
 {
         if (task_on_runqueue(p)) BUG();
diff -urN linux/kernel/fork.c work/kernel/fork.c
--- linux/kernel/fork.c Wed Jun 14 13:38:34 2000
+++ work/kernel/fork.c Thu Jun 15 15:39:33 2000
@@ -754,12 +754,7 @@
          * Let it rip!
          */
         retval = p->pid;
- write_lock_irq(&tasklist_lock);
- SET_LINKS(p);
- hash_pid(p);
- nr_threads++;
- write_unlock_irq(&tasklist_lock);
-
+ hash_process(p);
         wake_up_process(p); /* do this last */
         ++total_forks;
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:35 EST