1. 30 Mar, 2010 2 commits
    • Tejun Heo's avatar
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo authored
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Guess-its-ok-by: default avatarChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
    • Tejun Heo's avatar
      x86: don't include slab.h from arch/x86/include/asm/pgtable_32.h · 57f4c226
      Tejun Heo authored
      
      
      Including slab.h from x86 pgtable_32.h creates a troublesome
      dependency chain w/ ftrace enabled.  The following chain leads to
      inclusion of pgtable_32.h from define_trace.h.
      
       trace/define_trace.h
       trace/ftrace.h
       linux/ftrace_event.h
       linux/ring_buffer.h
       linux/mm.h
       asm/pgtable.h
       asm/pgtable_32.h
      
      slab.h itself defines trace hooks via
      
       linux/sl[aou]b_def.h
       linux/kmemtrace.h
       trace/events/kmem.h
      
      If slab.h is not included before define_trace.h is included, this
      leads to duplicate definitions of kmemtrace hooks or other include
      dependency problems.
      
      pgtable_32.h doesn't need slab.h to begin with.  Don't include it from
      there.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
      Acked-by: default avatarChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: H. Peter Anvin <hpa@zytor.com>
      57f4c226
  2. 29 Mar, 2010 2 commits
  3. 28 Mar, 2010 1 commit
  4. 27 Mar, 2010 1 commit
  5. 25 Mar, 2010 4 commits
  6. 24 Mar, 2010 4 commits
  7. 23 Mar, 2010 11 commits
  8. 22 Mar, 2010 10 commits
  9. 20 Mar, 2010 2 commits
    • Russell King's avatar
      ARM: Update mach-types · 48edcfcf
      Russell King authored
      
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      48edcfcf
    • Russell King's avatar
      ARM: Fix IXP23xx build error in mach/memory.h · 0372c380
      Russell King authored
      
      
      One to many close parens.
      
      In file included from arch/arm/include/asm/page.h:202,
                       from include/linux/mm_types.h:15,
                       from include/linux/sched.h:63,
                       from arch/arm/kernel/asm-offsets.c:13:
      arch/arm/include/asm/memory.h: In function 'virt_to_bus':
      arch/arm/include/asm/memory.h:214: error: expected ';' before ')' token
      arch/arm/include/asm/memory.h:214: error: expected statement before ')' token
      arch/arm/include/asm/memory.h: In function 'bus_to_virt':
      arch/arm/include/asm/memory.h:219: error: expected ';' before ')' token
      arch/arm/include/asm/memory.h:219: error: expected statement before ')' token
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      0372c380
  10. 19 Mar, 2010 3 commits
    • Andreas Herrmann's avatar
      x86, amd: Restrict usage of c1e_idle() · 035a02c1
      Andreas Herrmann authored
      
      
      Currently c1e_idle returns true for all CPUs greater than or equal to
      family 0xf model 0x40. This covers too many CPUs.
      
      Meanwhile a respective erratum for the underlying problem was filed
      (#400). This patch adds the logic to check whether erratum #400
      applies to a given CPU.
      Especially for CPUs where SMI/HW triggered C1e is not supported,
      c1e_idle() doesn't need to be used. We can check this by looking at
      the respective OSVW bit for erratum #400.
      
      Cc: <stable@kernel.org> # .32.x .33.x
      Signed-off-by: default avatarAndreas Herrmann <andreas.herrmann3@amd.com>
      LKML-Reference: <20100319110922.GA19614@alberich.amd.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      035a02c1
    • FUJITA Tomonori's avatar
      powerpc: Remove IOMMU_VMERGE config option · 191aee58
      FUJITA Tomonori authored
      
      
      The description says:
      
       Cause IO segments sent to a device for DMA to be merged virtually
       by the IOMMU when they happen to have been allocated contiguously.
       This doesn't add pressure to the IOMMU allocator. However, some
       drivers don't support getting large merged segments coming back
       from *_map_sg().
      
       Most drivers don't have this problem; it is safe to say Y here.
      
      It's out of date. Long ago, drivers didn't have a way to tell IOMMUs
      about their segment length limit (that is, the maximum segment length
      that they can handle). So IOMMUs merged as many segments as possible
      and gave too large segments to drivers.
      
      dma_get_max_seg_size() was introduced to solve the above
      problem. Device drives can use the API to tell IOMMU about the maximum
      segment length that they can handle. In addition, the default limit
      (64K) should be safe for everyone.
      
      So this config option seems to be unnecessary.
      
      Note that this config option just enables users to disable the virtual
      merging by default. Users can still disable the virtual merging by the
      boot parameter.
      Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      191aee58
    • FUJITA Tomonori's avatar
      powerpc: Fix swiotlb to respect the boot option · a9327296
      FUJITA Tomonori authored
      
      
      powerpc initializes swiotlb before parsing the kernel boot options so
      swiotlb options (e.g. specifying the swiotlb buffer size) are ignored.
      
      Any time before freeing bootmem works for swiotlb so this patch moves
      powerpc's swiotlb initialization after parsing the kernel boot
      options, mem_init (as x86 does).
      Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Tested-by: default avatarBecky Bruce <beckyb@kernel.crashing.org>
      Tested-by: default avatarAlbert Herranz <albert_herranz@yahoo.es>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      a9327296