[PATCH v2 1/1] headers: fix circular dependency between linux/sched.h and linux/wait.h

2011-02-21 Thread David Cohen
Currently sched.h and wait.h have circular dependency between both. wait.h defines macros wake_up*() which use macros TASK_* defined by sched.h. But as sched.h indirectly includes wait.h, such wait.h header file can't include sched.h too. The side effect is when some file includes wait.h and tries

Re: [PATCH v2 1/1] headers: fix circular dependency between linux/sched.h and linux/wait.h

2011-02-21 Thread Peter Zijlstra
On Mon, 2011-02-21 at 16:38 +0200, David Cohen wrote: > Currently sched.h and wait.h have circular dependency between both. > wait.h defines macros wake_up*() which use macros TASK_* defined by > sched.h. But as sched.h indirectly includes wait.h, such wait.h header > file can't include sched.h too

Re: [PATCH v2 1/1] headers: fix circular dependency between linux/sched.h and linux/wait.h

2011-02-21 Thread David Cohen
On Mon, Feb 21, 2011 at 5:54 PM, Peter Zijlstra wrote: > On Mon, 2011-02-21 at 16:38 +0200, David Cohen wrote: >> Currently sched.h and wait.h have circular dependency between both. >> wait.h defines macros wake_up*() which use macros TASK_* defined by >> sched.h. But as sched.h indirectly include

Re: [PATCH v2 1/1] headers: fix circular dependency between linux/sched.h and linux/wait.h

2011-02-21 Thread Peter Zijlstra
On Mon, 2011-02-21 at 18:03 +0200, David Cohen wrote: > On Mon, Feb 21, 2011 at 5:54 PM, Peter Zijlstra wrote: > > On Mon, 2011-02-21 at 16:38 +0200, David Cohen wrote: > >> Currently sched.h and wait.h have circular dependency between both. > >> wait.h defines macros wake_up*() which use macros T

Re: [PATCH v2 1/1] headers: fix circular dependency between linux/sched.h and linux/wait.h

2011-02-21 Thread Felipe Balbi
Hi, On Mon, Feb 21, 2011 at 05:20:45PM +0100, Peter Zijlstra wrote: > > > I think Alexey already told you what you done wrong. > > > > > > Also, I really don't like the task_state.h header, it assumes a lot of > > > things it doesn't include itself and only works because its using macros > > > and

Re: [PATCH v2 1/1] headers: fix circular dependency between linux/sched.h and linux/wait.h

2011-02-21 Thread Peter Zijlstra
On Mon, 2011-02-21 at 18:29 +0200, Felipe Balbi wrote: > Hi, > > On Mon, Feb 21, 2011 at 05:20:45PM +0100, Peter Zijlstra wrote: > > > > I think Alexey already told you what you done wrong. > > > > > > > > Also, I really don't like the task_state.h header, it assumes a lot of > > > > things it doe

Re: [PATCH v2 1/1] headers: fix circular dependency between linux/sched.h and linux/wait.h

2011-02-21 Thread Felipe Balbi
Hi, On Mon, Feb 21, 2011 at 05:43:27PM +0100, Peter Zijlstra wrote: > > > And then make sched.c include signal.h and completion.h. > > > > you wouldn't prevent the underlying problem which is the need to include > > sched.h whenever you include wait.h and use wake_up*() > > If you'd applied your

Re: [PATCH v2 1/1] headers: fix circular dependency between linux/sched.h and linux/wait.h

2011-02-21 Thread Peter Zijlstra
On Mon, 2011-02-21 at 18:54 +0200, Felipe Balbi wrote: > What you seem to have missed is that sched.h doesn't include wait.h, it > includes completion.h and completion.h needs wait.h due the > wait_queue_head_t it uses. Yeah, so? sched.h doesn't need completion.h, but like with wait.h I'd argue t

Re: [PATCH v2 1/1] headers: fix circular dependency between linux/sched.h and linux/wait.h

2011-02-21 Thread Felipe Balbi
On Mon, Feb 21, 2011 at 06:06:02PM +0100, Peter Zijlstra wrote: > On Mon, 2011-02-21 at 18:54 +0200, Felipe Balbi wrote: > > > What you seem to have missed is that sched.h doesn't include wait.h, it > > includes completion.h and completion.h needs wait.h due the > > wait_queue_head_t it uses. > >

Re: [PATCH v2 1/1] headers: fix circular dependency between linux/sched.h and linux/wait.h

2011-02-21 Thread Oleg Nesterov
On 02/21, Oleg Nesterov wrote: > > On 02/21, Peter Zijlstra wrote: > > > > afaict its needed because struct signal_struct and struct sighand_struct > > include a wait_queue_head_t. The inclusion seems to come through > > completion.h, but afaict we don't actually need to include completion.h > > be

Re: [PATCH v2 1/1] headers: fix circular dependency between linux/sched.h and linux/wait.h

2011-02-21 Thread Oleg Nesterov
On 02/21, Peter Zijlstra wrote: > > afaict its needed because struct signal_struct and struct sighand_struct > include a wait_queue_head_t. The inclusion seems to come through > completion.h, but afaict we don't actually need to include completion.h > because all we have is a pointer to a completio

Re: [PATCH v2 1/1] headers: fix circular dependency between linux/sched.h and linux/wait.h

2011-02-21 Thread Alexey Dobriyan
On Mon, Feb 21, 2011 at 06:06:02PM +0100, Peter Zijlstra wrote: > 1) remove the inclusion of completion.h -- easy we can live with an > incomplete type. ACK > 2) move the other wait_queue_head_t users (signal_struct sighand_struct) > out of sched.h > > 3) ... Compile test! :^) > 4) profit! >

Re: [PATCH v2 1/1] headers: fix circular dependency between linux/sched.h and linux/wait.h

2011-02-22 Thread David Cohen
On Mon, Feb 21, 2011 at 7:27 PM, Oleg Nesterov wrote: > On 02/21, Oleg Nesterov wrote: >> >> On 02/21, Peter Zijlstra wrote: >> > >> > afaict its needed because struct signal_struct and struct sighand_struct >> > include a wait_queue_head_t. The inclusion seems to come through >> > completion.h, b