14 Jul, 2010

1 commit

  • via following scripts

    FILES=$(find * -type f | grep -vE 'oprofile|[^K]config')

    sed -i \
    -e 's/lmb/memblock/g' \
    -e 's/LMB/MEMBLOCK/g' \
    $FILES

    for N in $(find . -name lmb.[ch]); do
    M=$(echo $N | sed 's/lmb/memblock/g')
    mv $N $M
    done

    and remove some wrong change like lmbench and dlmb etc.

    also move memblock.c from lib/ to mm/

    Suggested-by: Ingo Molnar
    Acked-by: "H. Peter Anvin"
    Acked-by: Benjamin Herrenschmidt
    Acked-by: Linus Torvalds
    Signed-off-by: Yinghai Lu
    Signed-off-by: Benjamin Herrenschmidt

    Yinghai Lu
     

21 Jun, 2010

1 commit

  • The function begins and ends with a read_lock. The latter is changed to a
    read_unlock.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @locked@
    expression E1;
    position p;
    @@

    read_lock(E1@p,...);

    @r exists@
    expression x

    Signed-off-by: Julia Lawall
    Acked-by: Matt Fleming
    Signed-off-by: Paul Mundt

    Julia Lawall
     

18 May, 2010

2 commits


11 May, 2010

2 commits

  • The minimum section size for the PMB is 16M, so just always error
    out early if the specified size is too small. This permits us to
    unconditionally call in to pmb_bolt_mapping() with variable sizes
    without wasting a TLB and cache flush for the range.

    Signed-off-by: Paul Mundt

    Paul Mundt
     
  • This reworks much of the bootmem setup and initialization code allowing
    us to get rid of duplicate work between the NUMA and non-NUMA cases. The
    end result is that we end up with a much more flexible interface for
    supporting more complex topologies (fake NUMA, highmem, etc, etc.) which
    is entirely LMB backed. This is an incremental step for more NUMA work as
    well as gradually enabling migration off of bootmem entirely.

    Signed-off-by: Paul Mundt

    Paul Mundt
     

10 May, 2010

1 commit

  • This plugs in a memory init callback in the machvec to permit boards to
    wire up various bits of memory directly in to LMB. A generic machvec
    implementation is provided that simply wraps around the normal
    Kconfig-derived memory start/size.

    Signed-off-by: Paul Mundt

    Paul Mundt
     

26 Apr, 2010

5 commits


20 Apr, 2010

1 commit


19 Apr, 2010

1 commit


05 Apr, 2010

2 commits


02 Apr, 2010

1 commit

  • While the MMUCR.URB and ITLB/UTLB differentiation works fine for all SH-4
    and later TLBs, these features are absent on SH-3. This splits out
    local_flush_tlb_all() in to SH-4 and PTEAEX copies while restoring the
    old SH-3 one, subsequently fixing up the build.

    This will probably want some further reordering and tidying in the
    future, but that's out of scope at present.

    Signed-off-by: Paul Mundt

    Paul Mundt
     

30 Mar, 2010

1 commit

  • …it 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: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

29 Mar, 2010

1 commit


26 Mar, 2010

1 commit


23 Mar, 2010

3 commits

  • set_pmb_entry() is now only used by a function that is wrapped in #ifdef
    CONFIG_PM, so wrap set_pmb_entry() in CONFIG_PM too.

    Signed-off-by: Matt Fleming
    Signed-off-by: Paul Mundt

    Matt Fleming
     
  • Setting the TI in MMUCR causes all the TLB bits in MMUCR to be
    cleared. Unfortunately, the TLB wired bits are also cleared when setting
    the TI bit, causing any wired TLB entries to become unwired.

    Use local_flush_tlb_all() which implements TLB flushing in a safer
    manner by using the memory-mapped TLB registers. As each CPU has its own
    PMB the modifications in pmb_init() only affect the local CPU, so only
    flush the local CPU's TLB.

    Signed-off-by: Matt Fleming
    Signed-off-by: Paul Mundt

    Matt Fleming
     
  • flush_tlb_page() can be used to flush TLB entries that map executable
    pages. Therefore, we need to ensure that the ITLB is also flushed in
    local_flush_tlb_page().

    Signed-off-by: Matt Fleming
    Signed-off-by: Paul Mundt

    Matt Fleming
     

10 Mar, 2010

1 commit


08 Mar, 2010

1 commit


05 Mar, 2010

1 commit


04 Mar, 2010

1 commit

  • Presently we run in to issues with the MMU resetting the CPU when
    variable sized mappings are employed. This takes a slightly more
    aggressive approach to keeping the TLB and cache state sane before
    establishing the mappings in order to cut down on races observed on
    SMP configurations.

    At the same time, we bump the VMA range up to the 0xb000...0xc000 range,
    as there still seems to be some undocumented behaviour in setting up
    variable mappings in the 0xa000...0xb000 range, resulting in reset by the
    TLB.

    Signed-off-by: Paul Mundt

    Paul Mundt
     

03 Mar, 2010

2 commits

  • In the case of NUMA emulation when in range PPNs are being used for
    secondary nodes, we need to make sure that the PMB has a mapping for it
    before setting up the pgdat. This prevents the MMU from resetting.

    Signed-off-by: Paul Mundt

    Paul Mundt
     
  • When entries are being bolted unconditionally it's possible that the boot
    loader has established mappings that are within range that we don't want
    to clobber. Perform some basic validation to ensure that the new mapping
    is out of range before allowing the entry setup to take place.

    Signed-off-by: Paul Mundt

    Paul Mundt
     

02 Mar, 2010

5 commits

  • This moves the pmb_remap_caller() mapping logic out in to
    pmb_bolt_mapping(), which enables us to establish fixed mappings in
    places such as the NUMA code.

    Signed-off-by: Paul Mundt

    Paul Mundt
     
  • This plugs in an early_param for permitting transparent PMB-backed
    ioremapping to be enabled/disabled. For the time being, we use a
    default-disabled policy.

    Signed-off-by: Paul Mundt

    Paul Mundt
     
  • This implements a fairly significant overhaul of the dynamic PMB mapping
    code. The primary change here is that the PMB gets its own VMA that
    follows the uncached mapping and we attempt to be a bit more intelligent
    with dynamic sizing, multi-entry mapping, and so forth.

    Signed-off-by: Paul Mundt

    Paul Mundt
     
  • Paul Mundt
     
  • * 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (100 commits)
    ARM: Eliminate decompressor -Dstatic= PIC hack
    ARM: 5958/1: ARM: U300: fix inverted clk round rate
    ARM: 5956/1: misplaced parentheses
    ARM: 5955/1: ep93xx: move timer defines into core.c and document
    ARM: 5954/1: ep93xx: move gpio interrupt support to gpio.c
    ARM: 5953/1: ep93xx: fix broken build of clock.c
    ARM: 5952/1: ARM: MM: Add ARM_L1_CACHE_SHIFT_6 for handle inside each ARCH Kconfig
    ARM: 5949/1: NUC900 add gpio virtual memory map
    ARM: 5948/1: Enable timer0 to time4 clock support for nuc910
    ARM: 5940/2: ARM: MMCI: remove custom DBG macro and printk
    ARM: make_coherent(): fix problems with highpte, part 2
    MM: Pass a PTE pointer to update_mmu_cache() rather than the PTE itself
    ARM: 5945/1: ep93xx: include correct irq.h in core.c
    ARM: 5933/1: amba-pl011: support hardware flow control
    ARM: 5930/1: Add PKMAP area description to memory.txt.
    ARM: 5929/1: Add checks to detect overlap of memory regions.
    ARM: 5928/1: Change type of VMALLOC_END to unsigned long.
    ARM: 5927/1: Make delimiters of DMA area globally visibly.
    ARM: 5926/1: Add "Virtual kernel memory..." printout.
    ARM: 5920/1: OMAP4: Enable L2 Cache
    ...

    Fix up trivial conflict in arch/arm/mach-mx25/clock.c

    Linus Torvalds
     

01 Mar, 2010

1 commit


23 Feb, 2010

2 commits


21 Feb, 2010

1 commit

  • On VIVT ARM, when we have multiple shared mappings of the same file
    in the same MM, we need to ensure that we have coherency across all
    copies. We do this via make_coherent() by making the pages
    uncacheable.

    This used to work fine, until we allowed highmem with highpte - we
    now have a page table which is mapped as required, and is not available
    for modification via update_mmu_cache().

    Ralf Beache suggested getting rid of the PTE value passed to
    update_mmu_cache():

    On MIPS update_mmu_cache() calls __update_tlb() which walks pagetables
    to construct a pointer to the pte again. Passing a pte_t * is much
    more elegant. Maybe we might even replace the pte argument with the
    pte_t?

    Ben Herrenschmidt would also like the pte pointer for PowerPC:

    Passing the ptep in there is exactly what I want. I want that
    -instead- of the PTE value, because I have issue on some ppc cases,
    for I$/D$ coherency, where set_pte_at() may decide to mask out the
    _PAGE_EXEC.

    So, pass in the mapped page table pointer into update_mmu_cache(), and
    remove the PTE value, updating all implementations and call sites to
    suit.

    Includes a fix from Stephen Rothwell:

    sparc: fix fallout from update_mmu_cache API change

    Signed-off-by: Stephen Rothwell

    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Russell King

    Russell King
     

18 Feb, 2010

2 commits

  • This implements a bit of rework for the PMB code, which permits us to
    kill off the legacy PMB mode completely. Rather than trusting the boot
    loader to do the right thing, we do a quick verification of the PMB
    contents to determine whether to have the kernel setup the initial
    mappings or whether it needs to mangle them later on instead.

    If we're booting from legacy mappings, the kernel will now take control
    of them and make them match the kernel's initial mapping configuration.
    This is accomplished by breaking the initialization phase out in to
    multiple steps: synchronization, merging, and resizing. With the recent
    rework, the synchronization code establishes page links for compound
    mappings already, so we build on top of this for promoting mappings and
    reclaiming unused slots.

    At the same time, the changes introduced for the uncached helpers also
    permit us to dynamically resize the uncached mapping without any
    particular headaches. The smallest page size is more than sufficient for
    mapping all of kernel text, and as we're careful not to jump to any far
    off locations in the setup code the mapping can safely be resized
    regardless of whether we are executing from it or not.

    Signed-off-by: Paul Mundt

    Paul Mundt
     
  • The PMB code is an example of something that spends an absurd amount of
    time running uncached when only a couple of operations really need to be.
    This switches over to the shiny new uncached helpers, permitting us to
    spend far more time running cached.

    Additionally, MMUCR twiddling is perfectly safe from cached space given
    that it's paired with a control register barrier, so fix that up, too.

    Signed-off-by: Paul Mundt

    Paul Mundt