From: Ingo Molnar <mingo@elte.hu>
To: Christoph Hellwig <hch@infradead.org>,
linux-kernel@vger.kernel.org,
Arjan van de Ven <arjanv@infradead.org>,
Roman Zippel <zippel@linux-m68k.org>,
Zwane Mwaikambo <zwane@arm.linux.org.uk>,
Ingo Oeser <ioe-lkml@axxeo.de>, Andrew Morton <akpm@osdl.org>,
Andi Kleen <ak@suse.de>, Thomas Gleixner <tglx@linutronix.de>,
Al Viro <viro@parcelfarce.linux.theplanet.co.uk>,
"David S. Miller" <davem@redhat.com>
Subject: Re: [patch] spinlock consolidation, v2
Date: Sun, 5 Jun 2005 12:42:46 +0200 [thread overview]
Message-ID: <20050605104245.GA9303@elte.hu> (raw)
In-Reply-To: <20050604113809.GD19819@infradead.org>
* Christoph Hellwig <hch@infradead.org> wrote:
> > the latest version of the spinlock consolidation patch can be found at:
> >
> > http://redhat.com/~mingo/spinlock-patches/consolidate-spinlocks.patch
> >
> > the patch is now complete in the sense that it does everything i wanted
> > it to do. If you have any other suggestions (or i have missed to
> > incorporate an earlier suggestion of yours), please yell.
>
> Looks pretty nice, but your usage of asm-generic is totally wrong.
> files in asm-generic must only ever be used for default
> implementations of asm/ headers, and _never_ be included from common
> code. But your asm-generic files are only ever used from
> linux/spinlock.h, so there's no point at all in splitting them out in
> the first time. [...]
I see your point. My intention was to make the include file structure
completely symmetric and thus easy to review. The following table
illustrates how we build up the spinlock type and primitives in the SMP
and UP cases:
SMP | UP
----------------------------|-----------------------------------
asm/spinlock_types.h | asm-generic/spinlock_types_up.h
linux/spinlock_types.h | linux/spinlock_types.h
asm/spinlock.h | asm-generic/spinlock_up.h
linux/spinlock_smp.h | linux/spinlock_up.h
linux/spinlock.h | linux/spinlock.h
as you can see in the list above, whenever something comes from the asm
directory, in the UP case we pick it from asm-generic. But i accept your
point that the use of asm-generic/ for this is improper, and i've moved
those files into include/linux/. (I also have renamed spinlock_smp.h and
spinlock_up.h to spinlock_api_smp.h and spinlock_api_up.h, to avoid the
filename clash.) The naming is still symmetric:
SMP | UP
----------------------------|-----------------------------------
asm/spinlock_types_smp.h | linux/spinlock_types_up.h
linux/spinlock_types.h | linux/spinlock_types.h
asm/spinlock_smp.h | linux/spinlock_up.h
linux/spinlock_api_smp.h | linux/spinlock_api_up.h
linux/spinlock.h | linux/spinlock.h
all this splitup structure was created based on a pretty simple rule:
whenever some aspect is sufficiently dissimilar to be #ifdef
CONFIG_SMP-ed, it gets into separate _smp and _up files. If it's generic
and shared it gets into the main spinlock.h file. The splitups were only
done to enable this clean structure.
> Similarly there's no point in a separate linux/spinlock_smp.h and
> linux/spinlock_up.h - it'll only cause some driver writers to include
> either of them directly and break the build for either UP or SMP. If
> you absolutely want to split them add an #error if not included from
> spinlock.h
ok, i've added the #error protectors.
> Little nitpick no 2: please include linux/*.h always before asm/*.h
> (in linux/jbd.h)
done.
you can find the latest patch with all these fixes included, at:
http://redhat.com/~mingo/spinlock-patches/consolidate-spinlocks.patch
Ingo
prev parent reply other threads:[~2005-06-05 10:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-03 15:40 [patch] spinlock consolidation, v2 Ingo Molnar
[not found] ` <20050604113809.GD19819@infradead.org>
2005-06-05 10:42 ` Ingo Molnar [this message]
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=20050605104245.GA9303@elte.hu \
--to=mingo@elte.hu \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=arjanv@infradead.org \
--cc=davem@redhat.com \
--cc=hch@infradead.org \
--cc=ioe-lkml@axxeo.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=viro@parcelfarce.linux.theplanet.co.uk \
--cc=zippel@linux-m68k.org \
--cc=zwane@arm.linux.org.uk \
/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