public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 5/6] drm/i915/ttm: switch over to ttm_buddy_man
Date: Tue, 8 Jun 2021 09:13:46 +0100	[thread overview]
Message-ID: <53aa14b3-87b5-65e9-42e3-198dc55c0a51@intel.com> (raw)
In-Reply-To: <b741db2d0b50b634a995d6f7bbfbf70b35818850.camel@linux.intel.com>

On 08/06/2021 08:39, Thomas Hellström wrote:
> On Mon, 2021-06-07 at 19:22 +0100, Matthew Auld wrote:
>> Move back to the buddy allocator for managing device local memory,
>> and
>> restore the lost mock selftests. Keep around the range manager
>> related
>> bits, since we likely need this for managing stolen at some point.
>> For
>> stolen we also don't need to reserve anything so no need to support a
>> generic reserve interface.
>>
>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
>> ---
>>   drivers/gpu/drm/i915/gem/i915_gem_ttm.c       |  26 +--
>>   drivers/gpu/drm/i915/intel_memory_region.c    |  55 +-----
>>   drivers/gpu/drm/i915/intel_memory_region.h    |  17 --
>>   drivers/gpu/drm/i915/intel_region_ttm.c       | 100 +++--------
>>   .../drm/i915/selftests/intel_memory_region.c  | 170 ++++++++++++----
>> --
>>
> 
> ...
> 
>>   
>>   static int i915_ttm_move(struct ttm_buffer_object *bo, bool evict,
>> @@ -661,20 +661,8 @@ int __i915_gem_ttm_object_init(struct
>> intel_memory_region *mem,
>>          static struct lock_class_key lock_class;
>>          struct drm_i915_private *i915 = mem->i915;
>>          enum ttm_bo_type bo_type;
>> -       size_t alignment = 0;
>>          int ret;
>>   
>> -       /* Adjust alignment to GPU- and CPU huge page sizes. */
>> -
>> -       if (mem->is_range_manager) {
>> -               if (size >= SZ_1G)
>> -                       alignment = SZ_1G >> PAGE_SHIFT;
>> -               else if (size >= SZ_2M)
>> -                       alignment = SZ_2M >> PAGE_SHIFT;
>> -               else if (size >= SZ_64K)
>> -                       alignment = SZ_64K >> PAGE_SHIFT;
>> -       }
>> -
>>          drm_gem_private_object_init(&i915->drm, &obj->base, size);
>>          i915_gem_object_init(obj, &i915_gem_ttm_obj_ops, &lock_class,
>> flags);
>>          i915_gem_object_init_memory_region(obj, mem);
>> @@ -696,7 +684,7 @@ int __i915_gem_ttm_object_init(struct
>> intel_memory_region *mem,
>>           */
>>          obj->base.vma_node.driver_private = i915_gem_to_ttm(obj);
>>          ret = ttm_bo_init(&i915->bdev, i915_gem_to_ttm(obj), size,
>> -                         bo_type, &i915_sys_placement, alignment,
>> +                         bo_type, &i915_sys_placement, PAGE_SIZE,
> 
> Actually just realized that the alignment is specified in PAGE_SIZE
> units, so above should be s/PAGE_SIZE/1/. Might need to check that the
> buddy TTM interface gets this right as well.

Oops, and yes it looks like the buddy is also confused here.

> 
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2021-06-08  8:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07 18:22 [Intel-gfx] [PATCH 0/6] Add back the buddy allocator Matthew Auld
2021-06-07 18:22 ` [Intel-gfx] [PATCH 1/6] drm/i915/ttm: add ttm_buddy_man Matthew Auld
2021-06-08  7:11   ` Thomas Hellström
2021-06-08  8:11     ` Matthew Auld
2021-06-08  8:15       ` Thomas Hellström
2021-06-07 18:22 ` [Intel-gfx] [PATCH 2/6] drm/i915/ttm: add i915_sg_from_buddy_resource Matthew Auld
2021-06-08  7:19   ` Thomas Hellström
2021-06-07 18:22 ` [Intel-gfx] [PATCH 3/6] drm/i915/ttm: Calculate the object placement at get_pages time Matthew Auld
2021-06-07 18:22 ` [Intel-gfx] [PATCH 4/6] drm/i915/ttm: pass along the I915_BO_ALLOC_CONTIGUOUS Matthew Auld
2021-06-08  7:26   ` Thomas Hellström
2021-06-08  8:08     ` Matthew Auld
2021-06-07 18:22 ` [Intel-gfx] [PATCH 5/6] drm/i915/ttm: switch over to ttm_buddy_man Matthew Auld
2021-06-08  7:34   ` Thomas Hellström
2021-06-08  7:39   ` Thomas Hellström
2021-06-08  8:13     ` Matthew Auld [this message]
2021-06-07 18:22 ` [Intel-gfx] [PATCH 6/6] drm/i915/ttm: restore min_page_size behaviour Matthew Auld
2021-06-08  7:41   ` Thomas Hellström
2021-06-07 20:08 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for Add back the buddy allocator Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53aa14b3-87b5-65e9-42e3-198dc55c0a51@intel.com \
    --to=matthew.auld@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=thomas.hellstrom@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox