12 Jul, 2013

3 commits

  • On ARM systems the dummy clockevent is registered with the cpu
    hotplug notifier chain before any other per-cpu clockevent. This
    has the side-effect of causing the dummy clockevent to be
    registered first in every hotplug sequence. Because the dummy is
    first, we'll try to turn the broadcast source on but the code in
    tick_device_uses_broadcast() assumes the broadcast source is in
    periodic mode and calls tick_broadcast_start_periodic()
    unconditionally.

    On boot this isn't a problem because we typically haven't
    switched into oneshot mode yet (if at all). During hotplug, if
    the broadcast source isn't in periodic mode we'll replace the
    broadcast oneshot handler with the broadcast periodic handler and
    start emulating oneshot mode when we shouldn't. Due to the way
    the broadcast oneshot handler programs the next_event it's
    possible for it to contain KTIME_MAX and cause us to hang the
    system when the periodic handler tries to program the next tick.
    Fix this by using the appropriate function to start the broadcast
    source.

    Reported-by: Stephen Warren
    Tested-by: Stephen Warren
    Signed-off-by: Stephen Boyd
    Cc: Mark Rutland
    Cc: Marc Zyngier
    Cc: ARM kernel mailing list
    Cc: John Stultz
    Cc: Joseph Lo
    Link: http://lkml.kernel.org/r/20130711140059.GA27430@codeaurora.org
    Signed-off-by: Thomas Gleixner

    Stephen Boyd
     
  • Get upstream changes so we can apply fixes against them

    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • Pull tracing changes from Steven Rostedt:
    "The majority of the changes here are cleanups for the large changes
    that were added to 3.10, which includes several bug fixes that have
    been marked for stable.

    As for new features, there were a few, but nothing to write to LWN
    about. These include:

    New function trigger called "dump" and "cpudump" that will cause
    ftrace to dump its buffer to the console when the function is called.
    The difference between "dump" and "cpudump" is that "dump" will dump
    the entire contents of the ftrace buffer, where as "cpudump" will only
    dump the contents of the ftrace buffer for the CPU that called the
    function.

    Another small enhancement is a new sysctl switch called
    "traceoff_on_warning" which, when enabled, will disable tracing if any
    WARN_ON() is triggered. This is useful if you want to debug what
    caused a warning and do not want to risk losing your trace data by the
    ring buffer overwriting the data before you can disable it. There's
    also a kernel command line option that will make this enabled at boot
    up called the same thing"

    * tag 'trace-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (34 commits)
    tracing: Make tracing_open_generic_{tr,tc}() static
    tracing: Remove ftrace() function
    tracing: Remove TRACE_EVENT_TYPE enum definition
    tracing: Make tracer_tracing_{off,on,is_on}() static
    tracing: Fix irqs-off tag display in syscall tracing
    uprobes: Fix return value in error handling path
    tracing: Fix race between deleting buffer and setting events
    tracing: Add trace_array_get/put() to event handling
    tracing: Get trace_array ref counts when accessing trace files
    tracing: Add trace_array_get/put() to handle instance refs better
    tracing: Protect ftrace_trace_arrays list in trace_events.c
    tracing: Make trace_marker use the correct per-instance buffer
    ftrace: Do not run selftest if command line parameter is set
    tracing/kprobes: Don't pass addr=ip to perf_trace_buf_submit()
    tracing: Use flag buffer_disabled for irqsoff tracer
    tracing/kprobes: Turn trace_probe->files into list_head
    tracing: Fix disabling of soft disable
    tracing: Add missing syscall_metadata comment
    tracing: Simplify code for showing of soft disabled flag
    tracing/kprobes: Kill probe_enable_lock
    ...

    Linus Torvalds
     

11 Jul, 2013

5 commits


10 Jul, 2013

13 commits

  • …eric/linux-dynticks into timers/urgent

    Pull nohz updates/fixes from Frederic Weisbecker:

    ' Note that "watchdog: Boot-disable by default on full dynticks" is a temporary
    solution to solve the issue with the watchdog that prevents the tick from
    stopping. This is to make sure that 3.11 doesn't have that problem as several
    people complained about it.

    A proper and longer term solution has been proposed by Peterz:

    http://lkml.kernel.org/r/20130618103632.GO3204@twins.programming.kicks-ass.net
    '

    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Ingo Molnar
     
  • Pull networking updates from David Miller:
    "This is a re-do of the net-next pull request for the current merge
    window. The only difference from the one I made the other day is that
    this has Eliezer's interface renames and the timeout handling changes
    made based upon your feedback, as well as a few bug fixes that have
    trickeled in.

    Highlights:

    1) Low latency device polling, eliminating the cost of interrupt
    handling and context switches. Allows direct polling of a network
    device from socket operations, such as recvmsg() and poll().

    Currently ixgbe, mlx4, and bnx2x support this feature.

    Full high level description, performance numbers, and design in
    commit 0a4db187a999 ("Merge branch 'll_poll'")

    From Eliezer Tamir.

    2) With the routing cache removed, ip_check_mc_rcu() gets exercised
    more than ever before in the case where we have lots of multicast
    addresses. Use a hash table instead of a simple linked list, from
    Eric Dumazet.

    3) Add driver for Atheros CQA98xx 802.11ac wireless devices, from
    Bartosz Markowski, Janusz Dziedzic, Kalle Valo, Marek Kwaczynski,
    Marek Puzyniak, Michal Kazior, and Sujith Manoharan.

    4) Support reporting the TUN device persist flag to userspace, from
    Pavel Emelyanov.

    5) Allow controlling network device VF link state using netlink, from
    Rony Efraim.

    6) Support GRE tunneling in openvswitch, from Pravin B Shelar.

    7) Adjust SOCK_MIN_RCVBUF and SOCK_MIN_SNDBUF for modern times, from
    Daniel Borkmann and Eric Dumazet.

    8) Allow controlling of TCP quickack behavior on a per-route basis,
    from Cong Wang.

    9) Several bug fixes and improvements to vxlan from Stephen
    Hemminger, Pravin B Shelar, and Mike Rapoport. In particular,
    support receiving on multiple UDP ports.

    10) Major cleanups, particular in the area of debugging and cookie
    lifetime handline, to the SCTP protocol code. From Daniel
    Borkmann.

    11) Allow packets to cross network namespaces when traversing tunnel
    devices. From Nicolas Dichtel.

    12) Allow monitoring netlink traffic via AF_PACKET sockets, in a
    manner akin to how we monitor real network traffic via ptype_all.
    From Daniel Borkmann.

    13) Several bug fixes and improvements for the new alx device driver,
    from Johannes Berg.

    14) Fix scalability issues in the netem packet scheduler's time queue,
    by using an rbtree. From Eric Dumazet.

    15) Several bug fixes in TCP loss recovery handling, from Yuchung
    Cheng.

    16) Add support for GSO segmentation of MPLS packets, from Simon
    Horman.

    17) Make network notifiers have a real data type for the opaque
    pointer that's passed into them. Use this to properly handle
    network device flag changes in arp_netdev_event(). From Jiri
    Pirko and Timo Teräs.

    18) Convert several drivers over to module_pci_driver(), from Peter
    Huewe.

    19) tcp_fixup_rcvbuf() can loop 500 times over loopback, just use a
    O(1) calculation instead. From Eric Dumazet.

    20) Support setting of explicit tunnel peer addresses in ipv6, just
    like ipv4. From Nicolas Dichtel.

    21) Protect x86 BPF JIT against spraying attacks, from Eric Dumazet.

    22) Prevent a single high rate flow from overruning an individual cpu
    during RX packet processing via selective flow shedding. From
    Willem de Bruijn.

    23) Don't use spinlocks in TCP md5 signing fast paths, from Eric
    Dumazet.

    24) Don't just drop GSO packets which are above the TBF scheduler's
    burst limit, chop them up so they are in-bounds instead. Also
    from Eric Dumazet.

    25) VLAN offloads are missed when configured on top of a bridge, fix
    from Vlad Yasevich.

    26) Support IPV6 in ping sockets. From Lorenzo Colitti.

    27) Receive flow steering targets should be updated at poll() time
    too, from David Majnemer.

    28) Fix several corner case regressions in PMTU/redirect handling due
    to the routing cache removal, from Timo Teräs.

    29) We have to be mindful of ipv4 mapped ipv6 sockets in
    upd_v6_push_pending_frames(). From Hannes Frederic Sowa.

    30) Fix L2TP sequence number handling bugs, from James Chapman."

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1214 commits)
    drivers/net: caif: fix wrong rtnl_is_locked() usage
    drivers/net: enic: release rtnl_lock on error-path
    vhost-net: fix use-after-free in vhost_net_flush
    net: mv643xx_eth: do not use port number as platform device id
    net: sctp: confirm route during forward progress
    virtio_net: fix race in RX VQ processing
    virtio: support unlocked queue poll
    net/cadence/macb: fix bug/typo in extracting gem_irq_read_clear bit
    Documentation: Fix references to defunct linux-net@vger.kernel.org
    net/fs: change busy poll time accounting
    net: rename low latency sockets functions to busy poll
    bridge: fix some kernel warning in multicast timer
    sfc: Fix memory leak when discarding scattered packets
    sit: fix tunnel update via netlink
    dt:net:stmmac: Add dt specific phy reset callback support.
    dt:net:stmmac: Add support to dwmac version 3.610 and 3.710
    dt:net:stmmac: Allocate platform data only if its NULL.
    net:stmmac: fix memleak in the open method
    ipv6: rt6_check_neigh should successfully verify neigh if no NUD information are available
    net: ipv6: fix wrong ping_v6_sendmsg return value
    ...

    Linus Torvalds
     
  • Merge together the unicore32, arm, and x86 reboot= command line
    parameter handling.

    Signed-off-by: Robin Holt
    Cc: H. Peter Anvin
    Cc: Russell King
    Cc: Guan Xuetao
    Cc: Russ Anderson
    Cc: Robin Holt
    Acked-by: Ingo Molnar
    Acked-by: Guan Xuetao
    Acked-by: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robin Holt
     
  • Get the new file to pass scripts/checkpatch.pl

    Signed-off-by: Robin Holt
    Cc: H. Peter Anvin
    Cc: Russ Anderson
    Cc: Robin Holt
    Cc: Russell King
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robin Holt
     
  • This patch is preparatory. It moves reboot related syscall, etc
    functions from kernel/sys.c to kernel/reboot.c.

    Signed-off-by: Robin Holt
    Cc: H. Peter Anvin
    Cc: Russ Anderson
    Cc: Robin Holt
    Cc: Russell King
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robin Holt
     
  • Remove the prior patch's #define for easier backporting to the stable
    releases.

    Signed-off-by: Robin Holt
    Cc: H. Peter Anvin
    Cc: Russ Anderson
    Cc: Robin Holt
    Cc: Russell King
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robin Holt
     
  • Change ptrace_detach() to call flush_ptrace_hw_breakpoint(child). This
    frees the slots for non-ptrace PERF_TYPE_BREAKPOINT users, and this
    ensures that the tracee won't be killed by SIGTRAP triggered by the
    active breakpoints.

    Test-case:

    unsigned long encode_dr7(int drnum, int enable, unsigned int type, unsigned int len)
    {
    unsigned long dr7;

    dr7 = ((len | type) & 0xf)
    << (DR_CONTROL_SHIFT + drnum * DR_CONTROL_SIZE);
    if (enable)
    dr7 |= (DR_GLOBAL_ENABLE << (drnum * DR_ENABLE_SIZE));

    return dr7;
    }

    int write_dr(int pid, int dr, unsigned long val)
    {
    return ptrace(PTRACE_POKEUSER, pid,
    offsetof (struct user, u_debugreg[dr]),
    val);
    }

    void func(void)
    {
    }

    int main(void)
    {
    int pid, stat;
    unsigned long dr7;

    pid = fork();
    if (!pid) {
    assert(ptrace(PTRACE_TRACEME, 0,0,0) == 0);
    kill(getpid(), SIGHUP);

    func();
    return 0x13;
    }

    assert(pid == waitpid(-1, &stat, 0));
    assert(WSTOPSIG(stat) == SIGHUP);

    assert(write_dr(pid, 0, (long)func) == 0);
    dr7 = encode_dr7(0, 1, DR_RW_EXECUTE, DR_LEN_1);
    assert(write_dr(pid, 7, dr7) == 0);

    assert(ptrace(PTRACE_DETACH, pid, 0,0) == 0);
    assert(pid == waitpid(-1, &stat, 0));
    assert(stat == 0x1300);

    return 0;
    }

    Before this patch the child is killed after PTRACE_DETACH.

    Signed-off-by: Oleg Nesterov
    Acked-by: Frederic Weisbecker
    Cc: Benjamin Herrenschmidt
    Cc: Ingo Molnar
    Cc: Jan Kratochvil
    Cc: Michael Neuling
    Cc: Paul Mackerras
    Cc: Paul Mundt
    Cc: Will Deacon
    Cc: Prasad
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • This reverts commit bf26c018490c ("Prepare to fix racy accesses on task
    breakpoints").

    The patch was fine but we can no longer race with SIGKILL after commit
    9899d11f6544 ("ptrace: ensure arch_ptrace/ptrace_request can never race
    with SIGKILL"), the __TASK_TRACED tracee can't be woken up and
    ->ptrace_bps[] can't go away.

    Now that ptrace_get_breakpoints/ptrace_put_breakpoints have no callers,
    we can kill them and remove task->ptrace_bp_refcnt.

    Signed-off-by: Oleg Nesterov
    Acked-by: Frederic Weisbecker
    Acked-by: Michael Neuling
    Cc: Benjamin Herrenschmidt
    Cc: Ingo Molnar
    Cc: Jan Kratochvil
    Cc: Paul Mackerras
    Cc: Paul Mundt
    Cc: Will Deacon
    Cc: Prasad
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Add the cpu/pid that called WARN() so that the stack traces can be
    matched up with the WARNING messages.

    [akpm@linux-foundation.org: remove stray quote]
    Signed-off-by: Alex Thorlton
    Reviewed-by: Robin Holt
    Cc: Stephen Boyd
    Cc: Vikram Mulukutla
    Cc: Rusty Russell
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alex Thorlton
     
  • Use proper decimal type for comparison with u32.

    Compilation warning was introduced by 780a7654 ("audit: Make testing for
    a valid loginuid explicit.")

    kernel/auditfilter.c: In function 'audit_data_to_entry':
    kernel/auditfilter.c:426:3: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
    if ((f->type == AUDIT_LOGINUID) && (f->val == 4294967295)) {

    Signed-off-by: Michal Simek
    Cc: Al Viro
    Cc: Eric Paris
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michal Simek
     
  • If both 'tree' and 'watch' are valid we must call audit_put_tree(), just
    like the preceding code within audit_add_rule().

    Signed-off-by: Chen Gang
    Cc: Al Viro
    Cc: Eric Paris
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chen Gang
     
  • kernel/auditfilter.c:426: warning: this decimal constant is unsigned only in ISO C90

    Signed-off-by: Raphael S. Carvalho
    Cc: Eric Paris
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Raphael S. Carvalho
     
  • The old audit PATH records for mq_open looked like this:

    type=PATH msg=audit(1366282323.982:869): item=1 name=(null) inode=6777
    dev=00:0c mode=041777 ouid=0 ogid=0 rdev=00:00
    obj=system_u:object_r:tmpfs_t:s15:c0.c1023
    type=PATH msg=audit(1366282323.982:869): item=0 name="test_mq" inode=26732
    dev=00:0c mode=0100700 ouid=0 ogid=0 rdev=00:00
    obj=staff_u:object_r:user_tmpfs_t:s15:c0.c1023

    ...with the audit related changes that went into 3.7, they now look like this:

    type=PATH msg=audit(1366282236.776:3606): item=2 name=(null) inode=66655
    dev=00:0c mode=0100700 ouid=0 ogid=0 rdev=00:00
    obj=staff_u:object_r:user_tmpfs_t:s15:c0.c1023
    type=PATH msg=audit(1366282236.776:3606): item=1 name=(null) inode=6926
    dev=00:0c mode=041777 ouid=0 ogid=0 rdev=00:00
    obj=system_u:object_r:tmpfs_t:s15:c0.c1023
    type=PATH msg=audit(1366282236.776:3606): item=0 name="test_mq"

    Both of these look wrong to me. As Steve Grubb pointed out:

    "What we need is 1 PATH record that identifies the MQ. The other PATH
    records probably should not be there."

    Fix it to record the mq root as a parent, and flag it such that it
    should be hidden from view when the names are logged, since the root of
    the mq filesystem isn't terribly interesting. With this change, we get
    a single PATH record that looks more like this:

    type=PATH msg=audit(1368021604.836:484): item=0 name="test_mq" inode=16914
    dev=00:0c mode=0100644 ouid=0 ogid=0 rdev=00:00
    obj=unconfined_u:object_r:user_tmpfs_t:s0

    In order to do this, a new audit_inode_parent_hidden() function is
    added. If we do it this way, then we avoid having the existing callers
    of audit_inode needing to do any sort of flag conversion if auditing is
    inactive.

    Signed-off-by: Jeff Layton
    Reported-by: Jiri Jaburek
    Cc: Steve Grubb
    Cc: Eric Paris
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Layton
     

07 Jul, 2013

2 commits

  • Pull timer core updates from Thomas Gleixner:
    "The timer changes contain:

    - posix timer code consolidation and fixes for odd corner cases

    - sched_clock implementation moved from ARM to core code to avoid
    duplication by other architectures

    - alarm timer updates

    - clocksource and clockevents unregistration facilities

    - clocksource/events support for new hardware

    - precise nanoseconds RTC readout (Xen feature)

    - generic support for Xen suspend/resume oddities

    - the usual lot of fixes and cleanups all over the place

    The parts which touch other areas (ARM/XEN) have been coordinated with
    the relevant maintainers. Though this results in an handful of
    trivial to solve merge conflicts, which we preferred over nasty cross
    tree merge dependencies.

    The patches which have been committed in the last few days are bug
    fixes plus the posix timer lot. The latter was in akpms queue and
    next for quite some time; they just got forgotten and Frederic
    collected them last minute."

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (59 commits)
    hrtimer: Remove unused variable
    hrtimers: Move SMP function call to thread context
    clocksource: Reselect clocksource when watchdog validated high-res capability
    posix-cpu-timers: don't account cpu timer after stopped thread runtime accounting
    posix_timers: fix racy timer delta caching on task exit
    posix-timers: correctly get dying task time sample in posix_cpu_timer_schedule()
    selftests: add basic posix timers selftests
    posix_cpu_timers: consolidate expired timers check
    posix_cpu_timers: consolidate timer list cleanups
    posix_cpu_timer: consolidate expiry time type
    tick: Sanitize broadcast control logic
    tick: Prevent uncontrolled switch to oneshot mode
    tick: Make oneshot broadcast robust vs. CPU offlining
    x86: xen: Sync the CMOS RTC as well as the Xen wallclock
    x86: xen: Sync the wallclock when the system time is set
    timekeeping: Indicate that clock was set in the pvclock gtod notifier
    timekeeping: Pass flags instead of multiple bools to timekeeping_update()
    xen: Remove clock_was_set() call in the resume path
    hrtimers: Support resuming with two or more CPUs online (but stopped)
    timer: Fix jiffies wrap behavior of round_jiffies_common()
    ...

    Linus Torvalds
     
  • Pull irqdomain refactoring from Grant Likely:
    "This is the long awaited simplification of irqdomain. It gets rid of
    the different types of irq domains and instead both linear and tree
    mappings can be supported in a single domain. Doing this removes a
    lot of special case code and makes irq domains simpler to understand
    overall"

    * tag 'irqdomain-for-linus' of git://git.secretlab.ca/git/linux:
    irq: fix checkpatch error
    irqdomain: Include hwirq number in /proc/interrupts
    irqdomain: make irq_linear_revmap() a fast path again
    irqdomain: remove irq_domain_generate_simple()
    irqdomain: Refactor irq_domain_associate_many()
    irqdomain: Beef up debugfs output
    irqdomain: Clean up aftermath of irq_domain refactoring
    irqdomain: Eliminate revmap type
    irqdomain: merge linear and tree reverse mappings.
    irqdomain: Add a name field
    irqdomain: Replace LEGACY mapping with LINEAR
    irqdomain: Relax failure path on setting up mappings

    Linus Torvalds
     

06 Jul, 2013

1 commit


05 Jul, 2013

6 commits

  • smp_call_function_* must not be called from softirq context.

    But clock_was_set() which calls on_each_cpu() is called from softirq
    context to implement a delayed clock_was_set() for the timer interrupt
    handler. Though that almost never gets invoked. A recent change in the
    resume code uses the softirq based delayed clock_was_set to support
    Xens resume mechanism.

    linux-next contains a new warning which warns if smp_call_function_*
    is called from softirq context which gets triggered by that Xen
    change.

    Fix this by moving the delayed clock_was_set() call to a work context.

    Reported-and-tested-by: Artem Savkov
    Reported-by: Sasha Levin
    Cc: David Vrabel
    Cc: Ingo Molnar
    Cc: H. Peter Anvin ,
    Cc: Konrad Wilk
    Cc: John Stultz
    Cc: xen-devel@lists.xen.org
    Cc: stable@vger.kernel.org
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • Up to commit 5d33b883a (clocksource: Always verify highres capability)
    we had no sanity check when selecting a clocksource, which prevented
    that a non highres capable clocksource is used when the system already
    switched to highres/nohz mode.

    The new sanity check works as Alex and Tim found out. It prevents the
    TSC from being used. This happens because on x86 the boot process
    looks like this:

    tsc_start_freqency_validation(TSC);
    clocksource_register(HPET);
    clocksource_done_booting();
    clocksource_select()
    Selects HPET which is valid for high-res

    switch_to_highres();

    clocksource_register(TSC);
    TSC is not selected, because it is not yet
    flagged as VALID_HIGH_RES

    clocksource_watchdog()
    Validates TSC for highres, but that does not make TSC
    the current clocksource.

    Before the sanity check was added, we installed TSC unvalidated which
    worked most of the time. If the TSC was really detected as unstable,
    then the unstable logic removed it and installed HPET again.

    The sanity check is correct and needed. So the watchdog needs to kick
    a reselection of the clocksource, when it qualifies TSC as a valid
    high res clocksource.

    To solve this, we mark the clocksource which got the flag
    CLOCK_SOURCE_VALID_FOR_HRES set by the watchdog with an new flag
    CLOCK_SOURCE_RESELECT and trigger the watchdog thread. The watchdog
    thread evaluates the flag and invokes clocksource_select() when set.

    To avoid that the clocksource_done_booting() code, which is about to
    install the first real clocksource anyway, needs to go through
    clocksource_select and tick_oneshot_notify() pointlessly, split out
    the clocksource_watchdog_kthread() list walk code and invoke the
    select/notify only when called from clocksource_watchdog_kthread().

    So clocksource_done_booting() can utilize the same splitout code
    without the select/notify invocation and the clocksource_mutex
    unlock/relock dance.

    Reported-and-tested-by: Alex Shi
    Cc: Hans Peter Anvin
    Cc: Tim Chen
    Cc: Andi Kleen
    Tested-by: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Davidlohr Bueso
    Cc: John Stultz
    Link: http://lkml.kernel.org/r/alpine.DEB.2.02.1307042239150.11637@ionos.tec.linutronix.de
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • This patch fixes a serious bug in:

    14c63f17b1fd perf: Drop sample rate when sampling is too slow

    There was an misunderstanding on the API of the do_div()
    macro. It returns the remainder of the division and this
    was not what the function expected leading to disabling the
    interrupt latency watchdog.

    This patch also remove a duplicate assignment in
    perf_sample_event_took().

    Signed-off-by: Stephane Eranian
    Cc: peterz@infradead.org
    Cc: dave.hansen@linux.intel.com
    Cc: ak@linux.intel.com
    Cc: jolsa@redhat.com
    Link: http://lkml.kernel.org/r/20130704223010.GA30625@quad
    Signed-off-by: Ingo Molnar

    Stephane Eranian
     
  • git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks into timers/core

    Frederic sayed: "Most of these patches have been hanging around for
    several month now, in -mmotm for a significant chunk. They already
    missed a few releases."

    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • Pull trivial tree updates from Jiri Kosina:
    "The usual stuff from trivial tree"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (34 commits)
    treewide: relase -> release
    Documentation/cgroups/memory.txt: fix stat file documentation
    sysctl/net.txt: delete reference to obsolete 2.4.x kernel
    spinlock_api_smp.h: fix preprocessor comments
    treewide: Fix typo in printk
    doc: device tree: clarify stuff in usage-model.txt.
    open firmware: "/aliasas" -> "/aliases"
    md: bcache: Fixed a typo with the word 'arithmetic'
    irq/generic-chip: fix a few kernel-doc entries
    frv: Convert use of typedef ctl_table to struct ctl_table
    sgi: xpc: Convert use of typedef ctl_table to struct ctl_table
    doc: clk: Fix incorrect wording
    Documentation/arm/IXP4xx fix a typo
    Documentation/networking/ieee802154 fix a typo
    Documentation/DocBook/media/v4l fix a typo
    Documentation/video4linux/si476x.txt fix a typo
    Documentation/virtual/kvm/api.txt fix a typo
    Documentation/early-userspace/README fix a typo
    Documentation/video4linux/soc-camera.txt fix a typo
    lguest: fix CONFIG_PAE -> CONFIG_x86_PAE in comment
    ...

    Linus Torvalds
     
  • When tsk->signal->cputimer->running is 1, signal->cputimer (i.e. per process
    timer account) and tsk->sum_sched_runtime (i.e. per thread timer account)
    increase at the same pace because update_curr() increases both accounting.

    However, there is one exception. When thread exiting, __exit_signal() turns
    over task's sum_shced_runtime to sig->sum_sched_runtime, but it doesn't stop
    signal->cputimer accounting.

    This inconsistency makes POSIX timer wake up too early. This patch fixes it.

    Original-patch-by: Olivier Langlois
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Acked-by: Peter Zijlstra
    Signed-off-by: Olivier Langlois
    Signed-off-by: KOSAKI Motohiro
    Signed-off-by: Frederic Weisbecker

    KOSAKI Motohiro
     

04 Jul, 2013

10 commits

  • Merge first patch-bomb from Andrew Morton:
    - various misc bits
    - I'm been patchmonkeying ocfs2 for a while, as Joel and Mark have been
    distracted. There has been quite a bit of activity.
    - About half the MM queue
    - Some backlight bits
    - Various lib/ updates
    - checkpatch updates
    - zillions more little rtc patches
    - ptrace
    - signals
    - exec
    - procfs
    - rapidio
    - nbd
    - aoe
    - pps
    - memstick
    - tools/testing/selftests updates

    * emailed patches from Andrew Morton : (445 commits)
    tools/testing/selftests: don't assume the x bit is set on scripts
    selftests: add .gitignore for kcmp
    selftests: fix clean target in kcmp Makefile
    selftests: add .gitignore for vm
    selftests: add hugetlbfstest
    self-test: fix make clean
    selftests: exit 1 on failure
    kernel/resource.c: remove the unneeded assignment in function __find_resource
    aio: fix wrong comment in aio_complete()
    drivers/w1/slaves/w1_ds2408.c: add magic sequence to disable P0 test mode
    drivers/memstick/host/r592.c: convert to module_pci_driver
    drivers/memstick/host/jmb38x_ms: convert to module_pci_driver
    pps-gpio: add device-tree binding and support
    drivers/pps/clients/pps-gpio.c: convert to module_platform_driver
    drivers/pps/clients/pps-gpio.c: convert to devm_* helpers
    drivers/parport/share.c: use kzalloc
    Documentation/accounting/getdelays.c: avoid strncpy in accounting tool
    aoe: update internal version number to v83
    aoe: update copyright date
    aoe: perform I/O completions in parallel
    ...

    Linus Torvalds
     
  • This line was introduced by fcb11918 ("resources: add arch hook for
    preventing allocation in reserved areas"). But the struct tmp was already
    assigned to *new in the above line, so this seems superfluous. Just
    remove it.

    Signed-off-by: Kevin Hao
    Cc: Bjorn Helgaas
    Cc: Jesse Barnes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kevin Hao
     
  • Move statement to static initilization of init_pid_ns.

    Signed-off-by: Raphael S. Carvalho
    Cc: "Eric W. Biederman"
    Acked-by: Serge Hallyn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Raphael S. Carvalho
     
  • copy_process() does a lot of "chaotic" initializations and checks
    CLONE_THREAD twice before it takes tasklist. In particular it sets
    "p->group_leader = p" and then changes it again under tasklist if
    !thread_group_leader(p).

    This looks a bit confusing, lets create a single "if (CLONE_THREAD)" block
    which initializes ->exit_signal, ->group_leader, and ->tgid.

    Signed-off-by: Oleg Nesterov
    Cc: "Eric W. Biederman"
    Cc: Michal Hocko
    Cc: Pavel Emelyanov
    Cc: Sergey Dyasly
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • copy_process() adds the new child to thread_group/init_task.tasks list and
    then does attach_pid(child, PIDTYPE_PID). This means that the lockless
    next_thread() or next_task() can see this thread with the wrong pid. Say,
    "ls /proc/pid/task" can list the same inode twice.

    We could move attach_pid(child, PIDTYPE_PID) up, but in this case
    find_task_by_vpid() can find the new thread before it was fully
    initialized.

    And this is already true for PIDTYPE_PGID/PIDTYPE_SID, With this patch
    copy_process() initializes child->pids[*].pid first, then calls
    attach_pid() to insert the task into the pid->tasks list.

    attach_pid() no longer need the "struct pid*" argument, it is always
    called after pid_link->pid was already set.

    Signed-off-by: Oleg Nesterov
    Cc: "Eric W. Biederman"
    Cc: Michal Hocko
    Cc: Pavel Emelyanov
    Cc: Sergey Dyasly
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Cleanup and preparation for the next changes.

    Move the "if (clone_flags & CLONE_THREAD)" code down under "if
    (likely(p->pid))" and turn it into into the "else" branch. This makes the
    process/thread initialization more symmetrical and removes one check.

    Signed-off-by: Oleg Nesterov
    Cc: "Eric W. Biederman"
    Cc: Michal Hocko
    Cc: Pavel Emelyanov
    Cc: Sergey Dyasly
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • When a task is attempting to violate the RLIMIT_NPROC limit we have a
    check to see if the task is sufficiently priviledged. The check first
    looks at CAP_SYS_ADMIN, then CAP_SYS_RESOURCE, then if the task is uid=0.

    A result is that tasks which are allowed by the uid=0 check are first
    checked against the security subsystem. This results in the security
    subsystem auditting a denial for sys_admin and sys_resource and then the
    task passing the uid=0 check.

    This patch rearranges the code to first check uid=0, since if we pass that
    we shouldn't hit the security system at all. We then check sys_resource,
    since it is the smallest capability which will solve the problem. Lastly
    we check the fallback everything cap_sysadmin. We don't want to give this
    capability many places since it is so powerful.

    This will eliminate many of the false positive/needless denial messages we
    get when a root task tries to violate the nproc limit. (note that
    kthreads count against root, so on a sufficiently large machine we can
    actually get past the default limits before any userspace tasks are
    launched.)

    Signed-off-by: Eric Paris
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Paris
     
  • Move __set_special_pids() from exit.c to sys.c close to its single caller
    and make it static.

    And rename it to set_special_pids(), another helper with this name has
    gone away.

    Signed-off-by: Oleg Nesterov
    Cc: "Eric W. Biederman"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • call_usermodehelper_exec() does nothing but returns success if path[0] ==
    0. The only user which needs this strange feature is request_module(), it
    can check modprobe_path[0] itself like other users do if they want to
    detect the "disabled by admin" case.

    Kill it. Not only it looks strange, it can confuse other callers. And
    this allows us to revert 264b83c0 ("usermodehelper: check
    subprocess_info->path != NULL"), do_execve(NULL) is safe.

    Signed-off-by: Oleg Nesterov
    Acked-by: Rusty Russell
    Cc: Lucas De Marchi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • crtools uses a parasite code for dumping processes. The parasite code is
    injected into a process with help PTRACE_SEIZE.

    Currently crtools blocks signals from a parasite code. If a process has
    pending signals, crtools wait while a process handles these signals.

    This method is not suitable for stopped tasks. A stopped task can have a
    few pending signals, when we will try to execute a parasite code, we will
    need to drop SIGSTOP, but all other signals must remain pending, because a
    state of processes must not be changed during checkpointing.

    This patch adds two ptrace commands to set/get signal-blocked mask.

    I think gdb can use this commands too.

    [akpm@linux-foundation.org: be consistent with brace layout]
    Signed-off-by: Andrey Vagin
    Reviewed-by: Oleg Nesterov
    Cc: Roland McGrath
    Cc: Michael Kerrisk
    Cc: Pavel Emelyanov
    Cc: Cyrill Gorcunov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Vagin