1. 29 3月, 2022 1 次提交
  2. 10 1月, 2022 3 次提交
  3. 14 12月, 2021 1 次提交
  4. 25 11月, 2021 4 次提交
  5. 24 11月, 2021 1 次提交
  6. 22 11月, 2021 1 次提交
  7. 11 11月, 2021 1 次提交
  8. 05 11月, 2021 1 次提交
  9. 02 11月, 2021 1 次提交
    • T
      drm/i915: Introduce refcounted sg-tables · cad7109a
      Thomas Hellström 提交于
      As we start to introduce asynchronous failsafe object migration,
      where we update the object state and then submit asynchronous
      commands we need to record what memory resources are actually used
      by various part of the command stream. Initially for three purposes:
      
      1) Error capture.
      2) Asynchronous migration error recovery.
      3) Asynchronous vma bind.
      
      At the time where these happens, the object state may have been updated
      to be several migrations ahead and object sg-tables discarded.
      
      In order to make it possible to keep sg-tables with memory resource
      information for these operations, introduce refcounted sg-tables that
      aren't freed until the last user is done with them.
      
      The alternative would be to reference information sitting on the
      corresponding ttm_resources which typically have the same lifetime as
      these refcountes sg_tables, but that leads to other awkward constructs:
      Due to the design direction chosen for ttm resource managers that would
      lead to diamond-style inheritance, the LMEM resources may sometimes be
      prematurely freed, and finally the subclassed struct ttm_resource would
      have to bleed into the asynchronous vma bind code.
      
      v3:
      - Address a number of style issues (Matthew Auld)
      v4:
      - Dont check for st->sgl being NULL in i915_ttm_tt__shmem_unpopulate(),
        that should never happen. (Matthew Auld)
      v5:
      - Fix a Potential double-free (Matthew Auld)
      Signed-off-by: NThomas Hellström <thomas.hellstrom@linux.intel.com>
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211101122444.114607-1-thomas.hellstrom@linux.intel.com
      cad7109a
  10. 22 10月, 2021 4 次提交
    • M
      drm/i915/ttm: enable shmem tt backend · 5d12ffe6
      Matthew Auld 提交于
      Turn on the shmem tt backend, and enable shrinking.
      Signed-off-by: NMatthew Auld <matthew.auld@intel.com>
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Reviewed-by: NThomas Hellström <thomas.hellstrom@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211018091055.1998191-8-matthew.auld@intel.com
      5d12ffe6
    • M
      drm/i915/ttm: use cached system pages when evicting lmem · 2eda4fc6
      Matthew Auld 提交于
      This should let us do an accelerated copy directly to the shmem pages
      when temporarily moving lmem-only objects, where the i915-gem shrinker
      can later kick in to swap out the pages, if needed.
      Signed-off-by: NMatthew Auld <matthew.auld@intel.com>
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Reviewed-by: NThomas Hellström <thomas.hellstrom@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211018091055.1998191-7-matthew.auld@intel.com
      2eda4fc6
    • M
      drm/i915/ttm: move shrinker management into adjust_lru · ebd4a8ec
      Matthew Auld 提交于
      We currently just evict lmem objects to system memory when under memory
      pressure. For this case we might lack the usual object mm.pages, which
      effectively hides the pages from the i915-gem shrinker, until we
      actually "attach" the TT to the object, or in the case of lmem-only
      objects it just gets migrated back to lmem when touched again.
      
      For all cases we can just adjust the i915 shrinker LRU each time we also
      adjust the TTM LRU. The two cases we care about are:
      
        1) When something is moved by TTM, including when initially populating
           an object. Importantly this covers the case where TTM moves something from
           lmem <-> smem, outside of the normal get_pages() interface, which
           should still ensure the shmem pages underneath are reclaimable.
      
        2) When calling into i915_gem_object_unlock(). The unlock should
           ensure the object is removed from the shinker LRU, if it was indeed
           swapped out, or just purged, when the shrinker drops the object lock.
      
      v2(Thomas):
        - Handle managing the shrinker LRU in adjust_lru, where it is always
          safe to touch the object.
      v3(Thomas):
        - Pretty much a re-write. This time piggy back off the shrink_pin
          stuff, which actually seems to fit quite well for what we want here.
      v4(Thomas):
        - Just use a simple boolean for tracking ttm_shrinkable.
      v5:
        - Ensure we call adjust_lru when faulting the object, to ensure the
          pages are visible to the shrinker, if needed.
        - Add back the adjust_lru when in i915_ttm_move (Thomas)
      v6(Reported-by: kernel test robot <lkp@intel.com>):
        - Remove unused i915_tt
      Signed-off-by: NMatthew Auld <matthew.auld@intel.com>
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> #v4
      Link: https://patchwork.freedesktop.org/patch/msgid/20211018091055.1998191-6-matthew.auld@intel.com
      ebd4a8ec
    • M
      drm/i915/ttm: add tt shmem backend · 7ae03459
      Matthew Auld 提交于
      For cached objects we can allocate our pages directly in shmem. This
      should make it possible(in a later patch) to utilise the existing
      i915-gem shrinker code for such objects. For now this is still disabled.
      
      v2(Thomas):
        - Add optional try_to_writeback hook for objects. Importantly we need
          to check if the object is even still shrinkable; in between us
          dropping the shrinker LRU lock and acquiring the object lock it could for
          example have been moved. Also we need to differentiate between
          "lazy" shrinking and the immediate writeback mode. Also later we need to
          handle objects which don't even have mm.pages, so bundling this into
          put_pages() would require somehow handling that edge case, hence
          just letting the ttm backend handle everything in try_to_writeback
          doesn't seem too bad.
      v3(Thomas):
        - Likely a bad idea to touch the object from the unpopulate hook,
          since it's not possible to hold a reference, without also creating
          circular dependency, so likely this is too fragile. For now just
          ensure we at least mark the pages as dirty/accessed when called from the
          shrinker on WILLNEED objects.
        - s/try_to_writeback/shrinker_release_pages, since this can do more
          than just writeback.
        - Get rid of do_backup boolean and just set the SWAPPED flag prior to
          calling unpopulate.
        - Keep shmem_tt as lowest priority for the TTM LRU bo_swapout walk, since
          these just get skipped anyway. We can try to come up with something
          better later.
      v4(Thomas):
        - s/PCI_DMA/DMA/. Also drop NO_KERNEL_MAPPING and NO_WARN, which
          apparently doesn't do anything with streaming mappings.
        - Just pass along the error for ->truncate, and assume nothing.
      Signed-off-by: NMatthew Auld <matthew.auld@intel.com>
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Cc: Christian König <christian.koenig@amd.com>
      Cc: Oak Zeng <oak.zeng@intel.com>
      Reviewed-by: NThomas Hellström <thomas.hellstrom@linux.intel.com>
      Acked-by: NOak Zeng <oak.zeng@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211018091055.1998191-2-matthew.auld@intel.com
      7ae03459
  11. 01 10月, 2021 1 次提交
    • T
      drm/i915/ttm: Rework object initialization slightly · 068396bb
      Thomas Hellström 提交于
      We may end up in i915_ttm_bo_destroy() in an error path before the
      object is fully initialized. In that case it's not correct to call
      __i915_gem_free_object(), because that function
      a) Assumes the gem object refcount is 0, which it isn't.
      b) frees the placements which are owned by the caller until the
      init_object() region ops returns successfully. Fix this by providing
      a lightweight cleanup function __i915_gem_object_fini() which is also
      called by __i915_gem_free_object().
      
      While doing this, also make sure we call dma_resv_fini() as part of
      ordinary object destruction and not from the RCU callback that frees
      the object. This will help track down bugs where the object is incorrectly
      locked from an RCU lookup.
      
      Finally, make sure the object isn't put on the region list until it's
      either locked or fully initialized in order to block list processing of
      partially initialized objects.
      
      v2:
      - The TTM object backend memory was freed before the gem pages were
        put. Separate this functionality into __i915_gem_object_pages_fini()
        and call it from the TTM delete_mem_notify() callback.
      v3:
      - Include i915_gem_object_free_mmaps() in __i915_gem_object_pages_fini()
        to make sure we don't inadvertedly introduce a race.
      
      Fixes: 48b09612 ("drm/i915: Move __i915_gem_free_object to ttm_bo_destroy")
      Signed-off-by: NThomas Hellström <thomas.hellstrom@linux.intel.com>
      Reviewed-by: Matthew Auld <matthew.auld@intel.com> #v1
      Link: https://patchwork.freedesktop.org/patch/msgid/20210930113236.583531-1-thomas.hellstrom@linux.intel.com
      068396bb
  12. 29 9月, 2021 1 次提交
  13. 24 9月, 2021 2 次提交
  14. 21 9月, 2021 1 次提交
  15. 16 9月, 2021 1 次提交
  16. 25 8月, 2021 2 次提交
  17. 23 8月, 2021 1 次提交
  18. 26 7月, 2021 1 次提交
  19. 17 7月, 2021 1 次提交
  20. 30 6月, 2021 2 次提交
  21. 25 6月, 2021 3 次提交
  22. 24 6月, 2021 1 次提交
  23. 19 6月, 2021 1 次提交
  24. 17 6月, 2021 1 次提交
  25. 16 6月, 2021 3 次提交