Skip to content
  1. Feb 16, 2015
  2. Feb 12, 2015
    • Paul Burton's avatar
      MIPS,prctl: add PR_[GS]ET_FP_MODE prctl options for MIPS · 9791554b
      Paul Burton authored
      
      
      Userland code may be built using an ABI which permits linking to objects
      that have more restrictive floating point requirements. For example,
      userland code may be built to target the O32 FPXX ABI. Such code may be
      linked with other FPXX code, or code built for either one of the more
      restrictive FP32 or FP64. When linking with more restrictive code, the
      overall requirement of the process becomes that of the more restrictive
      code. The kernel has no way to know in advance which mode the process
      will need to be executed in, and indeed it may need to change during
      execution. The dynamic loader is the only code which will know the
      overall required mode, and so it needs to have a means to instruct the
      kernel to switch the FP mode of the process.
      
      This patch introduces 2 new options to the prctl syscall which provide
      such a capability. The FP mode of the process is represented as a
      simple bitmask combining a number of mode bits mirroring those present
      in the hardware. Userland can either retrieve the current FP mode of
      the process:
      
        mode = prctl(PR_GET_FP_MODE);
      
      or modify the current FP mode of the process:
      
        err = prctl(PR_SET_FP_MODE, new_mode);
      
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: Matthew Fortune <matthew.fortune@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/8899/
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      9791554b
  3. Feb 05, 2015
    • James Hogan's avatar
      MIPS: cevt-r4k: Drop GIC special case · ae58d882
      James Hogan authored
      The cevt-r4k driver used to call into the GIC driver to find whether the
      timer was pending, but only with External Interrupt Controller (EIC)
      mode, where the Cause.IP bits can't be used as they encode the interrupt
      priority level (Cause.RIPL) instead.
      
      However commit e9de688d ("irqchip: mips-gic: Support local
      interrupts") changed the condition from cpu_has_veic to gic_present.
      This fails on cores such as P5600 which have a GIC but the local
      interrupts aren't routable by the GIC, causing c0_compare_int_usable()
      to consider the interrupt unusable so r4k_clockevent_init() fails.
      
      The previous behaviour, added in commit 98b67c37 ("MIPS: Add EIC
      support for GIC."), wasn't really correct either as far as I can tell,
      since P5600 apparently supports EIC mode too, and in any case the use of
      Cause.TI with r2 should have been sufficient anyway since commit
      010c108d
      
       ("MIPS: PowerTV: Fix support for timer interrupts with > 64
      external IRQs").
      
      Therefore drop the call into the gic driver altogether, and add a
      comment in c0_compare_int_pending() to clarify that Cause.TI does get
      checked since MIPS r2.
      
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Fixes: e9de688d
      
       ("irqchip: mips-gic: Support local interrupts")
      Reviewed-by: default avatarAndrew Bresticker <abrestic@chromium.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Steven J. Hill <steven.hill@imgtec.com>
      Cc: Qais Yousef <qais.yousef@imgtec.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/9077/
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      ae58d882
  4. Feb 04, 2015
  5. Jan 16, 2015
  6. Jan 13, 2015
  7. Jan 12, 2015
    • Linus Torvalds's avatar
      linux 3.19-rc4 · eaa27f34
      Linus Torvalds authored
      eaa27f34
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm · 0cbaed1d
      Linus Torvalds authored
      Pull ARM fixes from Russell King:
       "Three small fixes from over the Christmas period, and wiring up the
        new execveat syscall for ARM"
      
      * 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
        ARM: 8275/1: mm: fix PMD_SECT_RDONLY undeclared compile error
        ARM: 8253/1: mm: use phys_addr_t type in map_lowmem() for kernel mem region
        ARM: 8249/1: mm: dump: don't skip regions
        ARM: wire up execveat syscall
      0cbaed1d
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 505569d2
      Linus Torvalds authored
      Pull x86 fixes from Ingo Molnar:
       "Misc fixes: two vdso fixes, two kbuild fixes and a boot failure fix
        with certain odd memory mappings"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86, vdso: Use asm volatile in __getcpu
        x86/build: Clean auto-generated processor feature files
        x86: Fix mkcapflags.sh bash-ism
        x86: Fix step size adjustment during initial memory mapping
        x86_64, vdso: Fix the vdso address randomization algorithm
      505569d2
    • Linus Torvalds's avatar
      Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 5ab551d6
      Linus Torvalds authored
      Pull scheduler fixes from Ingo Molnar:
       "Misc fixes: group scheduling corner case fix, two deadline scheduler
        fixes, effective_load() overflow fix, nested sleep fix, 6144 CPUs
        system fix"
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/fair: Fix RCU stall upon -ENOMEM in sched_create_group()
        sched/deadline: Avoid double-accounting in case of missed deadlines
        sched/deadline: Fix migration of SCHED_DEADLINE tasks
        sched: Fix odd values in effective_load() calculations
        sched, fanotify: Deal with nested sleeps
        sched: Fix KMALLOC_MAX_SIZE overflow during cpumask allocation
      5ab551d6
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ddb321a8
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar:
       "Mostly tooling fixes, but also some kernel side fixes: uncore PMU
        driver fix, user regs sampling fix and an instruction decoder fix that
        unbreaks PEBS precise sampling"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/uncore/hsw-ep: Handle systems with only two SBOXes
        perf/x86_64: Improve user regs sampling
        perf: Move task_pt_regs sampling into arch code
        x86: Fix off-by-one in instruction decoder
        perf hists browser: Fix segfault when showing callchain
        perf callchain: Free callchains when hist entries are deleted
        perf hists: Fix children sort key behavior
        perf diff: Fix to sort by baseline field by default
        perf list: Fix --raw-dump option
        perf probe: Fix crash in dwarf_getcfi_elf
        perf probe: Fix to fall back to find probe point in symbols
        perf callchain: Append callchains only when requested
        perf ui/tui: Print backtrace symbols when segfault occurs
        perf report: Show progress bar for output resorting
      ddb321a8
    • Linus Torvalds's avatar
      Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 1e6c3e8f
      Linus Torvalds authored
      Pull locking fixes from Ingo Molnar:
       "A liblockdep fix and a mutex_unlock() mutex-debugging fix"
      
      * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        mutex: Always clear owner field upon mutex_unlock()
        tools/liblockdep: Fix debug_check thinko in mutex destroy
      1e6c3e8f
    • Konstantin Khlebnikov's avatar
      mm: fix corner case in anon_vma endless growing prevention · b800c91a
      Konstantin Khlebnikov authored
      Fix for BUG_ON(anon_vma->degree) splashes in unlink_anon_vmas() ("kernel
      BUG at mm/rmap.c:399!") caused by commit 7a3ef208
      
       ("mm: prevent
      endless growth of anon_vma hierarchy")
      
      Anon_vma_clone() is usually called for a copy of source vma in
      destination argument.  If source vma has anon_vma it should be already
      in dst->anon_vma.  NULL in dst->anon_vma is used as a sign that it's
      called from anon_vma_fork().  In this case anon_vma_clone() finds
      anon_vma for reusing.
      
      Vma_adjust() calls it differently and this breaks anon_vma reusing
      logic: anon_vma_clone() links vma to old anon_vma and updates degree
      counters but vma_adjust() overrides vma->anon_vma right after that.  As
      a result final unlink_anon_vmas() decrements degree for wrong anon_vma.
      
      This patch assigns ->anon_vma before calling anon_vma_clone().
      
      Signed-off-by: default avatarKonstantin Khlebnikov <koct9i@gmail.com>
      Reported-and-tested-by: default avatarChris Clayton <chris2553@googlemail.com>
      Reported-and-tested-by: default avatarOded Gabbay <oded.gabbay@amd.com>
      Reported-and-tested-by: default avatarChih-Wei Huang <cwhuang@android-x86.org>
      Acked-by: default avatarRik van Riel <riel@redhat.com>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Cc: Daniel Forrest <dan.forrest@ssec.wisc.edu>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: stable@vger.kernel.org  # to match back-porting of 7a3ef208
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b800c91a
    • Linus Torvalds's avatar
      mm: Don't count the stack guard page towards RLIMIT_STACK · 690eac53
      Linus Torvalds authored
      Commit fee7e49d
      
       ("mm: propagate error from stack expansion even for
      guard page") made sure that we return the error properly for stack
      growth conditions.  It also theorized that counting the guard page
      towards the stack limit might break something, but also said "Let's see
      if anybody notices".
      
      Somebody did notice.  Apparently android-x86 sets the stack limit very
      close to the limit indeed, and including the guard page in the rlimit
      check causes the android 'zygote' process problems.
      
      So this adds the (fairly trivial) code to make the stack rlimit check be
      against the actual real stack size, rather than the size of the vma that
      includes the guard page.
      
      Reported-and-tested-by: default avatarChih-Wei Huang <cwhuang@android-x86.org>
      Cc: Jay Foad <jay.foad@gmail.com>
      Cc: stable@kernel.org  # to match back-porting of fee7e49d
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      690eac53
  8. Jan 11, 2015
  9. Jan 10, 2015
    • Linus Torvalds's avatar
      Merge tag 'sound-3.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · eb749269
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "All a few small regression or stable fixes: a Nvidia HDMI ID addition,
        a regression fix for CAIAQ stream count, a typo fix for GPIO setup
        with STAC/IDT HD-audio codecs, and a Fireworks big-endian fix"
      
      * tag 'sound-3.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: fireworks: fix an endianness bug for transaction length
        ALSA: hda - Add new GPU codec ID 0x10de0072 to snd-hda
        ALSA: hda - Fix wrong gpio_dir & gpio_mask hint setups for IDT/STAC codecs
        ALSA: snd-usb-caiaq: fix stream count check
      eb749269
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid · 28023d2a
      Linus Torvalds authored
      Pull HID updates from Jiri Kosina:
      
       - bounds checking fixes in logitech and roccat drivers, from Peter Wu
         and Dan Carpenter
      
       - double-kfree fix in i2c-hid driver on bus shutdown, from Mika
         Westerberg
      
       - a couple of various small driver fixes
      
       - a few device id additions
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
        HID: roccat: potential out of bounds in pyra_sysfs_write_settings()
        HID: Add a new id 0x501a for Genius MousePen i608X
        HID: logitech-hidpp: prefix the name with "Logitech"
        HID: logitech-hidpp: avoid unintended fall-through
        HID: Allow HID_BATTERY_STRENGTH to be enabled
        HID: i2c-hid: Do not free buffers in i2c_hid_stop()
        HID: add battery quirk for USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO keyboard
        HID: logitech-hidpp: check WTP report length
        HID: logitech-dj: check report length
      28023d2a
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · 1dd34daa
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "I'm briefly working between holidays and LCA, so this is close to a
        couple of weeks of fixes,
      
        Two sets of amdkfd fixes, this is a new feature this kernel, and this
        pull fixes a few issues since it got merged, ordering when built-in to
        kernel and also the iommu vs gpu ordering patch, it also reworks the
        ioctl before the initial release.
      
        Otherwise:
         - radeon: some misc fixes all over, hdmi, 4k, dpm
         - nouveau: mcp77 init fixes, oops fix, bug on fix, msi fix
         - i915: power fixes, revert VGACNTR patch
      
        Probably be quiteer next week since I'll be at LCA anyways"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (33 commits)
        drm/amdkfd: rewrite kfd_ioctl() according to drm_ioctl()
        drm/amdkfd: reformat IOCTL definitions to drm-style
        drm/amdkfd: Do copy_to/from_user in general kfd_ioctl()
        drm/radeon: integer underflow in radeon_cp_dispatch_texture()
        drm/radeon: adjust default bapm settings for KV
        drm/radeon: properly filter DP1.2 4k modes on non-DP1.2 hw
        drm/radeon: fix sad_count check for dce3
        drm/radeon: KV has three PPLLs (v2)
        drm/amdkfd: unmap VMID<-->PASID when relesing VMID (non-HWS)
        drm/radeon: Init amdkfd only if it was compiled
        amdkfd: actually allocate longs for the pasid bitmask
        drm/nouveau/nouveau: Do not BUG_ON(!spin_is_locked()) on UP
        drm/nv4c/mc: disable msi
        drm/nouveau/fb/ram/mcp77: enable NISO poller
        drm/nouveau/fb/ram/mcp77: use carveout reg to determine size
        drm/nouveau/fb/ram/mcp77: subclass nouveau_ram
        drm/nouveau: wake up the card if necessary during gem callbacks
        drm/nouveau/device: Add support for GK208B, resolves bug 86935
        drm/nouveau: fix missing return statement in nouveau_ttm_tt_unpopulate
        drm/nouveau/bios: fix oops on pre-nv50 chipsets
        ...
      1dd34daa
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · d80b34c9
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
       "Here is a handful of minor arm64 fixes discovered and fixed over the
        Christmas break.  The main part is adding some missing #includes that
        we seem to be getting transitively but have started causing problems
        in -next.
      
         - Fix early mapping fixmap corruption by EFI runtime services
         - Fix __NR_compat_syscalls off-by-one
         - Add missing sanity checks for some 32-bit registers
         - Add some missing #includes which we get transitively
         - Remove unused prepare_to_copy() macro"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64/efi: add missing call to early_ioremap_reset()
        arm64: fix missing asm/io.h include in kernel/smp_spin_table.c
        arm64: fix missing asm/alternative.h include in kernel/module.c
        arm64: fix missing linux/bug.h include in asm/arch_timer.h
        arm64: fix missing asm/pgtable-hwdef.h include in asm/processor.h
        arm64: sanity checks: add missing AArch32 registers
        arm64: Remove unused prepare_to_copy()
        arm64: Correct __NR_compat_syscalls for bpf
      d80b34c9
    • Linus Torvalds's avatar
      Merge tag 'for_linus-3.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/kgdb · aa929135
      Linus Torvalds authored
      Pull kgdb/kdb fixes from Jason Wessel:
       "These have been around since 3.17 and in kgdb-next for the last 9
        weeks and some will go back to -stable.
      
        Summary of changes:
      
        Cleanups
         - kdb: Remove unused command flags, repeat flags and KDB_REPEAT_NONE
      
        Fixes
         - kgdb/kdb: Allow access on a single core, if a CPU round up is
           deemed impossible, which will allow inspection of the now "trashed"
           kernel
         - kdb: Add enable mask for the command groups
         - kdb: access controls to restrict sensitive commands"
      
      * tag 'for_linus-3.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/kgdb:
        kernel/debug/debug_core.c: Logging clean-up
        kgdb: timeout if secondary CPUs ignore the roundup
        kdb: Allow access to sensitive commands to be restricted by default
        kdb: Add enable mask for groups of commands
        kdb: Categorize kdb commands (similar to SysRq categorization)
        kdb: Remove KDB_REPEAT_NONE fl...
      aa929135
    • Linus Torvalds's avatar
      Merge branch 'for-3.19' of git://linux-nfs.org/~bfields/linux · dc9319f5
      Linus Torvalds authored
      Pull two nfsd bugfixes from Bruce Fields.
      
      * 'for-3.19' of git://linux-nfs.org/~bfields/linux:
        rpc: fix xdr_truncate_encode to handle buffer ending on page boundary
        nfsd: fix fi_delegees leak when fi_had_conflict returns true
      dc9319f5
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client · 20ebb345
      Linus Torvalds authored
      Pull two Ceph fixes from Sage Weil:
       "These are both pretty trivial: a sparse warning fix and size_t printk
        thing"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
        libceph: fix sparse endianness warnings
        ceph: use %zu for len in ceph_fill_inline_data()
      20ebb345
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · 03c751a5
      Linus Torvalds authored
      Pull btrfs fixes from Chris Mason:
       "None of these are huge, but my commit does fix a regression from 3.18
        that could cause lost files during log replay.
      
        This also adds Dave Sterba to the list of Btrfs maintainers.  It
        doesn't mean we're doing things differently, but Dave has really been
        helping with the maintainer workload for years"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
        Btrfs: don't delay inode ref updates during log replay
        Btrfs: correctly get tree level in tree_backref_for_extent
        Btrfs: call inode_dec_link_count() on mkdir error path
        Btrfs: abort transaction if we don't find the block group
        Btrfs, scrub: uninitialized variable in scrub_extent_for_parity()
        Btrfs: add more maintainers
      03c751a5
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · b3d574ae
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "12 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        mm, vmscan: prevent kswapd livelock due to pfmemalloc-throttled process being killed
        memcg: fix destination cgroup leak on task charges migration
        mm: memcontrol: switch soft limit default back to infinity
        mm/debug_pagealloc: remove obsolete Kconfig options
        vfs: renumber FMODE_NONOTIFY and add to uniqueness check
        arch/blackfin/mach-bf533/boards/stamp.c: add linux/delay.h
        ocfs2: fix the wrong directory passed to ocfs2_lookup_ino_from_name() when link file
        MAINTAINERS: update rydberg's addresses
        mm: protect set_page_dirty() from ongoing truncation
        mm: prevent endless growth of anon_vma hierarchy
        exit: fix race between wait_consider_task() and wait_task_zombie()
        ocfs2: remove bogus check in dlm_process_recovery_data
      b3d574ae
    • Victor Kamensky's avatar
      ARM: 8275/1: mm: fix PMD_SECT_RDONLY undeclared compile error · 1e347922
      Victor Kamensky authored
      In v3.19-rc3 tree when CONFIG_ARM_LPAE and CONFIG_DEBUG_RODATA are enabled
      image failed to compile with the following error:
      
      arch/arm/mm/init.c:661:14: error: ‘PMD_SECT_RDONLY’ undeclared here (not in a function)
      
      It seems that '80d6b0c2 ARM: mm: allow text and rodata sections to be read-only'
      and 'ded94779 ARM: 8109/1: mm: Modify pte_write and pmd_write logic for LPAE'
      commits crossed. 80d6b0c2 uses PMD_SECT_RDONLY macro but ded94779 renames it
      and uses software bits L_PMD_SECT_RDONLY instead.
      
      Fix is to use L_PMD_SECT_RDONLY instead PMD_SECT_RDONLY as ded94779
      
       does in
      another places.
      
      Signed-off-by: default avatarVictor Kamensky <victor.kamensky@linaro.org>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      1e347922
  10. Jan 09, 2015
    • Dan Carpenter's avatar
      HID: roccat: potential out of bounds in pyra_sysfs_write_settings() · 606185b2
      Dan Carpenter authored
      
      
      This is a static checker fix.  We write some binary settings to the
      sysfs file.  One of the settings is the "->startup_profile".  There
      isn't any checking to make sure it fits into the
      pyra->profile_settings[] array in the profile_activated() function.
      
      I added a check to pyra_sysfs_write_settings() in both places because
      I wasn't positive that the other callers were correct.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      606185b2
    • Chris Wilson's avatar
      mutex: Always clear owner field upon mutex_unlock() · a63b03e2
      Chris Wilson authored
      
      
      Currently if DEBUG_MUTEXES is enabled, the mutex->owner field is only
      cleared iff debug_locks is active. This exposes a race to other users of
      the field where the mutex->owner may be still set to a stale value,
      potentially upsetting mutex_spin_on_owner() among others.
      
      References: https://bugs.freedesktop.org/show_bug.cgi?id=87955
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: default avatarDavidlohr Bueso <dave@stgolabs.net>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Link: http://lkml.kernel.org/r/1420540175-30204-1-git-send-email-chris@chris-wilson.co.uk
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      a63b03e2
    • Tetsuo Handa's avatar
      sched/fair: Fix RCU stall upon -ENOMEM in sched_create_group() · 7f1a169b
      Tetsuo Handa authored
      
      
      When alloc_fair_sched_group() in sched_create_group() fails,
      free_sched_group() is called, and free_fair_sched_group() is called by
      free_sched_group(). Since destroy_cfs_bandwidth() is called by
      free_fair_sched_group() without calling init_cfs_bandwidth(),
      RCU stall occurs at hrtimer_cancel():
      
        INFO: rcu_sched self-detected stall on CPU { 1}  (t=60000 jiffies g=13074 c=13073 q=0)
        Task dump for CPU 1:
        (fprintd)       R  running task        0  6249      1 0x00000088
        ...
        Call Trace:
         <IRQ>  [<ffffffff81094988>] sched_show_task+0xa8/0x110
         [<ffffffff81097acd>] dump_cpu_task+0x3d/0x50
         [<ffffffff810c3a80>] rcu_dump_cpu_stacks+0x90/0xd0
         [<ffffffff810c7751>] rcu_check_callbacks+0x491/0x700
         [<ffffffff810cbf2b>] update_process_times+0x4b/0x80
         [<ffffffff810db046>] tick_sched_handle.isra.20+0x36/0x50
         [<ffffffff810db0a2>] tick_sched_timer+0x42/0x70
         [<ffffffff810ccb19>] __run_hrtimer+0x69/0x1a0
         [<ffffffff810db060>] ? tick_sched_handle.isra.20+0x50/0x50
         [<ffffffff810ccedf>] hrtimer_interrupt+0xef/0x230
         [<ffffffff810452cb>] local_apic_timer_interrupt+0x3b/0x70
         [<ffffffff8164a465>] smp_apic_timer_interrupt+0x45/0x60
         [<ffffffff816485bd>] apic_timer_interrupt+0x6d/0x80
         <EOI>  [<ffffffff810cc588>] ? lock_hrtimer_base.isra.23+0x18/0x50
         [<ffffffff81193cf1>] ? __kmalloc+0x211/0x230
         [<ffffffff810cc9d2>] hrtimer_try_to_cancel+0x22/0xd0
         [<ffffffff81193cf1>] ? __kmalloc+0x211/0x230
         [<ffffffff810ccaa2>] hrtimer_cancel+0x22/0x30
         [<ffffffff810a3cb5>] free_fair_sched_group+0x25/0xd0
         [<ffffffff8108df46>] free_sched_group+0x16/0x40
         [<ffffffff810971bb>] sched_create_group+0x4b/0x80
         [<ffffffff810aa383>] sched_autogroup_create_attach+0x43/0x1c0
         [<ffffffff8107dc9c>] sys_setsid+0x7c/0x110
         [<ffffffff81647729>] system_call_fastpath+0x12/0x17
      
      Check whether init_cfs_bandwidth() was called before calling
      destroy_cfs_bandwidth().
      
      Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      [ Move the check into destroy_cfs_bandwidth() to aid compilability. ]
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Ben Segall <bsegall@google.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Link: http://lkml.kernel.org/r/201412252210.GCC30204.SOMVFFOtQJFLOH@I-love.SAKURA.ne.jp
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      7f1a169b
    • Luca Abeni's avatar
      sched/deadline: Avoid double-accounting in case of missed deadlines · 269ad801
      Luca Abeni authored
      
      
      The dl_runtime_exceeded() function is supposed to ckeck if
      a SCHED_DEADLINE task must be throttled, by checking if its
      current runtime is <= 0. However, it also checks if the
      scheduling deadline has been missed (the current time is
      larger than the current scheduling deadline), further
      decreasing the runtime if this happens.
      This "double accounting" is wrong:
      
      - In case of partitioned scheduling (or single CPU), this
        happens if task_tick_dl() has been called later than expected
        (due to small HZ values). In this case, the current runtime is
        also negative, and replenish_dl_entity() can take care of the
        deadline miss by recharging the current runtime to a value smaller
        than dl_runtime
      
      - In case of global scheduling on multiple CPUs, scheduling
        deadlines can be missed even if the task did not consume more
        runtime than expected, hence penalizing the task is wrong
      
      This patch fix this problem by throttling a SCHED_DEADLINE task
      only when its runtime becomes negative, and not modifying the runtime
      
      Signed-off-by: default avatarLuca Abeni <luca.abeni@unitn.it>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: default avatarJuri Lelli <juri.lelli@gmail.com>
      Cc: <stable@vger.kernel.org>
      Cc: Dario Faggioli <raistlin@linux.it>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Link: http://lkml.kernel.org/r/1418813432-20797-3-git-send-email-luca.abeni@unitn.it
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      269ad801