1. 12 12月, 2017 1 次提交
  2. 29 11月, 2017 1 次提交
  3. 20 11月, 2017 2 次提交
  4. 16 11月, 2017 1 次提交
  5. 09 11月, 2017 1 次提交
  6. 03 11月, 2017 1 次提交
  7. 02 11月, 2017 1 次提交
  8. 01 11月, 2017 1 次提交
  9. 10 10月, 2017 2 次提交
  10. 22 9月, 2017 2 次提交
  11. 14 9月, 2017 1 次提交
    • M
      mm: treewide: remove GFP_TEMPORARY allocation flag · 0ee931c4
      Michal Hocko 提交于
      GFP_TEMPORARY was introduced by commit e12ba74d ("Group short-lived
      and reclaimable kernel allocations") along with __GFP_RECLAIMABLE.  It's
      primary motivation was to allow users to tell that an allocation is
      short lived and so the allocator can try to place such allocations close
      together and prevent long term fragmentation.  As much as this sounds
      like a reasonable semantic it becomes much less clear when to use the
      highlevel GFP_TEMPORARY allocation flag.  How long is temporary? Can the
      context holding that memory sleep? Can it take locks? It seems there is
      no good answer for those questions.
      
      The current implementation of GFP_TEMPORARY is basically GFP_KERNEL |
      __GFP_RECLAIMABLE which in itself is tricky because basically none of
      the existing caller provide a way to reclaim the allocated memory.  So
      this is rather misleading and hard to evaluate for any benefits.
      
      I have checked some random users and none of them has added the flag
      with a specific justification.  I suspect most of them just copied from
      other existing users and others just thought it might be a good idea to
      use without any measuring.  This suggests that GFP_TEMPORARY just
      motivates for cargo cult usage without any reasoning.
      
      I believe that our gfp flags are quite complex already and especially
      those with highlevel semantic should be clearly defined to prevent from
      confusion and abuse.  Therefore I propose dropping GFP_TEMPORARY and
      replace all existing users to simply use GFP_KERNEL.  Please note that
      SLAB users with shrinkers will still get __GFP_RECLAIMABLE heuristic and
      so they will be placed properly for memory fragmentation prevention.
      
      I can see reasons we might want some gfp flag to reflect shorterm
      allocations but I propose starting from a clear semantic definition and
      only then add users with proper justification.
      
      This was been brought up before LSF this year by Matthew [1] and it
      turned out that GFP_TEMPORARY really doesn't have a clear semantic.  It
      seems to be a heuristic without any measured advantage for most (if not
      all) its current users.  The follow up discussion has revealed that
      opinions on what might be temporary allocation differ a lot between
      developers.  So rather than trying to tweak existing users into a
      semantic which they haven't expected I propose to simply remove the flag
      and start from scratch if we really need a semantic for short term
      allocations.
      
      [1] http://lkml.kernel.org/r/20170118054945.GD18349@bombadil.infradead.org
      
      [akpm@linux-foundation.org: fix typo]
      [akpm@linux-foundation.org: coding-style fixes]
      [sfr@canb.auug.org.au: drm/i915: fix up]
        Link: http://lkml.kernel.org/r/20170816144703.378d4f4d@canb.auug.org.au
      Link: http://lkml.kernel.org/r/20170728091904.14627-1-mhocko@kernel.orgSigned-off-by: NMichal Hocko <mhocko@suse.com>
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Acked-by: NMel Gorman <mgorman@suse.de>
      Acked-by: NVlastimil Babka <vbabka@suse.cz>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Neil Brown <neilb@suse.de>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0ee931c4
  12. 13 9月, 2017 1 次提交
  13. 07 9月, 2017 2 次提交
  14. 06 9月, 2017 2 次提交
  15. 05 9月, 2017 1 次提交
  16. 31 8月, 2017 2 次提交
  17. 29 8月, 2017 3 次提交
  18. 24 8月, 2017 1 次提交
  19. 18 8月, 2017 6 次提交
  20. 15 8月, 2017 2 次提交
  21. 28 7月, 2017 3 次提交
    • C
      drm/i915: Force CPU synchronisation even if userspace requests ASYNC · 7b98da66
      Chris Wilson 提交于
      The goal here was to minimise doing any thing or any check inside the
      kernel that was not strictly required. For a userspace that assumes
      complete control over the cache domains, the kernel is usually using
      outdated information and may trigger clflushes where none were
      required.
      
      However, swapping is a situation where userspace has no knowledge of the
      domain transfer, and will leave the object in the CPU cache. The kernel
      must flush this out to the backing storage prior to use with the GPU. As
      we use an asynchronous task tracked by an implicit fence for this, we
      also need to cancel the ASYNC flag on the object so that the object will
      wait for the clflush to complete before being executed. This also absolves
      userspace of the responsibility imposed by commit 77ae9957 ("drm/i915:
      Enable userspace to opt-out of implicit fencing") that its needed to ensure
      that the object was out of the CPU cache prior to use on the GPU.
      
      Fixes: 77ae9957 ("drm/i915: Enable userspace to opt-out of implicit fencing")
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101571Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Jason Ekstrand <jason@jlekstrand.net>
      Reviewed-by: NJason Ekstrand <jason@jlekstrand.net>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170721145037.25105-5-chris@chris-wilson.co.ukReviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      (cherry picked from commit 0f46daa1)
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7b98da66
    • C
      drm/i915: Only skip updating execobject.offset after error · adf27835
      Chris Wilson 提交于
      I was being overly paranoid in not updating the execobject.offset after
      performing the fallback copy where we set reloc.presumed_offset to -1.
      The thinking was to ensure that a subsequent NORELOC execbuf would be
      forced to process the invalid relocations. However this is overkill so
      long as we *only* update the execobject.offset following a successful
      update of the relocation value witin the batch. If we have to repeat the
      execbuf due to a later interruption, then we may skip the relocations on
      the second pass (honouring NORELOC) since the execobject.offset match
      the actual offsets (even though reloc.presumed_offset is garbage).
      
      Subsequent calls to execbuf with NORELOC should themselves ensure that
      the reloc.presumed_offset have been corrected in case of future
      migration.
      
      Reporting back the actual execobject.offset, even when
      reloc.presumed_offset is garbage, ensures that reuse of those objects
      use the latest information to avoid relocations.
      
      Fixes: 2889caa9 ("drm/i915: Eliminate lots of iterations over the execobjects array")
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101635Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170721145037.25105-4-chris@chris-wilson.co.ukReviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      (cherry picked from commit 1f727d9e)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      adf27835
    • C
      drm/i915: Only mark the execobject as pinned on success · bed8d1c8
      Chris Wilson 提交于
      If we fail to acquire a fence (for old school fenced GPU access) then we
      unwind the vma reservation, including its pin. However, we were making
      the execobject as holding the pin before erring out, leading to a double
      unpin:
      
      [ 3193.991802] kernel BUG at drivers/gpu/drm/i915/i915_vma.h:287!
      [ 3193.998131] invalid opcode: 0000 [#1] PREEMPT SMP
      [ 3194.002816] Modules linked in: snd_hda_intel i915 vgem snd_hda_codec_analog snd_hda_codec_generic coretemp snd_hda_codec snd_hwdep snd_hda_core snd_pcm lpc_ich mei_me e1000e mei prime_numbers ptp pps_core [last unloaded: i915]
      [ 3194.022841] CPU: 0 PID: 8123 Comm: kms_flip Tainted: G     U          4.13.0-rc1-CI-CI_DRM_471+ #1
      [ 3194.031765] Hardware name: Dell Inc. OptiPlex 755                 /0PU052, BIOS A04 11/05/2007
      [ 3194.040343] task: ffff8800785d4c40 task.stack: ffffc90001768000
      [ 3194.046339] RIP: 0010:eb_release_vmas.isra.6+0x119/0x180 [i915]
      [ 3194.052234] RSP: 0018:ffffc9000176ba80 EFLAGS: 00010246
      [ 3194.057439] RAX: 00000000000003c0 RBX: ffff8800710fc2d8 RCX: ffff8800588e4f48
      [ 3194.064546] RDX: ffffffff1fffffff RSI: 00000000ffffffff RDI: ffff8800588e00d0
      [ 3194.071654] RBP: ffffc9000176bab0 R08: 0000000000000000 R09: 0000000000000000
      [ 3194.078761] R10: 0000000000000040 R11: 0000000000000001 R12: ffff880060822f00
      [ 3194.085867] R13: 0000000000000310 R14: 00000000000003b8 R15: ffffc9000176bbb0
      [ 3194.092975] FS:  00007fd2b94aba40(0000) GS:ffff88007d200000(0000) knlGS:0000000000000000
      [ 3194.101033] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 3194.106754] CR2: 00007ffbec3ff000 CR3: 0000000074e67000 CR4: 00000000000006f0
      [ 3194.113861] Call Trace:
      [ 3194.116321]  eb_relocate_slow+0x67/0x4e0 [i915]
      [ 3194.120861]  i915_gem_do_execbuffer+0x429/0x1260 [i915]
      [ 3194.126070]  ? lock_acquire+0xb5/0x210
      [ 3194.129803]  ? __might_fault+0x39/0x90
      [ 3194.133563]  i915_gem_execbuffer2+0x9b/0x1b0 [i915]
      [ 3194.138447]  ? i915_gem_execbuffer+0x2b0/0x2b0 [i915]
      [ 3194.143478]  drm_ioctl_kernel+0x64/0xb0
      [ 3194.147298]  drm_ioctl+0x2cd/0x390
      [ 3194.150710]  ? i915_gem_execbuffer+0x2b0/0x2b0 [i915]
      [ 3194.155741]  ? finish_task_switch+0xa5/0x210
      [ 3194.159993]  ? finish_task_switch+0x6a/0x210
      [ 3194.164247]  do_vfs_ioctl+0x90/0x670
      [ 3194.167806]  ? entry_SYSCALL_64_fastpath+0x5/0xb1
      [ 3194.172492]  ? __this_cpu_preempt_check+0x13/0x20
      [ 3194.177176]  ? trace_hardirqs_on_caller+0xe7/0x1c0
      [ 3194.181946]  SyS_ioctl+0x3c/0x70
      [ 3194.185159]  entry_SYSCALL_64_fastpath+0x1c/0xb1
      [ 3194.189756] RIP: 0033:0x7fd2b76a8587
      [ 3194.193314] RSP: 002b:00007fff074845b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      [ 3194.200855] RAX: ffffffffffffffda RBX: ffffffff8146da43 RCX: 00007fd2b76a8587
      [ 3194.207962] RDX: 00007fff074846e0 RSI: 0000000040406469 RDI: 0000000000000003
      [ 3194.215068] RBP: ffffc9000176bf88 R08: 0000000000000000 R09: 0000000000000003
      [ 3194.222175] R10: 00007fd2b796bb58 R11: 0000000000000246 R12: 00007fff07484880
      [ 3194.229280] R13: 0000000000000003 R14: 0000000040406469 R15: 0000000000000000
      [ 3194.236386]  ? __this_cpu_preempt_check+0x13/0x20
      [ 3194.241070] Code: 24 b0 00 00 00 48 85 c9 0f 84 6c ff ff ff 8b 41 20 85 c0 7e 73 83 e8 01 89 41 20 41 8b 84 24 e8 00 00 00 a8 0f 0f 85 5f ff ff ff <0f> 0b 48 83 c4 08 5b 41 5c 41 5d 41 5e 41 5f 5d f3 c3 49 8b 84
      [ 3194.259943] RIP: eb_release_vmas.isra.6+0x119/0x180 [i915] RSP: ffffc9000176ba80
      [ 3194.268047] ---[ end trace 1d7348c6575d8800 ]---
      [ 3673.658819] softdog: Initiating panic
      [ 3673.662471] Kernel panic - not syncing: Software Watchdog Timer expired
      [ 3673.669066] Kernel Offset: disabled
      [ 3673.672541] Rebooting in 1 seconds..
      Reported-by: NTomi Sarvela <tomi.p.sarvela@intel.com>
      Fixes: 2889caa9 ("drm/i915: Eliminate lots of iterations over the execobjects array")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170721145037.25105-3-chris@chris-wilson.co.ukReviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      (cherry picked from commit 1da7b54c)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      bed8d1c8
  22. 27 7月, 2017 3 次提交