From: "Bernatowicz, Marcin" <marcin.bernatowicz@linux.intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
intel-xe@lists.freedesktop.org
Cc: "Michał Winiarski" <michal.winiarski@intel.com>
Subject: Re: [PATCH] drm/xe/relay: Don't use GFP_KERNEL for new transactions
Date: Mon, 3 Feb 2025 10:20:39 +0100 [thread overview]
Message-ID: <19409b7a-e2a8-4d6a-8b57-9bf83209be13@linux.intel.com> (raw)
In-Reply-To: <20250131153713.808-1-michal.wajdeczko@intel.com>
On 1/31/2025 4:37 PM, Michal Wajdeczko wrote:
> VFs use a relay transaction during the resume/reset flow and use
> of the GFP_KERNEL flag may conflict with the reclaim:
>
> -> #0 (fs_reclaim){+.+.}-{0:0}:
> [ ] __lock_acquire+0x1874/0x2bc0
> [ ] lock_acquire+0xd2/0x310
> [ ] fs_reclaim_acquire+0xc5/0x100
> [ ] mempool_alloc_noprof+0x5c/0x1b0
> [ ] __relay_get_transaction+0xdc/0xa10 [xe]
> [ ] relay_send_to+0x251/0xe50 [xe]
> [ ] xe_guc_relay_send_to_pf+0x79/0x3a0 [xe]
> [ ] xe_gt_sriov_vf_connect+0x90/0x4d0 [xe]
> [ ] xe_uc_init_hw+0x157/0x3b0 [xe]
> [ ] do_gt_restart+0x1ae/0x650 [xe]
> [ ] xe_gt_resume+0xb6/0x120 [xe]
> [ ] xe_pm_runtime_resume+0x15b/0x370 [xe]
> [ ] xe_pci_runtime_resume+0x73/0x90 [xe]
> [ ] pci_pm_runtime_resume+0xa0/0x100
> [ ] __rpm_callback+0x4d/0x170
> [ ] rpm_callback+0x64/0x70
> [ ] rpm_resume+0x594/0x790
> [ ] __pm_runtime_resume+0x4e/0x90
> [ ] xe_pm_runtime_get_ioctl+0x9c/0x160 [xe]
>
> Since we have a preallocated pool of relay transactions, which
> should cover all our normal relay use cases, we may use the
> GFP_NOWAIT flag when allocating new outgoing transactions.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
> ---
> drivers/gpu/drm/xe/xe_guc_relay.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_guc_relay.c b/drivers/gpu/drm/xe/xe_guc_relay.c
> index 8f62de026724..e5dc94f3e618 100644
> --- a/drivers/gpu/drm/xe/xe_guc_relay.c
> +++ b/drivers/gpu/drm/xe/xe_guc_relay.c
> @@ -225,7 +225,7 @@ __relay_get_transaction(struct xe_guc_relay *relay, bool incoming, u32 remote, u
> * with CTB lock held which is marked as used in the reclaim path.
> * Btw, that's one of the reason why we use mempool here!
> */
> - txn = mempool_alloc(&relay->pool, incoming ? GFP_ATOMIC : GFP_KERNEL);
> + txn = mempool_alloc(&relay->pool, incoming ? GFP_ATOMIC : GFP_NOWAIT);
> if (!txn)
> return ERR_PTR(-ENOMEM);
>
LGTM. I tested this patch and no longer see the lockdep warning.
Tested-by: Marcin Bernatowicz marcin.bernatowicz@linux.intel.com
Reviewed-by: Marcin Bernatowicz marcin.bernatowicz@linux.intel.com
prev parent reply other threads:[~2025-02-03 9:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-31 15:37 [PATCH] drm/xe/relay: Don't use GFP_KERNEL for new transactions Michal Wajdeczko
2025-01-31 15:42 ` ✓ CI.Patch_applied: success for " Patchwork
2025-01-31 15:43 ` ✓ CI.checkpatch: " Patchwork
2025-01-31 15:45 ` ✓ CI.KUnit: " Patchwork
2025-01-31 16:01 ` ✓ CI.Build: " Patchwork
2025-01-31 16:04 ` ✓ CI.Hooks: " Patchwork
2025-01-31 16:05 ` ✓ CI.checksparse: " Patchwork
2025-01-31 16:25 ` ✓ Xe.CI.BAT: " Patchwork
2025-01-31 21:21 ` ✗ Xe.CI.Full: failure " Patchwork
2025-02-04 10:58 ` Michal Wajdeczko
2025-02-03 9:20 ` Bernatowicz, Marcin [this message]
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=19409b7a-e2a8-4d6a-8b57-9bf83209be13@linux.intel.com \
--to=marcin.bernatowicz@linux.intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=michal.wajdeczko@intel.com \
--cc=michal.winiarski@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.