public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: David Howells <dhowells@redhat.com>,
	tj@kernel.org, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] FRV: Fix the section attribute on UP DECLARE_PER_CPU()
Date: Wed, 15 Apr 2009 18:49:29 +0200	[thread overview]
Message-ID: <20090415164929.GA10345@elte.hu> (raw)
In-Reply-To: <alpine.LFD.2.00.0904150808550.4132@localhost.localdomain>


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Wed, 15 Apr 2009, David Howells wrote:
> > Linus Torvalds <torvalds@linux-foundation.org> 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

  reply	other threads:[~2009-04-15 16:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14 16:10 [PATCH] FRV: Fix the section attribute on UP DECLARE_PER_CPU() David Howells
2009-04-14 16:57 ` Linus Torvalds
2009-04-14 17:57   ` David Howells
2009-04-14 18:06     ` Linus Torvalds
2009-04-15 10:24       ` David Howells
2009-04-15 15:19         ` Linus Torvalds
2009-04-15 16:49           ` Ingo Molnar [this message]
2009-04-15 11:40       ` David Howells
2009-04-15 12:03         ` Ingo Molnar
2009-04-15 13:20           ` David Howells
2009-04-15 14:09             ` Ingo Molnar
2009-04-15 15:09               ` David Howells
2009-04-15 16:54                 ` Ingo Molnar
2009-04-21 18:36                   ` David Howells
2009-04-22  9:12                     ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090415164929.GA10345@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox