From: Ingo Molnar <mingo@elte.hu>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Brian Gerst <brgerst@gmail.com>, "H. Peter Anvin" <hpa@zytor.com>,
Yinghai Lu <yinghai@kernel.org>, Tejun Heo <tj@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: x86/Voyager
Date: Sun, 18 Jan 2009 22:33:17 +0100 [thread overview]
Message-ID: <20090118213317.GA30670@elte.hu> (raw)
In-Reply-To: <1232309514.3247.62.camel@localhost.localdomain>
* James Bottomley <James.Bottomley@HansenPartnership.com> wrote:
> > > But no-one's yet made any argument for why it's a worthwhile thing
> > > to be doing.
> >
> > Because the sub-arch code is butt-ugly.
> >
> > x86 subarchitectures are a hack that should never have gone upstream -
> > and we are now reversing that braindamage, step by step.
> > Subarchitectures are a compile-time "HAL", but a highly
> > non-transparent one at that. They complicates the x86 architecture in
> > a couple of key structures and very fundamentally so - and that
> > results in continued complications in critical areas of the x86 code.
>
> Right: it's a compile time HAL. Your "cleanup" is to convert it to a
> runtime one, which is a lot more complex because voyager still has to
> influence the x86 path in those locations regardless: it's not an x86 PC
> architecture and so is never going to be able to boot through an APIC/MP
> table SMP boot sequence.
>
> I'm not actually bothered by the complexity, though ... it would be cool
> for me to have a kernel that boots on both voyager and a PC. What
> worries me is the cost (both in terms of execution time and maintenance
> burden) this would impose on the standard PC path.
That cost is negligible. Voyager already uses smp_ops which solves most of
the callbacks. The remaining non-slowpath (non-init, non-shutdown, etc.)
bits are, roughly:
flush_tlb_[all|current_task|mm|page]()
smp_apic_timer_interrupt
Which can either reuse PARAVIRT with a Voyager-specific custom template
for these methods, or, if that's easier, we can add x86_quirk handlers as
well.
There is near zero overhead for normal PCs, ~5 functions will have:
if (unlikely(x86_quirks.smp_apic_timer_interrupt)) {
... quirk-path ...
}
type of constructs.
> The other thing I will point out is that if you think a runtime HAL
> simplification could be applied to the current kernel, a compile time
> HAL could equally well be done.
There are numerous advantages. Just a few of them, from the top of my
head:
- The point is to not split the build space on such a fundamental level -
testing is way too complex already.
- Runtime quirks tend to be tested far more than build-time quirks: for
example because a test kernel can just include all the runtime quirks
all at once - while it cannot possibly include all the
subarchitectures.
- It is far more apparent from the source code what happens if quirks are
out and visible. A compile-time 'HAL' is far less transparent: it is
very easy to miss that a function is present in multiple copies and
behaves in different ways, dependent on which subarch we are building
for. Developers tend to concentrate on a single piece of code, so
consolidating code flows is a development advantage.
- Runtime quirks tend to be much more usable. A distro kernel can include
all the quirks with near zero impact. Now in the specific case of
x86/Voyager this is probably not a big factor: as you seem to be owning
the last two (one?) working Voyager box in existence that runs
development kernels? But it is a factor in the general push to
eliminate subarchitectures.
(For similarly good reasons most of the hw quirks in the normal Linux
driver space are done via runtime constructs and not via build-time
constructs.)
Anyway, none of this is really new. We eliminated the ES7000, the VISWS
and the RDC321X subarchitectures already - Voyager is the holdout.
Ingo
next prev parent reply other threads:[~2009-01-18 21:33 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <73c1f2160901160610l57e31a64j56fe9544bd2fd309@mail.gmail.com>
2009-01-16 14:16 ` [PATCH 01/17] x86-64: Move irq stats from PDA to per-cpu and consolidate with 32-bit Brian Gerst
2009-01-16 14:16 ` [PATCH 02/17] x86-64: Move TLB state " Brian Gerst
2009-01-16 14:16 ` [PATCH 03/17] x86-64: Convert irqstacks to per-cpu Brian Gerst
2009-01-16 14:16 ` [PATCH 04/17] x86-64: Convert exception stacks " Brian Gerst
2009-01-16 14:16 ` [PATCH 05/17] x86-64: Move cpu number from PDA to per-cpu and consolidate with 32-bit Brian Gerst
2009-01-16 14:16 ` [PATCH 06/17] x86-64: Move current task " Brian Gerst
2009-01-16 14:16 ` [PATCH 07/17] x86-64: Move kernelstack from PDA to per-cpu Brian Gerst
2009-01-16 14:16 ` [PATCH 08/17] x86-64: Move oldrsp " Brian Gerst
2009-01-16 14:16 ` [PATCH 09/17] x86-64: Move irqcount " Brian Gerst
2009-01-16 14:16 ` [PATCH 10/17] x86-64: Move nodenumber " Brian Gerst
2009-01-16 14:16 ` [PATCH 11/17] x86-64: Move isidle " Brian Gerst
2009-01-16 14:16 ` [PATCH 12/17] x86-64: Use absolute displacements for per-cpu accesses Brian Gerst
2009-01-16 14:16 ` [PATCH 13/17] x86-64: Remove pda_init() Brian Gerst
2009-01-16 14:16 ` [PATCH 14/17] x86-64: Remove load_pda_offset() Brian Gerst
2009-01-16 14:16 ` [PATCH 15/17] percpu: Refactor percpu.h Brian Gerst
2009-01-16 14:16 ` [PATCH 16/17] x86-64: Remove the PDA Brian Gerst
2009-01-16 14:16 ` [PATCH 17/17] x86-64: Remove pda.h Brian Gerst
2009-01-18 4:54 ` Tejun Heo
2009-01-18 4:52 ` [PATCH 16/17] x86-64: Remove the PDA Tejun Heo
2009-01-18 7:46 ` Brian Gerst
2009-01-18 8:13 ` Tejun Heo
2009-01-18 8:41 ` Ingo Molnar
2009-01-18 4:32 ` [PATCH 13/17] x86-64: Remove pda_init() Tejun Heo
2009-01-18 5:20 ` Brian Gerst
2009-01-18 5:30 ` Tejun Heo
2009-01-18 4:22 ` [PATCH 12/17] x86-64: Use absolute displacements for per-cpu accesses Tejun Heo
[not found] ` <73c1f2160901172036m4d7bb4f8i50b6a5185a63e95@mail.gmail.com>
2009-01-18 16:42 ` Ingo Molnar
2009-01-18 17:38 ` Ingo Molnar
2009-01-18 5:05 ` [PATCH 05/17] x86-64: Move cpu number from PDA to per-cpu and consolidate with 32-bit Tejun Heo
2009-01-18 5:57 ` Brian Gerst
2009-01-18 5:59 ` Tejun Heo
2009-01-18 6:51 ` Brian Gerst
2009-01-18 7:14 ` x86/Voyager Ingo Molnar
2009-01-18 16:41 ` x86/Voyager James Bottomley
2009-01-18 17:41 ` x86/Voyager Brian Gerst
2009-01-18 18:04 ` x86/Voyager James Bottomley
2009-01-18 18:21 ` x86/Voyager Brian Gerst
2009-01-18 18:17 ` x86/Voyager Ingo Molnar
2009-01-18 20:11 ` x86/Voyager James Bottomley
2009-01-18 21:33 ` Ingo Molnar [this message]
2009-01-18 4:58 ` [PATCH 03/17] x86-64: Convert irqstacks to per-cpu Tejun Heo
2009-01-18 5:05 ` Brian Gerst
2009-01-18 5:08 ` Tejun Heo
2009-01-18 8:36 ` Ingo Molnar
2009-01-18 9:04 ` Tejun Heo
2009-01-18 9:16 ` Ingo Molnar
2009-01-18 5:01 ` Tejun Heo
2009-01-20 13:15 ` [PATCH 1/6] x86: Clean up gdt_page definition Brian Gerst
2009-01-20 13:15 ` [PATCH 2/6] x86-64: Fix percpu_write with 64-bit constants Brian Gerst
2009-01-20 13:15 ` [PATCH 3/6] x86-32: Set %fs to __KERNEL_PERCPU unconditionally Brian Gerst
2009-01-20 13:15 ` [PATCH 4/6] x86: Merge mmu_context.h Brian Gerst
2009-01-21 1:31 ` Tejun Heo
2009-01-21 8:21 ` Tejun Heo
2009-01-20 13:15 ` [PATCH 5/6] x86: Merge hardirq.h Brian Gerst
2009-01-21 8:19 ` Tejun Heo
2009-01-21 8:50 ` Tejun Heo
2009-01-21 10:14 ` Ingo Molnar
2009-01-21 10:13 ` Ingo Molnar
2009-01-21 11:33 ` Tejun Heo
2009-01-21 14:21 ` Tilman Schmidt
2009-01-20 13:15 ` [PATCH 6/6] x86: Merge irq_regs.h Brian Gerst
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=20090118213317.GA30670@elte.hu \
--to=mingo@elte.hu \
--cc=James.Bottomley@HansenPartnership.com \
--cc=brgerst@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--cc=yinghai@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.