1. 21 Jun, 2012 1 commit
  2. 20 Jun, 2012 1 commit
  3. 18 Jun, 2012 2 commits
    • Steven Rostedt's avatar
      ftrace: Make all inline tags also include notrace · 93b3cca1
      Steven Rostedt authored
      Commit 5963e317 ("ftrace/x86: Do not change stacks in DEBUG when
      calling lockdep") prevented lockdep calls from the int3 breakpoint handler
      from reseting the stack if a function that was called was in the process
      of being converted for tracing and had a breakpoint on it. The idea is,
      before calling the lockdep code, do a load_idt() to the special IDT that
      kept the breakpoint stack from reseting. This worked well as a quick fix
      for this kernel release, until a certain config caused a lockup in the
      function tracer start up tests.
      
      Investigating it, I found that the load_idt that was used to prevent
      the int3 from changing stacks was itself being traced!
      
      Even though the config had CONFIG_OPTIMIZE_INLINING disabled, and
      all 'inline' tags were set to always inline, there were still cases that
      it did not inline! This was caused by CONFIG_PARAVIRT_GUEST, where it
      would add a pointer to the native_load_idt() which made that function
      to be traced.
      
      Commit 45959ee7 ("ftrace: Do not function trace inlined functions")
      only touched the 'inline' tags when CONFIG_OPMITIZE_INLINING was enabled.
      PARAVIRT_GUEST shows that this was not enough and we need to also
      mark always_inline with notrace as well.
      Reported-by: default avatarFengguang Wu <wfg@linux.intel.com>
      Tested-by: default avatarFengguang Wu <wfg@linux.intel.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      93b3cca1
    • Salman Qazi's avatar
      perf: Use css_tryget() to avoid propping up css refcount · 9c5da09d
      Salman Qazi authored
      An rmdir pushes css's ref count to zero.  However, if the associated
      directory is open at the time, the dentry ref count is non-zero.  If
      the fd for this directory is then passed into perf_event_open, it
      does a css_get().  This bounces the ref count back up from zero.  This
      is a problem by itself.  But what makes it turn into a crash is the
      fact that we end up doing an extra dput, since we perform a dput
      when css_put sees the ref count go down to zero.
      
      css_tryget() does not fall into that trap. So, we use that instead.
      
      Reproduction test-case for the bug:
      
       #include <unistd.h>
       #include <sys/types.h>
       #include <sys/stat.h>
       #include <fcntl.h>
       #include <linux/unistd.h>
       #include <linux/perf_event.h>
       #include <string.h>
       #include <errno.h>
       #include <stdio.h>
      
       #define PERF_FLAG_PID_CGROUP    (1U << 2)
      
       int perf_event_open(struct perf_event_attr *hw_event_uptr,
                           pid_t pid, int cpu, int group_fd, unsigned long flags) {
               return syscall(__NR_perf_event_open,hw_event_uptr, pid, cpu,
                       group_fd, flags);
       }
      
       /*
        * Directly poke at the perf_event bug, since it's proving hard to repro
        * depending on where in the kernel tree.  what moved?
        */
       int main(int argc, char **argv)
       {
              int fd;
              struct perf_event_attr attr;
              memset(&attr, 0, sizeof(attr));
              attr.exclude_kernel = 1;
              attr.size = sizeof(attr);
              mkdir("/dev/cgroup/perf_event/blah", 0777);
              fd = open("/dev/cgroup/perf_event/blah", O_RDONLY);
              perror("open");
              rmdir("/dev/cgroup/perf_event/blah");
              sleep(2);
              perf_event_open(&attr, fd, 0, -1,  PERF_FLAG_PID_CGROUP);
              perror("perf_event_open");
              close(fd);
              return 0;
       }
      Signed-off-by: default avatarSalman Qazi <sqazi@google.com>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Link: http://lkml.kernel.org/r/20120614223108.1025.2503.stgit@dungbeetle.mtv.corp.google.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      9c5da09d
  4. 15 Jun, 2012 1 commit
  5. 14 Jun, 2012 1 commit
    • Don Zickus's avatar
      watchdog: Quiet down the boot messages · a7027046
      Don Zickus authored
      A bunch of bugzillas have complained how noisy the nmi_watchdog
      is during boot-up especially with its expected failure cases
      (like virt and bios resource contention).
      
      This is my attempt to quiet them down and keep it less confusing
      for the end user.  What I did is print the message for cpu0 and
      save it for future comparisons.  If future cpus have an
      identical message as cpu0, then don't print the redundant info.
      However, if a future cpu has a different message, happily print
      that loudly.
      
      Before the change, you would see something like:
      
          ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
          CPU0: Intel(R) Core(TM)2 Quad CPU    Q9550  @ 2.83GHz stepping 0a
          Performance Events: PEBS fmt0+, Core2 events, Intel PMU driver.
          ... version:                2
          ... bit width:              40
          ... generic registers:      2
          ... value mask:             000000ffffffffff
          ... max period:             000000007fffffff
          ... fixed-purpose events:   3
          ... event mask:             0000000700000003
          NMI watchdog enabled, takes one hw-pmu counter.
          Booting Node   0, Processors  #1
          NMI watchdog enabled, takes one hw-pmu counter.
           #2
          NMI watchdog enabled, takes one hw-pmu counter.
           #3 Ok.
          NMI watchdog enabled, takes one hw-pmu counter.
          Brought up 4 CPUs
          Total of 4 processors activated (22607.24 BogoMIPS).
      
      After the change, it is simplified to:
      
          ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
          CPU0: Intel(R) Core(TM)2 Quad CPU    Q9550  @ 2.83GHz stepping 0a
          Performance Events: PEBS fmt0+, Core2 events, Intel PMU driver.
          ... version:                2
          ... bit width:              40
          ... generic registers:      2
          ... value mask:             000000ffffffffff
          ... max period:             000000007fffffff
          ... fixed-purpose events:   3
          ... event mask:             0000000700000003
          NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter.
          Booting Node   0, Processors  #1 #2 #3 Ok.
          Brought up 4 CPUs
      
      V2: little changes based on Joe Perches' feedback
      V3: printk cleanup based on Ingo's feedback; checkpatch fix
      V4: keep printk as one long line
      V5: Ingo fix ups
      Reported-and-tested-by: default avatarNathan Zimmer <nzimmer@sgi.com>
      Signed-off-by: default avatarDon Zickus <dzickus@redhat.com>
      Cc: nzimmer@sgi.com
      Cc: joe@perches.com
      Link: http://lkml.kernel.org/r/1339594548-17227-1-git-send-email-dzickus@redhat.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      a7027046
  6. 13 Jun, 2012 1 commit
  7. 12 Jun, 2012 1 commit
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Fix synthesizing tracepoint names from the perf.data headers · cb9dd49e
      Arnaldo Carvalho de Melo authored
      We need to use the per event info snapshoted at record time to
      synthesize the events name, so do it just after reading the perf.data
      headers, when we already processed the /sys events data, otherwise we'll
      end up using the local /sys that only by sheer luck will have the same
      tracepoint ID -> real event association.
      
      Example:
      
        # uname -a
        Linux felicio.ghostprotocols.net 3.4.0-rc5+ #1 SMP Sat May 19 15:27:11 BRT 2012 x86_64 x86_64 x86_64 GNU/Linux
        # perf record -e sched:sched_switch usleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.015 MB perf.data (~648 samples) ]
        # cat /t/events/sched/sched_switch/id
        279
        # perf evlist -v
        sched:sched_switch: sample_freq=1, type: 2, config: 279, size: 80, sample_type: 1159, read_format: 7, disabled: 1, inherit: 1, mmap: 1, comm: 1, enable_on_exec: 1, sample_id_all: 1, exclude_guest: 1
        #
      
      So on the above machine the sched:sched_switch has tracepoint id 279, but on
      the machine were we'll analyse it it has a different id:
      
        $ cat /t/events/sched/sched_switch/id
        56
        $ perf evlist -i /tmp/perf.data
        kmem:mm_balancedirty_writeout
        $ cat /t/events/kmem/mm_balancedirty_writeout/id
        279
      
      With this fix:
      
        $ perf evlist -i /tmp/perf.data
        sched:sched_switch
      Reported-by: default avatarDmitry Antipov <dmitry.antipov@linaro.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-auwks8fpuhmrdpiefs55o5oz@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      cb9dd49e
  8. 11 Jun, 2012 2 commits
    • Stephane Eranian's avatar
      perf stat: Fix default output file · fc3e4d07
      Stephane Eranian authored
      The following commit:
      
      commit 56f3bae7
      Author: Jim Cromie <jim.cromie@gmail.com>
      Date:   Wed Sep 7 17:14:00 2011 -0600
      
          perf stat: Add --log-fd <N> option to redirect stderr elsewhere
      
      introduced a bug in the way perf stat outputs the results by default,
      i.e., without the --log-fd or --output option. It would default to
      writing to file descriptor 0, i.e., stdin. Writing to stdin is allowed
      and is equivalent to writing to stdout. However, there is a major
      difference for any script that was already capturing the output of perf
      stat via redirection:
      
          perf stat >/tmp/log .... or perf stat 2>/tmp/log ....
      
      They would not capture anything anymore. They would have to do:
          perf stat 0>/tmp/log ...
      
      This breaks compatibility with existing scripts and does not look very
      natural.
      
      This patch fixes the problem by looking at output_fd only when it was
      modified by user (> 0). It also checks that the value if positive.
      Passing --log-fd 0 is ignored.
      
      I would also argue that defaulting to stderr for the results is not the
      right thing to do, though this patch does not address this specific
      issue.
      Signed-off-by: default avatarStephane Eranian <eranian@google.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Jim Cromie <jim.cromie@gmail.com>
      Link: http://lkml.kernel.org/r/20120515111111.GA9870@quadSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fc3e4d07
    • David Ahern's avatar
      perf tools: Fix endianity swapping for adds_features bitmask · 80c0120a
      David Ahern authored
      Based on Jiri's latest attempt:
      https://lkml.org/lkml/2012/5/16/61
      
      Basically, adds_features should be byte swapped assuming unsigned
      longs are either 8-bytes (u64) or 4-bytes (u32).
      
          Fixes 32-bit ppc dumping 64-bit x86 feature data:
           ========
           captured on: Sun May 20 19:23:23 2012
           hostname : nxos-vdc-dev3
           os release : 3.4.0-rc7+
           perf version : 3.4.rc4.137.g978da3
           arch : x86_64
           nrcpus online : 16
           nrcpus avail : 16
           cpudesc : Intel(R) Xeon(R) CPU E5540 @ 2.53GHz
           cpuid : GenuineIntel,6,26,5
           total memory : 24680324 kB
          ...
      
      Verified 64-bit x86 can still dump feature data for 32-bit ppc.
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Reviewed-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/4FBBB539.5010805@gmail.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      80c0120a
  9. 08 Jun, 2012 1 commit
  10. 07 Jun, 2012 1 commit
    • Steven Rostedt's avatar
      tracing: Have tracing_off() actually turn tracing off · f2bf1f6f
      Steven Rostedt authored
      A recent update to have tracing_on/off() only affect the ftrace ring
      buffers instead of all ring buffers had a cut and paste error.
      The tracing_off() did the exact same thing as tracing_on() and
      would not actually turn off tracing. Unfortunately, tracing_off()
      is more important to be working than tracing_on() as this is a key
      development tool, as it lets the developer turn off tracing as soon
      as a problem is discovered. It is also used by panic and oops code.
      
      This bug also breaks the 'echo func:traceoff > set_ftrace_filter'
      
      Cc: <stable@vger.kernel.org> # 3.4
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      f2bf1f6f
  11. 06 Jun, 2012 10 commits
  12. 05 Jun, 2012 2 commits
  13. 04 Jun, 2012 12 commits
  14. 03 Jun, 2012 3 commits
    • Linus Torvalds's avatar
      vfs: move inode stat information closer together · 2f9d3df8
      Linus Torvalds authored
      The comment above it says "Stat data, not accessed from path walking",
      but in fact some of inode fields we use for the common stat data was way
      down at the end of the inode, causing unnecessary cache misses for the
      common stat operations.
      
      The inode structure is pretty big, and this can change padding depending
      on field width, but at least on the common 64-bit configurations this
      doesn't change the size.  Some of our inode layout has historically been
      to tro to avoid unnecessary padding fields, but cache locality is at
      least as important for layout, if not more.
      
      Noticed by looking at kernel profiles, and noticing that the "i_blkbits"
      access stood out like a sore thumb.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2f9d3df8
    • Linus Torvalds's avatar
      Linux 3.5-rc1 · f8f5701b
      Linus Torvalds authored
      f8f5701b
    • Linus Torvalds's avatar
      Merge tag 'dm-3.5-changes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm · 912afc36
      Linus Torvalds authored
      Pull device-mapper updates from Alasdair G Kergon:
       "Improve multipath's retrying mechanism in some defined circumstances
        and provide a simple reserve/release mechanism for userspace tools to
        access thin provisioning metadata while the pool is in use."
      
      * tag 'dm-3.5-changes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm:
        dm thin: provide userspace access to pool metadata
        dm thin: use slab mempools
        dm mpath: allow ioctls to trigger pg init
        dm mpath: delay retry of bypassed pg
        dm mpath: reduce size of struct multipath
      912afc36
  15. 02 Jun, 2012 1 commit
    • Joe Thornber's avatar
      dm thin: provide userspace access to pool metadata · cc8394d8
      Joe Thornber authored
      This patch implements two new messages that can be sent to the thin
      pool target allowing it to take a snapshot of the _metadata_.  This,
      read-only snapshot can be accessed by userland, concurrently with the
      live target.
      
      Only one metadata snapshot can be held at a time.  The pool's status
      line will give the block location for the current msnap.
      
      Since version 0.1.5 of the userland thin provisioning tools, the
      thin_dump program displays the msnap as follows:
      
          thin_dump -m <msnap root> <metadata dev>
      
      Available here: https://github.com/jthornber/thin-provisioning-tools
      
      Now that userland can access the metadata we can do various things
      that have traditionally been kernel side tasks:
      
           i) Incremental backups.
      
           By using metadata snapshots we can work out what blocks have
           changed over time.  Combined with data snapshots we can ensure
           the data doesn't change while we back it up.
      
           A short proof of concept script can be found here:
      
           https://github.com/jthornber/thinp-test-suite/blob/master/incremental_backup_example.rb
      
           ii) Migration of thin devices from one pool to another.
      
           iii) Merging snapshots back into an external origin.
      
           iv) Asyncronous replication.
      Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      cc8394d8