public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Nicolas Pitre <nico@fluxnic.net>
Cc: Detlef Vollmann <dv@vollmann.ch>, Ingo Molnar <mingo@elte.hu>,
	david@lang.hm,
	"Russell King - ARM Linux" <linux@arm.linux.org.uk>,
	Tony Lindgren <tony@atomide.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	lkml <linux-kernel@vger.kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	David Brown <davidb@codeaurora.org>,
	linux-omap@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [GIT PULL] omap changes for v2.6.39 merge window
Date: Sun, 3 Apr 2011 17:26:37 +0200	[thread overview]
Message-ID: <201104031726.37420.arnd@arndb.de> (raw)
In-Reply-To: <alpine.LFD.2.00.1104012129320.28032@xanadu.home>

On Saturday 02 April 2011, Nicolas Pitre wrote:
> On Sat, 2 Apr 2011, Arnd Bergmann wrote:
> > On Friday 01 April 2011 21:54:47 Nicolas Pitre wrote:
> > > I however don't think it is practical to go off in a separate 
> > > mach-nocrap space and do things in parallel.  Taking OMAP as an example, 
> > > there is already way too big of an infrastructure in place to simply 
> > > rewrite it in parallel to new OMAP versions coming up.
> > >
> > > It would be more useful and scalable to simply sit down, look at the 
> > > current mess, and identify common patterns that can be easily factored 
> > > out into some shared library code, and all that would be left in the 
> > > board or SOC specific files eventually is the data to register with that 
> > > library code.  Nothing so complicated as grand plans or planification 
> > > that makes it look like a mountain.
> > 
> > This is exactly the question it comes down to. So far, we have focused
> > on cleaning up platforms bit by bit. Given sufficient resources, I'm
> > sure this can work. You assume that continuing on this path is the
> > fastest way to clean up the whole mess, while my suggestion is based
> > on the assumption that we can do better by starting a small fork.
> 
> I don't think any fork would gain any traction.  That would only, heh, 
> fork the work force into two suboptimal branches for quite a while, and 
> given that we're talking about platform code, by the time the new branch 
> is usable and useful the hardware will probably be obsolete.  The only 
> way this may work is for totally new platforms but we're not talking 
> about a fork in that case.

Doing it just for new platforms could be an option if we decide not
to do a fork. The potential danger there is that new platform maintainers
could feel being treated unfairly because they'd have to do much more
work than the existing ones in order to get merged.

> > The things that I see as harder to do are where we need to change the
> > way that parts of the platform code interact with each other:
> > 
> > * platform specific IOMMU interfaces that need to be migrated to common
> >   interfaces
> 
> This can be done by actually forking the platform specific IOMMU code 
> only, just for the time required to migrate drivers to the common 
> interface.

True.

> > * duplicated but slightly different header files in include/mach/
> 
> Oh, actually that's part of the easy problems.  This simply require time 
> to progressively do the boring work.
> 
> With CONFIG_ARM_PATCH_PHYS_VIRT turned on we can get rid of almost all 
> instances of arch/arm/mach-*/include/mach/memory.h already.
> 
> Getting rid of all instances of arch/arm/mach-*/include/mach/vmalloc.h 
> can be trivially achieved by simply moving the VMALLOC_END values into 
> the corresponding struct machine_desc instances.
> 
> And so on for many other files.  This is all necessary for the 
> single-binary multi-SOC kernel work anyway.

I would phrase that differently: There are multiple good reaons why we
want to get rid of conflicting mach/*.h files, but there are at least
two ways to get there.

> > * static platform device definitions that get migrated to device tree
> >   definitions.
> 
> That require some kind of compatibility layer to make the transition 
> transparent to users.  I think Grant had some good ideas for this.

Yes, there are a number of good ideas (device tree fragments,
platform_data constructors, gradually replacing platform data
with properties, and possibly some more things). We'll probably
use a combination of these, and they something is needed either
way. 

> > The example that I have in mind is the time when we had a powerpc and a
> > ppc architecture in parallel, with ppc supporting a lot of hardware
> > that powerpc did not, but all new development getting done on powerpc.
> > 
> > This took years longer than we had expected at first, but I still think
> > it was a helpful fork. On ARM, we are in a much better shape in the
> > core code than what arch/ppc was, so there would be no point forking
> > that, but the problem on the platform code is quite similar.
> 
> Nah, I don't think we want to go there at all. The problem on the 
> platform code is probably much worse on ARM due to the greater diversity 
> of supported hardware.  If on PPC moving stuff across the fork took more 
> time on a year scale than expected, I think that on ARM we would simply 
> never see the end of it.  And the incentive would not really be there 
> either, unlike when the core code is concerned and everyone is affected.

What actually took really long was getting to the point where we
could completely delete the old arch/ppc directory, and we might
never want to do the equivalent here and move all existing platforms
over to common code.

There are a few other examples that were done in a similar way:
* The drivers/ide code still serves a few hardware platforms that
  never had anyone write a new libata code. Libata itself has
  been in a good shape for a long time though.
* Same thing with ALSA: sound/oss is still there for some really
  odd hardware, while ALSA is used everywhere else
* Many of the drivers getting into drivers/staging are so bad that
  they simply get rewritten into a new driver and then deleted,
  like arch/ppc.

We generally try to do gradual cleanups to any kernel code that is
worth keeping, because as you say the duplication itself causes a
lot of friction. For particularly hard cases, doing a replacement
implementation is an exceptional way out. What we need to find a
consensus on is how bad the problem in arch/arm/mach-*/ is:

1. No fundamental problem, just needs some care to clean up (your
   position, I guess), so we do do what we always do and keep doing
   gradual improvements, including treewide API changes.
2. Bad enough that starting a new competing implementation is easier
   because it lets us try different things more easily and reduce
   the number of treewide changes to all existing platforms.
   (this is where I think we are) Like IDE and OSS, the old code
   can still get improved and bug fixed, but concentrating on new
   code gives us better freedom to make progress more quickly.
3. In need of a complete replacement, like arch/ppc and a lot of
   drivers/staging. I'm not arguing that it's that bad.

	Arnd

	Arnd

  reply	other threads:[~2011-04-03 15:28 UTC|newest]

Thread overview: 159+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-17 18:30 [GIT PULL] omap changes for v2.6.39 merge window Tony Lindgren
2011-03-18  2:50 ` Linus Torvalds
2011-03-18  7:06   ` Tony Lindgren
2011-03-18 10:15   ` Russell King - ARM Linux
2011-03-18 11:13     ` Uwe Kleine-König
2011-03-30 17:06     ` Arnd Bergmann
2011-03-30 19:21       ` Linus Torvalds
2011-03-30 20:41         ` Nicolas Pitre
2011-03-30 21:02           ` Linus Torvalds
2011-03-30 23:31             ` Nicolas Pitre
2011-03-30 23:59               ` Russell King - ARM Linux
2011-03-31  0:15                 ` Tony Lindgren
2011-03-31  0:31               ` Bill Gatliff
2011-03-31  0:39               ` david
2011-03-31  3:17                 ` Nicolas Pitre
2011-03-31  3:29                   ` Dave Airlie
2011-03-31  4:38                     ` Nicolas Pitre
2011-03-31  9:54                       ` Alan Cox
2011-03-31 10:50                         ` Russell King - ARM Linux
2011-03-31 12:23                           ` Jean-Christophe PLAGNIOL-VILLARD
2011-03-31 12:38                           ` Catalin Marinas
2011-03-31 13:01                             ` Russell King - ARM Linux
2011-03-31 14:55                               ` Bill Gatliff
2011-04-01 12:41                                 ` Arnd Bergmann
2011-03-31 18:12                               ` Sam Ravnborg
2011-03-31 18:17                                 ` Russell King - ARM Linux
2011-03-31 18:34                                   ` Jesse Barnes
2011-03-31 13:54                           ` Thomas Gleixner
2011-03-31 17:22                           ` david
2011-03-31 18:08                             ` Koen Kooi
2011-03-31  5:05                   ` david
2011-03-31  7:15                     ` Nicolas Pitre
2011-03-31  8:06                       ` Ingo Molnar
2011-03-31  8:30                         ` Russell King - ARM Linux
2011-03-31 10:41                           ` Ingo Molnar
2011-03-31 13:25                             ` Russell King - ARM Linux
2011-03-31 12:04                           ` Thomas Gleixner
2011-03-31 14:43                             ` Kevin Hilman
2011-03-31 15:01                               ` Thomas Gleixner
2011-03-31 15:05                                 ` Russell King - ARM Linux
2011-03-31 15:45                                   ` david
2011-03-31 15:23                               ` Arnd Bergmann
2011-03-31 16:58                                 ` Thomas Gleixner
2011-03-31 18:23                                   ` Nicolas Pitre
2011-03-31 18:55                                     ` Thomas Gleixner
2011-04-01 11:32                                   ` Arnd Bergmann
2011-03-31 20:35                                 ` Kevin Hilman
2011-04-01 11:29                                   ` Arnd Bergmann
2011-04-01  7:32                                 ` Tomi Valkeinen
2011-04-01 11:22                                   ` Arnd Bergmann
2011-04-01 11:55                                     ` Tomi Valkeinen
2011-04-01 12:07                                       ` Arnd Bergmann
2011-04-01 12:15                                         ` Tomi Valkeinen
2011-03-31 16:03                           ` david
2011-03-31 16:45                             ` Russell King - ARM Linux
2011-03-31 17:17                               ` Linus Torvalds
2011-03-31 19:25                                 ` Nicolas Pitre
2011-03-31 20:05                                   ` Linus Torvalds
2011-03-31 20:28                                     ` Linus Torvalds
2011-03-31 22:49                                     ` Nicolas Pitre
2011-04-01  0:53                                       ` Mark Brown
2011-04-01  4:50                                       ` David Brown
2011-04-01  7:45                                         ` Ingo Molnar
2011-04-01 13:54                                           ` Arnd Bergmann
     [not found]                                             ` <4D95E112.4020400@vollmann.ch>
2011-04-01 14:59                                               ` Arnd Bergmann
2011-04-01 21:10                                                 ` Kevin Hilman
2011-04-01 21:32                                                   ` Arnd Bergmann
2011-04-01 21:51                                                     ` Catalin Marinas
     [not found]                                                 ` <4D95EF8E.9080902@vollmann.ch>
2011-04-01 15:50                                                   ` Arnd Bergmann
2011-04-01 17:44                                                     ` Russell King - ARM Linux
2011-04-01 19:54                                                     ` Nicolas Pitre
2011-04-01 21:00                                                       ` Uwe Kleine-König
2011-04-01 22:08                                                       ` Arnd Bergmann
2011-04-02  2:24                                                         ` Nicolas Pitre
2011-04-03 15:26                                                           ` Arnd Bergmann [this message]
2011-04-03 16:03                                                             ` Russell King - ARM Linux
2011-04-04  0:59                                                               ` Arnd Bergmann
2011-04-04  8:26                                                                 ` Marc Zyngier
2011-04-04 11:03                                                                 ` Catalin Marinas
2011-04-04 11:21                                                                   ` Russell King - ARM Linux
2011-04-04 13:24                                                                     ` Marc Zyngier
2011-04-04 13:31                                                                       ` Russell King - ARM Linux
2011-04-04 13:57                                                                         ` Marc Zyngier
2011-04-04 20:08                                                                           ` Linus Walleij
2011-04-05  6:40                                                                             ` Santosh Shilimkar
2011-04-05  7:45                                                                               ` Russell King - ARM Linux
2011-04-05 14:15                                                                                 ` Catalin Marinas
2011-04-05 22:16                                                                               ` Linus Walleij
2011-04-06  6:43                                                                                 ` Santosh Shilimkar
2011-04-05 22:22                                                                               ` Linus Walleij
2011-04-06  6:41                                                                                 ` Santosh Shilimkar
2011-04-05  7:30                                                                             ` Marc Zyngier
2011-05-26 13:38                                                               ` Pavel Machek
2011-04-02  2:59                                                       ` Mark Brown
2011-04-04  5:16                                                   ` Jean-Christophe PLAGNIOL-VILLARD
2011-04-04  9:27                                                   ` Nicolas Ferre
2011-04-03 22:18                                               ` Benjamin Herrenschmidt
2011-04-04  0:14                                                 ` Arnd Bergmann
2011-04-04  2:49                                                 ` Nicolas Pitre
2011-04-01 15:27                                             ` Will Deacon
2011-04-01 15:55                                               ` Arnd Bergmann
2011-04-01 16:39                                                 ` Linus Torvalds
2011-04-03 22:26                                                   ` Benjamin Herrenschmidt
2011-04-05 23:19                                                   ` Linus Walleij
2011-04-06  8:41                                                     ` Catalin Marinas
2011-04-07  1:44                                                       ` Arnd Bergmann
2011-04-01 20:19                                                 ` Nicolas Pitre
2011-04-02  4:38                                                   ` Richard Cochran
2011-04-02  3:27                                                 ` Mark Brown
2011-04-06  6:11                                             ` Barry Song
2011-04-06  7:31                                               ` Bryan Wu
2011-03-31 21:40                                   ` Thomas Gleixner
2011-03-31 17:56                             ` Nicolas Pitre
2011-03-31 18:34                               ` Thomas Gleixner
2011-03-31 19:02                               ` Linus Torvalds
2011-03-31  8:09                     ` Russell King - ARM Linux
2011-03-31 10:49                       ` Felipe Balbi
2011-03-31 18:00                       ` Alexander Holler
2011-03-31  5:45               ` Geert Uytterhoeven
2011-03-31  7:21                 ` Nicolas Pitre
2011-03-30 22:08           ` Tony Lindgren
2011-03-30 21:10         ` Thomas Gleixner
2011-03-30 21:54           ` Tony Lindgren
2011-03-30 22:25             ` Thomas Gleixner
2011-03-30 22:45               ` Tony Lindgren
2011-03-30 22:56                 ` Thomas Gleixner
2011-04-01  1:42                   ` Mark Brown
2011-03-30 22:38             ` Paul E. McKenney
2011-03-30 22:47               ` Tony Lindgren
2011-03-30 23:13                 ` Paul E. McKenney
2011-03-30 23:14                 ` Thomas Gleixner
2011-03-30 23:28                   ` Tony Lindgren
2011-03-31 11:00           ` Artem Bityutskiy
2011-03-31 13:54             ` Arnd Bergmann
2011-03-30 21:44         ` Tony Lindgren
2011-03-30 22:20           ` Linus Torvalds
2011-03-30 22:39             ` Tony Lindgren
2011-03-31  0:15         ` Russell King - ARM Linux
2011-03-31  0:55           ` Linus Torvalds
2011-03-31  1:15             ` Bill Gatliff
2011-03-31  1:37               ` Linus Torvalds
2011-03-31  1:44                 ` Bill Gatliff
2011-03-31  1:56                   ` Linus Torvalds
2011-03-31  2:20                     ` Bill Gatliff
2011-03-31  3:24                       ` Linus Torvalds
2011-03-31  6:42                         ` Olof Johansson
2011-03-31  6:56                         ` David Brown
2011-03-31 11:27                         ` Felipe Balbi
2011-03-31 13:39                 ` Thomas Gleixner
2011-03-31  4:09             ` Nicolas Pitre
2011-03-31 10:11               ` Thomas Gleixner
2011-03-30 21:07       ` Russell King - ARM Linux
2011-03-30 22:14         ` Tony Lindgren
2011-04-01  1:17           ` Mark Brown
2011-04-01 14:17         ` Arnd Bergmann
2011-03-18  3:02 ` Linus Torvalds
2011-03-18  7:09   ` Tony Lindgren
2011-03-18  8:06     ` Ohad Ben-Cohen
2011-03-18 23:43       ` Tony Lindgren

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=201104031726.37420.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=david@lang.hm \
    --cc=davidb@codeaurora.org \
    --cc=dv@vollmann.ch \
    --cc=hpa@zytor.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mingo@elte.hu \
    --cc=nico@fluxnic.net \
    --cc=tglx@linutronix.de \
    --cc=tony@atomide.com \
    --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