1. 29 Nov, 2017 2 commits
    • Ingo Molnar's avatar
      Merge branch 'perf/urgent' of... · 6e948c67
      Ingo Molnar authored
      Merge branch 'perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Pull perf tooling fixes from Arnaldo Carvalho de Melo:
      
      "- Fix window dimensions change handling in 'perf top' (Jiri Olsa)
      
      - Fix 'perf record -c/-F' options for CPU event aliases (Andi Kleen)
      
      - Generate PERF_RECORD_{MMAP,COMM,EXEC} with 'perf record --delay'
        fixing symbol resolution for processes created, maps put in place
        while --delay happens (Arnaldo Carvalho de Melo)
      
      - Fix up leftover perf_evsel_stat usage via evsel->priv, plugging
        a SEGV when using event groups as in:
      
           $ perf stat -e '{cpu-clock,instructions}' workload
      
      - Fix 'perf script --per-event-dump' for auxtrace synth evsels (Arnaldo Carvalho de Melo)
      
      - Ignore kptr_restrict when not sampling the kernel (Arnaldo Carvalho de Melo)
      
      - Synchronize kernel ABI headers wrt SPDX tags and ABI changes,
        taking minimal action to handle new syscall args and silencing
        perf build warnings (Arnaldo Carvalho de Melo, Ingo Molnar)
      
      - Fix header.size for namespace events (Jiri Olsa)
      
      - Fix a bug during strstart() conversion in 'perf help' (Namhyung Kim)
      
      - Do not truncate instruction names at 6 chars in 'perf annotate', there
        are really long instruction names in PPC (Ravi Bangoria)
      
      - Fixup discontiguous/sparse numa nodes in 'perf bench numa' (Satheesh Rajendran)
      
      - Fix an exit code of trace__symbols_init in 'perf trace' (Andrei Vagin)
      
      - Fix 'perf test' entries on s/390 (Thomas Richter)
      
      - Bring instruction decoder files used by Intel PT into line with the kernel,
        silencing build warning (Adrian Hunter)"
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      6e948c67
    • Ingo Molnar's avatar
  2. 28 Nov, 2017 29 commits
  3. 15 Nov, 2017 1 commit
    • Vasily Averin's avatar
      perf/core: Fix memory leak triggered by perf --namespace · 0e18dd12
      Vasily Averin authored
      perf with --namespace key leaks various memory objects including namespaces
      
        4.14.0+
        pid_namespace          1     12   2568   12    8
        user_namespace         1     39    824   39    8
        net_namespace          1      5   6272    5    8
      
      This happen because perf_fill_ns_link_info() struct patch ns_path:
      during initialization ns_path incremented counters on related mnt and dentry,
      but without lost path_put nobody decremented them back.
      Leaked dentry is name of related namespace,
      and its leak does not allow to free unused namespace.
      Signed-off-by: default avatarVasily Averin <vvs@virtuozzo.com>
      Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Hari Bathini <hbathini@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Fixes: commit e4222673 ("perf: Add PERF_RECORD_NAMESPACES to include namespaces related info")
      Link: http://lkml.kernel.org/r/c510711b-3904-e5e1-d296-61273d21118d@virtuozzo.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      0e18dd12
  4. 14 Nov, 2017 8 commits
    • Rafael J. Wysocki's avatar
      x86 / CPU: Avoid unnecessary IPIs in arch_freq_get_on_cpu() · b29c6ef7
      Rafael J. Wysocki authored
      Even though aperfmperf_snapshot_khz() caches the samples.khz value to
      return if called again in a sufficiently short time, its caller,
      arch_freq_get_on_cpu(), still uses smp_call_function_single() to run it
      which may allow user space to trigger an IPI storm by reading from the
      scaling_cur_freq cpufreq sysfs file in a tight loop.
      
      To avoid that, move the decision on whether or not to return the cached
      samples.khz value to arch_freq_get_on_cpu().
      
      This change was part of commit 941f5f0f ("x86: CPU: Fix up "cpu MHz"
      in /proc/cpuinfo"), but it was not the reason for the revert and it
      remains applicable.
      
      Fixes: 4815d3c5 (cpufreq: x86: Make scaling_cur_freq behave more as expected)
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: default avatarWANG Chao <chao.wang@ucloud.cn>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b29c6ef7
    • Linus Torvalds's avatar
      Merge branch 'x86-timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 99306dfc
      Linus Torvalds authored
      Pull x86 timer updates from Thomas Gleixner:
       "These updates are related to TSC handling:
      
         - Support platforms which have synchronized TSCs but the boot CPU has
           a non zero TSC_ADJUST value, which is considered a firmware bug on
           normal systems.
      
           This applies to HPE/SGI UV platforms where the platform firmware
           uses TSC_ADJUST to ensure TSC synchronization across a huge number
           of sockets, but due to power on timings the boot CPU cannot be
           guaranteed to have a zero TSC_ADJUST register value.
      
         - Fix the ordering of udelay calibration and kvmclock_init()
      
         - Cleanup the udelay and calibration code"
      
      * 'x86-timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/tsc: Mark cyc2ns_init() and detect_art() __init
        x86/platform/UV: Mark tsc_check_sync as an init function
        x86/tsc: Make CONFIG_X86_TSC=n build work again
        x86/platform/UV: Add check of TSC state set by UV BIOS
        x86/tsc: Provide a means to disable TSC ART
        x86/tsc: Drastically reduce the number of firmware bug warnings
        x86/tsc: Skip TSC test and error messages if already unstable
        x86/tsc: Add option that TSC on Socket 0 being non-zero is valid
        x86/timers: Move simple_udelay_calibration() past kvmclock_init()
        x86/timers: Make recalibrate_cpu_khz() void
        x86/timers: Move the simple udelay calibration to tsc.h
      99306dfc
    • Linus Torvalds's avatar
      Merge branch 'x86-cache-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3643b7e0
      Linus Torvalds authored
      Pull x86 cache resource updates from Thomas Gleixner:
       "This update provides updates to RDT:
      
        - A diagnostic framework for the Resource Director Technology (RDT)
          user interface (sysfs). The failure modes of the user interface are
          hard to diagnose from the error codes. An extra last command status
          file provides now sensible textual information about the failure so
          its simpler to use.
      
        - A few minor cleanups and updates in the RDT code"
      
      * 'x86-cache-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/intel_rdt: Fix a silent failure when writing zero value schemata
        x86/intel_rdt: Fix potential deadlock during resctrl mount
        x86/intel_rdt: Fix potential deadlock during resctrl unmount
        x86/intel_rdt: Initialize bitmask of shareable resource if CDP enabled
        x86/intel_rdt: Remove redundant assignment
        x86/intel_rdt/cqm: Make integer rmid_limbo_count static
        x86/intel_rdt: Add documentation for "info/last_cmd_status"
        x86/intel_rdt: Add diagnostics when making directories
        x86/intel_rdt: Add diagnostics when writing the cpus file
        x86/intel_rdt: Add diagnostics when writing the tasks file
        x86/intel_rdt: Add diagnostics when writing the schemata file
        x86/intel_rdt: Add framework for better RDT UI diagnostics
      3643b7e0
    • Linus Torvalds's avatar
      Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b18d6289
      Linus Torvalds authored
      Pull x86 APIC updates from Thomas Gleixner:
       "This update provides a major overhaul of the APIC initialization and
        vector allocation code:
      
         - Unification of the APIC and interrupt mode setup which was
           scattered all over the place and was hard to follow. This also
           distangles the timer setup from the APIC initialization which
           brings a clear separation of functionality.
      
           Great detective work from Dou Lyiang!
      
         - Refactoring of the x86 vector allocation mechanism. The existing
           code was based on nested loops and rather convoluted APIC callbacks
           which had a horrible worst case behaviour and tried to serve all
           different use cases in one go. This led to quite odd hacks when
           supporting the new managed interupt facility for multiqueue devices
           and made it more or less impossible to deal with the vector space
           exhaustion which was a major roadblock for server hibernation.
      
           Aside of that the code dealing with cpu hotplug and the system
           vectors was disconnected from the actual vector management and
           allocation code, which made it hard to follow and maintain.
      
           Utilizing the new bitmap matrix allocator core mechanism, the new
           allocator and management code consolidates the handling of system
           vectors, legacy vectors, cpu hotplug mechanisms and the actual
           allocation which needs to be aware of system and legacy vectors and
           hotplug constraints into a single consistent entity.
      
           This has one visible change: The support for multi CPU targets of
           interrupts, which is only available on a certain subset of
           CPUs/APIC variants has been removed in favour of single interrupt
           targets. A proper analysis of the multi CPU target feature revealed
           that there is no real advantage as the vast majority of interrupts
           end up on the CPU with the lowest APIC id in the set of target CPUs
           anyway. That change was agreed on by the relevant folks and allowed
           to simplify the implementation significantly and to replace rather
           fragile constructs like the vector cleanup IPI with straight
           forward and solid code.
      
           Furthermore this allowed to cleanly separate the allocation details
           for legacy, normal and managed interrupts:
      
            * Legacy interrupts are not longer wasting 16 vectors
              unconditionally
      
            * Managed interrupts have now a guaranteed vector reservation, but
              the actual vector assignment happens when the interrupt is
              requested. It's guaranteed not to fail.
      
            * Normal interrupts no longer allocate vectors unconditionally
              when the interrupt is set up (IO/APIC init or MSI(X) enable).
              The mechanism has been switched to a best effort reservation
              mode. The actual allocation happens when the interrupt is
              requested. Contrary to managed interrupts the request can fail
              due to vector space exhaustion, but drivers must handle a fail
              of request_irq() anyway. When the interrupt is freed, the vector
              is handed back as well.
      
              This solves a long standing problem with large unconditional
              vector allocations for a certain class of enterprise devices
              which prevented server hibernation due to vector space
              exhaustion when the unused allocated vectors had to be migrated
              to CPU0 while unplugging all non boot CPUs.
      
           The code has been equipped with trace points and detailed debugfs
           information to aid analysis of the vector space"
      
      * 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (60 commits)
        x86/vector/msi: Select CONFIG_GENERIC_IRQ_RESERVATION_MODE
        PCI/MSI: Set MSI_FLAG_MUST_REACTIVATE in core code
        genirq: Add config option for reservation mode
        x86/vector: Use correct per cpu variable in free_moved_vector()
        x86/apic/vector: Ignore set_affinity call for inactive interrupts
        x86/apic: Fix spelling mistake: "symmectic" -> "symmetric"
        x86/apic: Use dead_cpu instead of current CPU when cleaning up
        ACPI/init: Invoke early ACPI initialization earlier
        x86/vector: Respect affinity mask in irq descriptor
        x86/irq: Simplify hotplug vector accounting
        x86/vector: Switch IOAPIC to global reservation mode
        x86/vector/msi: Switch to global reservation mode
        x86/vector: Handle managed interrupts proper
        x86/io_apic: Reevaluate vector configuration on activate()
        iommu/amd: Reevaluate vector configuration on activate()
        iommu/vt-d: Reevaluate vector configuration on activate()
        x86/apic/msi: Force reactivation of interrupts at startup time
        x86/vector: Untangle internal state from irq_cfg
        x86/vector: Compile SMP only code conditionally
        x86/apic: Remove unused callbacks
        ...
      b18d6289
    • Linus Torvalds's avatar
      Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 7d58e1c9
      Linus Torvalds authored
      Pull smp/hotplug updates from Thomas Gleixner:
       "No functional changes, just removal of obsolete and outdated defines,
        macros and documentation"
      
      * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        cpu/hotplug: Get rid of CPU hotplug notifier leftovers
        cpu/hotplug: Remove obsolete notifier macros
      7d58e1c9
    • Linus Torvalds's avatar
      Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 2bcc6731
      Linus Torvalds authored
      Pull timer updates from Thomas Gleixner:
       "Yet another big pile of changes:
      
         - More year 2038 work from Arnd slowly reaching the point where we
           need to think about the syscalls themself.
      
         - A new timer function which allows to conditionally (re)arm a timer
           only when it's either not running or the new expiry time is sooner
           than the armed expiry time. This allows to use a single timer for
           multiple timeout requirements w/o caring about the first expiry
           time at the call site.
      
         - A new NMI safe accessor to clock real time for the printk timestamp
           work. Can be used by tracing, perf as well if required.
      
         - A large number of timer setup conversions from Kees which got
           collected here because either maintainers requested so or they
           simply got ignored. As Kees pointed out already there are a few
           trivial merge conflicts and some redundant commits which was
           unavoidable due to the size of this conversion effort.
      
         - Avoid a redundant iteration in the timer wheel softirq processing.
      
         - Provide a mechanism to treat RTC implementations depending on their
           hardware properties, i.e. don't inflict the write at the 0.5
           seconds boundary which originates from the PC CMOS RTC to all RTCs.
           No functional change as drivers need to be updated separately.
      
         - The usual small updates to core code clocksource drivers. Nothing
           really exciting"
      
      * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (111 commits)
        timers: Add a function to start/reduce a timer
        pstore: Use ktime_get_real_fast_ns() instead of __getnstimeofday()
        timer: Prepare to change all DEFINE_TIMER() callbacks
        netfilter: ipvs: Convert timers to use timer_setup()
        scsi: qla2xxx: Convert timers to use timer_setup()
        block/aoe: discover_timer: Convert timers to use timer_setup()
        ide: Convert timers to use timer_setup()
        drbd: Convert timers to use timer_setup()
        mailbox: Convert timers to use timer_setup()
        crypto: Convert timers to use timer_setup()
        drivers/pcmcia: omap1: Fix error in automated timer conversion
        ARM: footbridge: Fix typo in timer conversion
        drivers/sgi-xp: Convert timers to use timer_setup()
        drivers/pcmcia: Convert timers to use timer_setup()
        drivers/memstick: Convert timers to use timer_setup()
        drivers/macintosh: Convert timers to use timer_setup()
        hwrng/xgene-rng: Convert timers to use timer_setup()
        auxdisplay: Convert timers to use timer_setup()
        sparc/led: Convert timers to use timer_setup()
        mips: ip22/32: Convert timers to use timer_setup()
        ...
      2bcc6731
    • Linus Torvalds's avatar
      Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 670310df
      Linus Torvalds authored
      Pull irq core updates from Thomas Gleixner:
       "A rather large update for the interrupt core code and the irq chip drivers:
      
         - Add a new bitmap matrix allocator and supporting changes, which is
           used to replace the x86 vector allocator which comes with separate
           pull request. This allows to replace the convoluted nested loop
           allocation function in x86 with a facility which supports the
           recently added property of managed interrupts proper and allows to
           switch to a best effort vector reservation scheme, which addresses
           problems with vector exhaustion.
      
         - A large update to the ARM GIC-V3-ITS driver adding support for
           range selectors.
      
         - New interrupt controllers:
             - Meson and Meson8 GPIO
             - BCM7271 L2
             - Socionext EXIU
      
           If you expected that this will stop at some point, I have to
           disappoint you. There are new ones posted already. Sigh!
      
         - STM32 interrupt controller support for new platforms.
      
         - A pile of fixes, cleanups and updates to the MIPS GIC driver
      
         - The usual small fixes, cleanups and updates all over the place.
           Most visible one is to move the irq chip drivers Kconfig switches
           into a separate Kconfig menu"
      
      * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (70 commits)
        genirq: Fix type of shifting literal 1 in __setup_irq()
        irqdomain: Drop pointless NULL check in virq_debug_show_one
        genirq/proc: Return proper error code when irq_set_affinity() fails
        irq/work: Use llist_for_each_entry_safe
        irqchip: mips-gic: Print warning if inherited GIC base is used
        irqchip/mips-gic: Add pr_fmt and reword pr_* messages
        irqchip/stm32: Move the wakeup on interrupt mask
        irqchip/stm32: Fix initial values
        irqchip/stm32: Add stm32h7 support
        dt-bindings/interrupt-controllers: Add compatible string for stm32h7
        irqchip/stm32: Add multi-bank management
        irqchip/stm32: Select GENERIC_IRQ_CHIP
        irqchip/exiu: Add support for Socionext Synquacer EXIU controller
        dt-bindings: Add description of Socionext EXIU interrupt controller
        irqchip/gic-v3-its: Fix VPE activate callback return value
        irqchip: mips-gic: Make IPI bitmaps static
        irqchip: mips-gic: Share register writes in gic_set_type()
        irqchip: mips-gic: Remove gic_vpes variable
        irqchip: mips-gic: Use num_possible_cpus() to reserve IPIs
        irqchip: mips-gic: Configure EIC when CPUs come online
        ...
      670310df
    • Linus Torvalds's avatar
      Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 43ff2f4d
      Linus Torvalds authored
      Pull x86 platform updates from Ingo Molnar:
       "The main changes in this cycle were:
      
         - a refactoring of the early virt init code by merging 'struct
           x86_hyper' into 'struct x86_platform' and 'struct x86_init', which
           allows simplifications and also the addition of a new
           ->guest_late_init() callback. (Juergen Gross)
      
         - timer_setup() conversion of the UV code (Kees Cook)"
      
      * 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/virt/xen: Use guest_late_init to detect Xen PVH guest
        x86/virt, x86/platform: Add ->guest_late_init() callback to hypervisor_x86 structure
        x86/virt, x86/acpi: Add test for ACPI_FADT_NO_VGA
        x86/virt: Add enum for hypervisors to replace x86_hyper
        x86/virt, x86/platform: Merge 'struct x86_hyper' into 'struct x86_platform' and 'struct x86_init'
        x86/platform/UV: Convert timers to use timer_setup()
      43ff2f4d