Re: [PATCH] FRV: Fix the section attribute on UP DECLARE_PER_CPU()

From: Ingo Molnar
Date: Wed Apr 15 2009 - 12:51:18 EST



* Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> On Wed, 15 Apr 2009, David Howells wrote:
> > Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > > Hmm. Why not move it all above the '#include <asm/percpu.h>'?
> >
> > There are circular dependencies between the x86 arch headers that both use
> > this and are used to implement this, and it's a bit fragile.
>
> Grr. Indeed it seems to be. Nasty. Header files seem to want that
> DECLARE_PER_CPU() thing without all the other baggage that is
> implied by including all of <linux/percpu.h>, so they just include
> <asm/percpu.h> directly instead.
>
> What a mess.
>
> So maybe we could move DEFINE_PER_CPU in there too? It's less than
> perfect, but at least we'd have things together rather than split
> in really odd ways.

I think splitting the type related defines away into percpu_types.h,
and updating the lowlevel headers to include linux/percpu_types.h
[which would include asm/percpu.h] would do the trick.

Even the exising percpu.h could be made lighter:

slab.h: is needed for the kzalloc in the !SMP wrapper case. That
could be eliminated by uninlining the UP wrappers.

preempt.h: is needed for preempt_disable/enable() in the
get_cpu_var()/put_cpu_var() methods.

smp.h: not sure what it's needed for - nothing obvious at first
sight.

Most of them could be eliminated.

Ingo
--
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/