Merge branch 'linus' into core/rcu
authorIngo Molnar <mingo@elte.hu>
Fri, 4 Sep 2009 07:28:52 +0000 (09:28 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 4 Sep 2009 07:29:05 +0000 (09:29 +0200)
Merge reason: Avoid fuzz in init/main.c and update from rc6 to rc8.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
1  2 
include/linux/sched.h
kernel/fork.c

diff --combined include/linux/sched.h
@@@ -1163,8 -1163,6 +1163,8 @@@ struct sched_rt_entity 
  #endif
  };
  
 +struct rcu_node;
 +
  struct task_struct {
        volatile long state;    /* -1 unrunnable, 0 runnable, >0 stopped */
        void *stack;
         * a short time
         */
        unsigned char fpu_counter;
+       s8 oomkilladj; /* OOM kill score adjustment (bit shift). */
  #ifdef CONFIG_BLK_DEV_IO_TRACE
        unsigned int btrace_seq;
  #endif
        unsigned int policy;
        cpumask_t cpus_allowed;
  
 -#ifdef CONFIG_PREEMPT_RCU
 +#ifdef CONFIG_TREE_PREEMPT_RCU
        int rcu_read_lock_nesting;
 -      int rcu_flipctr_idx;
 -#endif /* #ifdef CONFIG_PREEMPT_RCU */
 +      char rcu_read_unlock_special;
 +      struct rcu_node *rcu_blocked_node;
 +      struct list_head rcu_node_entry;
 +#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */
  
  #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
        struct sched_info sched_info;
@@@ -1727,28 -1724,6 +1728,28 @@@ extern cputime_t task_gtime(struct task
  #define tsk_used_math(p) ((p)->flags & PF_USED_MATH)
  #define used_math() tsk_used_math(current)
  
 +#ifdef CONFIG_TREE_PREEMPT_RCU
 +
 +#define RCU_READ_UNLOCK_BLOCKED (1 << 0) /* blocked while in RCU read-side. */
 +#define RCU_READ_UNLOCK_NEED_QS (1 << 1) /* RCU core needs CPU response. */
 +#define RCU_READ_UNLOCK_GOT_QS  (1 << 2) /* CPU has responded to RCU core. */
 +
 +static inline void rcu_copy_process(struct task_struct *p)
 +{
 +      p->rcu_read_lock_nesting = 0;
 +      p->rcu_read_unlock_special = 0;
 +      p->rcu_blocked_node = NULL;
 +      INIT_LIST_HEAD(&p->rcu_node_entry);
 +}
 +
 +#else
 +
 +static inline void rcu_copy_process(struct task_struct *p)
 +{
 +}
 +
 +#endif
 +
  #ifdef CONFIG_SMP
  extern int set_cpus_allowed_ptr(struct task_struct *p,
                                const struct cpumask *new_mask);
diff --combined kernel/fork.c
@@@ -426,7 -426,6 +426,6 @@@ static struct mm_struct * mm_init(struc
        init_rwsem(&mm->mmap_sem);
        INIT_LIST_HEAD(&mm->mmlist);
        mm->flags = (current->mm) ? current->mm->flags : default_dump_filter;
-       mm->oom_adj = (current->mm) ? current->mm->oom_adj : 0;
        mm->core_state = NULL;
        mm->nr_ptes = 0;
        set_mm_counter(mm, file_rss, 0);
@@@ -816,11 -815,8 +815,8 @@@ static int copy_signal(unsigned long cl
  {
        struct signal_struct *sig;
  
-       if (clone_flags & CLONE_THREAD) {
-               atomic_inc(&current->signal->count);
-               atomic_inc(&current->signal->live);
+       if (clone_flags & CLONE_THREAD)
                return 0;
-       }
  
        sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL);
        tsk->signal = sig;
@@@ -878,16 -874,6 +874,6 @@@ void __cleanup_signal(struct signal_str
        kmem_cache_free(signal_cachep, sig);
  }
  
- static void cleanup_signal(struct task_struct *tsk)
- {
-       struct signal_struct *sig = tsk->signal;
-       atomic_dec(&sig->live);
-       if (atomic_dec_and_test(&sig->count))
-               __cleanup_signal(sig);
- }
  static void copy_flags(unsigned long clone_flags, struct task_struct *p)
  {
        unsigned long new_flags = p->flags;
@@@ -1022,7 -1008,10 +1008,7 @@@ static struct task_struct *copy_process
        copy_flags(clone_flags, p);
        INIT_LIST_HEAD(&p->children);
        INIT_LIST_HEAD(&p->sibling);
 -#ifdef CONFIG_PREEMPT_RCU
 -      p->rcu_read_lock_nesting = 0;
 -      p->rcu_flipctr_idx = 0;
 -#endif /* #ifdef CONFIG_PREEMPT_RCU */
 +      rcu_copy_process(p);
        p->vfork_done = NULL;
        spin_lock_init(&p->alloc_lock);
  
        }
  
        if (clone_flags & CLONE_THREAD) {
+               atomic_inc(&current->signal->count);
+               atomic_inc(&current->signal->live);
                p->group_leader = current->group_leader;
                list_add_tail_rcu(&p->thread_group, &p->group_leader->thread_group);
        }
@@@ -1280,7 -1271,8 +1268,8 @@@ bad_fork_cleanup_mm
        if (p->mm)
                mmput(p->mm);
  bad_fork_cleanup_signal:
-       cleanup_signal(p);
+       if (!(clone_flags & CLONE_THREAD))
+               __cleanup_signal(p->signal);
  bad_fork_cleanup_sighand:
        __cleanup_sighand(p->sighand);
  bad_fork_cleanup_fs: