public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: David Howells <dhowells@redhat.com>
Cc: paul.gortmaker@windriver.com, hpa@zytor.com,
	torvalds@linux-foundation.org, sfr@canb.auug.org.au,
	mingo@redhat.com, tglx@linutronix.de,
	linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Subject: Re: [RFC][PATCH 00/29] Disintegrate and kill asm/system.h
Date: Wed, 7 Mar 2012 21:46:51 +0000	[thread overview]
Message-ID: <201203072146.51494.arnd@arndb.de> (raw)
In-Reply-To: <20120307194548.15987.36073.stgit@warthog.procyon.org.uk>

On Wednesday 07 March 2012, David Howells wrote:
> Here are a bunch of patches to disintegrate asm/system.h into a set of separate
> bits to relieve the problem of circular inclusion dependencies.
>
> The reason for this is that I recently encountered a circular dependency
> problem that came about when I produced some patches to optimise get_order() by
> rewriting it to use ilog2().  This uses bitops - and on the SH arch
> asm/bitops.h drags in asm-generic/get_order.h by a circuituous route involving
> asm/system.h.
>
> The main difficulty seems to be asm/system.h.  It holds a number of low level
> bits with no/few dependencies that are commonly used (eg. memory barriers) and
> a number of bits with more dependencies that aren't used in many places
> (eg. switch_to()).

Excellent series!

One part you were missing seems to be include/asm-generic/system.h, which is used
on openrisc and contains a lot of the things you move to other places. It
would be helpful to split that up as well.

>These patches break asm/system.h up into the following core pieces:
>
>     (1) asm/barrier.h
>
>         Move memory barriers here.  This already done for MIPS and Alpha.
>
>     (2) asm/switch_to.h
>
>         Move switch_to() and related stuff here.
>
>     (3) asm/exec.h
>
>         Move arch_align_stack() here.  Other process execution related bits
>         could perhaps go here from asm/processor.h.
>
>     (4) asm/atomic.h
>
>         Move xchg() and cmpxchg() here as they're full word atomic ops and
>         frequently used by atomic_xchg() and atomic_cmpxchg().

Well, the thing with xchg and cmpxchg is that they operate on arbirary-sized
integers, not atomic_t, unlike everything else in atomic.h.

Some architectures already have an asm/cmpxchg.h, which seems more appropriate
here.

>     (5) asm/bug.h
>
>         Move die() and related bits.
>
>     (6) asm/auxvec.h
>
>         Move AT_VECTOR_SIZE_ARCH here.

These two look suboptimal, but I don't have a better idea either.

> These patches are somewhat inside-out.  They start by removing all the
> inclusions of asm/system.h and then patching up the core files to include the
> right headers and then patching up each arch.  Whilst that's the easiest for
> actually performing this task (as I can use the compiler to find breakages more
> easily), it does mean that the patchset is not bisectable as all arches will be
> broken for a greater or lesser span.
> 
> I'm not sure what's the best way to get around that.  Possibly by rearranging
> things so each arch's asm/system.h is split up, leaving just a file with a
> bunch of #includes - and then delete them all later.  That might not work,
> however, as it may lead to circular deps until asm/system.h is no longer used.
> 

How about adding a '-include asm/system.h' gcc switch for each architecture
in one patch in the beginning, so that the header becomes included all the
time, but then remove that for each arch you go through?

	Arnd

  parent reply	other threads:[~2012-03-07 21:47 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-07 19:45 [RFC][PATCH 00/29] Disintegrate and kill asm/system.h David Howells
2012-03-07 19:46 ` [PATCH 01/29] Move all declarations of free_initmem() to linux/mm.h David Howells
2012-03-07 19:46 ` [PATCH 02/29] Remove all #inclusions of asm/system.h David Howells
2012-03-07 19:46 ` [PATCH 03/29] Disintegrate asm/system.h on all arches David Howells
2012-03-07 19:46 ` [PATCH 04/29] " David Howells
2012-03-07 21:47   ` Arnd Bergmann
2012-03-07 19:46 ` [PATCH 05/29] Disintegrate asm/system.h for ARM David Howells
2012-03-07 19:47 ` [PATCH 06/29] Disintegrate asm/system.h for AVR32 David Howells
2012-03-07 19:47 ` [PATCH 07/29] Disintegrate asm/system.h for Blackfin David Howells
2012-03-07 19:47 ` [PATCH 08/29] Disintegrate asm/system.h for C6X David Howells
2012-03-07 21:28   ` Mark Salter
2012-03-07 21:36     ` David Howells
2012-03-07 21:43       ` Mark Salter
2012-03-07 22:42         ` David Howells
2012-03-07 22:52           ` Mark Salter
2012-03-07 21:44       ` Mark Salter
2012-03-07 19:47 ` [PATCH 09/29] Disintegrate asm/system.h for CRIS David Howells
2012-03-09 12:56   ` Jesper Nilsson
2012-03-07 19:47 ` [PATCH 10/29] Disintegrate asm/system.h for FRV David Howells
2012-03-07 19:47 ` [PATCH 11/29] Disintegrate asm/system.h for H8300 David Howells
2012-03-07 19:48 ` [PATCH 12/29] Disintegrate asm/system.h for Hexagon David Howells
2012-03-07 19:48 ` [PATCH 13/29] Disintegrate asm/system.h for IA64 David Howells
2012-03-07 19:48 ` [PATCH 14/29] Disintegrate asm/system.h for M32R David Howells
2012-03-07 19:48 ` [PATCH 15/29] Disintegrate asm/system.h for M68K David Howells
2012-03-07 19:48 ` [PATCH 16/29] Disintegrate asm/system.h for Microblaze David Howells
2012-03-07 19:49 ` [PATCH 17/29] Disintegrate asm/system.h for MIPS David Howells
2012-03-07 19:49 ` [PATCH 18/29] Disintegrate asm/system.h for MN10300 David Howells
2012-03-07 19:49 ` [PATCH 19/29] Disintegrate asm/system.h for OpenRISC David Howells
2012-03-07 19:49 ` [PATCH 20/29] Disintegrate asm/system.h for PA-RISC David Howells
2012-03-07 19:49 ` [PATCH 21/29] Disintegrate asm/system.h for PowerPC David Howells
2012-03-12 20:38   ` Benjamin Herrenschmidt
2012-03-07 19:50 ` [PATCH 22/29] Disintegrate asm/system.h for S390 David Howells
2012-03-08 11:18   ` Martin Schwidefsky
2012-03-12 23:40     ` David Howells
2012-03-07 19:50 ` [PATCH 23/29] Disintegrate asm/system.h for Score David Howells
2012-03-07 19:50 ` [PATCH 24/29] Disintegrate asm/system.h for SH David Howells
2012-03-07 19:50 ` [PATCH 25/29] Disintegrate asm/system.h for Sparc David Howells
2012-03-07 19:50 ` [PATCH 26/29] Disintegrate asm/system.h for Tile David Howells
2012-03-09 21:14   ` Chris Metcalf
2012-03-07 19:50 ` [PATCH 27/29] Disintegrate asm/system.h for Unicore32 David Howells
2012-03-07 19:51 ` [PATCH 28/29] Disintegrate asm/system.h for X86 David Howells
2012-03-07 19:51 ` [PATCH 29/29] Disintegrate asm/system.h for Xtensa David Howells
2012-03-07 21:46 ` Arnd Bergmann [this message]
2012-03-07 22:40   ` [RFC][PATCH 00/29] Disintegrate and kill asm/system.h David Howells
2012-03-07 22:59     ` Arnd Bergmann
2012-03-08 18:43 ` Paul Gortmaker
2012-03-08 21:51   ` David Howells

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=201203072146.51494.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=dhowells@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=sfr@canb.auug.org.au \
    --cc=tglx@linutronix.de \
    --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