. This allows
callers to:
1. Detect when job submission fails
2. Perform proper cleanup (e.g., release job and fence allocations)
3. Avoid potential memory leaks in error paths
Signed-off-by: Qianyi Liu
---
drivers/gpu/drm/scheduler/sched_entity.c | 8 ++--
include/drm/gpu_scheduler.h
From: qianyi liu
The last_scheduled fence leaks when an entity is being killed and adding
the cleanup callback fails.
Decrement the reference count of prev when dma_fence_add_callback()
fails, ensuring proper balance.
Cc: sta...@vger.kernel.org
Fixes: 2fdb8a8f07c2 ("drm/scheduler: r
> Sorry for the delay
>
> On Wed, 2025-02-26 at 17:05 +0800, Qianyi Liu wrote:
>> From: qianyi liu
>>
>> The last_scheduled fence leaked when an entity was being killed and
>> adding its callback failed.
>
> s/leaked/leaks
>
> s/was being/is being
xes: 2fdb8a8f07c2 ("drm/scheduler: rework entity flush, kill and fini")
>> Signed-off-by: qianyi liu
>
>> From: qianyi liu
>>
>> The last_scheduled fence leaked when an entity was being killed and
>> adding its callback failed.
>>
>> Decremen
From: qianyi liu
The last_scheduled fence leaked when an entity was being killed and
adding its callback failed.
Decrement the reference count of prev when dma_fence_add_callback()
fails, ensuring proper balance.
Cc: sta...@vger.kernel.org
Fixes: 2fdb8a8f07c2 ("drm/scheduler: rework e
Hello Markus,
>…
>> fence callback add fails.
> failed?
>> To fix this, we should decrement the reference count of prev when
>…
> See also:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.14-rc4#n94
> Oh, and importantly, I forgot:
> Since this is clearly a bug fix, it needs a "Fixes: " tag and put the
> stable kernel on Cc.
OK, thanks for reminding.
Qianyi.
From: qianyi liu
We leaked last_scheduled fences when the entity was being killed and the
fence callback add fails.
To fix this, we should decrement the reference count of prev when
dma_fence_add_callback() fails, ensuring proper balance.
v2:
* Make commit message more clearly. (Philipp and
Hello Matt,
>>
>> But also be handy of could share the kmemleak trace.
>>
> Agree kmemleak trace would good, include in commit message, but the
> patch looks correct to me.
Unfortunately, as trace involves private code of our driver, our driver has not
yet officially entered the community yet,
Hello Philipp,
Thank you for your patient reply. Let's first clarify the issue and send a new
patch if necessary.
As soon as it enters the drm_sched_entity_kill function, the entity
->last_scheduled reference count is incremented by 1. If there are still jobs in
the current entity, it will enter
Thank you for your patient reply. Let's first clarify the issue and send a new
patch if necessary.
As soon as it enters the drm_sched_entity_kill function, the entity
->last_stchedled reference count is incremented by 1. If there are still jobs in
the current entity, it will enter the while loop,
Problem: If prev(last_scheduled) was already signaled I encountred a
memory leak in drm_sched_entity_fini. This is because the
prev(last_scheduled) fence is not free properly.
Fix: Balance the prev(last_scheduled) fence refcnt when
dma_fence_add_callback failed.
Signed-off-by: qianyi liu
This patch fixes the following checkpatch:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
WARNING: Missing a blank line after declarations
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
Signed-off-by: qianyi liu
---
drive
13 matches
Mail list logo