18 Aug, 2011

3 commits

  • There was a problem with the parse_events() code not printing the
    correct event name when an event was unknown and starting with an 'r'.
    The source of the problem was the way raw notation was parsed.

    Without the patch:
    $ perf stat -e retired_foo
    invalid event modifier: 'tired_foo'

    With the patch:
    $ perf stat -e retired_foo
    invalid or unsupported event: 'retired_foo'

    This also covers the case where the name of the event was not printed at
    all when perf was linked with libpfm4.

    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20110723021043.GA20178@quad
    Signed-off-by: Stephane Eranian
    Signed-off-by: Arnaldo Carvalho de Melo

    Stephane Eranian
     
  • When no event is given to perf record, perf top, a default event is
    initialized (cycles). However, perf_evlist__add_default() was not
    setting the symbolic name for the event. Perf top worked simply because
    it was reconstructing the name from the event code. But it should not
    have to do this. This patch initializes the evsel->name field properly.

    This second version improves the code flow on the non error path.

    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20110607161936.GA8163@quad
    Signed-off-by: Stephane Eranian
    [committer note: Use perf_evsel__delete() instead of plain free()]
    Signed-off-by: Arnaldo Carvalho de Melo

    Stephane Eranian
     
  • This patch fixes an issue with the exit value of perf list:

    $ perf list; echo $?
    129

    perf list returns an error exit code even though there is no error.

    There was a stray exit(129) in print_events(). This patch removes this
    exit().

    $ perf list; echo $?
    0

    $ perf list hw sw
    cpu-cycles OR cycles [Hardware event]
    stalled-cycles-frontend OR idle-cycles-frontend [Hardware event]
    stalled-cycles-backend OR idle-cycles-backend [Hardware event]
    instructions [Hardware event]
    cache-references [Hardware event]
    cache-misses [Hardware event]
    branch-instructions OR branches [Hardware event]
    branch-misses [Hardware event]
    bus-cycles [Hardware event]

    cpu-clock [Software event]
    task-clock [Software event]
    page-faults OR faults [Software event]
    minor-faults [Software event]
    major-faults [Software event]
    context-switches OR cs [Software event]
    cpu-migrations OR migrations [Software event]
    alignment-faults [Software event]
    emulation-faults [Software event]
    $ echo $?
    0

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20110523123917.GA31060@quad
    Signed-off-by: Stephane Eranian
    Signed-off-by: Arnaldo Carvalho de Melo

    Stephane Eranian
     

14 Aug, 2011

1 commit


12 Aug, 2011

18 commits

  • With gcc4.6, some instances of concrete inlined function looks redundant
    and broken, because it appears inside of a concrete instance and its
    call_file and call_line are same as the original abstruct's decl_file
    and decl_line respectively.

    e.g.
    [ d1aa] subprogram
    external (flag) Yes
    name (strp) "add_timer"
    decl_file (data1) 2 ;here is original
    decl_line (data2) 847 ;line and file
    prototyped (flag) Yes
    inline (data1) inlined (1)
    sibling (ref4) [ d1c6]
    ...
    [ 11d84] subprogram
    abstract_origin (ref4) [ d1aa] ; concrete instance
    low_pc (addr) .text+0x000000000000246f
    high_pc (addr) .text+0x000000000000248b
    frame_base (block1) [ 0] call_frame_cfa
    sibling (ref4) [ 11dd9]
    [ 11d9f] formal_parameter
    abstract_origin (ref4) [ d1b9]
    location (data4) location list [ 701b]
    [ 11da8] inlined_subroutine
    abstract_origin (ref4) [ d1aa] ; redundant instance
    low_pc (addr) .text+0x000000000000247e
    high_pc (addr) .text+0x0000000000002480
    call_file (data1) 2 ; call line and file
    call_line (data2) 847 ; are same as above

    Those redundant instances leads unwilling results;

    e.g. find probe points inside of functions even if we specify
    a function entry as below;

    $ perf probe -V add_timer
    Available variables at add_timer
    @
    struct timer_list* timer
    @
    (No matched variables)

    So, this filters out those redundant instances based on call-site and
    decl-site information.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Cc: yrl.pp-manager.tt@hitachi.com
    Link: http://lkml.kernel.org/r/20110811110317.19900.59525.stgit@fedora15
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • gcc 4.6 generates a concrete out-of-line instance when there is a
    function which is implicitly inlined somewhere but also has its own
    instance. The concrete out-of-line instance means that it has an
    abstract origin of the function which is referred by not only
    inlined-subroutines but also a concrete subprogram.

    Since current dwarf_func_inline_instances() can find only instances of
    inlined-subroutines, this introduces new die_walk_instances() to find
    both of subprogram and inlined-subroutines.

    e.g. without this,
    Available variables at sched_group_rt_period
    @
    struct task_group* tg

    perf probe failed to find actual subprogram instance of
    sched_group_rt_period().

    With this,

    Available variables at sched_group_rt_period
    @
    struct task_group* tg
    @
    struct task_group* tg

    Now it found the sched_group_rt_period() itself.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Cc: yrl.pp-manager.tt@hitachi.com
    Link: http://lkml.kernel.org/r/20110811110311.19900.63997.stgit@fedora15
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Fix variable searching logic to search one in inner than local scope or
    global(CU) scope. In the other words, skip searching in intermediate
    scopes.

    e.g., in the following code,

    int var1;

    void inline infunc(int i)
    {
    i++; without.vars

    With this:
    $ perf probe -V pre_schedule --externs > with.vars

    Check the diff:
    $ diff without.vars with.vars
    88d87
    < int cpu
    133d131
    < long unsigned int* switch_count

    These vars are actually in the scope of schedule(), the caller of
    pre_schedule().

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Cc: yrl.pp-manager.tt@hitachi.com
    Link: http://lkml.kernel.org/r/20110811110305.19900.94374.stgit@fedora15
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Fix perf probe to search local variables in appropriate local inlined
    function scope. For example, pre_schedule() has only 2 local variables,
    as below;

    $ perf probe -L pre_schedule

    0 static inline void pre_schedule(struct rq *rq, struct task_struct *prev)
    {
    2 if (prev->sched_class->pre_schedule)
    3 prev->sched_class->pre_schedule(rq, prev);
    }

    However, current perf probe shows 4 local variables on pre_schedule(),
    because it searches variables in the caller(schedule()) scope.

    $ perf probe -V pre_schedule
    Available variables at pre_schedule
    @
    int cpu
    long unsigned int* switch_count
    struct rq* rq
    struct task_struct* prev

    This patch fixes this issue by searching variables in the local scope of
    the instance of inlined function. Here is the result.

    $ perf probe -V pre_schedule
    Available variables at pre_schedule
    @
    struct rq* rq
    struct task_struct* prev

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Cc: yrl.pp-manager.tt@hitachi.com
    Link: http://lkml.kernel.org/r/20110811110259.19900.85664.stgit@fedora15
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Check multiple --lines option and print warning informing that only the
    first specified --line option is valid.

    Changes from the 1st post:

    - Accept only the first option instead of the last.
    - Fix warning message according to David's comment.
    - Mark as a bugfix.

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Cc: yrl.pp-manager.tt@hitachi.com
    Link: http://lkml.kernel.org/r/20110811110253.19900.96192.stgit@fedora15
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Fix line-range collector to walk all instances of inlined function,
    because some execution paths can be optimized out depending on the
    function argument of instances.

    E.g.)
    inline_func (arg) {
    if (arg)
    do_something;
    else
    do_another;
    }

    func_A() {
    inline_func(1)
    }

    func_B() {
    inline_func(0)
    }

    In this case, func_A may have only do_something code and func_B may have
    only do_another.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Cc: yrl.pp-manager.tt@hitachi.com
    Link: http://lkml.kernel.org/r/20110811110247.19900.93702.stgit@fedora15
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Fix perf probe to walk through the lines of all nested inlined function
    call sites and declared lines when a whole CU is passed to the line
    walker.

    The die_walk_lines() can have two different type of DIEs, subprogram (or
    inlined-subroutine) DIE and CU DIE.

    If a caller passes a subprogram DIE, this means that the walker walk on
    lines of given subprogram. In this case, it just needs to search on
    direct children of DIE tree for finding call-site information of inlined
    function which directly called from given subprogram.

    On the other hand, if a caller passes a CU DIE to the walker, this means
    that the walker have to walk on all lines in the source files included
    in given CU DIE. In this case, it has to search whole DIE trees of all
    subprograms to find the call-site information of all nested inlined
    functions.

    Without this patch:

    $ perf probe --line kernel/cpu.c:151-157

    static int cpu_notify(unsigned long val, void *v)
    {
    154 return __cpu_notify(val, v, -1, NULL);
    }

    With this:
    $ perf probe --line kernel/cpu.c:151-157

    152 static int cpu_notify(unsigned long val, void *v)
    {
    154 return __cpu_notify(val, v, -1, NULL);
    }

    As you can see, --line option with source line range shows the declared
    lines as probe-able.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Cc: yrl.pp-manager.tt@hitachi.com
    Link: http://lkml.kernel.org/r/20110811110241.19900.34994.stgit@fedora15
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Fix line walker to check whether a given DIE is CU or not.

    Actually this function accepts CU, subprogram and inlined_subroutine
    DIEs.

    Without this fix, perf probe always fails to analyze lines on inlined
    functions;

    $ perf probe -L pre_schedule
    Debuginfo analysis failed. (-2)
    Error: Failed to show lines. (-2)

    This fixes that bug, as below.

    $ perf probe -L pre_schedule

    0 static inline void pre_schedule(struct rq *rq, struct task_struct *prev
    {
    2 if (prev->sched_class->pre_schedule)
    3 prev->sched_class->pre_schedule(rq, prev);
    }

    /* rq->lock is NOT held, but preemption is disabled */

    Changes from v1:
    - Update against current tip tree.(Fix dwarf-aux.c)

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Cc: yrl.pp-manager.tt@hitachi.com
    Link: http://lkml.kernel.org/r/20110811110235.19900.20614.stgit@fedora15
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Fix a memory leak for scopes array when it finds a variable in the
    global scope.

    Reviewed-by: Pekka Enberg
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Cc: yrl.pp-manager.tt@hitachi.com
    Link: http://lkml.kernel.org/r/20110811110229.19900.63019.stgit@fedora15
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • A file in /tmp/ might be a symlink, so lstat() should be used instead of
    stat().

    Acked-by: Pekka Enberg
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20110811205537.GA22864@albatros
    Signed-off-by: Vasiliy Kulikov
    Signed-off-by: Arnaldo Carvalho de Melo

    Vasiliy Kulikov
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
    sparc: Don't do hypervisor calls on non-sun4v in DS driver.

    Linus Torvalds
     
  • Reported-by: Pieter-Paul Giesberts
    Signed-off-by: David S. Miller

    David S. Miller
     
  • Just like files-layout, blocks & objects layouts are part of the
    NFS 4.1 protocol and should be automatically selected if NFS_4_1
    is selected. The small problem is that these depend on other
    Kernel support being present, while files only depends on NFS
    itself.

    This patch removes from the user choice the presence of objects
    and blocks layout. But makes sure these are selected only if
    the depended subsystems are present in the Kernel.

    Signed-off-by: Boaz Harrosh
    Acked-by: Peng Tao
    Signed-off-by: Linus Torvalds

    Boaz Harrosh
     
  • Commit df5e6223407e ("ext4: fix deadlock in ext4_symlink() in ENOSPC
    conditions") recalculated the number of credits needed for a long
    symlink, in the process of splitting it into two transactions. However,
    the first credit calculation under-counted because if selinux is
    enabled, credits are needed to create the selinux xattr as well.

    Overrunning the reservation will result in an OOPS in
    jbd2_journal_dirty_metadata() due to this assert:

    J_ASSERT_JH(jh, handle->h_buffer_credits > 0);

    Fix this by increasing the reservation size.

    Signed-off-by: Eric Sandeen
    Reviewed-by: Jan Kara
    Acked-by: "Theodore Ts'o"
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds

    Eric Sandeen
     
  • Commit ae54870a1dc9 ("ext3: Fix lock inversion in ext3_symlink()")
    recalculated the number of credits needed for a long symlink, in the
    process of splitting it into two transactions. However, the first
    credit calculation under-counted because if selinux is enabled, credits
    are needed to create the selinux xattr as well.

    Overrunning the reservation will result in an OOPS in
    journal_dirty_metadata() due to this assert:

    J_ASSERT_JH(jh, handle->h_buffer_credits > 0);

    Fix this by increasing the reservation size.

    Signed-off-by: Eric Sandeen
    Reviewed-by: Jan Kara
    Acked-by: "Theodore Ts'o"
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds

    Eric Sandeen
     
  • The patch http://lkml.org/lkml/2003/7/13/226 introduced an RLIMIT_NPROC
    check in set_user() to check for NPROC exceeding via setuid() and
    similar functions.

    Before the check there was a possibility to greatly exceed the allowed
    number of processes by an unprivileged user if the program relied on
    rlimit only. But the check created new security threat: many poorly
    written programs simply don't check setuid() return code and believe it
    cannot fail if executed with root privileges. So, the check is removed
    in this patch because of too often privilege escalations related to
    buggy programs.

    The NPROC can still be enforced in the common code flow of daemons
    spawning user processes. Most of daemons do fork()+setuid()+execve().
    The check introduced in execve() (1) enforces the same limit as in
    setuid() and (2) doesn't create similar security issues.

    Neil Brown suggested to track what specific process has exceeded the
    limit by setting PF_NPROC_EXCEEDED process flag. With the change only
    this process would fail on execve(), and other processes' execve()
    behaviour is not changed.

    Solar Designer suggested to re-check whether NPROC limit is still
    exceeded at the moment of execve(). If the process was sleeping for
    days between set*uid() and execve(), and the NPROC counter step down
    under the limit, the defered execve() failure because NPROC limit was
    exceeded days ago would be unexpected. If the limit is not exceeded
    anymore, we clear the flag on successful calls to execve() and fork().

    The flag is also cleared on successful calls to set_user() as the limit
    was exceeded for the previous user, not the current one.

    Similar check was introduced in -ow patches (without the process flag).

    v3 - clear PF_NPROC_EXCEEDED on successful calls to set_user().

    Reviewed-by: James Morris
    Signed-off-by: Vasiliy Kulikov
    Acked-by: NeilBrown
    Signed-off-by: Linus Torvalds

    Vasiliy Kulikov
     
  • …l/git/tip/linux-2.6-tip

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    perf symbols: Check '/tmp/perf-' symbol file ownership
    perf sched: Usage leftover from trace -> script rename
    perf sched: Do not delete session object prematurely
    perf tools: Check $HOME/.perfconfig ownership
    perf, x86: Add model 45 SandyBridge support
    perf tools: Add support to install perf python extension
    perf tools: do not look at ./config for configuration
    perf tools: Make clean leaves some files
    perf lock: Dropping unsupported ':r' modifier
    perf probe: Fix coredump introduced by probe module option
    jump label: Reduce the cycle count by changing the link order
    perf report: Use ui__warning in some more places
    perf python: Add PERF_RECORD_{LOST,READ,SAMPLE} routine tables
    perf evlist: Introduce 'disable' method
    trace events: Update version number reference to new 3.x scheme for EVENT_POWER_TRACING_DEPRECATED
    perf buildid-cache: Zero out buffer of filenames when adding/removing buildid

    Linus Torvalds
     
  • Change to new git tree -
    (git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git).

    Signed-off-by: Tracey Dent
    Acked-by: WANG Cong
    Signed-off-by: Linus Torvalds

    Tracey Dent
     

11 Aug, 2011

7 commits

  • This reverts commit af9d220bac41dc3201893e1601cc7c44f7da4498.

    It turns out that one was meant to be applied on top of the edac.git
    tree in -next that has more i7core_edac changes, but that wasn't clear
    in the original email.

    Reported-by: Stephen Rothwell
    Acked-by: Borislav Petkov
    Cc: Randy Dunlap
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • PNFS_BLOCK needs BLK_DEV_DM/MD, which is not a dependency for other
    pnfs layout drivers. Seperate it out so others can still build when
    BLK_DEV_DM/MD is not enabled.

    Also change select to depends on to avoid build failures.

    Reported-and-tested-by: Randy Dunlap
    Signed-off-by: Peng Tao
    Acked-by: Benny Halevy
    Signed-off-by: Linus Torvalds

    Peng Tao
     
  • If we bring the recorded perf data together with kernel binary from another
    machine using:

    on server A:
    perf archive

    on server B:
    tar xjvf perf.data.tar.bz2 -C ~/.debug

    the build_id kernel dso is not properly recognized during the "perf report"
    command on server B.

    The reason is, that build_id dsos are added during the session initialization,
    while the kernel maps are created during the sample event processing.

    The machine__create_kernel_maps functions ends up creating new dso object for
    kernel, but it does not check if we already have one added by build_id
    processing.

    Also the build_id reading ABI quirk added in commit:

    - commit b25114817a73bbd2b84ce9dba02ee1ef8989a947
    perf build-id: Add quirk to deal with perf.data file format breakage

    populates the "struct build_id_event::pid" with 0, which
    is later interpreted as DEFAULT_GUEST_KERNEL_ID.

    This is not always correct, so it's better to guess the pid
    value based on the "struct build_id_event::header::misc" value.

    - Tested with data generated on x86 kernel version v2.6.34
    and reported back on x86_64 current kernel.
    - Not tested for guest kernel case.

    Note the problem stays for PERF_RECORD_MMAP events recorded by perf that
    does not use proper pid (HOST_KERNEL_ID/DEFAULT_GUEST_KERNEL_ID). They are
    misinterpreted within the current perf code. Probably there's not much we
    can do about that.

    Cc: Avi Kivity
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Yanmin Zhang
    Link: http://lkml.kernel.org/r/20110601194346.GB1934@jolsa.brq.redhat.com
    Signed-off-by: Jiri Olsa
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • * 'fixes' of master.kernel.org:/home/rmk/linux-2.6-arm:
    ARM: drop experimental status for ARM_PATCH_PHYS_VIRT
    ARM: 7008/1: alignment: Make SIGBUS sent to userspace POSIXly correct
    ARM: 7007/1: alignment: Prevent ignoring of faults with ARMv6 unaligned access model
    ARM: 7010/1: mm: fix invalid loop for poison_init_mem
    ARM: 7005/1: freshen up mm/proc-arm946.S
    dmaengine: PL08x: Fix trivial build error
    ARM: Fix build error for SMP=n builds

    Linus Torvalds
     
  • * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
    powerpc: Really fix build without CONFIG_PCI
    powerpc: Fix build without CONFIG_PCI
    powerpc/4xx: Fix build of PCI code on 405
    powerpc/pseries: Simplify vpa deregistration functions
    powerpc/pseries: Cleanup VPA registration and deregistration errors
    powerpc/pseries: Fix kexec on recent firmware versions
    MAINTAINERS: change maintainership of mpc5xxx
    powerpc: Make KVM_GUEST default to n
    powerpc/kvm: Fix build errors with older toolchains
    powerpc: Lack of ibm,io-events not that important!
    powerpc: Move kdump default base address to half RMO size on 64bit
    powerpc/perf: Disable pagefaults during callchain stack read
    ppc: Remove duplicate definition of PV_POWER7
    powerpc: pseries: Fix kexec on machines with more than 4TB of RAM
    powerpc: Jump label misalignment causes oops at boot
    powerpc: Clean up some panic messages in prom_init
    powerpc: Fix device tree claim code
    powerpc: Return the_cpu_ spec from identify_cpu
    powerpc: mtspr/mtmsr should take an unsigned long

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ecryptfs/ecryptfs-2.6:
    Ecryptfs: Add mount option to check uid of device being mounted = expect uid
    eCryptfs: Fix payload_len unitialized variable warning
    eCryptfs: fix compile error
    eCryptfs: Return error when lower file pointer is NULL

    Linus Torvalds
     
  • Both AMD and Intel i7 EDAC drivers use MCE features and are thus
    dependent of this functionality present in the kernel. Express this in
    Kconfig so that randconfig builds don't break.

    Reported-by: Randy Dunlap
    Signed-off-by: Borislav Petkov
    Acked-by: Randy Dunlap
    Signed-off-by: Linus Torvalds

    Borislav Petkov
     

10 Aug, 2011

11 commits

  • It will be immediately replaced in perf_top_browser__run.

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-q7e2jzb44elqpkvdllk94x0i@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Brown paper bag day, previous commit wouldn't work very well with modules
    enabled. Move the exports into the ifdef.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     
  • This has now been well tested, and several platforms are now selecting
    this directly. It's time to drop its experimental status.

    Signed-off-by: Russell King

    Russell King
     
  • …inux into perf/urgent

    Ingo Molnar
     
  • Close a TOCTOU race for mounts done via ecryptfs-mount-private. The mount
    source (device) can be raced when the ownership test is done in userspace.
    Provide Ecryptfs a means to force the uid check at mount time.

    Signed-off-by: John Johansen
    Cc:
    Signed-off-by: Tyler Hicks

    John Johansen
     
  • syslog-ng versions before 3.3.0beta1 (2011-05-12) assume that
    CAP_SYS_ADMIN is sufficient to access syslog, so ever since CAP_SYSLOG
    was introduced (2010-11-25) they have triggered a warning.

    Commit ee24aebffb75 ("cap_syslog: accept CAP_SYS_ADMIN for now")
    improved matters a little by making syslog-ng work again, just keeping
    the WARN_ONCE(). But still, this is a warning that writes a stack trace
    we don't care about to syslog, sets a taint flag, and alarms sysadmins
    when nothing worse has happened than use of an old userspace with a
    recent kernel.

    Convert the WARN_ONCE to a printk_once to avoid that while continuing to
    give userspace developers a hint that this is an unwanted
    backward-compatibility feature and won't be around forever.

    Reported-by: Ralf Hildebrandt
    Reported-by: Niels
    Reported-by: Paweł Sikora
    Signed-off-by: Jonathan Nieder
    Liked-by: Gergely Nagy
    Acked-by: Serge Hallyn
    Acked-by: James Morris
    Signed-off-by: Linus Torvalds

    Jonathan Nieder
     
  • This reverts commit 8521fc50d433507a7cdc96bec280f9e5888a54cc.

    The patch incorrectly assumes that using atomic FLUSHING_CACHED_CHARGE
    bit operations is sufficient but that is not true. Johannes Weiner has
    reported a crash during parallel memory cgroup removal:

    BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
    IP: [] css_is_ancestor+0x20/0x70
    Oops: 0000 [#1] PREEMPT SMP
    Pid: 19677, comm: rmdir Tainted: G W 3.0.0-mm1-00188-gf38d32b #35 ECS MCP61M-M3/MCP61M-M3
    RIP: 0010:[] css_is_ancestor+0x20/0x70
    RSP: 0018:ffff880077b09c88 EFLAGS: 00010202
    Process rmdir (pid: 19677, threadinfo ffff880077b08000, task ffff8800781bb310)
    Call Trace:
    [] mem_cgroup_same_or_subtree+0x33/0x40
    [] drain_all_stock+0x11f/0x170
    [] mem_cgroup_force_empty+0x231/0x6d0
    [] mem_cgroup_pre_destroy+0x14/0x20
    [] cgroup_rmdir+0xb9/0x500
    [] vfs_rmdir+0x86/0xe0
    [] do_rmdir+0xfb/0x110
    [] sys_rmdir+0x16/0x20
    [] system_call_fastpath+0x16/0x1b

    We are crashing because we try to dereference cached memcg when we are
    checking whether we should wait for draining on the cache. The cache is
    already cleaned up, though.

    There is also a theoretical chance that the cached memcg gets freed
    between we test for the FLUSHING_CACHED_CHARGE and dereference it in
    mem_cgroup_same_or_subtree:

    CPU0 CPU1 CPU2
    mem=stock->cached
    stock->cached=NULL
    clear_bit
    test_and_set_bit
    test_bit() ...
    mem_cgroup_destroy
    use after free

    The percpu_charge_mutex protected from this race because sync draining
    is exclusive.

    It is safer to revert now and come up with a more parallel
    implementation later.

    Signed-off-by: Michal Hocko
    Reported-by: Johannes Weiner
    Acked-by: Johannes Weiner
    Acked-by: KAMEZAWA Hiroyuki
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds

    Michal Hocko
     
  • * 'slab/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6:
    slub: Fix partial count comparison confusion

    Linus Torvalds
     
  • fs/ecryptfs/keystore.c: In function ‘ecryptfs_generate_key_packet_set’:
    fs/ecryptfs/keystore.c:1991:28: warning: ‘payload_len’ may be used uninitialized in this function [-Wuninitialized]
    fs/ecryptfs/keystore.c:1976:9: note: ‘payload_len’ was declared here

    Signed-off-by: Tyler Hicks

    Tyler Hicks
     
  • This patch fixes the compile error reported at the address:

    https://bugzilla.kernel.org/show_bug.cgi?id=40292

    The problem arises when compiling eCryptfs as built-in and the 'encrypted'
    key type as a module. The patch prevents this combination from being set in
    the kernel configuration, by fixing the eCryptfs dependencies.

    Signed-off-by: Roberto Sassu
    Reported-by: David Hill
    Signed-off-by: Tyler Hicks

    Roberto Sassu
     
  • When an eCryptfs inode's lower file has been closed, and the pointer has
    been set to NULL, return an error when trying to do a lower read or
    write rather than calling BUG().

    https://bugzilla.kernel.org/show_bug.cgi?id=37292

    Signed-off-by: Tyler Hicks
    Cc:

    Tyler Hicks