19 Oct, 2010

1 commit

  • Provide a mechanism that allows running code in IRQ context. It is
    most useful for NMI code that needs to interact with the rest of the
    system -- like wakeup a task to drain buffers.

    Perf currently has such a mechanism, so extract that and provide it as
    a generic feature, independent of perf so that others may also
    benefit.

    The IRQ context callback is generated through self-IPIs where
    possible, or on architectures like powerpc the decrementer (the
    built-in timer facility) is set to generate an interrupt immediately.

    Architectures that don't have anything like this get to do with a
    callback from the timer tick. These architectures can call
    irq_work_run() at the tail of any IRQ handlers that might enqueue such
    work (like the perf IRQ handler) to avoid undue latencies in
    processing the work.

    Signed-off-by: Peter Zijlstra
    Acked-by: Kyle McMartin
    Acked-by: Martin Schwidefsky
    [ various fixes ]
    Signed-off-by: Huang Ying
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

08 Oct, 2010

1 commit


30 Sep, 2010

1 commit

  • Commit c52c2ddc1dfa ("alpha: switch osf_sigprocmask() to use of
    sigprocmask()") had several problems. The more obvious compile issues
    got fixed in commit 0f44fbd297e1 ("alpha: fix compile problem in
    arch/alpha/kernel/signal.c"), but it also caused a regression.

    Since _BLOCKABLE is already the set of signals that can be blocked, the
    code should do "newmask & _BLOCKABLE" rather than inverting _BLOCKABLE
    before masking.

    Reported-by: Michael Cree
    Patch-by: Al Viro
    Patch-by: Ivan Kokshaysky
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

29 Sep, 2010

1 commit


28 Sep, 2010

2 commits


26 Sep, 2010

2 commits

  • rdusp() gives us the right value only for the current thread...

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • We want interrupts disabled on all paths leading to RESTORE_ALL;
    otherwise, we are risking an IRQ coming between the updates of
    alpha_mv->hae_cache and *alpha_mv->hae_register and set_hae()
    within the IRQ getting badly confused.

    RESTORE_ALL used to play with disabling IRQ itself, but that got
    removed back in 2002, without making sure we had them disabled
    on all paths. It's cheaper to make sure we have them disabled than
    to revert to original variant...

    Remove the detritus left from that commit back in 2002; we used to
    need a reload of $0 and $1 since swpipl would change those, but
    doing that had become pointless when we stopped doing swpipl in
    there...

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     

21 Sep, 2010

1 commit


19 Sep, 2010

9 commits

  • Unlike the other targets, alpha sets _one_ sigframe and
    buggers off until the next syscall/interrupt, even if
    more signals are pending. It leads to quite a few unpleasant
    inconsistencies, starting with SIGSEGV potentially arriving
    not where it should and including e.g. mess with sigsuspend();
    consider two pending signals blocked until sigsuspend()
    unblocks them. We pick the first one; then, if we are hit
    by interrupt while in the handler, we process the second one
    as well. If we are not, and if no syscalls had been made,
    we get out of the first handler and leave the second signal
    pending; normally sigreturn() would've picked it anyway, but
    here it starts with restoring the original mask and voila -
    the second signal is blocked again. On everything else we
    get both delivered consistently.

    It's actually easy to fix; the only thing to watch out for
    is prevention of double syscall restart. Fortunately, the
    idea I've nicked from arm fix by rmk works just fine...

    Testcase demonstrating the behaviour in question; on alpha
    we get one or both flags set (usually one), on everything
    else both are always set.
    #include
    #include
    int had1, had2;
    void f1(int sig) { had1 = 1; }
    void f2(int sig) { had2 = 1; }
    main()
    {
    sigset_t set1, set2;
    sigemptyset(&set1);
    sigemptyset(&set2);
    sigaddset(&set2, 1);
    sigaddset(&set2, 2);
    signal(1, f1);
    signal(2, f2);
    sigprocmask(SIG_SETMASK, &set2, NULL);
    raise(1);
    raise(2);
    sigsuspend(&set1);
    printf("had1:%d had2:%d\n", had1, had2);
    }

    Tested-by: Michael Cree
    Signed-off-by: Al Viro
    Signed-off-by: Matt Turner

    Al Viro
     
  • The way sigreturn() is implemented on alpha breaks PTRACE_SYSCALL,
    all way back to 1.3.95 when alpha has grown PTRACE_SYSCALL support.

    What happens is direct return to ret_from_syscall, in order to bypass
    mangling of a3 (error indicator) and prevent other mutilations of
    registers (e.g. by syscall restart). That's fine, but... the entire
    TIF_SYSCALL_TRACE codepath is kept separate on alpha and post-syscall
    stopping/notifying the tracer is after the syscall. And the normal
    path we are forcibly switching to doesn't have it.

    So we end up with *one* stop in traced sigreturn() vs. two in other
    syscalls. And yes, strace is visibly broken by that; try to strace
    the following
    #include
    #include
    void f(int sig) {}
    main()
    {
    signal(SIGHUP, f);
    raise(SIGHUP);
    write(1, "eeeek\n", 6);
    }
    and watch the show. The
    close(1) = 405
    in the end of strace output is coming from return value of write() (6 ==
    __NR_close on alpha) and syscall number of exit_group() (__NR_exit_group ==
    405 there).

    The fix is fairly simple - the only thing we end up missing is the call
    of syscall_trace() and we can tell whether we'd been called from the
    SYSCALL_TRACE path by checking ra value. Since we are setting the
    switch_stack up (that's what sys_sigreturn() does), we have the right
    environment for calling syscall_trace() - just before we call
    undo_switch_stack() and return. Since undo_switch_stack() will overwrite
    s0 anyway, we can use it to store the result of "has it been called from
    SYSCALL_TRACE path?" check. The same thing applies in rt_sigreturn().

    Tested-by: Michael Cree
    Signed-off-by: Al Viro
    Signed-off-by: Matt Turner

    Al Viro
     
  • Old code used to set regs->r0 and regs->r19 to force the right
    return value. Leaving that after switch to ERESTARTNOHAND
    was a Bad Idea(tm), since now that screws the restart - if we
    hit the case when get_signal_to_deliver() returns 0, we will
    step back to syscall insn, with v0 set to EINTR and a3 to 1.
    The latter won't matter, since EINTR is 4, aka __NR_write.

    Testcase:

    #include
    #define _GNU_SOURCE
    #include
    #include

    main()
    {
    sigset_t mask;
    sigemptyset(&mask);
    sigaddset(&mask, SIGCONT);
    sigprocmask(SIG_SETMASK, &mask, NULL);
    kill(0, SIGCONT);
    syscall(__NR_sigsuspend, 1, "b0rken\n", 7);
    }

    results on alpha in immediate message to stdout...

    Fix is obvious; moreover, since we don't need regs anymore, we can
    switch to normal prototypes for these guys and lose the wrappers.
    Even better, rt_sigsuspend() is identical to generic version in
    kernel/signal.c now.

    Tested-by: Michael Cree
    Signed-off-by: Al Viro
    Signed-off-by: Matt Turner

    Al Viro
     
  • same thing as had been done on other targets back in 2003 -
    move setting ->restart_block.fn into {rt_,}sigreturn().

    Tested-by: Michael Cree
    Signed-off-by: Al Viro
    Signed-off-by: Matt Turner

    Al Viro
     
  • Pending work from the performance event subsystem is executed in
    the timer interrupt. This patch shifts the call to
    perf_event_do_pending() before the call to update_process_times()
    as the latter may call back into the perf event subsystem and it
    is prudent to have the pending work executed first.

    Signed-off-by: Michael Cree
    Signed-off-by: Matt Turner

    Michael Cree
     
  • The 2.6.36-rc kernel added three new system calls:
    fanotify_init, fanotify_mark, and prlimit64. This
    patch wires them up on Alpha.

    Built and booted on an XP900. Untested beyond that.

    Signed-off-by: Mikael Pettersson
    Signed-off-by: Matt Turner

    Mikael Pettersson
     
  • All uses of the BKL on alpha are totally bogus, nothing
    is really protected by this. Remove the remaining users
    so we don't have to mark alpha as 'depends on BKL'.

    Signed-off-by: Arnd Bergmann
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: linux-alpha@vger.kernel.org
    Signed-off-by: Matt Turner

    Arnd Bergmann
     
  • Acked-by: Jan-Benedict Glaw
    Signed-off-by: matt mooney
    Signed-off-by: Matt Turner

    matt mooney
     
  • Acked-by: Richard Henderson
    Signed-off-by: Joe Perches
    Signed-off-by: Matt Turner

    Joe Perches
     

15 Sep, 2010

2 commits


10 Sep, 2010

5 commits

  • Neither the overcommit nor the reservation sysfs parameter were
    actually working, remove them as they'll only get in the way.

    Signed-off-by: Peter Zijlstra
    Cc: paulus
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Replace pmu::{enable,disable,start,stop,unthrottle} with
    pmu::{add,del,start,stop}, all of which take a flags argument.

    The new interface extends the capability to stop a counter while
    keeping it scheduled on the PMU. We replace the throttled state with
    the generic stopped state.

    This also allows us to efficiently stop/start counters over certain
    code paths (like IRQ handlers).

    It also allows scheduling a counter without it starting, allowing for
    a generic frozen state (useful for rotating stopped counters).

    The stopped state is implemented in two different ways, depending on
    how the architecture implemented the throttled state:

    1) We disable the counter:
    a) the pmu has per-counter enable bits, we flip that
    b) we program a NOP event, preserving the counter state

    2) We store the counter state and ignore all read/overflow events

    Signed-off-by: Peter Zijlstra
    Cc: paulus
    Cc: stephane eranian
    Cc: Robert Richter
    Cc: Will Deacon
    Cc: Paul Mundt
    Cc: Frederic Weisbecker
    Cc: Cyrill Gorcunov
    Cc: Lin Ming
    Cc: Yanmin
    Cc: Deng-Cheng Zhu
    Cc: David Miller
    Cc: Michael Cree
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Changes perf_disable() into perf_pmu_disable().

    Signed-off-by: Peter Zijlstra
    Cc: paulus
    Cc: stephane eranian
    Cc: Robert Richter
    Cc: Will Deacon
    Cc: Paul Mundt
    Cc: Frederic Weisbecker
    Cc: Cyrill Gorcunov
    Cc: Lin Ming
    Cc: Yanmin
    Cc: Deng-Cheng Zhu
    Cc: David Miller
    Cc: Michael Cree
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Simple registration interface for struct pmu, this provides the
    infrastructure for removing all the weak functions.

    Signed-off-by: Peter Zijlstra
    Cc: paulus
    Cc: stephane eranian
    Cc: Robert Richter
    Cc: Will Deacon
    Cc: Paul Mundt
    Cc: Frederic Weisbecker
    Cc: Cyrill Gorcunov
    Cc: Lin Ming
    Cc: Yanmin
    Cc: Deng-Cheng Zhu
    Cc: David Miller
    Cc: Michael Cree
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • sed -ie 's/const struct pmu\>/struct pmu/g' `git grep -l "const struct pmu\>"`

    Signed-off-by: Peter Zijlstra
    Cc: paulus
    Cc: stephane eranian
    Cc: Robert Richter
    Cc: Will Deacon
    Cc: Paul Mundt
    Cc: Frederic Weisbecker
    Cc: Cyrill Gorcunov
    Cc: Lin Ming
    Cc: Yanmin
    Cc: Deng-Cheng Zhu
    Cc: David Miller
    Cc: Michael Cree
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

01 Sep, 2010

3 commits

  • When compiling alpha generic build get errors such as:
    arch/alpha/kernel/err_marvel.c: In function ‘marvel_print_err_cyc’:
    arch/alpha/kernel/err_marvel.c:119: error: format ‘%ld’ expects type ‘long int’, but argument 6 has type ‘u64’

    Replaced a number of %ld format specifiers with %lld since u64
    is unsigned long long.

    Signed-off-by: Michael Cree
    Signed-off-by: Matt Turner

    Michael Cree
     
  • Updates the Alpha perf_event code to match the changes
    recently made to the core perf_event code in commit
    e78505958cf123048fb48cb56b79cebb8edd15fb.

    Signed-off-by: Michael Cree
    Signed-off-by: Matt Turner

    Michael Cree
     
  • This patch fixes the failure to compile Alpha Generic because of
    previously overlooked calls to ns87312_enable_ide(). The function has
    been replaced by newer SuperIO code.

    Tested-by: Michael Cree
    Signed-off-by: Morten H. Larsen
    Signed-off-by: Matt Turner

    Morten H. Larsen
     

29 Aug, 2010

1 commit

  • Fix a comma that got accidentally deleted from sys_osf_statfs() leading to the
    following warning:

    arch/alpha/kernel/osf_sys.c: In function 'SYSC_osf_statfs':
    arch/alpha/kernel/osf_sys.c:255: error: syntax error before 'buffer'

    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    David Howells
     

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
     

14 Aug, 2010

1 commit

  • Mark arguments to certain system calls as being const where they should be but
    aren't. The list includes:

    (*) The filename arguments of various stat syscalls, execve(), various utimes
    syscalls and some mount syscalls.

    (*) The filename arguments of some syscall helpers relating to the above.

    (*) The buffer argument of various write syscalls.

    Signed-off-by: David Howells
    Acked-by: David S. Miller
    Signed-off-by: Linus Torvalds

    David Howells
     

11 Aug, 2010

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (96 commits)
    no need for list_for_each_entry_safe()/resetting with superblock list
    Fix sget() race with failing mount
    vfs: don't hold s_umount over close_bdev_exclusive() call
    sysv: do not mark superblock dirty on remount
    sysv: do not mark superblock dirty on mount
    btrfs: remove junk sb_dirt change
    BFS: clean up the superblock usage
    AFFS: wait for sb synchronization when needed
    AFFS: clean up dirty flag usage
    cifs: truncate fallout
    mbcache: fix shrinker function return value
    mbcache: Remove unused features
    add f_flags to struct statfs(64)
    pass a struct path to vfs_statfs
    update VFS documentation for method changes.
    All filesystems that need invalidate_inode_buffers() are doing that explicitly
    convert remaining ->clear_inode() to ->evict_inode()
    Make ->drop_inode() just return whether inode needs to be dropped
    fs/inode.c:clear_inode() is gone
    fs/inode.c:evict() doesn't care about delete vs. non-delete paths now
    ...

    Fix up trivial conflicts in fs/nilfs2/super.c

    Linus Torvalds
     

10 Aug, 2010

3 commits

  • This implements hardware performance events for the EV67 and later CPUs
    within the Linux performance events subsystem. Only using the performance
    monitoring unit in HP/Compaq's so called "Aggregrate mode" is supported.

    The code has been implemented in a manner that makes extension to other
    older Alpha CPUs relatively straightforward should some mug wish to
    indulge themselves.

    Signed-off-by: Michael Cree
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Cc: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Jay Estabrook
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Cree
     
  • The following patches implement hardware performance events for the Alpha
    EV67 and later CPUs. I have had this running on a Compaq XP1000 (EV67,
    single CPU) for a few days now. Pretty cool -- discovered that the glibc
    exp2() library routine uses on average 985 cycles to execute 777 CPU
    instructions whereas Compaq's CPML library version of exp2() uses on
    average 32 cycles to execute 47 CPU instructions to achieve the same
    thing!

    This patch:

    Add performance monitor interrupt counternd and export the count to user
    space via /proc/interrupts.

    Signed-off-by: Michael Cree
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Cc: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Jay Estabrook
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Cree
     
  • We'll need the path to implement the flags field for statvfs support.
    We do have it available in all callers except:

    - ecryptfs_statfs. This one doesn't actually need vfs_statfs but just
    needs to do a caller to the lower filesystem statfs method.
    - sys_ustat. Add a non-exported statfs_by_dentry helper for it which
    doesn't won't be able to fill out the flags field later on.

    In addition rename the helpers for statfs vs fstatfs to do_*statfs instead
    of the misleading vfs prefix.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     

16 Jun, 2010

2 commits


26 May, 2010

1 commit

  • Alpha has a tsc like rpcc counter that it uses to manage time.
    This can be converted to an actual clocksource instead of utilizing
    the arch_gettimeoffset method that is really only there for legacy
    systems with no continuous counter.

    Further cleanups could be made if alpha converted to the clockevent
    model.

    CC: Thomas Gleixner
    CC: Richard Henderson
    Acked-by: Ivan Kokshaysky
    Tested-by: Ivan Kokshaysky
    Signed-off-by: Matt Turner
    Signed-off-by: John Stultz

    John Stultz
     

22 May, 2010

1 commit


20 May, 2010

1 commit

  • …ernel/git/tip/linux-2.6-tip

    * 'timers-for-linus-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    avr32: Fix typo in read_persistent_clock()
    sparc: Convert sparc to use read/update_persistent_clock
    cris: Convert cris to use read/update_persistent_clock
    m68k: Convert m68k to use read/update_persistent_clock
    m32r: Convert m32r to use read/update_peristent_clock
    blackfin: Convert blackfin to use read/update_persistent_clock
    ia64: Convert ia64 to use read/update_persistent_clock
    avr32: Convert avr32 to use read/update_persistent_clock
    h8300: Convert h8300 to use read/update_persistent_clock
    frv: Convert frv to use read/update_persistent_clock
    mn10300: Convert mn10300 to use read/update_persistent_clock
    alpha: Convert alpha to use read/update_persistent_clock
    xtensa: Fix unnecessary setting of xtime
    time: Clean up direct xtime usage in xen

    Linus Torvalds