1. 18 May, 2011 7 commits
  2. 17 May, 2011 7 commits
    • Jeff Layton's avatar
      cifs: fix cifsConvertToUCS() for the mapchars case · 11379b5e
      Jeff Layton authored
      As Metze pointed out, commit 84cdf74e broke mapchars option:
      
          Commit "cifs: fix unaligned accesses in cifsConvertToUCS"
          (84cdf74e) does multiple steps
          in just one commit (moving the function and changing it without
          testing).
      
          put_unaligned_le16(temp, &target[j]); is never called for any
          codepoint the goes via the 'default' switch statement. As a result
          we put just zero (or maybe uninitialized) bytes into the target
          buffer.
      
      His proposed patch looks correct, but doesn't apply to the current head
      of the tree. This patch should also fix it.
      
      Cc: <stable@kernel.org> # .38.x: 581ade4d: cifs: clean up various nits in unicode routines (try #2)
      Reported-by: default avatarStefan Metzmacher <metze@samba.org>
      Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
      Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
      11379b5e
    • Jeff Layton's avatar
      cifs: add fallback in is_path_accessible for old servers · 221d1d79
      Jeff Layton authored
      The is_path_accessible check uses a QPathInfo call, which isn't
      supported by ancient win9x era servers. Fall back to an older
      SMBQueryInfo call if it fails with the magic error codes.
      
      Cc: stable@kernel.org
      Reported-and-Tested-by: default avatarSandro Bonazzola <sandro.bonazzola@gmail.com>
      Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
      Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
      221d1d79
    • Linus Torvalds's avatar
      Merge branch 'timers-fixes-for-linus' of... · a085963a
      Linus Torvalds authored
      Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
      
      * 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
        tick: Clear broadcast active bit when switching to oneshot
        rtc: mc13xxx: Don't call rtc_device_register while holding lock
        rtc: rp5c01: Initialize drvdata before registering device
        rtc: pcap: Initialize drvdata before registering device
        rtc: msm6242: Initialize drvdata before registering device
        rtc: max8998: Initialize drvdata before registering device
        rtc: max8925: Initialize drvdata before registering device
        rtc: m41t80: Initialize clientdata before registering device
        rtc: ds1286: Initialize drvdata before registering device
        rtc: ep93xx: Initialize drvdata before registering device
        rtc: davinci: Initialize drvdata before registering device
        rtc: mxc: Initialize drvdata before registering device
        clocksource: Install completely before selecting
      a085963a
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 · c1d10d18
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
        net: Change netdev_fix_features messages loglevel
        vmxnet3: Fix inconsistent LRO state after initialization
        sfc: Fix oops in register dump after mapping change
        IPVS: fix netns if reading ip_vs_* procfs entries
        bridge: fix forwarding of IPv6
      c1d10d18
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc · 477de0de
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
        Revert "mmc: fix a race between card-detect rescan and clock-gate work instances"
      477de0de
    • Randy Dunlap's avatar
      mm: fix kernel-doc warning in page_alloc.c · b5e6ab58
      Randy Dunlap authored
      Fix new kernel-doc warning in mm/page_alloc.c:
      
        Warning(mm/page_alloc.c:2370): No description found for parameter 'nid'
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b5e6ab58
    • Yinghai Lu's avatar
      PCI: Clear bridge resource flags if requested size is 0 · 93d2175d
      Yinghai Lu authored
      During pci remove/rescan testing found:
      
        pci 0000:c0:03.0: PCI bridge to [bus c4-c9]
        pci 0000:c0:03.0:   bridge window [io  0x1000-0x0fff]
        pci 0000:c0:03.0:   bridge window [mem 0xf0000000-0xf00fffff]
        pci 0000:c0:03.0:   bridge window [mem 0xfc180000000-0xfc197ffffff 64bit pref]
        pci 0000:c0:03.0: device not available (can't reserve [io  0x1000-0x0fff])
        pci 0000:c0:03.0: Error enabling bridge (-22), continuing
        pci 0000:c0:03.0: enabling bus mastering
        pci 0000:c0:03.0: setting latency timer to 64
        pcieport 0000:c0:03.0: device not available (can't reserve [io  0x1000-0x0fff])
        pcieport: probe of 0000:c0:03.0 failed with error -22
      
      This bug was caused by commit c8adf9a3 ("PCI: pre-allocate
      additional resources to devices only after successful allocation of
      essential resources.")
      
      After that commit, pci_hotplug_io_size is changed to additional_io_size
      from minium size.  So it will not go through resource_size(res) != 0
      path, and will not be reset.
      
      The root cause is: pci_bridge_check_ranges will set RESOURCE_IO flag for
      pci bridge, and later if children do not need IO resource.  those bridge
      resources will not need to be allocated.  but flags is still there.
      that will confuse the the pci_enable_bridges later.
      
      related code:
      
         static void assign_requested_resources_sorted(struct resource_list *head,
                                          struct resource_list_x *fail_head)
         {
                 struct resource *res;
                 struct resource_list *list;
                 int idx;
      
                 for (list = head->next; list; list = list->next) {
                         res = list->res;
                         idx = res - &list->dev->resource[0];
                         if (resource_size(res) && pci_assign_resource(list->dev, idx)) {
         ...
                                 reset_resource(res);
                         }
                 }
         }
      
      At last, We have to clear the flags in pbus_size_mem/io when requested
      size == 0 and !add_head.  becasue this case it will not go through
      adjust_resources_sorted().
      
      Just make size1 = size0 when !add_head. it will make flags get cleared.
      
      At the same time when requested size == 0, add_size != 0, will still
      have in head and add_list.  because we do not clear the flags for it.
      
      After this, we will get right result:
      
        pci 0000:c0:03.0: PCI bridge to [bus c4-c9]
        pci 0000:c0:03.0:   bridge window [io  disabled]
        pci 0000:c0:03.0:   bridge window [mem 0xf0000000-0xf00fffff]
        pci 0000:c0:03.0:   bridge window [mem 0xfc180000000-0xfc197ffffff 64bit pref]
        pci 0000:c0:03.0: enabling bus mastering
        pci 0000:c0:03.0: setting latency timer to 64
        pcieport 0000:c0:03.0: setting latency timer to 64
        pcieport 0000:c0:03.0: irq 160 for MSI/MSI-X
        pcieport 0000:c0:03.0: Signaling PME through PCIe PME interrupt
        pci 0000:c4:00.0: Signaling PME through PCIe PME interrupt
        pcie_pme 0000:c0:03.0:pcie01: service driver pcie_pme loaded
        aer 0000:c0:03.0:pcie02: service driver aer loaded
        pciehp 0000:c0:03.0:pcie04: Hotplug Controller:
      
      v3: more simple fix. also fix one typo in pbus_size_mem
      Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
      Reviewed-by: default avatarRam Pai <linuxram@us.ibm.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      93d2175d
  3. 16 May, 2011 8 commits
    • Thomas Gleixner's avatar
      tick: Clear broadcast active bit when switching to oneshot · 07f4beb0
      Thomas Gleixner authored
      The first cpu which switches from periodic to oneshot mode switches
      also the broadcast device into oneshot mode. The broadcast device
      serves as a backup for per cpu timers which stop in deeper
      C-states. To avoid starvation of the cpus which might be in idle and
      depend on broadcast mode it marks the other cpus as broadcast active
      and sets the brodcast expiry value of those cpus to the next tick.
      
      The oneshot mode broadcast bit for the other cpus is sticky and gets
      only cleared when those cpus exit idle. If a cpu was not idle while
      the bit got set in consequence the bit prevents that the broadcast
      device is armed on behalf of that cpu when it enters idle for the
      first time after it switched to oneshot mode.
      
      In most cases that goes unnoticed as one of the other cpus has usually
      a timer pending which keeps the broadcast device armed with a short
      timeout. Now if the only cpu which has a short timer active has the
      bit set then the broadcast device will not be armed on behalf of that
      cpu and will fire way after the expected timer expiry. In the case of
      Christians bug report it took ~145 seconds which is about half of the
      wrap around time of HPET (the limit for that device) due to the fact
      that all other cpus had no timers armed which expired before the 145
      seconds timeframe.
      
      The solution is simply to clear the broadcast active bit
      unconditionally when a cpu switches to oneshot mode after the first
      cpu switched the broadcast device over. It's not idle at that point
      otherwise it would not be executing that code.
      
      [ I fundamentally hate that broadcast crap. Why the heck thought some
        folks that when going into deep idle it's a brilliant concept to
        switch off the last device which brings the cpu back from that
        state? ]
      
      Thanks to Christian for providing all the valuable debug information!
      Reported-and-tested-by: default avatarChristian Hoffmann <email@christianhoffmann.info>
      Cc: John Stultz <johnstul@us.ibm.com>
      Link: http://lkml.kernel.org/r/%3Calpine.LFD.2.02.1105161105170.3078%40ionos%3E
      Cc: stable@kernel.org
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      07f4beb0
    • Michał Mirosław's avatar
      net: Change netdev_fix_features messages loglevel · 6f404e44
      Michał Mirosław authored
      Those reduced to DEBUG can possibly be triggered by unprivileged processes
      and are nothing exceptional. Illegal checksum combinations can only be
      caused by driver bug, so promote those messages to WARN.
      
      Since GSO without SG will now only cause DEBUG message from
      netdev_fix_features(), remove the workaround from register_netdevice().
      Signed-off-by: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6f404e44
    • Thomas Jarosch's avatar
      vmxnet3: Fix inconsistent LRO state after initialization · ebde6f8a
      Thomas Jarosch authored
      During initialization of vmxnet3, the state of LRO
      gets out of sync with netdev->features.
      
      This leads to very poor TCP performance in a IP forwarding
      setup and is hitting many VMware users.
      
      Simplified call sequence:
      1. vmxnet3_declare_features() initializes "adapter->lro" to true.
      
      2. The kernel automatically disables LRO if IP forwarding is enabled,
      so vmxnet3_set_flags() gets called. This also updates netdev->features.
      
      3. Now vmxnet3_setup_driver_shared() is called. "adapter->lro" is still
      set to true and LRO gets enabled again, even though
      netdev->features shows it's disabled.
      
      Fix it by updating "adapter->lro", too.
      
      The private vmxnet3 adapter flags are scheduled for removal
      in net-next, see commit a0d2730c
      "net: vmxnet3: convert to hw_features".
      
      Patch applies to 2.6.37 / 2.6.38 and 2.6.39-rc6.
      
      Please CC: comments.
      Signed-off-by: default avatarThomas Jarosch <thomas.jarosch@intra2net.com>
      Acked-by: default avatarStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ebde6f8a
    • Ben Hutchings's avatar
      sfc: Fix oops in register dump after mapping change · 867955f5
      Ben Hutchings authored
      Commit 747df225 ('sfc: Always map MCDI
      shared memory as uncacheable') introduced a separate mapping for the
      MCDI shared memory (MC_TREG_SMEM).  This means we can no longer easily
      include it in the register dump.  Since it is not particularly useful
      in debugging, substitute a recognisable dummy value.
      Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      867955f5
    • Linus Torvalds's avatar
      Merge branch 'omap-fixes-for-linus' of... · df8d06ad
      Linus Torvalds authored
      Merge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6
      
      * 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6:
        OMAP3: set the core dpll clk rate in its set_rate function
        omap: iommu: Return IRQ_HANDLED in fault handler when no fault occured
      df8d06ad
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 · 7c21738e
      Linus Torvalds authored
      * 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
        drm: Take lock around probes for drm_fb_helper_hotplug_event
        drm/i915: Revert i915.semaphore=1 default from 47ae63e0
        vga_switcheroo: don't toggle-switch devices
        drm/radeon/kms: add some evergreen/ni safe regs
        drm/radeon/kms: fix extended lvds info parsing
        drm/radeon/kms: fix tiling reg on fusion
      7c21738e
    • Chris Ball's avatar
      Revert "mmc: fix a race between card-detect rescan and clock-gate work instances" · 86f315bb
      Chris Ball authored
      This reverts commit 26fc8775, which has
      been reported to cause boot/resume-time crashes for some users:
      
      https://bbs.archlinux.org/viewtopic.php?id=118751.
      Signed-off-by: default avatarChris Ball <cjb@laptop.org>
      Cc: <stable@kernel.org>
      86f315bb
    • Chris Wilson's avatar
      drm: Take lock around probes for drm_fb_helper_hotplug_event · 752d2635
      Chris Wilson authored
      We need to hold the dev->mode_config.mutex whilst detecting the output
      status. But we also need to drop it for the call into
      drm_fb_helper_single_fb_probe(), which indirectly acquires the lock when
      attaching the fbcon.
      
      Failure to do so exposes a race with normal output probing. Detected by
      adding some warnings that the mutex is held to the backend detect routines:
      
      [   17.772456] WARNING: at drivers/gpu/drm/i915/intel_crt.c:471 intel_crt_detect+0x3e/0x373 [i915]()
      [   17.772458] Hardware name: Latitude E6400
      [   17.772460] Modules linked in: ....
      [   17.772582] Pid: 11, comm: kworker/0:1 Tainted: G        W 2.6.38.4-custom.2 #8
      [   17.772584] Call Trace:
      [   17.772591]  [<ffffffff81046af5>] ? warn_slowpath_common+0x78/0x8c
      [   17.772603]  [<ffffffffa03f3e5c>] ? intel_crt_detect+0x3e/0x373 [i915]
      [   17.772612]  [<ffffffffa0355d49>] ?  drm_helper_probe_single_connector_modes+0xbf/0x2af [drm_kms_helper]
      [   17.772619]  [<ffffffffa03534d5>] ?  drm_fb_helper_probe_connector_modes+0x39/0x4d [drm_kms_helper]
      [   17.772625]  [<ffffffffa0354760>] ?  drm_fb_helper_hotplug_event+0xa5/0xc3 [drm_kms_helper]
      [   17.772633]  [<ffffffffa035577f>] ? output_poll_execute+0x146/0x17c [drm_kms_helper]
      [   17.772638]  [<ffffffff81193c01>] ? cfq_init_queue+0x247/0x345
      [   17.772644]  [<ffffffffa0355639>] ? output_poll_execute+0x0/0x17c [drm_kms_helper]
      [   17.772648]  [<ffffffff8105b540>] ? process_one_work+0x193/0x28e
      [   17.772652]  [<ffffffff8105c6bc>] ? worker_thread+0xef/0x172
      [   17.772655]  [<ffffffff8105c5cd>] ? worker_thread+0x0/0x172
      [   17.772658]  [<ffffffff8105c5cd>] ? worker_thread+0x0/0x172
      [   17.772663]  [<ffffffff8105f767>] ? kthread+0x7a/0x82
      [   17.772668]  [<ffffffff8100a724>] ? kernel_thread_helper+0x4/0x10
      [   17.772671]  [<ffffffff8105f6ed>] ? kthread+0x0/0x82
      [   17.772674]  [<ffffffff8100a720>] ? kernel_thread_helper+0x0/0x10
      Reported-by: default avatarFrederik Himpe <fhimpe@telenet.be>
      References: https://bugs.freedesktop.org/show_bug.cgi?id=36394Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      752d2635
  4. 15 May, 2011 9 commits
    • Andy Lutomirski's avatar
      drm/i915: Revert i915.semaphore=1 default from 47ae63e0 · 8eea1be1
      Andy Lutomirski authored
      My Q67 / i7-2600 box has rev09 Sandy Bridge graphics.  It hangs
      instantly when GNOME loads and it hangs so hard the reset button
      doesn't work.  Setting i915.semaphore=0 fixes it.
      
      Semaphores were disabled in a1656b90
      in 2.6.38 and were re-enabled by
      
      commit 47ae63e0
      Merge: c59a333f 467cffba
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Mon Mar 7 12:32:44 2011 +0000
      
          Merge branch 'drm-intel-fixes' into drm-intel-next
      
          Apply the trivial conflicting regression fixes, but keep GPU semaphores
          enabled.
      
          Conflicts:
              drivers/gpu/drm/i915/i915_drv.h
              drivers/gpu/drm/i915/i915_gem_execbuffer.c
      
      (It's worth noting that the offending change is i915_drv.c,
       which is not a conflict.)
      Signed-off-by: default avatarAndy Lutomirski <luto@mit.edu>
      Acked-by: default avatarKeith Packard <keithp@keithp.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      8eea1be1
    • Florian Mickler's avatar
      vga_switcheroo: don't toggle-switch devices · a67b8887
      Florian Mickler authored
      If the requested device is already active, ignore the request.
      
      This restores the original behaviour of the interface. The change was
      probably an unintended side effect of
      
      commit 66b37c67 vga_switcheroo: split switching into two stages
      
      which did not take into account to duplicate the !active check in the split-off
      stage2.
      
      Fix this by factoring that check out of stage1 into the debugfs_write routine.
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=34252Reported-by: default avatarIgor Murzov <e-mail@date.by>
      Tested-by: default avatarIgor Murzov <e-mail@date.by>
      Signed-off-by: default avatarFlorian Mickler <florian@mickler.org>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      a67b8887
    • David S. Miller's avatar
    • Ingo Molnar's avatar
      Merge branch 'perf/urgent' of... · 52004ea7
      Ingo Molnar authored
      Merge branch 'perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 into perf/urgent
      52004ea7
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable · eed631e0
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
        Btrfs: fix FS_IOC_SETFLAGS ioctl
        Btrfs: fix FS_IOC_GETFLAGS ioctl
        fs: remove FS_COW_FL
        Btrfs: fix easily get into ENOSPC in mixed case
        Prevent oopsing in posix_acl_valid()
      eed631e0
    • Hans Schillstrom's avatar
      IPVS: fix netns if reading ip_vs_* procfs entries · 0f08190f
      Hans Schillstrom authored
      Without this patch every access to ip_vs in procfs will increase
      the netns count i.e. an unbalanced get_net()/put_net().
      (ipvsadm commands also use procfs.)
      The result is you can't exit a netns if reading ip_vs_* procfs entries.
      Signed-off-by: default avatarHans Schillstrom <hans.schillstrom@ericsson.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      0f08190f
    • Stephen Hemminger's avatar
      bridge: fix forwarding of IPv6 · d8083deb
      Stephen Hemminger authored
      The commit 6b1e960f
          bridge: Reset IPCB when entering IP stack on NF_FORWARD
      broke forwarding of IPV6 packets in bridge because it would
      call bp_parse_ip_options with an IPV6 packet.
      Reported-by: default avatarNoah Meyerhans <noahm@debian.org>
      Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
      Reviewed-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      d8083deb
    • Arnaldo Carvalho de Melo's avatar
      perf evlist: Fix per thread mmap setup · aece948f
      Arnaldo Carvalho de Melo authored
      The PERF_EVENT_IOC_SET_OUTPUT ioctl was returning -EINVAL when using
      --pid when monitoring multithreaded apps, as we can only share a ring
      buffer for events on the same thread if not doing per cpu.
      
      Fix it by using per thread ring buffers.
      
      Tested with:
      
      [root@felicio ~]# tuna -t 26131 -CP | nl
        1                      thread       ctxt_switches
        2    pid SCHED_ rtpri affinity voluntary nonvoluntary             cmd
        3 26131   OTHER     0      0,1  10814276      2397830 chromium-browse
        4  642    OTHER     0      0,1     14688            0 chromium-browse
        5  26148  OTHER     0      0,1    713602       115479 chromium-browse
        6  26149  OTHER     0      0,1    801958         2262 chromium-browse
        7  26150  OTHER     0      0,1   1271128          248 chromium-browse
        8  26151  OTHER     0      0,1         3            0 chromium-browse
        9  27049  OTHER     0      0,1     36796            9 chromium-browse
       10  618    OTHER     0      0,1     14711            0 chromium-browse
       11  661    OTHER     0      0,1     14593            0 chromium-browse
       12  29048  OTHER     0      0,1     28125            0 chromium-browse
       13  26143  OTHER     0      0,1   2202789          781 chromium-browse
      [root@felicio ~]#
      
      So 11 threads under pid 26131, then:
      
      [root@felicio ~]# perf record -F 50000 --pid 26131
      
      [root@felicio ~]# grep perf_event /proc/`pidof perf`/maps | nl
        1 7fa4a2538000-7fa4a25b9000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
        2 7fa4a25b9000-7fa4a263a000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
        3 7fa4a263a000-7fa4a26bb000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
        4 7fa4a26bb000-7fa4a273c000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
        5 7fa4a273c000-7fa4a27bd000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
        6 7fa4a27bd000-7fa4a283e000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
        7 7fa4a283e000-7fa4a28bf000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
        8 7fa4a28bf000-7fa4a2940000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
        9 7fa4a2940000-7fa4a29c1000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
       10 7fa4a29c1000-7fa4a2a42000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
       11 7fa4a2a42000-7fa4a2ac3000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
      [root@felicio ~]#
      
      11 mmaps, one per thread since we didn't specify any CPU list, so we need one
      mmap per thread and:
      
      [root@felicio ~]# perf record -F 50000 --pid 26131
      ^M
      ^C[ perf record: Woken up 79 times to write data ]
      [ perf record: Captured and wrote 20.614 MB perf.data (~900639 samples) ]
      
      [root@felicio ~]# perf report -D | grep PERF_RECORD_SAMPLE | cut -d/ -f2 | cut -d: -f1 | sort -n | uniq -c | sort -nr | nl
           1	 371310 26131
           2	  96516 26148
           3	  95694 26149
           4	  95203 26150
           5	   7291 26143
           6	     87 27049
           7	     76 661
           8	     60 29048
           9	     47 618
          10	     43 642
      [root@felicio ~]#
      
      Ok, one of the threads, 26151 was quiescent, so no samples there, but all the
      others are there.
      
      Then, if I specify one CPU:
      
      [root@felicio ~]# perf record -F 50000 --pid 26131 --cpu 1
      ^C[ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.680 MB perf.data (~29730 samples) ]
      
      [root@felicio ~]# perf report -D | grep PERF_RECORD_SAMPLE | cut -d/ -f2 | cut -d: -f1 | sort -n | uniq -c | sort -nr | nl
           1	   8444 26131
           2	   2584 26149
           3	   2518 26148
           4	   2324 26150
           5	    123 26143
           6	      9 661
           7	      9 29048
      [root@felicio ~]#
      
      This machine has two cores, so fewer threads appeared on the radar, and:
      
      [root@felicio ~]# grep perf_event /proc/`pidof perf`/maps | nl
       1 7f484b922000-7f484b9a3000 rwxs 00000000 00:09 4064 anon_inode:[perf_event]
      [root@felicio ~]#
      
      Just one mmap, as now we can use just one per-cpu buffer instead of the
      per-thread needed in the previous case.
      
      For global profiling:
      
      [root@felicio ~]# perf record -F 50000 -a
      ^C[ perf record: Woken up 26 times to write data ]
      [ perf record: Captured and wrote 7.128 MB perf.data (~311412 samples) ]
      
      [root@felicio ~]# grep perf_event /proc/`pidof perf`/maps | nl
           1	7fb49b435000-7fb49b4b6000 rwxs 00000000 00:09 4064                       anon_inode:[perf_event]
           2	7fb49b4b6000-7fb49b537000 rwxs 00000000 00:09 4064                       anon_inode:[perf_event]
      [root@felicio ~]#
      
      It uses per-cpu buffers.
      
      For just one thread:
      
      [root@felicio ~]# perf record -F 50000 --tid 26148
      ^C[ perf record: Woken up 2 times to write data ]
      [ perf record: Captured and wrote 0.330 MB perf.data (~14426 samples) ]
      
      [root@felicio ~]# perf report -D | grep PERF_RECORD_SAMPLE | cut -d/ -f2 | cut -d: -f1 | sort -n | uniq -c | sort -nr | nl
           1	   9969 26148
      [root@felicio ~]#
      
      [root@felicio ~]# grep perf_event /proc/`pidof perf`/maps | nl
           1	7f286a51b000-7f286a59c000 rwxs 00000000 00:09 4064                       anon_inode:[perf_event]
      [root@felicio ~]#
      Tested-by: default avatarDavid Ahern <dsahern@gmail.com>
      Tested-by: default avatarLin Ming <ming.m.lin@intel.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Link: http://lkml.kernel.org/r/20110426204401.GB1746@ghostprotocols.netSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      aece948f
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Honour the cpu list parameter when also monitoring a thread list · b9019418
      Arnaldo Carvalho de Melo authored
      The perf_evlist__create_maps was discarding the --cpu parameter when a
      --pid or --tid was specified, fix that.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Link: http://lkml.kernel.org/r/20110426204401.GB1746@ghostprotocols.netSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b9019418
  5. 14 May, 2011 9 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client · bd1a643e
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
        rbd: fix split bio handling
        rbd: fix leak of ops struct
      bd1a643e
    • Li Zefan's avatar
      Btrfs: fix FS_IOC_SETFLAGS ioctl · ebcb904d
      Li Zefan authored
      Steps to reproduce the bug:
      
        - Call FS_IOC_SETLFAGS ioctl with flags=FS_COMPR_FL
        - Call FS_IOC_SETFLAGS ioctl with flags=0
        - Call FS_IOC_GETFLAGS ioctl, and you'll see FS_COMPR_FL is still set!
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      ebcb904d
    • Li Zefan's avatar
      Btrfs: fix FS_IOC_GETFLAGS ioctl · d0092bdd
      Li Zefan authored
      As we've added per file compression/cow support.
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      d0092bdd
    • Li Zefan's avatar
      fs: remove FS_COW_FL · e1e8fb6a
      Li Zefan authored
      FS_COW_FL and FS_NOCOW_FL were newly introduced to control per file
      COW in btrfs, but FS_NOCOW_FL is sufficient.
      
      The fact is we don't have corresponding BTRFS_INODE_COW flag.
      
      COW is default, and FS_NOCOW_FL can be used to switch off COW for
      a single file.
      
      If we mount btrfs with nodatacow, a newly created file will be set with
      the FS_NOCOW_FL flag. So to turn on COW for it, we can just clear the
      FS_NOCOW_FL flag.
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      e1e8fb6a
    • liubo's avatar
      Btrfs: fix easily get into ENOSPC in mixed case · 1aba86d6
      liubo authored
      When a btrfs disk is created by mixed data & metadata option, it will have no
      pure data or pure metadata space info.
      
      In btrfs's for-linus branch, commit 78b1ea13838039cd88afdd62519b40b344d6c920
      (Btrfs: fix OOPS of empty filesystem after balance) initializes space infos at
      the very beginning.  The problem is this initialization does not take the mixed
      case into account, which will cause btrfs will easily get into ENOSPC in mixed
      case.
      Signed-off-by: default avatarLiu Bo <liubo2009@cn.fujitsu.com>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      1aba86d6
    • Daniel J Blueman's avatar
      Prevent oopsing in posix_acl_valid() · f5de9391
      Daniel J Blueman authored
      If posix_acl_from_xattr() returns an error code, a negative address is
      dereferenced causing an oops; fix by checking for error code first.
      Signed-off-by: default avatarDaniel J Blueman <daniel.blueman@gmail.com>
      Reviewed-by: default avatarJosef Bacik <josef@redhat.com>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      f5de9391
    • Linus Torvalds's avatar
    • Hugh Dickins's avatar
      tmpfs: fix race between swapoff and writepage · 05bf86b4
      Hugh Dickins authored
      Shame on me!  Commit b1dea800 "tmpfs: fix race between umount and
      writepage" fixed the advertized race, but introduced another: as even
      its comment makes clear, we cannot safely rely on a peek at list_empty()
      while holding no lock - until info->swapped is set, shmem_unuse_inode()
      may delete any formerly-swapped inode from the shmem_swaplist, which
      in this case would leave a swap area impossible to swapoff.
      
      Although I don't relish taking the mutex every time, I don't care much
      for the alternatives either; and at least the peek at list_empty() in
      shmem_evict_inode() (a hotter path since most inodes would never have
      been swapped) remains safe, because we already truncated the whole file.
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      05bf86b4
    • Tejun Heo's avatar
      libata: fix oops when LPM is used with PMP · 5f6f12cc
      Tejun Heo authored
      ae01b249 (libata: Implement ATA_FLAG_NO_DIPM and apply it to mcp65)
      added ATA_FLAG_NO_DIPM and made ata_eh_set_lpm() check the flag.
      However, @ap is NULL if @link points to a PMP link and thus the
      unconditional @ap->flags dereference leads to the following oops.
      
        BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
        IP: [<ffffffff813f98e1>] ata_eh_recover+0x9a1/0x1510
        ...
        Pid: 295, comm: scsi_eh_4 Tainted: P            2.6.38.5-core2 #1 System76, Inc. Serval Professional/Serval Professional
        RIP: 0010:[<ffffffff813f98e1>]  [<ffffffff813f98e1>] ata_eh_recover+0x9a1/0x1510
        RSP: 0018:ffff880132defbf0  EFLAGS: 00010246
        RAX: 0000000000000000 RBX: ffff880132f40000 RCX: 0000000000000000
        RDX: ffff88013377c000 RSI: ffff880132f40000 RDI: 0000000000000000
        RBP: ffff880132defce0 R08: ffff88013377dc58 R09: ffff880132defd98
        R10: 0000000000000000 R11: 00000000ffffffff R12: 0000000000000000
        R13: 0000000000000000 R14: ffff88013377c000 R15: 0000000000000000
        FS:  0000000000000000(0000) GS:ffff8800bf700000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
        CR2: 0000000000000018 CR3: 0000000001a03000 CR4: 00000000000406e0
        DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
        DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
        Process scsi_eh_4 (pid: 295, threadinfo ffff880132dee000, task ffff880133b416c0)
        Stack:
         0000000000000000 ffff880132defcc0 0000000000000000 ffff880132f42738
         ffffffff813ee8f0 ffffffff813eefe0 ffff880132defd98 ffff88013377f190
         ffffffffa00b3e30 ffffffff813ef030 0000000032defc60 ffff880100000000
        Call Trace:
         [<ffffffff81400867>] sata_pmp_error_handler+0x607/0xc30
         [<ffffffffa00b273f>] ahci_error_handler+0x1f/0x70 [libahci]
         [<ffffffff813faade>] ata_scsi_error+0x5be/0x900
         [<ffffffff813cf724>] scsi_error_handler+0x124/0x650
         [<ffffffff810834b6>] kthread+0x96/0xa0
         [<ffffffff8100cd64>] kernel_thread_helper+0x4/0x10
        Code: 8b 95 70 ff ff ff b8 00 00 00 00 48 3b 9a 10 2e 00 00 48 0f 44 c2 48 89 85 70 ff ff ff 48 8b 8d 70 ff ff ff f6 83 69 02 00 00 01 <48> 8b 41 18 0f 85 48 01 00 00 48 85 c9 74 12 48 8b 51 08 48 83
        RIP  [<ffffffff813f98e1>] ata_eh_recover+0x9a1/0x1510
         RSP <ffff880132defbf0>
        CR2: 0000000000000018
      
      Fix it by testing @link->ap->flags instead.
      
      stable: ATA_FLAG_NO_DIPM was added during 2.6.39 cycle but was
              backported to 2.6.37 and 38.  This is a fix for that and thus
              also applicable to 2.6.37 and 38.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatar"Nathan A. Mourey II" <nmoureyii@ne.rr.com>
      LKML-Reference: <1304555277.2059.2.camel@localhost.localdomain>
      Cc: Connor H <cmdkhh@gmail.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
      5f6f12cc