lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 15 Apr 2009 14:20:59 +0100
From:	David Howells <dhowells@...hat.com>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	dhowells@...hat.com,
	Linus Torvalds <torvalds@...ux-foundation.org>, tj@...nel.org,
	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] FRV: Fix the section attribute on UP DECLARE_PER_CPU()

Ingo Molnar <mingo@...e.hu> 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


Download attachment "08-percpu-add-headers.diff" of type "message/rfc822" (26860 bytes)

Download attachment "09-move-declare-cpu.diff" of type "message/rfc822" (56461 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ