Ingo Molnar wrote: > > The problem is mainly one of #include recursion. There's way too > > much of it. > > that should be mapped and eliminated then. Indeed. My suggestion was intended for after elimination to discourage it from returning. > There is absolutely _nothing_ wrong about defining structures in a > hierarchical way! For example task_struct does have to combine a lot > of derived types. It can use types directly and indirectly as well. > Hierarchical data structures are _good_. Indeed. I didn't say you shouldn't include one header file from another, just that you shouldn't have a cycle of header files that include one another. > The solution to this is the creation of a separate data versus > method include file hiearchy: for example mm_types.h and > spinlock_types.h. That's what I've been doing - but it's not as simple as just splitting each header file in to two, however. > There's three too 'thick' headers: linux/percpu.h, linux/prefetch.h > and asm/processor.h. Yes, I noticed. linux/percpu.h needs to be split three ways for instance: definitions, access methods, and alocators. linux/prefetch.h isn't too bad: what it needs is the prefetch stuff splitting out of asm/processor.h into asm/prefetch.h. > Please create include/linux/percpu_types.h for basic data types and > simple, self-sufficient primitives. Also have an > include/linux/percpu_api.h or include/linux/percpu.h include file > for convenience/speedup inlines. The latter will only be included in > .c files, where 'combination' of type spaces is not a problem. Not so. The problem is that various header files make use of per-cpu variable accessors (asm/current.h and asm/thread_info.h to name a couple) to build inline asm. Anyway, here are a pair of patches on top of the one I've already sent to Linus. The second breaks a number of header files into pieces and rearranges the percpu headers to put the DECLARE and DEFINE macros together. The first patch could potentially be applied immediately. It adds #inclusions and forward refs that are required to iron out compile errors from the second patch. Note that these only work for the configuration I routinely use on my x86_64 test machine. It will break all other arches and many other i386 and x86_64 configurations. David