Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>
Cc: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 07/10] drm/xe: Use dma_resv_alloc for lockdep annotation
Date: Thu, 27 Aug 2026 13:04:16 +0000	[thread overview]
Message-ID: <20260827130416.7B05F1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260827124910.2245-8-christian.koenig@amd.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Early return on dma_resv_alloc() failure unintentionally skips unrelated lockdep annotations.
--

commit 2c2f2285d05d44caf485778222c036bce79fbb3f
Author: Christian König <ckoenig.leichtzumerken@gmail.com>

drm/xe: Use dma_resv_alloc for lockdep annotation

This patch replaces the stack-allocated dma_resv in
xe_pm_runtime_lockdep_prime() with a dynamically allocated one to align with
the move towards reference-counted dynamic allocation.

> diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
> index a5289a9df8d25..13f25d15f5482 100644
> --- a/drivers/gpu/drm/xe/xe_pm.c
> +++ b/drivers/gpu/drm/xe/xe_pm.c
> @@ -764,15 +764,20 @@ static void xe_rpm_might_enter_cb(const struct xe_device *xe)
>   */
>  static void xe_pm_runtime_lockdep_prime(void)
>  {
> -	struct dma_resv lockdep_resv;
> +	struct dma_resv *lockdep_resv;
> +
> +	lockdep_resv = dma_resv_alloc();
> +	if (!lockdep_resv)
> +		return;

[Severity: Low]
Does this unconditional early return unintentionally skip the unrelated
lockdep annotations that follow?

If dma_resv_alloc() fails, it looks like we abort the entire
xe_pm_runtime_lockdep_prime() function. This skips the completely
independent shrinker and nod3cold annotations below. Could this lead to
incomplete lockdep coverage under memory pressure?

>  
> -	dma_resv_init(&lockdep_resv);
>  	lock_map_acquire(&xe_pm_runtime_d3cold_map);
>  	/* D3Cold takes the dma_resv locks to evict bos */
> -	dma_resv_lock(&lockdep_resv, NULL);
> -	dma_resv_unlock(&lockdep_resv);
> +	dma_resv_lock(lockdep_resv, NULL);
> +	dma_resv_unlock(lockdep_resv);
>  	lock_map_release(&xe_pm_runtime_d3cold_map);
>  
> +	dma_resv_put(lockdep_resv);
> +
>  	/* Shrinkers might like to wake up the device under reclaim. */
>  	fs_reclaim_acquire(GFP_KERNEL);
>  	lock_map_acquire(&xe_pm_runtime_nod3cold_map);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260827124910.2245-1-christian.koenig@amd.com?part=7

  reply	other threads:[~2026-08-27 13:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-27 12:38 Refcounting dma_resv v2 Christian König
2026-08-27 12:38 ` [PATCH 01/10] dma-buf: Add reference counting to dma_resv Christian König
2026-08-27 18:39   ` Andi Shyti
2026-08-28 18:21   ` Danilo Krummrich
2026-08-28 19:17     ` Matthew Brost
2026-08-28 19:34       ` Matthew Brost
2026-08-27 12:38 ` [PATCH 02/10] dma-buf/tests: Convert st-dma-resv tests to use dma_resv_alloc Christian König
2026-08-27 13:08   ` sashiko-bot
2026-08-27 12:38 ` [PATCH 03/10] drm/gem: Add helper for drm_gem_object resv assignment Christian König
2026-08-27 13:22   ` sashiko-bot
2026-08-27 12:38 ` [PATCH 04/10] drm/gem: Convert drm_gem_private_object_init to return error code Christian König
2026-08-27 13:19   ` sashiko-bot
2026-08-27 12:38 ` [PATCH 05/10] drm/gem: Use dynamic allocation for GEM object dma_resv Christian König
2026-08-27 13:13   ` sashiko-bot
2026-08-27 12:38 ` [PATCH 06/10] drm/mode_config: Use dma_resv_alloc for lockdep annotation Christian König
2026-08-27 13:02   ` sashiko-bot
2026-08-27 12:38 ` [PATCH 07/10] drm/xe: " Christian König
2026-08-27 13:04   ` sashiko-bot [this message]
2026-08-27 12:38 ` [PATCH 08/10] drm/i915/gt: Use dma_resv_alloc for VM reservation objects Christian König
2026-08-27 13:11   ` sashiko-bot
2026-08-27 12:38 ` [PATCH 09/10] drm/ttm/tests: Use dma_resv_alloc in test files Christian König
2026-08-27 13:12   ` sashiko-bot
2026-08-27 12:38 ` [PATCH 10/10] dma-buf: Inline dma_resv_init and remove allocated flag Christian König
2026-08-27 13:31   ` sashiko-bot

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=20260827130416.7B05F1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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