[Intel-gfx] [PATCH v2] drm/i915: do not clean GT table on error path

Andrzej Hajda andrzej.hajda at intel.com
Thu Nov 16 12:34:29 UTC 2023



On 16.11.2023 12:44, Andi Shyti wrote:
> Hi Andrzej,
>
> On Wed, Nov 15, 2023 at 11:54:03AM +0100, Andrzej Hajda wrote:
>> The only task of intel_gt_release_all is to zero gt table. Calling
>> it on error path prevents intel_gt_driver_late_release_all (called from
>> i915_driver_late_release) to cleanup GTs, causing leakage.
>> After i915_driver_late_release GT array is not used anymore so
>> it does not need cleaning at all.
>>
>> Sample leak report:
>>
>> BUG i915_request (...): Objects remaining in i915_request on __kmem_cache_shutdown()
>> ...
>> Object 0xffff888113420040 @offset=64
>> Allocated in __i915_request_create+0x75/0x610 [i915] age=18339 cpu=1 pid=1454
>>   kmem_cache_alloc+0x25b/0x270
>>   __i915_request_create+0x75/0x610 [i915]
>>   i915_request_create+0x109/0x290 [i915]
>>   __engines_record_defaults+0xca/0x440 [i915]
>>   intel_gt_init+0x275/0x430 [i915]
>>   i915_gem_init+0x135/0x2c0 [i915]
>>   i915_driver_probe+0x8d1/0xdc0 [i915]
>>
>> v2: removed whole intel_gt_release_all
>>
>> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8489
>> Fixes: bec68cc9ea42d8 ("drm/i915: Prepare for multiple GTs")
>> Signed-off-by: Andrzej Hajda <andrzej.hajda at intel.com>
> Reviewed-by: Andi Shyti <andi.shyti at linux.intel.com>

Thx all, pushed.

> Andi



More information about the Intel-gfx mailing list