Re: [PATCH 3/4] rcu: introduce task_rcu_struct and move task's RCUcode to rcupdate_defs.h

From: Alexey Dobriyan
Date: Thu Apr 07 2011 - 09:40:34 EST


On Thu, Apr 7, 2011 at 10:07 AM, Lai Jiangshan <laijs@xxxxxxxxxxxxxx> wrote:
> Add struct task_rcu_struct to make code clearer and move
> them to rcupdate_defs.h which help us for code maitainment.

> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -1232,17 +1232,7 @@ struct task_struct {
>        unsigned int policy;
>        cpumask_t cpus_allowed;
>
> -#ifdef CONFIG_PREEMPT_RCU
> -       int rcu_read_lock_nesting;
> -       char rcu_read_unlock_special;
> -       struct list_head rcu_node_entry;
> -#endif /* #ifdef CONFIG_PREEMPT_RCU */
> -#ifdef CONFIG_TREE_PREEMPT_RCU
> -       struct rcu_node *rcu_blocked_node;
> -#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */
> -#ifdef CONFIG_RCU_BOOST
> -       struct rt_mutex *rcu_boost_mutex;
> -#endif /* #ifdef CONFIG_RCU_BOOST */
> +       struct task_rcu_struct task_rcu_struct;

Oh, wow, all these movements are for this.

You could do

struct task_rcu {
...
} rcu;

inside sched.h, drop pointless 1:1 current_() et al wrappers and
avoid all this mess.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/