This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / arch / arm / kernel / process.c
index 7df6e1a..489c069 100644 (file)
@@ -264,12 +264,8 @@ void show_fpregs(struct user_fp *regs)
 /*
  * Task structure and kernel stack allocation.
  */
-struct thread_info_list {
-       unsigned long *head;
-       unsigned int nr;
-};
-
-static DEFINE_PER_CPU(struct thread_info_list, thread_info_list) = { NULL, 0 };
+static unsigned long *thread_info_head;
+static unsigned int nr_thread_info;
 
 #define EXTRA_TASK_STRUCT      4
 
@@ -278,15 +274,12 @@ struct thread_info *alloc_thread_info(struct task_struct *task)
        struct thread_info *thread = NULL;
 
        if (EXTRA_TASK_STRUCT) {
-               struct thread_info_list *th = &get_cpu_var(thread_info_list);
-               unsigned long *p = th->head;
+               unsigned long *p = thread_info_head;
 
                if (p) {
-                       th->head = (unsigned long *)p[0];
-                       th->nr -= 1;
+                       thread_info_head = (unsigned long *)p[0];
+                       nr_thread_info -= 1;
                }
-               put_cpu_var(thread_info_list);
-
                thread = (struct thread_info *)p;
        }
 
@@ -307,19 +300,13 @@ struct thread_info *alloc_thread_info(struct task_struct *task)
 
 void free_thread_info(struct thread_info *thread)
 {
-       if (EXTRA_TASK_STRUCT) {
-               struct thread_info_list *th = &get_cpu_var(thread_info_list);
-               if (th->nr < EXTRA_TASK_STRUCT) {
-                       unsigned long *p = (unsigned long *)thread;
-                       p[0] = (unsigned long)th->head;
-                       th->head = p;
-                       th->nr += 1;
-                       put_cpu_var(thread_info_list);
-                       return;
-               }
-               put_cpu_var(thread_info_list);
-       }
-       free_pages((unsigned long)thread, THREAD_SIZE_ORDER);
+       if (EXTRA_TASK_STRUCT && nr_thread_info < EXTRA_TASK_STRUCT) {
+               unsigned long *p = (unsigned long *)thread;
+               p[0] = (unsigned long)thread_info_head;
+               thread_info_head = p;
+               nr_thread_info += 1;
+       } else
+               free_pages((unsigned long)thread, THREAD_SIZE_ORDER);
 }
 
 /*
@@ -487,3 +474,4 @@ unsigned long get_wchan(struct task_struct *p)
        } while (count ++ < 16);
        return 0;
 }
+EXPORT_SYMBOL(get_wchan);