1. 12 10月, 2016 1 次提交
  2. 10 10月, 2016 2 次提交
  3. 04 10月, 2016 1 次提交
  4. 21 9月, 2016 3 次提交
  5. 15 9月, 2016 1 次提交
  6. 09 9月, 2016 5 次提交
  7. 27 8月, 2016 1 次提交
  8. 22 8月, 2016 1 次提交
    • C
      drm/i915: Ignore stuck requests when considering hangs · 34730fed
      Chris Wilson 提交于
      If the engine isn't being retired (worker starvation?) then it is
      possible for us to repeatedly observe that between consecutive
      hangchecks the seqno on the ring to be the same and there remain
      unretired requests. Ignore these completely and only regard the engine
      as busy for the purpose of hang detection (not stall detection) if there
      are outstanding breadcrumbs.
      
      In recent history we have looked at using both the request and seqno as
      indication of activity on the engine, but that was reduced to just
      inspecting seqno in commit cffa781e ("drm/i915: Simplify check for
      idleness in hangcheck"). However, in commit dcff85c8 ("drm/i915:
      Enable i915_gem_wait_for_idle() without holding struct_mutex"), I made
      the decision to use the new common lockless function, under the
      assumption that request retirement was more frequent than hangcheck and
      so we would not have a stuck busy check. The flaw there was in
      forgetting that we accumulate the hang score, and so successive checks
      seeing a stuck request, albeit with the GPU advancing elsewhere and so
      not necessary the same stuck request, would eventually trigger the hang.
      
      Fixes: dcff85c8 ("drm/i915: Enable i915_gem_wait_for_idle()...")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20160820145408.32180-1-chris@chris-wilson.co.ukReviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      34730fed
  9. 10 8月, 2016 1 次提交
  10. 06 8月, 2016 1 次提交
  11. 05 8月, 2016 1 次提交
    • C
      drm/i915: Enable i915_gem_wait_for_idle() without holding struct_mutex · dcff85c8
      Chris Wilson 提交于
      The principal motivation for this was to try and eliminate the
      struct_mutex from i915_gem_suspend - but we still need to hold the mutex
      current for the i915_gem_context_lost(). (The issue there is that there
      may be an indirect lockdep cycle between cpu_hotplug (i.e. suspend) and
      struct_mutex via the stop_machine().) For the moment, enabling last
      request tracking for the engine, allows us to do busyness checking and
      waiting without requiring the struct_mutex - which is useful in its own
      right.
      
      As a side-effect of having a robust means for tracking engine busyness,
      we can replace our other busyness heuristic, that of comparing against
      the last submitted seqno. For paranoid reasons, we have a semi-ordered
      check of that seqno inside the hangchecker, which we can now improve to
      an ordered check of the engine's busyness (removing a locked xchg in the
      process).
      
      v2: Pass along "bool interruptible" as being unlocked we cannot rely on
      i915->mm.interruptible being stable or even under our control.
      v3: Replace check Ironlake i915_gpu_busy() with the common precalculated value
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1470388464-28458-6-git-send-email-chris@chris-wilson.co.uk
      dcff85c8
  12. 03 8月, 2016 1 次提交
  13. 27 7月, 2016 1 次提交
  14. 20 7月, 2016 2 次提交
  15. 15 7月, 2016 1 次提交
  16. 14 7月, 2016 1 次提交
  17. 08 7月, 2016 1 次提交
  18. 06 7月, 2016 1 次提交
  19. 05 7月, 2016 3 次提交
  20. 04 7月, 2016 3 次提交
  21. 02 7月, 2016 8 次提交
    • C
      drm/i915: Remove debug noise on detecting fault-injection of missed interrupts · c5a7b5aa
      Chris Wilson 提交于
      Since the tests can and do explicitly check debugfs/i915_ring_missed_irqs
      for the handling of a "missed interrupt", adding it to the dmesg at INFO
      is just noise. When it happens for real, we still class it as an ERROR.
      
      Note that I have chose to remove it entirely because when we detect the
      "missed interrupt" is irrelevant and the message contains no more
      information than we glean from looking in debugfs.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1467390209-3576-20-git-send-email-chris@chris-wilson.co.uk
      c5a7b5aa
    • C
      drm/i915: Move the get/put irq locking into the caller · 31bb59cc
      Chris Wilson 提交于
      With only a single callsite for intel_engine_cs->irq_get and ->irq_put,
      we can reduce the code size by moving the common preamble into the
      caller, and we can also eliminate the reference counting.
      
      For completeness, as we are no longer doing reference counting on irq,
      rename the get/put vfunctions to enable/disable respectively and are
      able to review the use of posting reads. We only require the
      serialisation with hardware when enabling the interrupt (i.e. so we
      cannot miss an interrupt by going to sleep before the hardware truly
      enables it).
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: http://patchwork.freedesktop.org/patch/msgid/1467390209-3576-18-git-send-email-chris@chris-wilson.co.uk
      31bb59cc
    • C
      drm/i915: Only apply one barrier after a breadcrumb interrupt is posted · 3d5564e9
      Chris Wilson 提交于
      If we flag the seqno as potentially stale upon receiving an interrupt,
      we can use that information to reduce the frequency that we apply the
      heavyweight coherent seqno read (i.e. if we wake up a chain of waiters).
      
      v2: Use cmpxchg to replace READ_ONCE/WRITE_ONCE for more explicit
      control of the ordering wrt to interrupt generation and interrupt
      checking in the bottom-half.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1467390209-3576-14-git-send-email-chris@chris-wilson.co.uk
      3d5564e9
    • C
      drm/i915: Add a delay between interrupt and inspecting the final seqno (ilk) · f8973c21
      Chris Wilson 提交于
      On Ironlake, there is no command nor register to ensure that the write
      from a MI_STORE command is completed (and coherent on the CPU) before the
      command parser continues. This means that the ordering between the seqno
      write and the subsequent user interrupt is undefined (like gen6+). So to
      ensure that the seqno write is completed after the final user interrupt
      we need to delay the read sufficiently to allow the write to complete.
      This delay is undefined by the bspec, and empirically requires 75us even
      though a register read combined with a clflush is less than 500ns. Hence,
      the delay is due to an on-chip buffer rather than the latency of the write
      to memory.
      
      Note that the render ring controls this by filling the PIPE_CONTROL fifo
      with stalling commands that force the earliest pipe-control with the
      seqno to be completed before the command parser continues. Given that we
      need a barrier operation for BSD, we may as well forgo the extra
      per-batch latency by using a common per-interrupt barrier.
      
      Studying the impact of adding the usleep shows that in both sequences of
      and individual synchronous no-op batches is negligible for the media
      engine (where the write now is unordered with the interrupt). Converting
      the render engine over from the current glutton of pie-controls over to
      the per-interrupt delays speeds up both the sequential and individual
      synchronous no-ops by 20% and 60%, respectively. This speed up holds
      even when looking at the throughput of small copies (4KiB->4MiB), both
      serial and synchronous, by about 20%. This is because despite adding a
      significant delay to the interrupt, in all likelihood we will see the
      seqno write without having to apply the barrier (only in the rare corner
      cases where the write is delayed on the last required is the delay
      necessary).
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94307
      Testcase: igt/gem_sync #ilk
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1467390209-3576-12-git-send-email-chris@chris-wilson.co.uk
      f8973c21
    • C
      drm/i915: Use HWS for seqno tracking everywhere · 1b7744e7
      Chris Wilson 提交于
      By using the same address for storing the HWS on every platform, we can
      remove the platform specific vfuncs and reduce the get-seqno routine to
      a single read of a cached memory location.
      
      v2: Fix semaphore_passed() to look at the signaling engine (not the
      waiter's)
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1467390209-3576-8-git-send-email-chris@chris-wilson.co.uk
      1b7744e7
    • C
      drm/i915: Slaughter the thundering i915_wait_request herd · 688e6c72
      Chris Wilson 提交于
      One particularly stressful scenario consists of many independent tasks
      all competing for GPU time and waiting upon the results (e.g. realtime
      transcoding of many, many streams). One bottleneck in particular is that
      each client waits on its own results, but every client is woken up after
      every batchbuffer - hence the thunder of hooves as then every client must
      do its heavyweight dance to read a coherent seqno to see if it is the
      lucky one.
      
      Ideally, we only want one client to wake up after the interrupt and
      check its request for completion. Since the requests must retire in
      order, we can select the first client on the oldest request to be woken.
      Once that client has completed his wait, we can then wake up the
      next client and so on. However, all clients then incur latency as every
      process in the chain may be delayed for scheduling - this may also then
      cause some priority inversion. To reduce the latency, when a client
      is added or removed from the list, we scan the tree for completed
      seqno and wake up all the completed waiters in parallel.
      
      Using igt/benchmarks/gem_latency, we can demonstrate this effect. The
      benchmark measures the number of GPU cycles between completion of a
      batch and the client waking up from a call to wait-ioctl. With many
      concurrent waiters, with each on a different request, we observe that
      the wakeup latency before the patch scales nearly linearly with the
      number of waiters (before external factors kick in making the scaling much
      worse). After applying the patch, we can see that only the single waiter
      for the request is being woken up, providing a constant wakeup latency
      for every operation. However, the situation is not quite as rosy for
      many waiters on the same request, though to the best of my knowledge this
      is much less likely in practice. Here, we can observe that the
      concurrent waiters incur extra latency from being woken up by the
      solitary bottom-half, rather than directly by the interrupt. This
      appears to be scheduler induced (having discounted adverse effects from
      having a rbtree walk/erase in the wakeup path), each additional
      wake_up_process() costs approximately 1us on big core. Another effect of
      performing the secondary wakeups from the first bottom-half is the
      incurred delay this imposes on high priority threads - rather than
      immediately returning to userspace and leaving the interrupt handler to
      wake the others.
      
      To offset the delay incurred with additional waiters on a request, we
      could use a hybrid scheme that did a quick read in the interrupt handler
      and dequeued all the completed waiters (incurring the overhead in the
      interrupt handler, not the best plan either as we then incur GPU
      submission latency) but we would still have to wake up the bottom-half
      every time to do the heavyweight slow read. Or we could only kick the
      waiters on the seqno with the same priority as the current task (i.e. in
      the realtime waiter scenario, only it is woken up immediately by the
      interrupt and simply queues the next waiter before returning to userspace,
      minimising its delay at the expense of the chain, and also reducing
      contention on its scheduler runqueue). This is effective at avoid long
      pauses in the interrupt handler and at avoiding the extra latency in
      realtime/high-priority waiters.
      
      v2: Convert from a kworker per engine into a dedicated kthread for the
      bottom-half.
      v3: Rename request members and tweak comments.
      v4: Use a per-engine spinlock in the breadcrumbs bottom-half.
      v5: Fix race in locklessly checking waiter status and kicking the task on
      adding a new waiter.
      v6: Fix deciding when to force the timer to hide missing interrupts.
      v7: Move the bottom-half from the kthread to the first client process.
      v8: Reword a few comments
      v9: Break the busy loop when the interrupt is unmasked or has fired.
      v10: Comments, unnecessary churn, better debugging from Tvrtko
      v11: Wake all completed waiters on removing the current bottom-half to
      reduce the latency of waking up a herd of clients all waiting on the
      same request.
      v12: Rearrange missed-interrupt fault injection so that it works with
      igt/drv_missed_irq_hang
      v13: Rename intel_breadcrumb and friends to intel_wait in preparation
      for signal handling.
      v14: RCU commentary, assert_spin_locked
      v15: Hide BUG_ON behind the compiler; report on gem_latency findings.
      v16: Sort seqno-groups by priority so that first-waiter has the highest
      task priority (and so avoid priority inversion).
      v17: Add waiters to post-mortem GPU hang state.
      v18: Return early for a completed wait after acquiring the spinlock.
      Avoids adding ourselves to the tree if the is already complete, and
      skips the awkward question of why we don't do completion wakeups for
      waits earlier than or equal to ourselves.
      v19: Prepare for init_breadcrumbs to fail. Later patches may want to
      allocate during init, so be prepared to propagate back the error code.
      
      Testcase: igt/gem_concurrent_blit
      Testcase: igt/benchmarks/gem_latency
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: "Rogozhkin, Dmitry V" <dmitry.v.rogozhkin@intel.com>
      Cc: "Gong, Zhipeng" <zhipeng.gong@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Cc: Dave Gordon <david.s.gordon@intel.com>
      Cc: "Goel, Akash" <akash.goel@intel.com>
      Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> #v18
      Link: http://patchwork.freedesktop.org/patch/msgid/1467390209-3576-6-git-send-email-chris@chris-wilson.co.uk
      688e6c72
    • C
      drm/i915: Separate GPU hang waitqueue from advance · 1f15b76f
      Chris Wilson 提交于
      Currently __i915_wait_request uses a per-engine wait_queue_t for the dual
      purpose of waking after the GPU advances or for waking after an error.
      In the future, we may add even more wake sources and require greater
      separation, but for now we can conceptually simplify wakeups by separating
      the two sources. In particular, this allows us to use different wait-queues
      (e.g. one on the engine advancement, a global one for errors and one on
      each requests) without any hassle.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1467390209-3576-5-git-send-email-chris@chris-wilson.co.uk
      1f15b76f
    • C
      drm/i915: Make queueing the hangcheck work inline · 26a02b8f
      Chris Wilson 提交于
      Since the function is a small wrapper around schedule_delayed_work(),
      move it inline to remove the function call overhead for the principle
      caller.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1467390209-3576-4-git-send-email-chris@chris-wilson.co.uk
      26a02b8f