1. 08 7月, 2016 17 次提交
  2. 01 7月, 2016 1 次提交
  3. 27 6月, 2016 3 次提交
  4. 25 6月, 2016 1 次提交
    • M
      tree wide: get rid of __GFP_REPEAT for order-0 allocations part I · 32d6bd90
      Michal Hocko 提交于
      This is the third version of the patchset previously sent [1].  I have
      basically only rebased it on top of 4.7-rc1 tree and dropped "dm: get
      rid of superfluous gfp flags" which went through dm tree.  I am sending
      it now because it is tree wide and chances for conflicts are reduced
      considerably when we want to target rc2.  I plan to send the next step
      and rename the flag and move to a better semantic later during this
      release cycle so we will have a new semantic ready for 4.8 merge window
      hopefully.
      
      Motivation:
      
      While working on something unrelated I've checked the current usage of
      __GFP_REPEAT in the tree.  It seems that a majority of the usage is and
      always has been bogus because __GFP_REPEAT has always been about costly
      high order allocations while we are using it for order-0 or very small
      orders very often.  It seems that a big pile of them is just a
      copy&paste when a code has been adopted from one arch to another.
      
      I think it makes some sense to get rid of them because they are just
      making the semantic more unclear.  Please note that GFP_REPEAT is
      documented as
      
      * __GFP_REPEAT: Try hard to allocate the memory, but the allocation attempt
      
      * _might_ fail.  This depends upon the particular VM implementation.
        while !costly requests have basically nofail semantic.  So one could
        reasonably expect that order-0 request with __GFP_REPEAT will not loop
        for ever.  This is not implemented right now though.
      
      I would like to move on with __GFP_REPEAT and define a better semantic
      for it.
      
        $ git grep __GFP_REPEAT origin/master | wc -l
        111
        $ git grep __GFP_REPEAT | wc -l
        36
      
      So we are down to the third after this patch series.  The remaining
      places really seem to be relying on __GFP_REPEAT due to large allocation
      requests.  This still needs some double checking which I will do later
      after all the simple ones are sorted out.
      
      I am touching a lot of arch specific code here and I hope I got it right
      but as a matter of fact I even didn't compile test for some archs as I
      do not have cross compiler for them.  Patches should be quite trivial to
      review for stupid compile mistakes though.  The tricky parts are usually
      hidden by macro definitions and thats where I would appreciate help from
      arch maintainers.
      
      [1] http://lkml.kernel.org/r/1461849846-27209-1-git-send-email-mhocko@kernel.org
      
      This patch (of 19):
      
      __GFP_REPEAT has a rather weak semantic but since it has been introduced
      around 2.6.12 it has been ignored for low order allocations.  Yet we
      have the full kernel tree with its usage for apparently order-0
      allocations.  This is really confusing because __GFP_REPEAT is
      explicitly documented to allow allocation failures which is a weaker
      semantic than the current order-0 has (basically nofail).
      
      Let's simply drop __GFP_REPEAT from those places.  This would allow to
      identify place which really need allocator to retry harder and formulate
      a more specific semantic for what the flag is supposed to do actually.
      
      Link: http://lkml.kernel.org/r/1464599699-30131-2-git-send-email-mhocko@kernel.orgSigned-off-by: NMichal Hocko <mhocko@suse.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Chen Liqin <liqin.linux@gmail.com>
      Cc: Chris Metcalf <cmetcalf@mellanox.com> [for tile]
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Lennox Wu <lennox.wu@gmail.com>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Matt Fleming <matt@codeblueprint.co.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      32d6bd90
  5. 24 6月, 2016 7 次提交
    • J
      xen-pciback: return proper values during BAR sizing · d2bd05d8
      Jan Beulich 提交于
      Reads following writes with all address bits set to 1 should return all
      changeable address bits as one, not the BAR size (nor, as was the case
      for the upper half of 64-bit BARs, the high half of the region's end
      address). Presumably this didn't cause any problems so far because
      consumers use the value to calculate the size (usually via val & -val),
      and do nothing else with it.
      
      But also consider the exception here: Unimplemented BARs should always
      return all zeroes.
      
      And finally, the check for whether to return the sizing address on read
      for the ROM BAR should ignore all non-address bits, not just the ROM
      Enable one.
      Signed-off-by: NJan Beulich <jbeulich@suse.com>
      Reviewed-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      d2bd05d8
    • S
      HID: hiddev: validate num_values for HIDIOCGUSAGES, HIDIOCSUSAGES commands · 93a2001b
      Scott Bauer 提交于
      This patch validates the num_values parameter from userland during the
      HIDIOCGUSAGES and HIDIOCSUSAGES commands. Previously, if the report id was set
      to HID_REPORT_ID_UNKNOWN, we would fail to validate the num_values parameter
      leading to a heap overflow.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NScott Bauer <sbauer@plzdonthack.me>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      93a2001b
    • M
      drm/atomic: Make drm_atomic_legacy_backoff reset crtc->acquire_ctx · 81e257e9
      Maarten Lankhorst 提交于
      Atomic updates may acquire more state than initially locked through
      drm_modeset_lock_crtc, running with heavy stress can cause a
      WARN_ON(crtc->acquire_ctx) in drm_modeset_lock_crtc:
      
      [  601.491296] ------------[ cut here ]------------
      [  601.491366] WARNING: CPU: 0 PID: 2411 at
      drivers/gpu/drm/drm_modeset_lock.c:191 drm_modeset_lock_crtc+0xeb/0xf0 [drm]
      [  601.491369] Modules linked in: drm i915 drm_kms_helper
      [  601.491414] CPU: 0 PID: 2411 Comm: kms_cursor_lega Tainted: G     U 4.7.0-rc4-patser+ #4798
      [  601.491417] Hardware name: Intel Corporation Skylake Client
      [  601.491420]  0000000000000000 ffff88044d153c98 ffffffff812ead28 0000000000000000
      [  601.491425]  0000000000000000 ffff88044d153cd8 ffffffff810868e6 000000bf58058030
      [  601.491431]  ffff880088b415e8 ffff880458058030 ffff88008a271548 ffff88008a271568
      [  601.491436] Call Trace:
      [  601.491443]  [<ffffffff812ead28>] dump_stack+0x4d/0x65
      [  601.491447]  [<ffffffff810868e6>] __warn+0xc6/0xe0
      [  601.491452]  [<ffffffff81086968>] warn_slowpath_null+0x18/0x20
      [  601.491472]  [<ffffffffc00d4ffb>] drm_modeset_lock_crtc+0xeb/0xf0 [drm]
      [  601.491491]  [<ffffffffc00c5526>] drm_mode_cursor_common+0x66/0x180 [drm]
      [  601.491509]  [<ffffffffc00c91cc>] drm_mode_cursor_ioctl+0x3c/0x40 [drm]
      [  601.491524]  [<ffffffffc00bc94d>] drm_ioctl+0x14d/0x530 [drm]
      [  601.491540]  [<ffffffffc00c9190>] ? drm_mode_setcrtc+0x520/0x520 [drm]
      [  601.491545]  [<ffffffff81176aeb>] ? handle_mm_fault+0x106b/0x1430
      [  601.491550]  [<ffffffff81108441>] ? stop_one_cpu+0x61/0x70
      [  601.491556]  [<ffffffff811bb71d>] do_vfs_ioctl+0x8d/0x570
      [  601.491560]  [<ffffffff81290d7e>] ? security_file_ioctl+0x3e/0x60
      [  601.491565]  [<ffffffff811bbc74>] SyS_ioctl+0x74/0x80
      [  601.491571]  [<ffffffff810e321c>] ? posix_get_monotonic_raw+0xc/0x10
      [  601.491576]  [<ffffffff8175b11b>] entry_SYSCALL_64_fastpath+0x13/0x8f
      [  601.491581] ---[ end trace 56f3d3d85f000d00 ]---
      
      For good measure, test mode_config.acquire_ctx too, although this should
      never happen.
      
      Testcase: kms_cursor_legacy
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      81e257e9
    • D
      drm/nouveau: fix for disabled fbdev emulation · 52dfcc5c
      Dmitrii Tcvetkov 提交于
      Hello,
      
      after this commit:
      
      commit f045f459
      Author: Ben Skeggs <bskeggs@redhat.com>
      Date:   Thu Jun 2 12:23:31 2016 +1000
          drm/nouveau/fbcon: fix out-of-bounds memory accesses
      
      kernel started to oops when loading nouveau module when using GTX 780 Ti
      video adapter. This patch fixes the problem.
      
      Bug report: https://bugzilla.kernel.org/show_bug.cgi?id=120591Signed-off-by: NDmitrii Tcvetkov <demfloro@demfloro.ru>
      Suggested-by: NIlia Mirkin <imirkin@alum.mit.edu>
      Fixes: f045f459 ("nouveau_fbcon_init()")
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      Cc: stable@vger.kernel.org
      52dfcc5c
    • C
      PM / devfreq: Send the DEVFREQ_POSTCHANGE notification when target() is failed · 0d37189e
      Chanwoo Choi 提交于
      This patch sends the DEVFREQ_POSTCHANGE notification when
      devfreq->profile->targer() is failed. The PRECHANGE/POSTCHANGE
      should be paired.
      
      Fixes: 0fe3a664 (PM / devfreq: Add new DEVFREQ_TRANSITION_NOTIFIER notifier)
      Reported-by: NLin Huang <hl@rock-chips.com>
      Signed-off-by: NChanwoo Choi <cw00.choi@samsung.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0d37189e
    • M
      cpufreq: pcc-cpufreq: Fix doorbell.access_width · 3c67a829
      Mike Galbraith 提交于
      Commit 920de6eb (ACPICA: Hardware: Enhance
      acpi_hw_validate_register() with access_width/bit_offset awareness)
      apparently exposed a latent bug, doorbell.access_width is initialized
      to 64, but per Lv Zheng, it should be 4, and indeed, making that
      change does bring pcc-cpufreq back to life.
      
      Fixes: 920de6eb (ACPICA: Hardware: Enhance acpi_hw_validate_register() with access_width/bit_offset awareness)
      Suggested-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NMike Galbraith <umgwanakikbuti@gmail.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      3c67a829
    • B
      IB/srpt: Reduce QP buffer size · c0cf4512
      Bart Van Assche 提交于
      The memory needed for the send and receive queues associated with
      a QP is proportional to the max_sge parameter. The current value
      of that parameter is such that with an mlx4 HCA the QP buffer size
      is 8 MB. Since DMA is used for communication between HCA and CPU
      that buffer either has to be allocated coherently or map_single()
      must succeed for that buffer. Since large contiguous allocations
      are fragile and since the maximum segment size for e.g. swiotlb
      is 256 KB, reduce the max_sge parameter. This patch avoids that
      the following text appears on the console after SRP logout and
      relogin on a system equipped with multiple IB HCAs:
      
      mlx4_core 0000:05:00.0: swiotlb buffer is full (sz: 8388608 bytes)
      swiotlb: coherent allocation failed for device 0000:05:00.0 size=8388608
      CPU: 11 PID: 148 Comm: kworker/11:1 Not tainted 4.7.0-rc4-dbg+ #1
      Call Trace:
       [<ffffffff812c6d35>] dump_stack+0x67/0x92
       [<ffffffff812efe71>] swiotlb_alloc_coherent+0x141/0x150
       [<ffffffff810458be>] x86_swiotlb_alloc_coherent+0x3e/0x50
       [<ffffffffa03861fa>] mlx4_buf_direct_alloc.isra.5+0x9a/0x120 [mlx4_core]
       [<ffffffffa0386545>] mlx4_buf_alloc+0x165/0x1a0 [mlx4_core]
       [<ffffffffa035053d>] create_qp_common.isra.29+0x57d/0xff0 [mlx4_ib]
       [<ffffffffa03510da>] mlx4_ib_create_qp+0x12a/0x3f0 [mlx4_ib]
       [<ffffffffa031154a>] ib_create_qp+0x3a/0x250 [ib_core]
       [<ffffffffa055dd4b>] srpt_cm_handler+0x4bb/0xcad [ib_srpt]
       [<ffffffffa02c1ab0>] cm_process_work+0x20/0xf0 [ib_cm]
       [<ffffffffa02c3640>] cm_work_handler+0x1ac0/0x2059 [ib_cm]
       [<ffffffff810737ed>] process_one_work+0x19d/0x490
       [<ffffffff81073b29>] worker_thread+0x49/0x490
       [<ffffffff8107a0ea>] kthread+0xea/0x100
       [<ffffffff815b25af>] ret_from_fork+0x1f/0x40
      
      Fixes: b99f8e4d ("IB/srpt: convert to the generic RDMA READ/WRITE API")
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Cc: Laurence Oberman <loberman@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Sagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      c0cf4512
  6. 23 6月, 2016 11 次提交