[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1302557074.2388.108.camel@twins>
Date: Mon, 11 Apr 2011 23:24:34 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: paulmck@...ux.vnet.ibm.com
Cc: Lai Jiangshan <laijs@...fujitsu.com>,
"H. Peter Anvin" <hpa@...ux.intel.com>,
Michal Marek <mmarek@...e.cz>,
Jan Beulich <JBeulich@...ell.com>, Ingo Molnar <mingo@...e.hu>,
Alexander van Heukelum <heukelum@...tmail.fm>,
Dipankar Sarma <dipankar@...ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Sam Ravnborg <sam@...nborg.org>,
David Howells <dhowells@...hat.com>,
Oleg Nesterov <oleg@...hat.com>,
Roland McGrath <roland@...hat.com>,
linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [RFC PATCH 4/5] RCU: Add TASK_RCU_OFFSET
On Mon, 2011-04-11 at 14:02 -0700, Paul E. McKenney wrote:
> On Mon, Apr 11, 2011 at 04:31:10PM +0800, Lai Jiangshan wrote:
> > On 04/11/2011 01:12 PM, Paul E. McKenney wrote:
> >
> > > -static inline struct task_struct *next_thread(const struct task_struct *p)
> > > -{
> > > - return list_entry_rcu(p->thread_group.next,
> > > - struct task_struct, thread_group);
> > > -}
> > > +/* Avoid #include hell for inlining rcu_read_lock(). */
> > > +#define next_thread(p) \
> > > + list_entry_rcu((p)->thread_group.next, struct task_struct, thread_group)
> > >
> > I admit the work will become very much simpler if this pattern is allowed.
>
> The guy who maintains much of sched.h suggested it. ;-)
While its not the nicest thing its something that's on more than one
occasion there's an existing site in sched.h and there's on in key.h and
iirc there's another one that's relevant.
A nice solution would be to move a lot of things out of sched.h into
something like process.h, a header that deals with task groups and
processes.
But until that time, I see no problem with using this.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists