25 May, 2011

2 commits

  • Fold all the mmu_gather rework patches into one for submission

    Signed-off-by: Peter Zijlstra
    Reported-by: Hugh Dickins
    Cc: Benjamin Herrenschmidt
    Cc: David Miller
    Cc: Martin Schwidefsky
    Cc: Russell King
    Cc: Paul Mundt
    Cc: Jeff Dike
    Cc: Richard Weinberger
    Cc: Tony Luck
    Cc: KAMEZAWA Hiroyuki
    Cc: Mel Gorman
    Cc: KOSAKI Motohiro
    Cc: Nick Piggin
    Cc: Namhyung Kim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     
  • Architectures that implement their own show_mem() function did not pass
    the filter argument to show_free_areas() to appropriately avoid emitting
    the state of nodes that are disallowed in the current context. This patch
    now passes the filter argument to show_free_areas() so those nodes are now
    avoided.

    This patch also removes the show_free_areas() wrapper around
    __show_free_areas() and converts existing callers to pass an empty filter.

    ia64 emits additional information for each node, so skip_free_areas_zone()
    must be made global to filter disallowed nodes and it is converted to use
    a nid argument rather than a zone for this use case.

    Signed-off-by: David Rientjes
    Cc: Russell King
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: Kyle McMartin
    Cc: Helge Deller
    Cc: James Bottomley
    Cc: "David S. Miller"
    Cc: Guan Xuetao
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     

23 May, 2011

1 commit


21 Apr, 2011

1 commit

  • When a DISCONTIGMEM memory range is brought online as a NUMA node, it
    also needs to have its bet set in N_NORMAL_MEMORY. This is necessary for
    generic kernel code that utilizes N_NORMAL_MEMORY as a subset of N_ONLINE
    for memory savings.

    These types of hacks can hopefully be removed once DISCONTIGMEM is either
    removed or abstracted away from CONFIG_NUMA.

    Fixes a panic in the slub code which only initializes structures for
    N_NORMAL_MEMORY to save memory:

    Backtrace:
    [] add_partial+0x28/0x98
    [] __slab_free+0x1d0/0x1d8
    [] kmem_cache_free+0xc4/0x128
    [] ida_get_new_above+0x21c/0x2c0
    [] sysfs_new_dirent+0xd0/0x238
    [] create_dir+0x5c/0x168
    [] sysfs_create_dir+0x98/0x128
    [] kobject_add_internal+0x114/0x258
    [] kobject_add_varg+0x7c/0xa0
    [] kobject_add+0x50/0x90
    [] kobject_create_and_add+0x54/0xc8
    [] cgroup_init+0x138/0x1f0
    [] start_kernel+0x5a0/0x840
    [] start_parisc+0xa4/0xb8
    [] packet_ioctl+0x16c/0x208
    [] ip_mroute_setsockopt+0x260/0xf20

    Signed-off-by: David Rientjes
    Cc: stable@kernel.org
    Signed-off-by: James Bottomley

    David Rientjes
     

16 Apr, 2011

1 commit

  • Currently parisc has the whole kernel marked as RWX, meaning any
    kernel page at all is eligible to be executed. This can cause a
    theoretical problem on systems with combined I/D TLB because the act
    of referencing a page causes a TLB insertion with an executable bit.
    This TLB entry may be used by the CPU as the basis for speculating the
    page into the I-Cache. If this speculated page is subsequently used
    for a user process, there is the possibility we will get a stale
    I-cache line picked up as the binary executes.

    As a point of good practise, only mark actual kernel text pages as
    executable. The same has to be done for init_text pages, but they're
    converted to data pages (and the I-Cache flushed) when the init memory
    is released.

    Signed-off-by: James Bottomley

    James Bottomley
     

25 Mar, 2011

1 commit

  • Commit ddd588b5dd55 ("oom: suppress nodes that are not allowed from
    meminfo on oom kill") moved lib/show_mem.o out of lib/lib.a, which
    resulted in build warnings on all architectures that implement their own
    versions of show_mem():

    lib/lib.a(show_mem.o): In function `show_mem':
    show_mem.c:(.text+0x1f4): multiple definition of `show_mem'
    arch/sparc/mm/built-in.o:(.text+0xd70): first defined here

    The fix is to remove __show_mem() and add its argument to show_mem() in
    all implementations to prevent this breakage.

    Architectures that implement their own show_mem() actually don't do
    anything with the argument yet, but they could be made to filter nodes
    that aren't allowed in the current context in the future just like the
    generic implementation.

    Reported-by: Stephen Rothwell
    Reported-by: James Bottomley
    Suggested-by: Andrew Morton
    Signed-off-by: David Rientjes
    Signed-off-by: Linus Torvalds

    David Rientjes
     

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
     

28 Sep, 2009

1 commit

  • building kernel 2.6.32(pre), gives this compiler warning:
    /linus-linux-2.6/mm/vmalloc.c: In function 'pcpu_get_vm_areas':
    /linus-linux-2.6/mm/vmalloc.c:2104: warning: 'vmalloc_start' is used
    uninitialized in this function

    The reason is, that the code in mm/vmalloc defines a local variable called
    vmalloc_start, which is already defined as global variable in parisc's code.

    To avoid this kind of problems in future, I suggest to rename the parisc
    variable
    to parisc_vmalloc_start.

    Signed-off-by: Helge Deller
    Signed-off-by: Kyle McMartin

    Helge Deller
     

22 Sep, 2009

1 commit

  • Commit 96177299416dbccb73b54e6b344260154a445375 ("Drop free_pages()")
    modified nr_free_pages() to return 'unsigned long' instead of 'unsigned
    int'. This made the casts to 'unsigned long' in most callers superfluous,
    so remove them.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Geert Uytterhoeven
    Reviewed-by: Christoph Lameter
    Acked-by: Ingo Molnar
    Acked-by: Russell King
    Acked-by: David S. Miller
    Acked-by: Kyle McMartin
    Acked-by: WANG Cong
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Haavard Skinnemoen
    Cc: Mikael Starvik
    Cc: "Luck, Tony"
    Cc: Hirokazu Takata
    Cc: Ralf Baechle
    Cc: David Howells
    Acked-by: Benjamin Herrenschmidt
    Cc: Martin Schwidefsky
    Cc: Paul Mundt
    Cc: Chris Zankel
    Cc: Michal Simek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Geert Uytterhoeven
     

03 Jul, 2009

2 commits


31 Mar, 2009

1 commit

  • This patch fixes a long outstanding bug on 32bit parisc linux kernels
    which prevented us from using 32bit PTE table entries (instead of 64bit
    entries of which 32bit were unused).

    The problem was caused by this assembler statement in the L2_ptep
    macro in arch/parisc/kernel/entry.S:447:
    EXTR \va,31-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index
    which expanded to
    extrw,u r8,9,11,r1
    and which has undefined behavior since the length value (11) extends
    beyond the leftmost bit (11-1 > 9).
    Interestingly PA2.0 processors seem to don't care and just zero-extend
    the value, while PA1.1 processors don't.

    Fix this problem by detecting an address space overflow with ASM_BITS_PER_PGD
    and adjusting it accordingly. To prevent such problems in the future,
    some compile time sanity checks in arch/parisc/mm/init.c were added.

    Since the page table now only consumes half of it's old size, we can
    use the freed memory to harmonize 32- and 64bit kernels and let both
    map 16MB for the initial page table.

    Signed-off-by: Helge Deller
    Signed-off-by: Kyle McMartin

    Helge Deller
     

13 Mar, 2009

1 commit


25 Jul, 2008

2 commits

  • free_area_init_node() gets passed in the node id as well as the node
    descriptor. This is redundant as the function can trivially get the node
    descriptor itself by means of NODE_DATA() and the node's id.

    I checked all the users and NODE_DATA() seems to be usable everywhere
    from where this function is called.

    Signed-off-by: Johannes Weiner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     
  • There are a lot of places that define either a single bootmem descriptor or an
    array of them. Use only one central array with MAX_NUMNODES items instead.

    Signed-off-by: Johannes Weiner
    Acked-by: Ralf Baechle
    Cc: Ingo Molnar
    Cc: Richard Henderson
    Cc: Russell King
    Cc: Tony Luck
    Cc: Hirokazu Takata
    Cc: Geert Uytterhoeven
    Cc: Kyle McMartin
    Cc: Paul Mackerras
    Cc: Paul Mundt
    Cc: David S. Miller
    Cc: Yinghai Lu
    Cc: Christoph Lameter
    Cc: Mel Gorman
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     

26 Jun, 2008

1 commit


13 Jun, 2008

1 commit


16 May, 2008

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6:
    arch/parisc/kernel/perf_asm.S: build fix
    parisc: remove -traditional from assembler flags
    parisc: use conditional macro for 64-bit wide ops
    parisc: Remove ioctl.h content picked up from .
    arch/parisc/kernel/unaligned.c: use time_* macros
    parisc: remove redundant display of free swap space in show_mem()
    drivers/parisc: replace remaining __FUNCTION__ occurrences
    parisc: replace remaining __FUNCTION__ occurrences
    parisc: new termios definitions
    parisc: fix trivial section name warnings

    Linus Torvalds
     

15 May, 2008

1 commit

  • show_mem() has no need to print the amount of free swap space manually because
    show_free_areas() does this already and is called by the former.

    The two outputs only differ in text formatting:

    printk("Free swap = %lukB\n", ...);
    printk("Free swap: %6ldkB\n", ...);

    Signed-off-by: Johannes Weiner
    Cc: Kyle McMartin
    Cc: Matthew Wilcox
    Cc: Grant Grundler
    Signed-off-by: Andrew Morton
    Signed-off-by: Kyle McMartin

    Johannes Weiner
     

13 May, 2008

1 commit

  • PA-RISC to aid debugging prints out the zonelists setup by the system. A
    bad call to node_zonelist() breaks at compile-time. This patch fixes it.

    Signed-off-by: Mel Gorman
    Cc: Christoph Lameter
    Cc: Lee Schermerhorn
    Cc: Kyle McMartin
    Cc: Grant Grundler
    Cc: James Bottomley
    Cc: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mel Gorman
     

28 Apr, 2008

2 commits

  • Filtering zonelists requires very frequent use of zone_idx(). This is costly
    as it involves a lookup of another structure and a substraction operation. As
    the zone_idx is often required, it should be quickly accessible. The node idx
    could also be stored here if it was found that accessing zone->node is
    significant which may be the case on workloads where nodemasks are heavily
    used.

    This patch introduces a struct zoneref to store a zone pointer and a zone
    index. The zonelist then consists of an array of these struct zonerefs which
    are looked up as necessary. Helpers are given for accessing the zone index as
    well as the node index.

    [kamezawa.hiroyu@jp.fujitsu.com: Suggested struct zoneref instead of embedding information in pointers]
    [hugh@veritas.com: mm-have-zonelist: fix memcg ooms]
    [hugh@veritas.com: just return do_try_to_free_pages]
    [hugh@veritas.com: do_try_to_free_pages gfp_mask redundant]
    Signed-off-by: Mel Gorman
    Acked-by: Christoph Lameter
    Acked-by: David Rientjes
    Signed-off-by: Lee Schermerhorn
    Cc: KAMEZAWA Hiroyuki
    Cc: Mel Gorman
    Cc: Christoph Lameter
    Cc: Nick Piggin
    Signed-off-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mel Gorman
     
  • Currently a node has two sets of zonelists, one for each zone type in the
    system and a second set for GFP_THISNODE allocations. Based on the zones
    allowed by a gfp mask, one of these zonelists is selected. All of these
    zonelists consume memory and occupy cache lines.

    This patch replaces the multiple zonelists per-node with two zonelists. The
    first contains all populated zones in the system, ordered by distance, for
    fallback allocations when the target/preferred node has no free pages. The
    second contains all populated zones in the node suitable for GFP_THISNODE
    allocations.

    An iterator macro is introduced called for_each_zone_zonelist() that interates
    through each zone allowed by the GFP flags in the selected zonelist.

    Signed-off-by: Mel Gorman
    Acked-by: Christoph Lameter
    Signed-off-by: Lee Schermerhorn
    Cc: KAMEZAWA Hiroyuki
    Cc: Mel Gorman
    Cc: Christoph Lameter
    Cc: Hugh Dickins
    Cc: Nick Piggin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mel Gorman
     

08 Feb, 2008

1 commit

  • This patchset adds a flags variable to reserve_bootmem() and uses the
    BOOTMEM_EXCLUSIVE flag in crashkernel reservation code to detect collisions
    between crashkernel area and already used memory.

    This patch:

    Change the reserve_bootmem() function to accept a new flag BOOTMEM_EXCLUSIVE.
    If that flag is set, the function returns with -EBUSY if the memory already
    has been reserved in the past. This is to avoid conflicts.

    Because that code runs before SMP initialisation, there's no race condition
    inside reserve_bootmem_core().

    [akpm@linux-foundation.org: coding-style fixes]
    [akpm@linux-foundation.org: fix powerpc build]
    Signed-off-by: Bernhard Walle
    Cc:
    Cc: "Eric W. Biederman"
    Cc: Vivek Goyal
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bernhard Walle
     

18 Oct, 2007

1 commit


23 May, 2007

1 commit


27 Feb, 2007

1 commit

  • * master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6: (78 commits)
    [PARISC] Use symbolic last syscall in __NR_Linux_syscalls
    [PARISC] Add missing statfs64 and fstatfs64 syscalls
    Revert "[PARISC] Optimize TLB flush on SMP systems"
    [PARISC] Compat signal fixes for 64-bit parisc
    [PARISC] Reorder syscalls to match unistd.h
    Revert "[PATCH] make kernel/signal.c:kill_proc_info() static"
    [PARISC] fix sys_rt_sigqueueinfo
    [PARISC] fix section mismatch warnings in harmony sound driver
    [PARISC] do not export get_register/set_register
    [PARISC] add ENTRY()/ENDPROC() and simplify assembly of HP/UX emulation code
    [PARISC] convert to use CONFIG_64BIT instead of __LP64__
    [PARISC] use CONFIG_64BIT instead of __LP64__
    [PARISC] add ASM_EXCEPTIONTABLE_ENTRY() macro
    [PARISC] more ENTRY(), ENDPROC(), END() conversions
    [PARISC] fix ENTRY() and ENDPROC() for 64bit-parisc
    [PARISC] Fixes /proc/cpuinfo cache output on B160L
    [PARISC] implement standard ENTRY(), END() and ENDPROC()
    [PARISC] kill ENTRY_SYS_CPUS
    [PARISC] clean up debugging printks in smp.c
    [PARISC] factor syscall_restart code out of do_signal
    ...

    Fix conflict in include/linux/sched.h due to kill_proc_info() being made
    publicly available to PARISC again.

    Linus Torvalds
     

17 Feb, 2007

1 commit


13 Feb, 2007

2 commits


12 Feb, 2007

1 commit


08 Dec, 2006

3 commits


04 Oct, 2006

1 commit


26 Sep, 2006

2 commits

  • There are many places where we need to determine the node of a zone.
    Currently we use a difficult to read sequence of pointer dereferencing.
    Put that into an inline function and use throughout VM. Maybe we can find
    a way to optimize the lookup in the future.

    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     
  • Fix array initialization in lots of arches

    The number of zones may now be reduced from 4 to 2 for many arches. Fix the
    array initialization for the zones array for all architectures so that it is
    not initializing a fixed number of elements.

    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

02 Jul, 2006

1 commit


01 Jul, 2006

1 commit


22 Apr, 2006

1 commit

  • More work towards supporing multiple page sizes on 64-bit. Convert
    some assumptions that 64bit uses 3 level page tables into testing
    PT_NLEVELS. Also some BUG() to BUG_ON() conversions and some cleanups
    to assembler.

    Signed-off-by: Helge Deller
    Signed-off-by: Kyle McMartin

    Helge Deller
     

31 Mar, 2006

1 commit