1. 28 10月, 2013 1 次提交
  2. 24 10月, 2013 1 次提交
    • J
      perf script python: Fix mem leak due to missing Py_DECREFs on dict entries · c0268e8d
      Joseph Schuchart 提交于
      We are using the Python scripting interface in perf to extract kernel
      events relevant for performance analysis of HPC codes. We noticed that
      the "perf script" call allocates a significant amount of memory (in the
      order of several 100 MiB) during it's run, e.g. 125 MiB for a 25 MiB
      input file:
      
        $> perf record -o perf.data -a -R -g fp \
             -e power:cpu_frequency -e sched:sched_switch \
             -e sched:sched_migrate_task -e sched:sched_process_exit \
             -e sched:sched_process_fork -e sched:sched_process_exec \
             -e cycles  -m 4096 --freq 4000
        $> /usr/bin/time perf script -i perf.data -s dummy_script.py
        0.84user 0.13system 0:01.92elapsed 51%CPU (0avgtext+0avgdata
        125532maxresident)k
        73072inputs+0outputs (57major+33086minor)pagefaults 0swaps
      
      Upon further investigation using the valgrind massif tool, we noticed
      that Python objects that are created in trace-event-python.c via
      PyString_FromString*() (and their Integer and Long counterparts) are
      never free'd.
      
      The reason for this seem to be missing Py_DECREF calls on the objects
      that are returned by these functions and stored in the Python
      dictionaries. The Python dictionaries do not steal references (as
      opposed to Python tuples and lists) but instead add their own reference.
      
      Hence, the reference that is returned by these object creation functions
      is never released and the memory is leaked. (see [1,2])
      
      The attached patch fixes this by wrapping all relevant calls to
      PyDict_SetItemString() and decrementing the reference counter
      immediately after the Python function call.
      
      This reduces the allocated memory to a reasonable amount:
      
        $> /usr/bin/time perf script -i perf.data -s dummy_script.py
        0.73user 0.05system 0:00.79elapsed 99%CPU (0avgtext+0avgdata
        49132maxresident)k
        0inputs+0outputs (0major+14045minor)pagefaults 0swaps
      
      For comparison, with a 120 MiB input file the memory consumption
      reported by time drops from almost 600 MiB to 146 MiB.
      
      The patch has been tested using Linux 3.8.2 with Python 2.7.4 and Linux
      3.11.6 with Python 2.7.5.
      
      Please let me know if you need any further information.
      
      [1] http://docs.python.org/2/c-api/tuple.html#PyTuple_SetItem
      [2] http://docs.python.org/2/c-api/dict.html#PyDict_SetItemStringSigned-off-by: NJoseph Schuchart <joseph.schuchart@tu-dresden.de>
      Reviewed-by: NTom Zanussi <tom.zanussi@linux.intel.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Tom Zanussi <tom.zanussi@linux.intel.com>
      Link: http://lkml.kernel.org/r/1381468543-25334-4-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c0268e8d
  3. 20 10月, 2013 2 次提交
  4. 19 10月, 2013 4 次提交
  5. 18 10月, 2013 14 次提交
    • R
      Merge branch 'acpi-fixes' · 981984cb
      Rafael J. Wysocki 提交于
      * acpi-fixes:
        ACPI / PM: Drop two functions that are not used any more
        ATA / ACPI: remove power dependent device handling
        ACPI / power: Drop automaitc resume of power resource dependent devices
        ACPI: remove /proc/acpi/event from ACPI_BUTTON help
        ACPI / power: Release resource_lock after acpi_power_get_state() return error
      981984cb
    • R
      Merge branch 'pm-fixes' · bdbff716
      Rafael J. Wysocki 提交于
      * pm-fixes:
        cpufreq: s3c64xx: Rename index to driver_data
        intel_pstate: Fix type mismatch warning
        cpufreq / intel_pstate: Fix max_perf_pct on resume
      bdbff716
    • L
      Merge branch 'for-linus' of git://git.samba.org/sfrench/cifs-2.6 · 04919afb
      Linus Torvalds 提交于
      Pull CIFS fixes from Steve French:
       "Five small cifs fixes (includes fixes for: unmount hang, 2 security
        related, symlink, large file writes)"
      
      * 'for-linus' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: ntstatus_to_dos_map[] is not terminated
        cifs: Allow LANMAN auth method for servers supporting unencapsulated authentication methods
        cifs: Fix inability to write files >2GB to SMB2/3 shares
        cifs: Avoid umount hangs with smb2 when server is unresponsive
        do not treat non-symlink reparse points as valid symlinks
      04919afb
    • S
      perf: Disable PERF_RECORD_MMAP2 support · 3090ffb5
      Stephane Eranian 提交于
      For now, we disable the extended MMAP record support (MMAP2).
      
      We have identified cases where it would not report the correct mapping
      information, clone(VM_CLONE) but with separate pids.  We will revisit
      the support once we find a solution for this case.
      
      The patch changes the kernel to return EINVAL if attr->mmap2 is set. The
      patch also modifies the perf tool to use regular PERF_RECORD_MMAP for
      synthetic events and it also prevents the tool from requesting
      attr->mmap2 mode because the kernel would reject it.
      
      The support will be revisited once the kenrel interface is updated.
      
      In V2, we reduce the patch to the strict minimum.
      
      In V3, we avoid calling perf_event_open() with mmap2 set because we know
      it will fail and require fallback retry.
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20131017173215.GA8820@quadSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3090ffb5
    • A
      perf scripting perl: Fix build error on Fedora 12 · 3b16ff89
      Arnaldo Carvalho de Melo 提交于
      Cast __u64 to u64 to silence this warning on older distros, such as
      Fedora 12:
      
          CC       /tmp/build/perf/util/scripting-engines/trace-event-perl.o
        cc1: warnings being treated as errors
        util/scripting-engines/trace-event-perl.c: In function ‘perl_process_tracepoint’:
        util/scripting-engines/trace-event-perl.c:285: error: format ‘%lu’ expects type ‘long unsigned int’, but argument 2 has type ‘__u64’
        make[1]: *** [/tmp/build/perf/util/scripting-engines/trace-event-perl.o] Error 1
        make: *** [install] Error 2
        make: Leaving directory `/home/acme/git/linux/tools/perf'
        [acme@fedora12 linux]$
      Reported-by: NWaiman Long <Waiman.Long@hp.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      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: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tom.zanussi@linux.intel.com>
      Cc: Waiman Long <Waiman.Long@hp.com>
      Link: http://lkml.kernel.org/n/tip-nlxofdqcdjfm0w9o6bgq4kqv@git.kernel.org
      Link: http://lkml.kernel.org/r/1381265120-58532-1-git-send-email-Waiman.Long@hp.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3b16ff89
    • L
      Merge tag 'driver-core-3.12-rc6' of... · 83f11a9c
      Linus Torvalds 提交于
      Merge tag 'driver-core-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core fix from Greg KH:
       "Here is one fix for the hotplug memory path that resolves a regression
        when removing memory that showed up in 3.12-rc1"
      
      * tag 'driver-core-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        driver core: Release device_hotplug_lock when store_mem_state returns EINVAL
      83f11a9c
    • L
      Merge tag 'usb-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 02a3250f
      Linus Torvalds 提交于
      Pull USB fixes from Greg KH:
       "Here are some USB fixes and new device ids for 3.12-rc6
      
        The largest change here is a bunch of new device ids for the option
        USB serial driver for new Huawei devices.  Other than that, just some
        small bug fixes for issues that people have reported (run-time and
        build-time), nothing major"
      
      * tag 'usb-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        usb: usb_phy_gen: refine conditional declaration of usb_nop_xceiv_register
        usb: misc: usb3503: Fix compile error due to incorrect regmap depedency
        usb/chipidea: fix oops on memory allocation failure
        usb-storage: add quirk for mandatory READ_CAPACITY_16
        usb: serial: option: blacklist Olivetti Olicard200
        USB: quirks: add touchscreen that is dazzeled by remote wakeup
        Revert "usb: musb: gadget: fix otg active status flag"
        USB: quirks.c: add one device that cannot deal with suspension
        USB: serial: option: add support for Inovia SEW858 device
        USB: serial: ti_usb_3410_5052: add Abbott strip port ID to combined table as well.
        USB: support new huawei devices in option.c
        usb: musb: start musb on the udc side, too
        xhci: Fix spurious wakeups after S5 on Haswell
        xhci: fix write to USB3_PSSEN and XUSB2PRM pci config registers
        xhci: quirk for extra long delay for S4
        xhci: Don't enable/disable RWE on bus suspend/resume.
      02a3250f
    • L
      Merge tag 'tty-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 7b4a5155
      Linus Torvalds 提交于
      Pull serial driver fixes from Greg KH:
       "Here are two serial driver fixes for your tree.  One is a revert of a
        patch that causes a build error, the other is a fix to provide the
        correct brace placement which resolves a bug where the driver was not
        working properly"
      
      * tag 'tty-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        serial: vt8500: add missing braces
        Revert "serial: i.MX: evaluate linux,stdout-path property"
      7b4a5155
    • L
      Merge tag 'char-misc-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 66eb411e
      Linus Torvalds 提交于
      Pull char/misc driver fixes from Greg KH:
       "Here are some small iio and w1 driver fixes for 3.12-rc6.
      
        There is also a hyper-v fix in here, which turned out to be incorrect,
        so it was reverted.  That will probably have to wait unto 3.13-rc1 to
        get accepted as it's still being discussed"
      
      * tag 'char-misc-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        Revert "Drivers: hv: vmbus: Fix a bug in channel rescind code"
        Drivers: hv: vmbus: Fix a bug in channel rescind code
        iio:buffer: Free active scan mask in iio_disable_all_buffers()
        iio: frequency: adf4350: add missing clk_disable_unprepare() on error in adf4350_probe()
        w1 - call request_module with w1 master mutex unlocked
        w1 - fix fops in w1_bus_notify
      66eb411e
    • L
      Merge tag 'sound-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 630db0e3
      Linus Torvalds 提交于
      Pull sound fixes from Takashi Iwai:
       "All reasonably small fixes as rc6: a HD-audio mic fix, a us122l mmap
        regression fix, and kernel memory leak fix in hdsp driver.  Hopefully
        this will be the last pull request for 3.12..."
      
      * tag 'sound-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hdsp - info leak in snd_hdsp_hwdep_ioctl()
        ALSA: us122l: Fix pcm_usb_stream mmapping regression
        ALSA: hda - Fix inverted internal mic not indicated on some machines
      630db0e3
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security · b2118ea9
      Linus Torvalds 提交于
      Pull apparmor fixes from James Morris:
       "A couple more regressions fixed"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
        apparmor: fix bad lock balance when introspecting policy
        apparmor: fix memleak of the profile hash
      b2118ea9
    • G
      Merge tag 'iio-fixes-for-3.12c' of... · e13cef8d
      Greg Kroah-Hartman 提交于
      Merge tag 'iio-fixes-for-3.12c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-linus
      
      Jonathan writes:
      
      Third set of IIO fixes for the 3.12 cycle.
      
      Two little ones this time:
      
      1) A missing clk_unprepare in adf4350.
      2) A missing free of the active_scan_mask when iio_disable_all_buffers is
      called during an unexpected device removal.  This leak was introduced by
      the fix
      a87c82e4 iio: Stop sampling when the device is removed
      and hence is a regression fix.
      e13cef8d
    • G
      usb: usb_phy_gen: refine conditional declaration of usb_nop_xceiv_register · 94468783
      Guenter Roeck 提交于
      Commit 3fa4d734 (usb: phy: rename nop_usb_xceiv => usb_phy_gen_xceiv)
      changed the conditional around the declaration of usb_nop_xceiv_register
      from
      	#if defined(CONFIG_NOP_USB_XCEIV) ||
      		(defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE))
      to
      	#if IS_ENABLED(CONFIG_NOP_USB_XCEIV)
      
      While that looks the same, it is semantically different. The first expression
      is true if CONFIG_NOP_USB_XCEIV is built as module and if the including
      code is built as module. The second expression is true if code depending on
      CONFIG_NOP_USB_XCEIV if built as module or into the kernel.
      
      As a result, the arm:allmodconfig build fails with
      
      arch/arm/mach-omap2/built-in.o: In function `omap3_evm_init':
      arch/arm/mach-omap2/board-omap3evm.c:703: undefined reference to
      	`usb_nop_xceiv_register'
      
      Fix the problem by reverting to the old conditional.
      
      Cc: Josh Boyer <jwboyer@redhat.com>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      94468783
    • G
      Revert "Drivers: hv: vmbus: Fix a bug in channel rescind code" · b762799d
      Greg Kroah-Hartman 提交于
      This reverts commit 90d33f3e as it's not
      the correct fix for this issue, and it causes a build warning to be
      added to the kernel tree.
      
      Cc: K. Y. Srinivasan <kys@microsoft.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b762799d
  6. 17 10月, 2013 18 次提交