01 Jun, 2012

1 commit

  • Pull second pile of signal handling patches from Al Viro:
    "This one is just task_work_add() series + remaining prereqs for it.

    There probably will be another pull request from that tree this
    cycle - at least for helpers, to get them out of the way for per-arch
    fixes remaining in the tree."

    Fix trivial conflict in kernel/irq/manage.c: the merge of Andrew's pile
    had brought in commit 97fd75b7b8e0 ("kernel/irq/manage.c: use the
    pr_foo() infrastructure to prefix printks") which changed one of the
    pr_err() calls that this merge moves around.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal:
    keys: kill task_struct->replacement_session_keyring
    keys: kill the dummy key_replace_session_keyring()
    keys: change keyctl_session_to_parent() to use task_work_add()
    genirq: reimplement exit_irq_thread() hook via task_work_add()
    task_work_add: generic process-context callbacks
    avr32: missed _TIF_NOTIFY_RESUME on one of do_notify_resume callers
    parisc: need to check NOTIFY_RESUME when exiting from syscall
    move key_repace_session_keyring() into tracehook_notify_resume()
    TIF_NOTIFY_RESUME is defined on all targets now

    Linus Torvalds
     

26 May, 2012

2 commits

  • Pull tile updates from Chris Metcalf:
    "These changes cover a range of new arch/tile features and
    optimizations. They've been through LKML review and on linux-next for
    a month or so. There's also one bug-fix that just missed 3.4, which
    I've marked for stable."

    Fixed up trivial conflict in arch/tile/Kconfig (new added tile Kconfig
    entries clashing with the generic timer/clockevents changes).

    * git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
    tile: default to tilegx_defconfig for ARCH=tile
    tile: fix bug where fls(0) was not returning 0
    arch/tile: mark TILEGX as not EXPERIMENTAL
    tile/mm/fault.c: Port OOM changes to handle_page_fault
    arch/tile: add descriptive text if the kernel reports a bad trap
    arch/tile: allow querying cpu module information from the hypervisor
    arch/tile: fix hardwall for tilegx and generalize for idn and ipi
    arch/tile: support multiple huge page sizes dynamically
    mm: add new arch_make_huge_pte() method for tile support
    arch/tile: support kexec() for tilegx
    arch/tile: support header for cacheflush() syscall
    arch/tile: Allow tilegx to build with either 16K or 64K page size
    arch/tile: optimize get_user/put_user and friends
    arch/tile: support building big-endian kernel
    arch/tile: allow building Linux with transparent huge pages enabled
    arch/tile: use interrupt critical sections less

    Linus Torvalds
     
  • The hardwall drain code was not properly implemented for tilegx,
    just tilepro, so you couldn't reliably restart an application that
    made use of the udn.

    In addition, the code was only applicable to the udn (user dynamic
    network). On tilegx there is a second user network that is available
    (the "idn"), and there is support for having I/O shims deliver
    user-level interrupts to applications ("ipi") which functions in a
    very similar way to the inter-core permissions used for udn/idn.
    So this change also generalizes the code from supporting just the udn
    to supports udn/idn/ipi on tilegx.

    By default we now use /dev/hardwall/{udn,idn,ipi} with separate
    minor numbers for the three devices.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     

24 May, 2012

1 commit


22 May, 2012

1 commit

  • Pull smp hotplug cleanups from Thomas Gleixner:
    "This series is merily a cleanup of code copied around in arch/* and
    not changing any of the real cpu hotplug horrors yet. I wish I'd had
    something more substantial for 3.5, but I underestimated the lurking
    horror..."

    Fix up trivial conflicts in arch/{arm,sparc,x86}/Kconfig and
    arch/sparc/include/asm/thread_info_32.h

    * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (79 commits)
    um: Remove leftover declaration of alloc_task_struct_node()
    task_allocator: Use config switches instead of magic defines
    sparc: Use common threadinfo allocator
    score: Use common threadinfo allocator
    sh-use-common-threadinfo-allocator
    mn10300: Use common threadinfo allocator
    powerpc: Use common threadinfo allocator
    mips: Use common threadinfo allocator
    hexagon: Use common threadinfo allocator
    m32r: Use common threadinfo allocator
    frv: Use common threadinfo allocator
    cris: Use common threadinfo allocator
    x86: Use common threadinfo allocator
    c6x: Use common threadinfo allocator
    fork: Provide kmemcache based thread_info allocator
    tile: Use common threadinfo allocator
    fork: Provide weak arch_release_[task_struct|thread_info] functions
    fork: Move thread info gfp flags to header
    fork: Remove the weak insanity
    sh: Remove cpu_idle_wait()
    ...

    Linus Torvalds
     

17 May, 2012

1 commit

  • First, we were at risk of handling thread-info flags, in particular
    do_signal(), when returning from kernel space. This could happen
    after a failed kernel_execve(), or when forking a kernel thread.
    The fix is to test in do_work_pending() for user_mode() and return
    immediately if so; we already had this test for one of the flags,
    so I just hoisted it to the top of the function.

    Second, if a ptraced process updated the callee-saved registers
    in the ptregs struct and then processed another thread-info flag, we
    would overwrite the modifications with the original callee-saved
    registers. To fix this, we add a register to note if we've already
    saved the registers once, and skip doing it on additional passes
    through the loop. To avoid a performance hit from the couple of
    extra instructions involved, I modified the GET_THREAD_INFO() macro
    to be guaranteed to be one instruction, then bundled it with adjacent
    instructions, yielding an overall net savings.

    Reported-By: Al Viro
    Signed-off-by: Chris Metcalf

    Chris Metcalf
     

08 May, 2012

1 commit


03 Apr, 2012

1 commit


02 Apr, 2012

1 commit

  • Commit bd119c69239322caafdb64517a806037d0d0c70a

    "Disintegrate asm/system.h for Tile"

    created the asm/switch_to.h file, but did not add an include
    of it to all its users.

    Also, commit b4816afa3986704d1404fc48e931da5135820472

    "Move the asm-generic/system.h xchg() implementation to asm-generic/cmpxchg.h"

    introduced the concept of asm/cmpxchg.h but the tile arch
    never got one. Fork the cmpxchg content out of the asm/atomic.h
    file to create one.

    Acked-by: David Howells
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Chris Metcalf

    Paul Gortmaker
     

29 Mar, 2012

1 commit


01 Mar, 2012

1 commit


12 Dec, 2011

3 commits

  • Those two APIs were provided to optimize the calls of
    tick_nohz_idle_enter() and rcu_idle_enter() into a single
    irq disabled section. This way no interrupt happening in-between would
    needlessly process any RCU job.

    Now we are talking about an optimization for which benefits
    have yet to be measured. Let's start simple and completely decouple
    idle rcu and dyntick idle logics to simplify.

    Signed-off-by: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Peter Zijlstra
    Reviewed-by: Josh Triplett
    Signed-off-by: Paul E. McKenney

    Frederic Weisbecker
     
  • It is assumed that rcu won't be used once we switch to tickless
    mode and until we restart the tick. However this is not always
    true, as in x86-64 where we dereference the idle notifiers after
    the tick is stopped.

    To prepare for fixing this, add two new APIs:
    tick_nohz_idle_enter_norcu() and tick_nohz_idle_exit_norcu().

    If no use of RCU is made in the idle loop between
    tick_nohz_enter_idle() and tick_nohz_exit_idle() calls, the arch
    must instead call the new *_norcu() version such that the arch doesn't
    need to call rcu_idle_enter() and rcu_idle_exit().

    Otherwise the arch must call tick_nohz_enter_idle() and
    tick_nohz_exit_idle() and also call explicitly:

    - rcu_idle_enter() after its last use of RCU before the CPU is put
    to sleep.
    - rcu_idle_exit() before the first use of RCU after the CPU is woken
    up.

    Signed-off-by: Frederic Weisbecker
    Cc: Mike Frysinger
    Cc: Guan Xuetao
    Cc: David Miller
    Cc: Chris Metcalf
    Cc: Hans-Christian Egtvedt
    Cc: Ralf Baechle
    Cc: Paul E. McKenney
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: H. Peter Anvin
    Cc: Russell King
    Cc: Paul Mackerras
    Cc: Heiko Carstens
    Cc: Paul Mundt
    Signed-off-by: Paul E. McKenney

    Frederic Weisbecker
     
  • The tick_nohz_stop_sched_tick() function, which tries to delay
    the next timer tick as long as possible, can be called from two
    places:

    - From the idle loop to start the dytick idle mode
    - From interrupt exit if we have interrupted the dyntick
    idle mode, so that we reprogram the next tick event in
    case the irq changed some internal state that requires this
    action.

    There are only few minor differences between both that
    are handled by that function, driven by the ts->inidle
    cpu variable and the inidle parameter. The whole guarantees
    that we only update the dyntick mode on irq exit if we actually
    interrupted the dyntick idle mode, and that we enter in RCU extended
    quiescent state from idle loop entry only.

    Split this function into:

    - tick_nohz_idle_enter(), which sets ts->inidle to 1, enters
    dynticks idle mode unconditionally if it can, and enters into RCU
    extended quiescent state.

    - tick_nohz_irq_exit() which only updates the dynticks idle mode
    when ts->inidle is set (ie: if tick_nohz_idle_enter() has been called).

    To maintain symmetry, tick_nohz_restart_sched_tick() has been renamed
    into tick_nohz_idle_exit().

    This simplifies the code and micro-optimize the irq exit path (no need
    for local_irq_save there). This also prepares for the split between
    dynticks and rcu extended quiescent state logics. We'll need this split to
    further fix illegal uses of RCU in extended quiescent states in the idle
    loop.

    Signed-off-by: Frederic Weisbecker
    Cc: Mike Frysinger
    Cc: Guan Xuetao
    Cc: David Miller
    Cc: Chris Metcalf
    Cc: Hans-Christian Egtvedt
    Cc: Ralf Baechle
    Cc: Paul E. McKenney
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: H. Peter Anvin
    Cc: Russell King
    Cc: Paul Mackerras
    Cc: Heiko Carstens
    Cc: Paul Mundt
    Signed-off-by: Paul E. McKenney
    Reviewed-by: Josh Triplett

    Frederic Weisbecker
     

13 May, 2011

1 commit

  • This support was partially present in the existing code (look for
    "__tilegx__" ifdefs) but with this change you can build a working
    kernel using the TILE-Gx toolchain and ARCH=tilegx.

    Most of these files are new, generally adding a foo_64.c file
    where previously there was just a foo_32.c file.

    The ARCH=tilegx directive redirects to arch/tile, not arch/tilegx,
    using the existing SRCARCH mechanism in the top-level Makefile.

    Changes to existing files:

    - and changed to factor the
    include of in the common header.

    - and arch/tile/kernel/compat.c changed to remove
    the "const" markers I had put on compat_sys_execve() when trying
    to match some recent similar changes to the non-compat execve.
    It turns out the compat version wasn't "upgraded" to use const.

    - and were
    previously included accidentally, with the 32-bit contents. Now
    they have the proper 64-bit contents.

    Finally, I had to hack the existing hacky drivers/input/input-compat.h
    to add yet another "#ifdef" for INPUT_COMPAT_TEST (same as x86_64).

    Signed-off-by: Chris Metcalf
    Acked-by: Dmitry Torokhov [drivers/input]

    Chris Metcalf
     

03 May, 2011

1 commit

  • This support is required for CONFIG_KEYS, NFSv4 kernel DNS, etc.
    The change is slightly more complex than the minimal thing, since
    I took advantage of having to go into the assembly code to just
    move a bunch of stuff into C code: specifically, the schedule(),
    do_async_page_fault(), do_signal(), and single_step_once() support,
    in addition to the TIF_NOTIFY_RESUME support.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     

23 Mar, 2011

1 commit

  • Add a node parameter to alloc_thread_info(), and change its name to
    alloc_thread_info_node()

    This change is needed to allow NUMA aware kthread_create_on_cpu()

    Signed-off-by: Eric Dumazet
    Acked-by: David S. Miller
    Reviewed-by: Andi Kleen
    Acked-by: Rusty Russell
    Cc: Tejun Heo
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: David Howells
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Dumazet
     

11 Mar, 2011

1 commit

  • The Tilera architecture traditionally supports 64KB page sizes
    to improve TLB utilization and improve performance when the
    hardware is being used primarily to run a single application.

    For more generic server scenarios, it can be beneficial to run
    with 4KB page sizes, so this commit allows that to be specified
    (by modifying the arch/tile/include/hv/pagesize.h header).

    As part of this change, we also re-worked the PTE management
    slightly so that PTE writes all go through a __set_pte() function
    where we can do some additional validation. The set_pte_order()
    function was eliminated since the "order" argument wasn't being used.

    One bug uncovered was in the PCI DMA code, which wasn't properly
    flushing the specified range. This was benign with 64KB pages,
    but with 4KB pages we were getting some larger flushes wrong.

    The per-cpu memory reservation code also needed updating to
    conform with the newer percpu stuff; before it always chose 64KB,
    and that was always correct, but with 4KB granularity we now have
    to pay closer attention and reserve the amount of memory that will
    be requested when the percpu code starts allocating.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     

02 Mar, 2011

1 commit

  • To handle single-step, tile mmap's a page of memory in the process
    space for each thread and uses it to construct a version of the
    instruction that we want to single step. If the process exec's,
    though, we lose that mapping, and the kernel needs to be aware that
    it will need to recreate it if the exec'ed process than tries to
    single-step as well.

    Also correct some int32_t to s32 for better kernel style.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     

18 Dec, 2010

1 commit

  • Previously we were just setting up the "tp" register in the
    new task as started by clone() in libc. However, this is not
    quite right, since in principle a signal might be delivered to
    the new task before it had its TLS set up. (Of course, this race
    window still exists for resetting the libc getpid() cached value
    in the new task, in principle. But in any case, we are now doing
    this exactly the way all other architectures do it.)

    This change is important for 2.6.37 since the tile glibc we will
    be submitting upstream will not set TLS in user space any more,
    so it will only work on a kernel that has this fix. It should
    also be taken for 2.6.36.x in the stable tree if possible.

    Signed-off-by: Chris Metcalf
    Cc: stable

    Chris Metcalf
     

16 Oct, 2010

1 commit


15 Oct, 2010

2 commits


15 Sep, 2010

3 commits


18 Aug, 2010

1 commit

  • Make do_execve() take a const filename pointer so that kernel_execve() compiles
    correctly on ARM:

    arch/arm/kernel/sys_arm.c:88: warning: passing argument 1 of 'do_execve' discards qualifiers from pointer target type

    This also requires the argv and envp arguments to be consted twice, once for
    the pointer array and once for the strings the array points to. This is
    because do_execve() passes a pointer to the filename (now const) to
    copy_strings_kernel(). A simpler alternative would be to cast the filename
    pointer in do_execve() when it's passed to copy_strings_kernel().

    do_execve() may not change any of the strings it is passed as part of the argv
    or envp lists as they are some of them in .rodata, so marking these strings as
    const should be fine.

    Further kernel_execve() and sys_execve() need to be changed to match.

    This has been test built on x86_64, frv, arm and mips.

    Signed-off-by: David Howells
    Tested-by: Ralf Baechle
    Acked-by: Russell King
    Signed-off-by: Linus Torvalds

    David Howells
     

07 Jul, 2010

1 commit

  • This commit is primarily changes caused by reviewing "sparse"
    and "checkpatch" output on our sources, so is somewhat noisy, since
    things like "printk() -> pr_err()" (or whatever) throughout the
    codebase tend to get tedious to read. Rather than trying to tease
    apart precisely which things changed due to which type of code
    review, this commit includes various cleanups in the code:

    - sparse: Add declarations in headers for globals.
    - sparse: Fix __user annotations.
    - sparse: Using gfp_t consistently instead of int.
    - sparse: removing functions not actually used.
    - checkpatch: Clean up printk() warnings by using pr_info(), etc.;
    also avoid partial-line printks except in bootup code.
    - checkpatch: Use exposed structs rather than typedefs.
    - checkpatch: Change some C99 comments to C89 comments.

    In addition, a couple of minor other changes are rolled in
    to this commit:

    - Add support for a "raise" instruction to cause SIGFPE, etc., to be raised.
    - Remove some compat code that is unnecessary when we fully eliminate
    some of the deprecated syscalls from the generic syscall ABI.
    - Update the tile_defconfig to reflect current config contents.

    Signed-off-by: Chris Metcalf
    Acked-by: Arnd Bergmann

    Chris Metcalf
     

07 Jun, 2010

1 commit


05 Jun, 2010

1 commit

  • This change is the core kernel support for TILEPro and TILE64 chips.
    No driver support (except the console driver) is included yet.

    This includes the relevant Linux headers in asm/; the low-level
    low-level "Tile architecture" headers in arch/, which are
    shared with the hypervisor, etc., and are build-system agnostic;
    and the relevant hypervisor headers in hv/.

    Signed-off-by: Chris Metcalf
    Acked-by: Arnd Bergmann
    Acked-by: FUJITA Tomonori
    Reviewed-by: Paul Mundt

    Chris Metcalf