Skip to content
  1. Aug 13, 2016
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3bc6d8c1
      Linus Torvalds authored
      Pull timer fixes from Ingo Molnar:
       "Misc fixes: a /dev/rtc regression fix, two APIC timer period
        calibration fixes, an ARM clocksource driver fix and a NOHZ
        power use regression fix"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/hpet: Fix /dev/rtc breakage caused by RTC cleanup
        x86/timers/apic: Inform TSC deadline clockevent device about recalibration
        x86/timers/apic: Fix imprecise timer interrupts by eliminating TSC clockevents frequency roundoff error
        timers: Fix get_next_timer_interrupt() computation
        clocksource/arm_arch_timer: Force per-CPU interrupt to be level-triggered
      3bc6d8c1
    • Linus Torvalds's avatar
      Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · e6e7214f
      Linus Torvalds authored
      Pull scheduler fixes from Ingo Molnar:
       "Misc fixes: cputime fixes, two deadline scheduler fixes and a cgroups
        scheduling fix"
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/cputime: Fix omitted ticks passed in parameter
        sched/cputime: Fix steal time accounting
        sched/deadline: Fix lock pinning warning during CPU hotplug
        sched/cputime: Mitigate performance regression in times()/clock_gettime()
        sched/fair: Fix typo in sync_throttle()
        sched/deadline: Fix wrap-around in DL heap
      e6e7214f
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ad83242a
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar:
       "Mostly tooling fixes, plus two uncore-PMU fixes, an uprobes fix, a
        perf-cgroups fix and an AUX events fix"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/intel/uncore: Add enable_box for client MSR uncore
        perf/x86/intel/uncore: Fix uncore num_counters
        uprobes/x86: Fix RIP-relative handling of EVEX-encoded instructions
        perf/core: Set cgroup in CPU contexts for new cgroup events
        perf/core: Fix sideband list-iteration vs. event ordering NULL pointer deference crash
        perf probe ppc64le: Fix probe location when using DWARF
        perf probe: Add function to post process kernel trace events
        tools: Sync cpufeatures headers with the kernel
        toops: Sync tools/include/uapi/linux/bpf.h with the kernel
        tools: Sync cpufeatures.h and vmx.h with the kernel
        perf probe: Support signedness casting
        perf stat: Avoid skew when reading events
        perf probe: Fix module name matching
        perf probe: Adjust map->reloc offset when finding kernel symbol from map
        perf hists: Trim libtraceevent trace_seq buffers
        perf script: Add 'bpf-output' field to usage message
      ad83242a
    • Linus Torvalds's avatar
      Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 1f8083c6
      Linus Torvalds authored
      Pull locking fixes from Ingo Molnar:
       "Misc fixes: lockstat fix, futex fix on !MMU systems, big endian fix
        for qrwlocks and a race fix for pvqspinlocks"
      
      * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        locking/pvqspinlock: Fix a bug in qstat_read()
        locking/pvqspinlock: Fix double hash race
        locking/qrwlock: Fix write unlock bug on big endian systems
        futex: Assume all mappings are private on !MMU systems
      1f8083c6
    • Linus Torvalds's avatar
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 25db6918
      Linus Torvalds authored
      Pull irq fix from Ingo Molnar:
       "A fix for an MSI regression"
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        genirq/msi: Make sure PCI MSIs are activated early
      25db6918
    • Linus Torvalds's avatar
      Merge branch 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 0e1117b2
      Linus Torvalds authored
      Pull EFI fixes from Ingo Molnar:
       "A fix for EFI capsules and an SGI UV platform fix"
      
      * 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        efi/capsule: Allocate whole capsule into virtual memory
        x86/platform/uv: Skip UV runtime services mapping in the efi_runtime_disabled case
      0e1117b2
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-4.8-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · 99091700
      Linus Torvalds authored
      Pull NFS client bugfixes from Trond Myklebust:
       "Highlights include:
      
         - Stable patch from Olga to fix RPCSEC_GSS upcalls when the same user
           needs multiple different security services (e.g.  krb5i and krb5p).
      
         - Stable patch to fix a regression introduced by the use of
           SO_REUSEPORT, and that prevented the use of multiple different NFS
           versions to the same server.
      
         - TCP socket reconnection timer fixes.
      
         - Patch from Neil to disable the use of IPv6 temporary addresses"
      
      * tag 'nfs-for-4.8-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        NFSv4: Cap the transport reconnection timer at 1/2 lease period
        NFSv4: Cleanup the setting of the nfs4 lease period
        SUNRPC: Limit the reconnect backoff timer to the max RPC message timeout
        SUNRPC: Fix reconnection timeouts
        NFSv4.2: LAYOUTSTATS may return NFS4ERR_ADMIN/DELEG_REVOKED
        SUNRPC: disable the use of IPv6 temporary addresses.
        SUNRPC: allow for upcalls for same uid but different gss service
        SUNRPC: Fix up socket autodisconnect
        SUNRPC: Handle EADDRNOTAVAIL on connection failures
      99091700
    • Linus Torvalds's avatar
      Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · c239ae10
      Linus Torvalds authored
      Pull libnvdimm fixes from Dan Williams:
      
       - Fix for the nd_blk (NVDIMM Block Window Aperture) driver.
      
         A spec clarification requires the driver to mask off reserved bits in
         status register.  This is tagged for -stable back to the v4.2 kernel.
      
       - Fix for a kernel crash in the nvdimm unit tests when module loading
         is interrupted with SIGTERM.  Tagged for -stable since validation
         efforts external to Intel use the unit tests for qualifying
         backports.
      
       - Add a new 'size' sysfs attribute for the BTT (NVDIMM Block
         Translation Table) driver to make it symmetric with the other
         namespace personality drivers (PFN and DAX) that provide a size
         attribute for indicating how much namespace capacity is lost to
         metadata.
      
         The BTT change arrived at the start of the merge window and has
         appeared in a -next release.  It can technically wait for 4.9, but it
         is small, fixes asymmetry in the libnvdimm-sysfs interface, and
         something I would have squeezed into the v4.8 pull request had it
         arrived a few days earlier.
      
      * 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        tools/testing/nvdimm: fix SIGTERM vs hotplug crash
        nvdimm, btt: add a size attribute for BTTs
        libnvdimm, nd_blk: mask off reserved status bits
      c239ae10
    • Linus Torvalds's avatar
      Merge tag 'sound-4.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 86fc0488
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "A regression fix of HD-audio runtime PM and two USB quirks"
      
      * tag 'sound-4.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda - Manage power well properly for resume
        ALSA: usb-audio: Add quirk for ELP HD USB Camera
        ALSA: usb-audio: Add a sample rate quirk for Creative Live! Cam Socialize HD (VF0610)
      86fc0488
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 8766dc68
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "Some powerpc fixes for 4.8:
      
        Misc:
         - powerpc/vdso: Fix build rules to rebuild vdsos correctly from Nicholas Piggin
         - powerpc/ptrace: Fix coredump since ptrace TM changes from Cyril Bur
         - powerpc/32: Fix csum_partial_copy_generic() from Christophe Leroy
         - cxl: Set psl_fir_cntl to production environment value from Frederic Barrat
         - powerpc/eeh: Switch to conventional PCI address output in EEH log from Guilherme G. Piccoli
         - cxl: Use fixed width predefined types in data structure. from Philippe Bergheaud
         - powerpc/vdso: Add missing include file from Guenter Roeck
         - powerpc: Fix unused function warning 'lmb_to_memblock' from Alastair D'Silva
         - powerpc/powernv/ioda: Fix TCE invalidate to work in real mode again from Alexey Kardashevskiy
         - powerpc/cell: Add missing error code in spufs_mkgang() from Dan Carpenter
         - crypto: crc32c-vpmsum - Convert to CPU feature based module autoloading from Anton Blanchard
         - powerpc/pasemi: Fix coherent_dma_mask for dma engine from Darren Stevens
      
        Benjamin Herrenschmidt:
         - powerpc/32: Fix crash during static key init
         - powerpc: Update obsolete comment in setup_32.c about early_init()
         - powerpc: Print the kernel load address at the end of prom_init()
         - powerpc/pnv/pci: Fix incorrect PE reservation attempt on some 64-bit BARs
         - powerpc/xics: Properly set Edge/Level type and enable resend
      
        Mahesh Salgaonkar:
         - powerpc/book3s: Fix MCE console messages for unrecoverable MCE.
         - powerpc/powernv: Fix MCE handler to avoid trashing CR0/CR1 registers.
         - powerpc/powernv: Move IDLE_STATE_ENTER_SEQ macro to cpuidle.h
         - powerpc/powernv: Load correct TOC pointer while waking up from winkle.
      
        Andrew Donnellan:
         - cxl: Fix sparse warnings
         - cxl: Fix NULL dereference in cxl_context_init() on PowerVM guests
      
        Michael Ellerman:
         - selftests/powerpc: Specify we expect to build with std=gnu99
         - powerpc/Makefile: Use cflags-y/aflags-y for setting endian options
         - powerpc/pci: Fix endian bug in fixed PHB numbering"
      
      * tag 'powerpc-4.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (26 commits)
        selftests/powerpc: Specify we expect to build with std=gnu99
        powerpc/vdso: Fix build rules to rebuild vdsos correctly
        powerpc/Makefile: Use cflags-y/aflags-y for setting endian options
        powerpc/32: Fix crash during static key init
        powerpc: Update obsolete comment in setup_32.c about early_init()
        powerpc: Print the kernel load address at the end of prom_init()
        powerpc/ptrace: Fix coredump since ptrace TM changes
        powerpc/32: Fix csum_partial_copy_generic()
        cxl: Set psl_fir_cntl to production environment value
        powerpc/pnv/pci: Fix incorrect PE reservation attempt on some 64-bit BARs
        powerpc/book3s: Fix MCE console messages for unrecoverable MCE.
        powerpc/pci: Fix endian bug in fixed PHB numbering
        powerpc/eeh: Switch to conventional PCI address output in EEH log
        cxl: Fix sparse warnings
        cxl: Fix NULL dereference in cxl_context_init() on PowerVM guests
        cxl: Use fixed width predefined types in data structure.
        powerpc/vdso: Add missing include file
        powerpc: Fix unused function warning 'lmb_to_memblock'
        powerpc/powernv: Fix MCE handler to avoid trashing CR0/CR1 registers.
        powerpc/powernv: Move IDLE_STATE_ENTER_SEQ macro to cpuidle.h
        ...
      8766dc68
  2. Aug 12, 2016
    • Kan Liang's avatar
      perf/x86/intel/uncore: Add enable_box for client MSR uncore · 95f3be79
      Kan Liang authored
      
      
      There are bug reports about miscounting uncore counters on some
      client machines like Sandybridge, Broadwell and Skylake. It is
      very likely to be observed on idle systems.
      
      This issue is caused by a hardware issue. PERF_GLOBAL_CTL could be
      cleared after Package C7, and nothing will be count.
      The related errata (HSD 158) could be found in:
      
        www.intel.com/content/dam/www/public/us/en/documents/specification-updates/4th-gen-core-family-desktop-specification-update.pdf
      
      This patch tries to work around this issue by re-enabling PERF_GLOBAL_CTL
      in ->enable_box(). The workaround does not cover all cases. It helps for new
      events after returning from C7. But it cannot prevent C7, it will still
      miscount if a counter is already active.
      
      There is no drawback in leaving it enabled, so it does not need
      disable_box() here.
      
      Signed-off-by: default avatarKan Liang <kan.liang@intel.com>
      Cc: <stable@vger.kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Link: http://lkml.kernel.org/r/1470925874-59943-1-git-send-email-kan.liang@intel.com
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      95f3be79
    • Kan Liang's avatar
      perf/x86/intel/uncore: Fix uncore num_counters · 10e9e7bd
      Kan Liang authored
      
      
      Some uncore boxes' num_counters value for Haswell server and
      Broadwell server are not correct (too large, off by one).
      
      This issue was found by comparing the code with the document. Although
      there is no bug report from users yet, accessing non-existent counters
      is dangerous and the behavior is undefined: it may cause miscounting or
      even crashes.
      
      This patch makes them consistent with the uncore document.
      
      Reported-by: default avatarLukasz Odzioba <lukasz.odzioba@intel.com>
      Signed-off-by: default avatarKan Liang <kan.liang@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: <stable@vger.kernel.org>
      Link: http://lkml.kernel.org/r/1470925820-59847-1-git-send-email-kan.liang@intel.com
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      10e9e7bd
    • Denys Vlasenko's avatar
      uprobes/x86: Fix RIP-relative handling of EVEX-encoded instructions · 68187872
      Denys Vlasenko authored
      
      
      Since instruction decoder now supports EVEX-encoded instructions, two fixes
      are needed to correctly handle them in uprobes.
      
      Extended bits for MODRM.rm field need to be sanitized just like we do it
      for VEX3, to avoid encoding wrong register for register-relative access.
      
      EVEX has _two_ extended bits: b and x. Theoretically, EVEX.x should be
      ignored by the CPU (since GPRs go only up to 15, not 31), but let's be
      paranoid here: proper encoding for register-relative access
      should have EVEX.x = 1.
      
      Secondly, we should fetch vex.vvvv for EVEX too.
      This is now super easy because instruction decoder populates
      vex_prefix.bytes[2] for all flavors of (e)vex encodings, even for VEX2.
      
      Signed-off-by: default avatarDenys Vlasenko <dvlasenk@redhat.com>
      Acked-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: linux-kernel@vger.kernel.org
      Cc: <stable@vger.kernel.org> # v4.1+
      Fixes: 8a764a87
      
       ("x86/asm/decoder: Create artificial 3rd byte for 2-byte VEX")
      Link: http://lkml.kernel.org/r/20160811154521.20469-1-dvlasenk@redhat.com
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      68187872
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 4b9eaf33
      Linus Torvalds authored
      Merge fixes from Andrew Morton:
       "7 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        mm/memory_hotplug.c: initialize per_cpu_nodestats for hotadded pgdats
        mm, oom: fix uninitialized ret in task_will_free_mem()
        kasan: remove the unnecessary WARN_ONCE from quarantine.c
        mm: memcontrol: fix memcg id ref counter on swap charge move
        mm: memcontrol: fix swap counter leak on swapout from offline cgroup
        proc, meminfo: use correct helpers for calculating LRU sizes in meminfo
        mm/hugetlb: fix incorrect hugepages count during mem hotplug
      4b9eaf33
    • Reza Arbab's avatar
      mm/memory_hotplug.c: initialize per_cpu_nodestats for hotadded pgdats · 5830169f
      Reza Arbab authored
      
      
      The following oops occurs after a pgdat is hotadded:
      
        Unable to handle kernel paging request for data at address 0x00c30001
        Faulting instruction address: 0xc00000000022f8f4
        Oops: Kernel access of bad area, sig: 11 [#1]
        SMP NR_CPUS=2048 NUMA pSeries
        Modules linked in: ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 ipt_REJECT nf_reject_ipv4 xt_conntrack ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw iptable_filter nls_utf8 isofs sg virtio_balloon uio_pdrv_genirq uio ip_tables xfs libcrc32c sr_mod cdrom sd_mod virtio_net ibmvscsi scsi_transport_srp virtio_pci virtio_ring virtio dm_mirror dm_region_hash dm_log dm_mod
        CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W 4.8.0-rc1-device #110
        task: c000000000ef3080 task.stack: c000000000f6c000
        NIP: c00000000022f8f4 LR: c00000000022f948 CTR: 0000000000000000
        REGS: c000000000f6fa50 TRAP: 0300   Tainted: G        W (4.8.0-rc1-device)
        MSR: 800000010280b033 <SF,VEC,VSX,EE,FP,ME,IR,DR,RI,LE,TM[E]>  CR: 84002028  XER: 20000000
        CFAR: d000000001d2013c DAR: 0000000000c30001 DSISR: 40000000 SOFTE: 0
        NIP refresh_cpu_vm_stats+0x1a4/0x2f0
        LR refresh_cpu_vm_stats+0x1f8/0x2f0
        Call Trace:
          refresh_cpu_vm_stats+0x1f8/0x2f0 (unreliable)
      
      Add per_cpu_nodestats initialization to the hotplug codepath.
      
      Link: http://lkml.kernel.org/r/1470931473-7090-1-git-send-email-arbab@linux.vnet.ibm.com
      Signed-off-by: default avatarReza Arbab <arbab@linux.vnet.ibm.com>
      Cc: Mel Gorman <mgorman@techsingularity.net>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5830169f
    • Geert Uytterhoeven's avatar
      mm, oom: fix uninitialized ret in task_will_free_mem() · f33e6f06
      Geert Uytterhoeven authored
          mm/oom_kill.c: In function `task_will_free_mem':
          mm/oom_kill.c:767: warning: `ret' may be used uninitialized in this function
      
      If __task_will_free_mem() is never called inside the for_each_process()
      loop, ret will not be initialized.
      
      Fixes: 1af8bb43
      
       ("mm, oom: fortify task_will_free_mem()")
      Link: http://lkml.kernel.org/r/1470255599-24841-1-git-send-email-geert@linux-m68k.org
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f33e6f06
    • Alexander Potapenko's avatar
      kasan: remove the unnecessary WARN_ONCE from quarantine.c · bcbf0d56
      Alexander Potapenko authored
      
      
      It's quite unlikely that the user will so little memory that the per-CPU
      quarantines won't fit into the given fraction of the available memory.
      Even in that case he won't be able to do anything with the information
      given in the warning.
      
      Link: http://lkml.kernel.org/r/1470929182-101413-1-git-send-email-glider@google.com
      Signed-off-by: default avatarAlexander Potapenko <glider@google.com>
      Acked-by: default avatarAndrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Andrey Konovalov <adech.fo@gmail.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Kuthonuzo Luruo <kuthonuzo.luruo@hpe.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      bcbf0d56
    • Vladimir Davydov's avatar
      mm: memcontrol: fix memcg id ref counter on swap charge move · 615d66c3
      Vladimir Davydov authored
      Since commit 73f576c0 ("mm: memcontrol: fix cgroup creation failure
      after many small jobs") swap entries do not pin memcg->css.refcnt
      directly.  Instead, they pin memcg->id.ref.  So we should adjust the
      reference counters accordingly when moving swap charges between cgroups.
      
      Fixes: 73f576c0
      
       ("mm: memcontrol: fix cgroup creation failure after many small jobs")
      Link: http://lkml.kernel.org/r/9ce297c64954a42dc90b543bc76106c4a94f07e8.1470219853.git.vdavydov@virtuozzo.com
      Signed-off-by: default avatarVladimir Davydov <vdavydov@virtuozzo.com>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Cc: <stable@vger.kernel.org>	[3.19+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      615d66c3
    • Vladimir Davydov's avatar
      mm: memcontrol: fix swap counter leak on swapout from offline cgroup · 1f47b61f
      Vladimir Davydov authored
      An offline memory cgroup might have anonymous memory or shmem left
      charged to it and no swap.  Since only swap entries pin the id of an
      offline cgroup, such a cgroup will have no id and so an attempt to
      swapout its anon/shmem will not store memory cgroup info in the swap
      cgroup map.  As a result, memcg->swap or memcg->memsw will never get
      uncharged from it and any of its ascendants.
      
      Fix this by always charging swapout to the first ancestor cgroup that
      hasn't released its id yet.
      
      [hannes@cmpxchg.org: add comment to mem_cgroup_swapout]
      [vdavydov@virtuozzo.com: use WARN_ON_ONCE() in mem_cgroup_id_get_online()]
        Link: http://lkml.kernel.org/r/20160803123445.GJ13263@esperanza
      Fixes: 73f576c0
      
       ("mm: memcontrol: fix cgroup creation failure after many small jobs")
      Link: http://lkml.kernel.org/r/5336daa5c9a32e776067773d9da655d2dc126491.1470219853.git.vdavydov@virtuozzo.com
      Signed-off-by: default avatarVladimir Davydov <vdavydov@virtuozzo.com>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: <stable@vger.kernel.org>	[3.19+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1f47b61f
    • Mel Gorman's avatar
      proc, meminfo: use correct helpers for calculating LRU sizes in meminfo · 2f95ff90
      Mel Gorman authored
      
      
      meminfo_proc_show() and si_mem_available() are using the wrong helpers
      for calculating the size of the LRUs.  The user-visible impact is that
      there appears to be an abnormally high number of unevictable pages.
      
      Link: http://lkml.kernel.org/r/20160805105805.GR2799@techsingularity.net
      Signed-off-by: default avatarMel Gorman <mgorman@techsingularity.net>
      Cc: Dave Chinner <david@fromorbit.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2f95ff90
    • zhong jiang's avatar
      mm/hugetlb: fix incorrect hugepages count during mem hotplug · c1470b33
      zhong jiang authored
      
      
      When memory hotplug operates, free hugepages will be freed if the
      movable node is offline.  Therefore, /proc/sys/vm/nr_hugepages will be
      incorrect.
      
      Fix it by reducing max_huge_pages when the node is offlined.
      
      n-horiguchi@ah.jp.nec.com said:
      
      : dissolve_free_huge_page intends to break a hugepage into buddy, and the
      : destination hugepage is supposed to be allocated from the pool of the
      : destination node, so the system-wide pool size is reduced.  So adding
      : h->max_huge_pages-- makes sense to me.
      
      Link: http://lkml.kernel.org/r/1470624546-902-1-git-send-email-zhongjiang@huawei.com
      Signed-off-by: default avatarzhong jiang <zhongjiang@huawei.com>
      Cc: Mike Kravetz <mike.kravetz@oracle.com>
      Acked-by: default avatarNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c1470b33
    • Linus Torvalds's avatar
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · d3396e1e
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "A couple of bug fixes have come in for v4.8 so far.  Since the first
        few were originally meant to go into -rc1 (but didn't get sent in time
        for travel reasons), the branch is unfortunately based on top of a
        commit in the middle of the merge window rather than -rc1.
      
        Content-wise we have:
      
         - a fix for the last remaining broken build in kernelci, getting
           mach-shmobile to build again with SMP disabled
      
         - a fix for a realview regression that broke real hardware but not
           the qemu model that everyone uses in practice (needed for v4.7 as
           well)
      
         - a merge conflict fix for Tegra that also broke v4.7
      
         - two Kconfig fixes for arm64 build regressions
      
         - a couple of arm32 build warning fixes (all harmless)
      
         - fix the RTC on Exynos7 Espresso (which apparently never worked
           right)"
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        Merge tag 'pxa-fixes-v4.8' of https://github.com/rjarzmik/linux into randconfig-4.8
        arm64: Kconfig: select HISILICON_IRQ_MBIGEN only if PCI is selected
        arm64: Kconfig: select ALPINE_MSI only if PCI is selected
        ARM: dts: realview: Fix PBX-A9 cache description
        ARM: tegra: fix erroneous address in dts
        ARM: dts: add syscon compatible string for AP syscon
        ARM: dts: add syscon compatible string for CP syscon
        ARM: oxnas: select reset controller framework
        ARM: hide mach-*/ include for ARM_SINGLE_ARMV7M
        ARM: don't include removed directories
        Revert "ARM: aspeed: adapt defconfigs for new CONFIG_PRINTK_TIME"
        ARM: shmobile: don't call platform_can_secondary_boot on UP
        MAINTAINER: alpine: add a mailing list
        ARM: do away with final ARCH_REQUIRE_GPIOLIB
        arm64: dts: Fix RTC by providing rtc_src clock
      d3396e1e
    • Linus Torvalds's avatar
      Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost · 6da7e953
      Linus Torvalds authored
      Pull virtio/vhost fixes and cleanups from Michael Tsirkin:
       "Misc fixes and cleanups all over the place"
      
      * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
        virtio/s390: deprecate old transport
        virtio/s390: keep early_put_chars
        virtio_blk: Fix a slient kernel panic
        virtio-vsock: fix include guard typo
        vhost/vsock: fix vhost virtio_vsock_pkt use-after-free
        9p/trans_virtio: use kvfree() for iov_iter_get_pages_alloc()
        virtio: fix error handling for debug builds
        virtio: fix memory leak in virtqueue_add()
      6da7e953
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-4.8-rc2' of https://github.com/ceph/ceph-client · 3b3ce01a
      Linus Torvalds authored
      Pull ceph fixes from Ilya Dryomov:
       "A patch for a NULL dereference bug introduced in 4.8-rc1 and a handful
        of static checker fixes"
      
      * tag 'ceph-for-4.8-rc2' of https://github.com/ceph/ceph-client:
        ceph: initialize pathbase in the !dentry case in encode_caps_cb()
        rbd: nuke the 32-bit pool id check
        rbd: destroy header_oloc in rbd_dev_release()
        ceph: fix null pointer dereference in ceph_flush_snaps()
        libceph: using kfree_rcu() to simplify the code
        libceph: make cancel_generic_request() static
        libceph: fix return value check in alloc_msg_with_page_vector()
      3b3ce01a
  3. Aug 11, 2016
    • Frederic Weisbecker's avatar
      sched/cputime: Fix omitted ticks passed in parameter · 26f2c75c
      Frederic Weisbecker authored
      Commit:
      
        f9bcf1e0
      
       ("sched/cputime: Fix steal time accounting")
      
      ... fixes a leak on steal time accounting but forgets to account
      the ticks passed in parameters, assuming there is only one to
      take into account.
      
      Let's consider that parameter back.
      
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: default avatarWanpeng Li <kernellwp@gmail.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Radim <rkrcmar@redhat.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Wanpeng Li <wanpeng.li@hotmail.com>
      Cc: linux-tip-commits@vger.kernel.org
      Link: http://lkml.kernel.org/r/20160811125822.GB4214@lerouge
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      26f2c75c
    • Austin Christ's avatar
      efi/capsule: Allocate whole capsule into virtual memory · 6862e6ad
      Austin Christ authored
      
      
      According to UEFI 2.6 section 7.5.3, the capsule should be in contiguous
      virtual memory and firmware may consume the capsule immediately. To
      correctly implement this functionality, the kernel driver needs to vmap
      the entire capsule at the time it is made available to firmware.
      
      The virtual allocation of the capsule update has been changed from kmap,
      which was only allocating the first page of the update, to vmap, and
      allocates the entire data payload.
      
      Signed-off-by: default avatarAustin Christ <austinwc@codeaurora.org>
      Signed-off-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
      Reviewed-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
      Reviewed-by: default avatarLee, Chun-Yi <jlee@suse.com>
      Cc: <stable@vger.kernel.org> # v4.7
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Bryan O'Donoghue <pure.logic@nexus-software.ie>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Kweh Hock Leong <hock.leong.kweh@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/1470912120-22831-3-git-send-email-matt@codeblueprint.co.uk
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      6862e6ad
    • Alex Thorlton's avatar
      x86/platform/uv: Skip UV runtime services mapping in the efi_runtime_disabled case · f72075c9
      Alex Thorlton authored
      
      
      This problem has actually been in the UV code for a while, but we didn't
      catch it until recently, because we had been relying on EFI_OLD_MEMMAP
      to allow our systems to boot for a period of time.  We noticed the issue
      when trying to kexec a recent community kernel, where we hit this NULL
      pointer dereference in efi_sync_low_kernel_mappings():
      
       [    0.337515] BUG: unable to handle kernel NULL pointer dereference at 0000000000000880
       [    0.346276] IP: [<ffffffff8105df8d>] efi_sync_low_kernel_mappings+0x5d/0x1b0
      
      The problem doesn't show up with EFI_OLD_MEMMAP because we skip the
      chunk of setup_efi_state() that sets the efi_loader_signature for the
      kexec'd kernel.  When the kexec'd kernel boots, it won't set EFI_BOOT in
      setup_arch, so we completely avoid the bug.
      
      We always kexec with noefi on the command line, so this shouldn't be an
      issue, but since we're not actually checking for efi_runtime_disabled in
      uv_bios_init(), we end up trying to do EFI runtime callbacks when we
      shouldn't be. This patch just adds a check for efi_runtime_disabled in
      uv_bios_init() so that we don't map in uv_systab when runtime_disabled ==
      true.
      
      Signed-off-by: default avatarAlex Thorlton <athorlton@sgi.com>
      Signed-off-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
      Cc: <stable@vger.kernel.org> # v4.7
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Travis <travis@sgi.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Russ Anderson <rja@sgi.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/1470912120-22831-2-git-send-email-matt@codeblueprint.co.uk
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      f72075c9
    • Wanpeng Li's avatar
      sched/cputime: Fix steal time accounting · f9bcf1e0
      Wanpeng Li authored
      Commit:
      
        57430218
      
       ("sched/cputime: Count actually elapsed irq & softirq time")
      
      ... didn't take steal time into consideration with passing the noirqtime
      kernel parameter.
      
      As Paolo pointed out before:
      
      | Why not? If idle=poll, for example, any time the guest is suspended (and
      | thus cannot poll) does count as stolen time.
      
      This patch fixes it by reducing steal time from idle time accounting when
      the noirqtime parameter is true. The average idle time drops from 56.8%
      to 54.75% for nohz idle kvm guest(noirqtime, idle=poll, four vCPUs running
      on one pCPU).
      
      Signed-off-by: default avatarWanpeng Li <wanpeng.li@hotmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Radim <rkrcmar@redhat.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/1470893795-3527-1-git-send-email-wanpeng.li@hotmail.com
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      f9bcf1e0
    • Arnd Bergmann's avatar
      Merge tag 'pxa-fixes-v4.8' of https://github.com/rjarzmik/linux into randconfig-4.8 · 12beb346
      Arnd Bergmann authored
      This is the pxa changes for v4.8 cycle.
      
      This is a tiny fix couple to enable changes in includes in
      gpio API without breaking pxa boards.
      
      * tag 'pxa-fixes-v4.8' of https://github.com/rjarzmik/linux:
        ARM: pxa: add module.h for corgi symbol_get/symbol_put usage
        ARM: pxa: add module.h for spitz symbol_get/symbol_put usage
      12beb346
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 85e97be3
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "8 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        mm/slub.c: run free_partial() outside of the kmem_cache_node->list_lock
        rmap: fix compound check logic in page_remove_file_rmap
        mm, rmap: fix false positive VM_BUG() in page_add_file_rmap()
        mm/page_alloc.c: recalculate some of node threshold when on/offline memory
        mm/page_alloc.c: fix wrong initialization when sysctl_min_unmapped_ratio changes
        thp: move shmem_huge_enabled() outside of SYSFS ifdef
        revert "ARM: keystone: dts: add psci command definition"
        rapidio: dereferencing an error pointer
      85e97be3
    • Chris Wilson's avatar
      mm/slub.c: run free_partial() outside of the kmem_cache_node->list_lock · 60398923
      Chris Wilson authored
      With debugobjects enabled and using SLAB_DESTROY_BY_RCU, when a
      kmem_cache_node is destroyed the call_rcu() may trigger a slab
      allocation to fill the debug object pool (__debug_object_init:fill_pool).
      
      Everywhere but during kmem_cache_destroy(), discard_slab() is performed
      outside of the kmem_cache_node->list_lock and avoids a lockdep warning
      about potential recursion:
      
        =============================================
        [ INFO: possible recursive locking detected ]
        4.8.0-rc1-gfxbench+ #1 Tainted: G     U
        ---------------------------------------------
        rmmod/8895 is trying to acquire lock:
         (&(&n->list_lock)->rlock){-.-...}, at: [<ffffffff811c80d7>] get_partial_node.isra.63+0x47/0x430
      
        but task is already holding lock:
         (&(&n->list_lock)->rlock){-.-...}, at: [<ffffffff811cbda4>] __kmem_cache_shutdown+0x54/0x320
      
        other info that might help us debug this:
        Possible unsafe locking scenario:
              CPU0
              ----
         lock(&(&n->list_lock)->rlock);
         lock(&(&n->list_lock)->rlock);
      
         *** DEADLOCK ***
         May be due to missing lock nesting notation
         5 locks held by rmmod/8895:
         #0:  (&dev->mutex){......}, at: driver_detach+0x42/0xc0
         #1:  (&dev->mutex){......}, at: driver_detach+0x50/0xc0
         #2:  (cpu_hotplug.dep_map){++++++}, at: get_online_cpus+0x2d/0x80
         #3:  (slab_mutex){+.+.+.}, at: kmem_cache_destroy+0x3c/0x220
         #4:  (&(&n->list_lock)->rlock){-.-...}, at: __kmem_cache_shutdown+0x54/0x320
      
        stack backtrace:
        CPU: 6 PID: 8895 Comm: rmmod Tainted: G     U          4.8.0-rc1-gfxbench+ #1
        Hardware name: Gigabyte Technology Co., Ltd. H87M-D3H/H87M-D3H, BIOS F11 08/18/2015
        Call Trace:
          __lock_acquire+0x1646/0x1ad0
          lock_acquire+0xb2/0x200
          _raw_spin_lock+0x36/0x50
          get_partial_node.isra.63+0x47/0x430
          ___slab_alloc.constprop.67+0x1a7/0x3b0
          __slab_alloc.isra.64.constprop.66+0x43/0x80
          kmem_cache_alloc+0x236/0x2d0
          __debug_object_init+0x2de/0x400
          debug_object_activate+0x109/0x1e0
          __call_rcu.constprop.63+0x32/0x2f0
          call_rcu+0x12/0x20
          discard_slab+0x3d/0x40
          __kmem_cache_shutdown+0xdb/0x320
          shutdown_cache+0x19/0x60
          kmem_cache_destroy+0x1ae/0x220
          i915_gem_load_cleanup+0x14/0x40 [i915]
          i915_driver_unload+0x151/0x180 [i915]
          i915_pci_remove+0x14/0x20 [i915]
          pci_device_remove+0x34/0xb0
          __device_release_driver+0x95/0x140
          driver_detach+0xb6/0xc0
          bus_remove_driver+0x53/0xd0
          driver_unregister+0x27/0x50
          pci_unregister_driver+0x25/0x70
          i915_exit+0x1a/0x1e2 [i915]
          SyS_delete_module+0x193/0x1f0
          entry_SYSCALL_64_fastpath+0x1c/0xac
      
      Fixes: 52b4b950
      
       ("mm: slab: free kmem_cache_node after destroy sysfs file")
      Link: http://lkml.kernel.org/r/1470759070-18743-1-git-send-email-chris@chris-wilson.co.uk
      Reported-by: default avatarDave Gordon <david.s.gordon@intel.com>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarVladimir Davydov <vdavydov@virtuozzo.com>
      Acked-by: default avatarChristoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Dave Gordon <david.s.gordon@intel.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      60398923
    • Steve Capper's avatar
      rmap: fix compound check logic in page_remove_file_rmap · 57dea93a
      Steve Capper authored
      In page_remove_file_rmap(.) we have the following check:
      
        VM_BUG_ON_PAGE(compound && !PageTransHuge(page), page);
      
      This is meant to check for either HugeTLB pages or THP when a compound
      page is passed in.
      
      Unfortunately, if one disables CONFIG_TRANSPARENT_HUGEPAGE, then
      PageTransHuge(.) will always return false, provoking BUGs when one runs
      the libhugetlbfs test suite.
      
      This patch replaces PageTransHuge(), with PageHead() which will work for
      both HugeTLB and THP.
      
      Fixes: dd78fedd
      
       ("rmap: support file thp")
      Link: http://lkml.kernel.org/r/1470838217-5889-1-git-send-email-steve.capper@arm.com
      Signed-off-by: default avatarSteve Capper <steve.capper@arm.com>
      Acked-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Huang Shijie <shijie.huang@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      57dea93a
    • Kirill A. Shutemov's avatar
      mm, rmap: fix false positive VM_BUG() in page_add_file_rmap() · c8efc390
      Kirill A. Shutemov authored
      
      
      PageTransCompound() doesn't distinguish THP from from any other type of
      compound pages.  This can lead to false-positive VM_BUG_ON() in
      page_add_file_rmap() if called on compound page from a driver[1].
      
      I think we can exclude such cases by checking if the page belong to a
      mapping.
      
      The VM_BUG_ON_PAGE() is downgraded to VM_WARN_ON_ONCE().  This path
      should not cause any harm to non-THP page, but good to know if we step
      on anything else.
      
      [1] http://lkml.kernel.org/r/c711e067-0bff-a6cb-3c37-04dfe77d2db1@redhat.com
      
      Link: http://lkml.kernel.org/r/20160810161345.GA67522@black.fi.intel.com
      Signed-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Reported-by: default avatarLaura Abbott <labbott@redhat.com>
      Tested-by: default avatarLaura Abbott <labbott@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c8efc390
    • Joonsoo Kim's avatar
      mm/page_alloc.c: recalculate some of node threshold when on/offline memory · 6423aa81
      Joonsoo Kim authored
      
      
      Some of node threshold depends on number of managed pages in the node.
      When memory is going on/offline, it can be changed and we need to adjust
      them.
      
      Add recalculation to appropriate places and clean-up related functions
      for better maintenance.
      
      Link: http://lkml.kernel.org/r/1470724248-26780-2-git-send-email-iamjoonsoo.kim@lge.com
      Signed-off-by: default avatarJoonsoo Kim <iamjoonsoo.kim@lge.com>
      Acked-by: default avatarMel Gorman <mgorman@techsingularity.net>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Minchan Kim <minchan@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6423aa81
    • Joonsoo Kim's avatar
      mm/page_alloc.c: fix wrong initialization when sysctl_min_unmapped_ratio changes · 81cbcbc2
      Joonsoo Kim authored
      Before resetting min_unmapped_pages, we need to initialize
      min_unmapped_pages rather than min_slab_pages.
      
      Fixes: a5f5f91d
      
       (mm: convert zone_reclaim to node_reclaim)
      Link: http://lkml.kernel.org/r/1470724248-26780-1-git-send-email-iamjoonsoo.kim@lge.com
      Signed-off-by: default avatarJoonsoo Kim <iamjoonsoo.kim@lge.com>
      Acked-by: default avatarMel Gorman <mgorman@techsingularity.net>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Minchan Kim <minchan@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      81cbcbc2
    • Arnd Bergmann's avatar
      thp: move shmem_huge_enabled() outside of SYSFS ifdef · 3b33719c
      Arnd Bergmann authored
      The newly introduced shmem_huge_enabled() function has two definitions,
      but neither of them is visible if CONFIG_SYSFS is disabled, leading to a
      build error:
      
        mm/khugepaged.o: In function `khugepaged':
        khugepaged.c:(.text.khugepaged+0x3ca): undefined reference to `shmem_huge_enabled'
      
      This changes the #ifdef guards around the definition to match those that
      are used in the header file.
      
      Fixes: e496cf3d
      
       ("thp: introduce CONFIG_TRANSPARENT_HUGE_PAGECACHE")
      Link: http://lkml.kernel.org/r/20160809123638.1357593-1-arnd@arndb.de
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3b33719c
    • Andrew Morton's avatar
      revert "ARM: keystone: dts: add psci command definition" · a545de5c
      Andrew Morton authored
      Revert commit 51d5d12b
      
       ("ARM: keystone: dts: add psci command
      definition"), which was inadvertently added twice.
      
      Cc: Russell King - ARM Linux <linux@armlinux.org.uk>
      Cc: Vitaly Andrianov <vitalya@ti.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a545de5c
    • Dan Carpenter's avatar
      rapidio: dereferencing an error pointer · 73984137
      Dan Carpenter authored
      
      
      Original patch: https://lkml.org/lkml/2016/8/4/32
      
      If riocm_ch_alloc() fails then we end up dereferencing the error
      pointer.
      
      The problem is that we're not unwinding in the reverse order from how we
      allocate things so it gets confusing.  I've changed this around so now
      "ch" is NULL when we are done with it after we call riocm_put_channel().
      That way we can check if it's NULL and avoid calling riocm_put_channel()
      on it twice.
      
      I renamed err_nodev to err_put_new_ch so that it better reflects what
      the goto does.
      
      Then because we had flipping things around, it means we don't neeed to
      initialize the pointers to NULL and we can remove an if statement and
      pull things in an indent level.
      
      Link: http://lkml.kernel.org/r/20160805152406.20713-1-alexandre.bounine@idt.com
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarAlexandre Bounine <alexandre.bounine@idt.com>
      Cc: Matt Porter <mporter@kernel.crashing.org>
      Cc: Andre van Herk <andre.van.herk@prodrive-technologies.com>
      Cc: Barry Wood <barry.wood@idt.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      73984137
    • Dan Williams's avatar
      tools/testing/nvdimm: fix SIGTERM vs hotplug crash · d8d378fa
      Dan Williams authored
      
      
      The unit tests crash when hotplug races the previous probe. This race
      requires that the loading of the nfit_test module be terminated with
      SIGTERM, and the module to be unloaded while the ars scan is still
      running.
      
      In contrast to the normal nfit driver, the unit test calls
      acpi_nfit_init() twice to simulate hotplug, whereas the nominal case
      goes through the acpi_nfit_notify() event handler.  The
      acpi_nfit_notify() path is careful to flush the previous region
      registration before servicing the hotplug event. The unit test was
      missing this guarantee.
      
       BUG: unable to handle kernel NULL pointer dereference at           (null)
       IP: [<ffffffff810cdce7>] pwq_activate_delayed_work+0x47/0x170
       [..]
       Call Trace:
        [<ffffffff810ce186>] pwq_dec_nr_in_flight+0x66/0xa0
        [<ffffffff810ce490>] process_one_work+0x2d0/0x680
        [<ffffffff810ce331>] ? process_one_work+0x171/0x680
        [<ffffffff810ce88e>] worker_thread+0x4e/0x480
        [<ffffffff810ce840>] ? process_one_work+0x680/0x680
        [<ffffffff810ce840>] ? process_one_work+0x680/0x680
        [<ffffffff810d5343>] kthread+0xf3/0x110
        [<ffffffff8199846f>] ret_from_fork+0x1f/0x40
        [<ffffffff810d5250>] ? kthread_create_on_node+0x230/0x230
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      d8d378fa
    • Sudeep Holla's avatar
      arm64: Kconfig: select HISILICON_IRQ_MBIGEN only if PCI is selected · f9db43bc
      Sudeep Holla authored
      
      
      Even when PCI is disabled, ARCH_HISI selects HISILICON_IRQ_MBIGEN
      triggerring the following config warning:
      
      warning: (ARM64 && HISILICON_IRQ_MBIGEN) selects ARM_GIC_V3_ITS which
      	has unmet direct dependencies (PCI && PCI_MSI)
      
      This patch makes selection of HISILICON_IRQ_MBIGEN conditional on PCI.
      
      Cc: Ma Jun <majun258@huawei.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      f9db43bc