2005-02-25 12:09:17

by Ian Pratt

[permalink] [raw]
Subject: RE: arch/xen is a bad idea


> The Xen team still believe that it's best to keep arch/xen,
> arch/xen/i386,
> arch/xen/x86_64, etc. And I believe that Andi (who is the
> world expert on
> maintaining an i386 derivative) thinks that this is will be a
> long-term
> maintenance problem.

I think there's an interim compromise position that everyone might go
for:

Phase 1 is for us to submit a load of patches that squeeze out the low
hanging fruit in unifying xen/i386 and i386. Most of these will be
strict cleanups to i386, and the result will be to almost halve the
number of files that we need to modify.

The next phase is that we re-organise the current arch/xen as follows:

We move the remaining (reduced) contents of arch/xen/i386 to
arch/i386/xen (ditto for x86_64). We then move the xen-specific files
that are shared between all the different xen architectures to
drivers/xen/core. I know this last step is a bit odd, but it's the best
location that Rusty Russel and I could come up with.

At this point, I'd hope that we could get xen into the main-line tree.

The final phase is to see if we can further unify more native and xen
files. This is going to require some significant i386 code refactoring,
and I think its going to be much easier to do if all the code is in the
main-line tree so that people can see the motivation for what's going
on.

What do you think?

Best,
Ian


2005-02-25 15:03:49

by Andi Kleen

[permalink] [raw]
Subject: Re: arch/xen is a bad idea

> Phase 1 is for us to submit a load of patches that squeeze out the low
> hanging fruit in unifying xen/i386 and i386. Most of these will be
> strict cleanups to i386, and the result will be to almost halve the
> number of files that we need to modify.

Sounds good. I would try to track that for x86-64 too then when
possible to make the later x86-64 merge easier.

>
> The next phase is that we re-organise the current arch/xen as follows:
>
> We move the remaining (reduced) contents of arch/xen/i386 to
> arch/i386/xen (ditto for x86_64). We then move the xen-specific files

What would these files be?

> that are shared between all the different xen architectures to
> drivers/xen/core. I know this last step is a bit odd, but it's the best
> location that Rusty Russel and I could come up with.
>
> At this point, I'd hope that we could get xen into the main-line tree.
>
> The final phase is to see if we can further unify more native and xen
> files. This is going to require some significant i386 code refactoring,
> and I think its going to be much easier to do if all the code is in the
> main-line tree so that people can see the motivation for what's going
> on.

Hmm, I would prefer to do that during the merge. I'm not sure there
will be that much push afterwards to unify stuff, and then we might
be stuck with an inferior setup.

I don't think it makes much difference for review if the previous
code is in mainline or not.

-Andi

2005-02-25 22:32:29

by Andrew Morton

[permalink] [raw]
Subject: Re: arch/xen is a bad idea

"Ian Pratt" <[email protected]> wrote:
>
>
> > The Xen team still believe that it's best to keep arch/xen,
> > arch/xen/i386,
> > arch/xen/x86_64, etc. And I believe that Andi (who is the
> > world expert on
> > maintaining an i386 derivative) thinks that this is will be a
> > long-term
> > maintenance problem.
>
> I think there's an interim compromise position that everyone might go
> for:
>
> Phase 1 is for us to submit a load of patches that squeeze out the low
> hanging fruit in unifying xen/i386 and i386. Most of these will be
> strict cleanups to i386, and the result will be to almost halve the
> number of files that we need to modify.

OK. It would be good to have a phase 0: any refactoring, abstracting, etc
to the core kernel and to i386 which is a preparatory step, prior to
introducing any Xen code. After phase 0 everything should still compile
and run. The subsequent Xen patches should merely add stuff and not move
existing code around.

> The next phase is that we re-organise the current arch/xen as follows:
>
> We move the remaining (reduced) contents of arch/xen/i386 to
> arch/i386/xen (ditto for x86_64). We then move the xen-specific files
> that are shared between all the different xen architectures to
> drivers/xen/core. I know this last step is a bit odd, but it's the best
> location that Rusty Russel and I could come up with.
>
> At this point, I'd hope that we could get xen into the main-line tree.

What would you propose doing with the i386 header files? Such as the
pagetable handling?

> The final phase is to see if we can further unify more native and xen
> files. This is going to require some significant i386 code refactoring,
> and I think its going to be much easier to do if all the code is in the
> main-line tree so that people can see the motivation for what's going
> on.
>
> What do you think?

It sounds decent. The main objective is to minimise code duplication. The
question of where in the tree all the resulting code actually lands is
secondary from a maintainability POV.