22 Jul, 2015

3 commits

  • region_is_ram() looks up the iomem_resource table to check if
    a target range is in RAM. However, it always returns with -1
    due to invalid range checks. It always breaks the loop at the
    first entry of the table.

    Another issue is that it compares p->flags and flags, but it always
    fails. flags is declared as int, which makes it as a negative value
    with IORESOURCE_BUSY (0x80000000) set while p->flags is unsigned long.

    Fix the range check and flags so that region_is_ram() works as
    advertised.

    Signed-off-by: Toshi Kani
    Reviewed-by: Dan Williams
    Cc: Mike Travis
    Cc: Luis R. Rodriguez
    Cc: Andrew Morton
    Cc: Roland Dreier
    Cc: linux-mm@kvack.org
    Link: http://lkml.kernel.org/r/1437088996-28511-4-git-send-email-toshi.kani@hp.com
    Signed-off-by: Thomas Gleixner

    Toshi Kani
     
  • __ioremap_caller() calls region_is_ram() to walk through the
    iomem_resource table to check if a target range is in RAM, which was
    added to improve the lookup performance over page_is_ram() (commit
    906e36c5c717 "x86: use optimized ioresource lookup in ioremap
    function"). page_is_ram() was no longer used when this change was
    added, though.

    __ioremap_caller() then calls walk_system_ram_range(), which had
    replaced page_is_ram() to improve the lookup performance (commit
    c81c8a1eeede "x86, ioremap: Speed up check for RAM pages").

    Since both checks walk through the same iomem_resource table for
    the same purpose, there is no need to call both functions.

    Aside of that walk_system_ram_range() is the only useful check at the
    moment because region_is_ram() always returns -1 due to an
    implementation bug. That bug in region_is_ram() cannot be fixed
    without breaking existing ioremap callers, which rely on the subtle
    difference of walk_system_ram_range() versus non page aligned ranges.

    Once these offending callers are fixed we can use region_is_ram() and
    remove walk_system_ram_range().

    [ tglx: Massaged changelog ]

    Signed-off-by: Toshi Kani
    Reviewed-by: Dan Williams
    Cc: Roland Dreier
    Cc: Mike Travis
    Cc: Luis R. Rodriguez
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: Borislav Petkov
    Cc: linux-mm@kvack.org
    Link: http://lkml.kernel.org/r/1437088996-28511-3-git-send-email-toshi.kani@hp.com
    Signed-off-by: Thomas Gleixner

    Toshi Kani
     
  • __ioremap_check_ram() has a WARN_ONCE() which is emitted when the
    given pfn range is not RAM. The warning is bogus in two aspects:

    - it never triggers since walk_system_ram_range() only calls
    __ioremap_check_ram() for RAM ranges.

    - the warning message is wrong as it says: "ioremap on RAM' after it
    established that the pfn range is not RAM.

    Move the WARN_ONCE() to __ioremap_caller(), and update the message to
    include the address range so we get an actual warning when something
    tries to ioremap system RAM.

    [ tglx: Massaged changelog ]

    Signed-off-by: Toshi Kani
    Reviewed-by: Dan Williams
    Cc: Roland Dreier
    Cc: Luis R. Rodriguez
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: Borislav Petkov
    Cc: linux-mm@kvack.org
    Link: http://lkml.kernel.org/r/1437088996-28511-2-git-send-email-toshi.kani@hp.com
    Signed-off-by: Thomas Gleixner

    Toshi Kani
     

21 Jul, 2015

9 commits

  • Pull an EFI fix from Matt Fleming:

    - Fix a bug in the Common Platform Error Record (CPER) driver that
    caused old UEFI spec (< 2.3) versions of the memory error record
    structure to be declared invalid. (Tony Luck)

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • On built-in kernels this warning will always splat, even if no ivtvfb
    hardware is present, as this is part of the module init:

    if (WARN(pat_enabled(),
    "ivtvfb needs PAT disabled, boot with nopat kernel parameter\n")) {

    Fix that by shifting the PAT requirement check out under the code
    that does the "quasi-probe" for the device.

    This device driver relies on an existing driver to find its own devices,
    it looks for that device driver and its own found devices, then uses
    driver_for_each_device() to try to see if it can probe each of those
    devices as a frambuffer device with ivtvfb_init_card().

    We tuck the PAT requiremenet check then on the ivtvfb_init_card() call
    making the check at least require an ivtv device present before
    complaining.

    Reported-by: Fengguang Wu [0-day test robot]
    Signed-off-by: Luis R. Rodriguez
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: andy@silverblocksystems.net
    Cc: benh@kernel.crashing.org
    Cc: bp@suse.de
    Cc: dan.j.williams@intel.com
    Cc: dledford@redhat.com
    Cc: jkosina@suse.cz
    Cc: julia.lawall@lip6.fr
    Cc: luto@amacapital.net
    Cc: mchehab@osg.samsung.com
    Link: http://lkml.kernel.org/r/1437167245-28273-3-git-send-email-mcgrof@do-not-panic.com
    Signed-off-by: Ingo Molnar

    Luis R. Rodriguez
     
  • WARN() may confuse users, fix that. ipath_init_one() is part the
    device's probe so this would only be triggered if a
    corresponding device was found.

    Signed-off-by: Luis R. Rodriguez
    Acked-by: Doug Ledford
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: andy@silverblocksystems.net
    Cc: benh@kernel.crashing.org
    Cc: bp@suse.de
    Cc: dan.j.williams@intel.com
    Cc: jkosina@suse.cz
    Cc: julia.lawall@lip6.fr
    Cc: luto@amacapital.net
    Cc: mchehab@osg.samsung.com
    Link: http://lkml.kernel.org/r/1437167245-28273-2-git-send-email-mcgrof@do-not-panic.com
    Signed-off-by: Ingo Molnar

    Luis R. Rodriguez
     
  • Make WT really mean WT (rather than UC).

    I can't see why commit 9cd25aac1f ("x86/mm/pat: Emulate PAT when
    it is disabled") didn't make this to match its changes to
    pat_init().

    Signed-off-by: Jan Beulich
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Toshi Kani
    Link: http://lkml.kernel.org/r/55ACC3660200007800092E62@mail.emea.novell.com
    Signed-off-by: Ingo Molnar

    Jan Beulich
     
  • Complete the set of dependent features that need disabling at
    once: XSAVEC, AVX-512 and all currently known to the kernel
    extensions to it, as well as MPX need to be disabled too.

    Signed-off-by: Jan Beulich
    Cc: Dave Hansen
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/55ACC40D0200007800092E6C@mail.emea.novell.com
    Signed-off-by: Ingo Molnar

    Jan Beulich
     
  • MPX setups private anonymous mapping, but uses vma->vm_ops too.
    This can confuse core VM, as it relies on vm->vm_ops to
    distinguish file VMAs from anonymous.

    As result we will get SIGBUS, because handle_pte_fault() thinks
    it's file VMA without vm_ops->fault and it doesn't know how to
    handle the situation properly.

    Let's fix that by not setting ->vm_ops.

    We don't really need ->vm_ops here: MPX VMA can be detected with
    VM_MPX flag. And vma_merge() will not merge MPX VMA with non-MPX
    VMA, because ->vm_flags won't match.

    The only thing left is name of VMA. I'm not sure if it's part of
    ABI, or we can just drop it. The patch keep it by providing
    arch_vma_name() on x86.

    Signed-off-by: Kirill A. Shutemov
    Signed-off-by: Dave Hansen
    Cc: # Fixes: 6b7339f4 (mm: avoid setting up anonymous pages into file mapping)
    Cc: Andy Lutomirski
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: dave@sr71.net
    Link: http://lkml.kernel.org/r/20150720212958.305CC3E9@viggo.jf.intel.com
    Signed-off-by: Ingo Molnar

    Kirill A. Shutemov
     
  • flush_tlb_info->flush_start/end are both normal virtual
    addresses. When calculating 'nr_pages' (only used for the
    tracepoint), I neglected to put parenthesis in.

    Thanks to David Koufaty for pointing this out.

    Signed-off-by: Dave Hansen
    Cc: Andrew Morton
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: dave@sr71.net
    Cc:
    Link: http://lkml.kernel.org/r/20150720230153.9E834081@viggo.jf.intel.com
    Signed-off-by: Ingo Molnar

    Dave Hansen
     
  • Pull s390 fix from Martin Schwidefsky:
    "Fast path fix for the thread_struct breakage"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
    s390: adapt entry.S to the move of thread_struct

    Linus Torvalds
     
  • Pull AVR32 update from Hans-Christian Egtvedt.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32:
    AVR32/time: Migrate to new 'set-state' interface

    Linus Torvalds
     

20 Jul, 2015

7 commits

  • git commit 0c8c0f03e3a292e031596484275c14cf39c0ab7a
    "x86/fpu, sched: Dynamically allocate 'struct fpu'"
    moved the thread_struct to the end of the task_struct.

    This causes some of the offsets used in entry.S to overflow their
    instruction operand field. To fix this use aghi to create a
    dedicated pointer for the thread_struct.

    Signed-off-by: Martin Schwidefsky

    Martin Schwidefsky
     
  • Migrate avr32 driver to the new 'set-state' interface provided by
    clockevents core, the earlier 'set-mode' interface is marked obsolete
    now.

    This also enables us to implement callbacks for new states of clockevent
    devices, for example: ONESHOT_STOPPED.

    We want to call cpu_idle_poll_ctrl() in shutdown only if we were in
    oneshot or resume state earlier. Create another variable to save this
    information and check that in shutdown callback.

    Cc: Haavard Skinnemoen
    Cc: Hans-Christian Egtvedt
    Signed-off-by: Viresh Kumar
    Acked-by: Hans-Christian Egtvedt

    Viresh Kumar
     
  • Linus Torvalds
     
  • Pull SCSI fixes from James Bottomley:
    "Two fairly simple fixes: one is a change that causes us to have a very
    low queue depth leading to performance issues and the other is a null
    deref occasionally in tapes thanks to use after put"

    * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
    scsi: fix host max depth checking for the 'queue_depth' sysfs interface
    st: null pointer dereference panic caused by use after kref_put by st_open

    Linus Torvalds
     
  • Pull MIPS fixes from Ralf Baechle:
    "Another round of MIPS fixes for 4.2.

    Things are looking quite decent at this stage but the recent work on
    the FPU support took its toll:

    - fix an incorrect overly restrictive ifdef

    - select O32 64-bit FP support for O32 binary compatibility

    - remove workarounds for Sibyte SB1250 Pass1 parts. There are rare
    fixing the workarounds is not worth the effort.

    - patch up an outdated and now incorrect comment"

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
    MIPS: fpu.h: Allow 64-bit FPU on a 64-bit MIPS R6 CPU
    MIPS: SB1: Remove support for Pass 1 parts.
    MIPS: Require O32 FP64 support for MIPS64 with O32 compat
    MIPS: asm-offset.c: Patch up various comments refering to the old filename.

    Linus Torvalds
     
  • Pull parisc fix from Helge Deller:
    "A memory leak fix from Christophe Jaillet which was introduced with
    kernel 4.0 and which leads to kernel crashes on parisc after 1-3 days"

    * 'parisc-4.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
    parisc: mm: Fix a memory leak related to pmd not attached to the pgd

    Linus Torvalds
     
  • Pull ARM SoC fixes from Olof Johansson:
    "By far most of the fixes here are updates to DTS files to deal with
    some mostly minor bugs.

    There's also a fix to deal with non-PM kernel configs on i.MX, a
    regression fix for ethernet on PXA platforms and a dependency fix for
    OMAP"

    * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
    ARM: keystone: dts: rename pcie nodes to help override status
    ARM: keystone: dts: fix dt bindings for PCIe
    ARM: pxa: fix dm9000 platform data regression
    ARM: dts: Correct audio input route & set mic bias for am335x-pepper
    ARM: OMAP2+: Add HAVE_ARM_SCU for AM43XX
    MAINTAINERS: digicolor: add dts files
    ARM: ux500: fix MMC/SD card regression
    ARM: ux500: define serial port aliases
    ARM: dts: OMAP5: Add #iommu-cells property to IOMMUs
    ARM: dts: OMAP4: Add #iommu-cells property to IOMMUs
    ARM: dts: Fix frequency scaling on Gumstix Pepper
    ARM: dts: configure regulators for Gumstix Pepper
    ARM: dts: omap3: overo: Update LCD panel names
    ARM: dts: cros-ec-keyboard: Add support for some Japanese keys
    ARM: imx6: gpc: always enable PU domain if CONFIG_PM is not set
    ARM: dts: imx53-qsb: fix TVE entry
    ARM: dts: mx23: fix iio-hwmon support
    ARM: dts: imx27: Adjust the GPT compatible string
    ARM: socfpga: dts: Fix entries order
    ARM: socfpga: dts: Fix adxl34x formating and compatible string

    Linus Torvalds
     

19 Jul, 2015

10 commits

  • Commit 6134d94923d0 ("MIPS: asm: fpu: Allow 64-bit FPU on MIPS32 R6")
    added support for 64-bit FPU on a 32-bit MIPS R6 processor but it missed
    the 64-bit CPU case leading to FPU failures when requesting FR=1 mode
    (which is always the case for MIPS R6 userland) when running a 32-bit
    kernel on a 64-bit CPU. We also fix the MIPS R2 case.

    Signed-off-by: Markos Chandras
    Fixes: 6134d94923d0 ("MIPS: asm: fpu: Allow 64-bit FPU on MIPS32 R6")
    Reviewed-by: Paul Burton
    Cc: # 4.0+
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/10734/
    Signed-off-by: Ralf Baechle

    Markos Chandras
     
  • Commit 0e0da48dee8d ("parisc: mm: don't count preallocated pmds")
    introduced a memory leak.

    After this commit, the 'return' statement in pmd_free is executed in all
    cases. Even for pmd that are not attached to the pgd. So 'free_pages'
    can never be called anymore, leading to a memory leak.

    Signed-off-by: Christophe JAILLET
    Acked-by: Kirill A. Shutemov
    Acked-by: Mikulas Patocka
    Acked-by: Helge Deller
    Cc: stable@vger.kernel.org # v4.0+
    Signed-off-by: Helge Deller

    Christophe Jaillet
     
  • Merge "pxa fixes for v4.2" from Robert Jarzmik:

    ARM: pxa: fixes for v4.2-rc2

    This single fix reenables ethernet cards for several pxa boards,
    broken by regulator addition to dm9000 driver.

    * tag 'pxa-fixes-v4.2-rc2' of https://github.com/rjarzmik/linux:
    ARM: pxa: fix dm9000 platform data regression

    Olof Johansson
     
  • Pull ARM fixes from Russell King:
    "A small set of ARM fixes for -rc3, most of them not far off
    one-liners, with the exception of fixing the V7 cache invalidation for
    incoming SMP processors which was causing problems for SoCFPGA
    devices"

    * 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
    ARM: fix __virt_to_idmap build error on !MMU
    ARM: invalidate L1 before enabling coherency
    ARM: 8404/1: dma-mapping: fix off-by-one error in bitmap size check
    ARM: 8402/1: perf: Don't use of_node after putting it
    ARM: 8400/1: use virt_to_idmap to get phys_reset address

    Linus Torvalds
     
  • Pull x86 fixes from Ingo Molnar:
    "Two families of fixes:

    - Fix an FPU context related boot crash on newer x86 hardware with
    larger context sizes than what most people test. To fix this
    without ugly kludges or extensive reverts we had to touch core task
    allocator, to allow x86 to determine the task size dynamically, at
    boot time.

    I've tested it on a number of x86 platforms, and I cross-built it
    to a handful of architectures:

    (warns) (warns)
    testing x86-64: -git: pass ( 0), -tip: pass ( 0)
    testing x86-32: -git: pass ( 0), -tip: pass ( 0)
    testing arm: -git: pass ( 1359), -tip: pass ( 1359)
    testing cris: -git: pass ( 1031), -tip: pass ( 1031)
    testing m32r: -git: pass ( 1135), -tip: pass ( 1135)
    testing m68k: -git: pass ( 1471), -tip: pass ( 1471)
    testing mips: -git: pass ( 1162), -tip: pass ( 1162)
    testing mn10300: -git: pass ( 1058), -tip: pass ( 1058)
    testing parisc: -git: pass ( 1846), -tip: pass ( 1846)
    testing sparc: -git: pass ( 1185), -tip: pass ( 1185)

    ... so I hope the cross-arch impact 'none', as intended.

    (by Dave Hansen)

    - Fix various NMI handling related bugs unearthed by the big asm code
    rewrite and generally make the NMI code more robust and more
    maintainable while at it. These changes are a bit late in the
    cycle, I hope they are still acceptable.

    (by Andy Lutomirski)"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/fpu, sched: Introduce CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT and use it on x86
    x86/fpu, sched: Dynamically allocate 'struct fpu'
    x86/entry/64, x86/nmi/64: Add CONFIG_DEBUG_ENTRY NMI testing code
    x86/nmi/64: Make the "NMI executing" variable more consistent
    x86/nmi/64: Minor asm simplification
    x86/nmi/64: Use DF to avoid userspace RSP confusing nested NMI detection
    x86/nmi/64: Reorder nested NMI checks
    x86/nmi/64: Improve nested NMI comments
    x86/nmi/64: Switch stacks on userspace NMI entry
    x86/nmi/64: Remove asm code that saves CR2
    x86/nmi: Enable nested do_nmi() handling for 64-bit kernels

    Linus Torvalds
     
  • Pull timer fix from Ingo Molnar:
    "Fix for a misplaced export that can cause build failures in certain
    (rare) Kconfig situations"

    * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    tick: Move the export of tick_broadcast_oneshot_control to the proper place

    Linus Torvalds
     
  • Pull scheduler fix from Ingo Molnar:
    "A oneliner rq throttling fix"

    * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    sched/fair: Test list head instead of list entry in throttle_cfs_rq()

    Linus Torvalds
     
  • Pull perf fixes from Ingo Molnar:
    "Mostly tooling fixes, plus a static key fix fixing /sys/devices/cpu/rdpmc"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf tools: Really allow to specify custom CC, AR or LD
    perf auxtrace: Fix misplaced check for HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT
    perf hists browser: Take the --comm, --dsos, etc filters into account
    perf symbols: Store if there is a filter in place
    x86, perf: Fix static_key bug in load_mm_cr4()
    tools: Copy lib/hweight.c from the kernel sources
    perf tools: Fix the detached tarball wrt rbtree copy
    perf thread_map: Fix the sizeof() calculation for map entries
    tools lib: Improve clean target
    perf stat: Fix shadow declaration of close
    perf tools: Fix lockup using 32-bit compat vdso

    Linus Torvalds
     
  • Pull irq fixes from Ingo Molnar:
    "Misc irq fixes:

    - two driver fixes
    - a Xen regression fix
    - a nested irq thread crash fix"

    * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    irqchip/gicv3-its: Fix mapping of LPIs to collections
    genirq: Prevent resend to interrupts marked IRQ_NESTED_THREAD
    genirq: Revert sparse irq locking around __cpu_up() and move it to x86 for now
    gpio/davinci: Fix race in installing chained irq handler

    Linus Torvalds
     
  • Merge fixes from Andrew Morton:
    "25 fixes"

    * emailed patches from Andrew Morton : (25 commits)
    lib/decompress: set the compressor name to NULL on error
    mm/cma_debug: correct size input to bitmap function
    mm/cma_debug: fix debugging alloc/free interface
    mm/page_owner: set correct gfp_mask on page_owner
    mm/page_owner: fix possible access violation
    fsnotify: fix oops in fsnotify_clear_marks_by_group_flags()
    /proc/$PID/cmdline: fixup empty ARGV case
    dma-debug: skip debug_dma_assert_idle() when disabled
    hexdump: fix for non-aligned buffers
    checkpatch: fix long line messages about patch context
    mm: clean up per architecture MM hook header files
    MAINTAINERS: uclinux-h8-devel is moderated for non-subscribers
    mailmap: update Sudeep Holla's email id
    Update Viresh Kumar's email address
    mm, meminit: suppress unused memory variable warning
    configfs: fix kernel infoleak through user-controlled format string
    include, lib: add __printf attributes to several function prototypes
    s390/hugetlb: add hugepages_supported define
    mm: hugetlb: allow hugepages_supported to be architecture specific
    revert "s390/mm: make hugepages_supported a boot time decision"
    ...

    Linus Torvalds
     

18 Jul, 2015

11 commits

  • Pull btrfs fixes from Chris Mason:
    "These are all from Filipe, and cover a few problems we've had reported
    on the list recently (along with ones he found on his own)"

    * 'for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
    Btrfs: fix file corruption after cloning inline extents
    Btrfs: fix order by which delayed references are run
    Btrfs: fix list transaction->pending_ordered corruption
    Btrfs: fix memory leak in the extent_same ioctl
    Btrfs: fix shrinking truncate when the no_holes feature is enabled

    Linus Torvalds
     
  • Pull rtc fixes from Alexandre Belloni:
    "A few fixes for the RTC susbsystem for 4.2.

    The mt6397 driver was introduce in 4.2 so it is worth fixing before
    the final release. I though the compilation warning for armada38x was
    fixed by akpm in commit f98b733e93e0 ("rtc-armada38x.c: remove unused
    local `flags'") but he actually missed some occurrences of the
    variables. Since I received 4 patches for that, I think we can
    include it now.

    Summary:
    - fix mt6397 wakealarm creation
    - remove a compilation warning for armada38x that was forgotten"

    * tag 'rtc-v4.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux:
    rtc: armada38x: Remove unused variable from armada38x_rtc_set_time()
    rtc: mt6397: enable wakeup before registering rtc device

    Linus Torvalds
     
  • Pull device mapper fixes from Mike Snitzer:

    - revert a request-based DM core change that caused IO latency to
    increase and adversely impact both throughput and system load

    - fix for a use after free bug in DM core's device cleanup

    - a couple DM btree removal fixes (used by dm-thinp)

    - a DM thinp fix for order-5 allocation failure

    - a DM thinp fix to not degrade to read-only metadata mode when in
    out-of-data-space mode for longer than the 'no_space_timeout'

    - fix a long-standing oversight in both dm-thinp and dm-cache by now
    exporting 'needs_check' in status if it was set in metadata

    - fix an embarrassing dm-cache busy-loop that caused worker threads to
    eat cpu even if no IO was actively being issued to the cache device

    * tag 'dm-4.2-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
    dm cache: avoid calls to prealloc_free_structs() if possible
    dm cache: avoid preallocation if no work in writeback_some_dirty_blocks()
    dm cache: do not wake_worker() in free_migration()
    dm cache: display 'needs_check' in status if it is set
    dm thin: display 'needs_check' in status if it is set
    dm thin: stay in out-of-data-space mode once no_space_timeout expires
    dm: fix use after free crash due to incorrect cleanup sequence
    Revert "dm: only run the queue on completion if congested or no requests pending"
    dm btree: silence lockdep lock inversion in dm_btree_del()
    dm thin: allocate the cell_sort_array dynamically
    dm btree remove: fix bug in redistribute3

    Linus Torvalds
     
  • Don't burden architectures without dynamic task_struct sizing
    with the overhead of dynamic sizing.

    Also optimize the x86 code a bit by caching task_struct_size.

    Acked-and-Tested-by: Dave Hansen
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Dave Hansen
    Cc: Denys Vlasenko
    Cc: Linus Torvalds
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1437128892-9831-3-git-send-email-mingo@kernel.org
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • The FPU rewrite removed the dynamic allocations of 'struct fpu'.
    But, this potentially wastes massive amounts of memory (2k per
    task on systems that do not have AVX-512 for instance).

    Instead of having a separate slab, this patch just appends the
    space that we need to the 'task_struct' which we dynamically
    allocate already. This saves from doing an extra slab
    allocation at fork().

    The only real downside here is that we have to stick everything
    and the end of the task_struct. But, I think the
    BUILD_BUG_ON()s I stuck in there should keep that from being too
    fragile.

    Signed-off-by: Dave Hansen
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Dave Hansen
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1437128892-9831-2-git-send-email-mingo@kernel.org
    Signed-off-by: Ingo Molnar

    Dave Hansen
     
  • Without this we end up using the previous name of the compressor in the
    loop in unpack_rootfs. For example we get errors like "compression
    method gzip not configured" even when we have CONFIG_DECOMPRESS_GZIP
    enabled.

    Signed-off-by: Aneesh Kumar K.V
    Cc: "H. Peter Anvin"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Aneesh Kumar K.V
     
  • In CMA, 1 bit in bitmap means 1 << order_per_bits pages so size of
    bitmap is cma->count >> order_per_bits rather than just cma->count.
    This patch fixes it.

    Signed-off-by: Joonsoo Kim
    Acked-by: Michal Nazarewicz
    Cc: Sasha Levin
    Cc: Stefan Strogin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joonsoo Kim
     
  • CMA has alloc/free interface for debugging. It is intended that
    alloc/free occurs in specific CMA region, but, currently, alloc/free
    interface is on root dir due to the bug so we can't select CMA region
    where alloc/free happens.

    This patch fixes this problem by making alloc/free interface per CMA
    region.

    Signed-off-by: Joonsoo Kim
    Acked-by: Michal Nazarewicz
    Cc: Sasha Levin
    Cc: Stefan Strogin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joonsoo Kim
     
  • Currently, we set wrong gfp_mask to page_owner info in case of isolated
    freepage by compaction and split page. It causes incorrect mixed
    pageblock report that we can get from '/proc/pagetypeinfo'. This metric
    is really useful to measure fragmentation effect so should be accurate.
    This patch fixes it by setting correct information.

    Without this patch, after kernel build workload is finished, number of
    mixed pageblock is 112 among roughly 210 movable pageblocks.

    But, with this fix, output shows that mixed pageblock is just 57.

    Signed-off-by: Joonsoo Kim
    Cc: Mel Gorman
    Cc: Vlastimil Babka
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joonsoo Kim
     
  • When I tested my new patches, I found that page pointer which is used
    for setting page_owner information is changed. This is because page
    pointer is used to set new migratetype in loop. After this work, page
    pointer could be out of bound. If this wrong pointer is used for
    page_owner, access violation happens. Below is error message that I
    got.

    BUG: unable to handle kernel paging request at 0000000000b00018
    IP: [] save_stack_address+0x30/0x40
    PGD 1af2d067 PUD 166e0067 PMD 0
    Oops: 0002 [#1] SMP
    ...snip...
    Call Trace:
    print_context_stack+0xcf/0x100
    dump_trace+0x15f/0x320
    save_stack_trace+0x2f/0x50
    __set_page_owner+0x46/0x70
    __isolate_free_page+0x1f7/0x210
    split_free_page+0x21/0xb0
    isolate_freepages_block+0x1e2/0x410
    compaction_alloc+0x22d/0x2d0
    migrate_pages+0x289/0x8b0
    compact_zone+0x409/0x880
    compact_zone_order+0x6d/0x90
    try_to_compact_pages+0x110/0x210
    __alloc_pages_direct_compact+0x3d/0xe6
    __alloc_pages_nodemask+0x6cd/0x9a0
    alloc_pages_current+0x91/0x100
    runtest_store+0x296/0xa50
    simple_attr_write+0xbd/0xe0
    __vfs_write+0x28/0xf0
    vfs_write+0xa9/0x1b0
    SyS_write+0x46/0xb0
    system_call_fastpath+0x16/0x75

    This patch fixes this error by moving up set_page_owner().

    Signed-off-by: Joonsoo Kim
    Cc: Mel Gorman
    Cc: Vlastimil Babka
    Acked-by: Minchan Kim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joonsoo Kim
     
  • fsnotify_clear_marks_by_group_flags() can race with
    fsnotify_destroy_marks() so when fsnotify_destroy_mark_locked() drops
    mark_mutex, a mark from the list iterated by
    fsnotify_clear_marks_by_group_flags() can be freed and we dereference free
    memory in the loop there.

    Fix the problem by keeping mark_mutex held in
    fsnotify_destroy_mark_locked(). The reason why we drop that mutex is that
    we need to call a ->freeing_mark() callback which may acquire mark_mutex
    again. To avoid this and similar lock inversion issues, we move the call
    to ->freeing_mark() callback to the kthread destroying the mark.

    Signed-off-by: Jan Kara
    Reported-by: Ashish Sangwan
    Suggested-by: Lino Sanfilippo
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara