From: "Bernatowicz, Marcin" <marcin.bernatowicz@linux.intel.com>
To: "Piórkowski, Piotr" <piotr.piorkowski@intel.com>,
intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v1 1/5] drm/xe/pf: Split the bulk priority provisioning function
Date: Tue, 10 Nov 2026 11:44:58 +0100 [thread overview]
Message-ID: <7e9b4208-ec8f-45fa-8ed7-bafc8b447e89@linux.intel.com> (raw)
In-Reply-To: <20261027103009.1259199-2-piotr.piorkowski@intel.com>
LGTM,
Reviewed-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
On 10/27/2026 11:30 AM, Piórkowski, Piotr wrote:
> From: Michal Wajdeczko <michal.wajdeczko@intel.com>
>
> During VGPU profile provisioning we will want to reuse the current
> code that converts the scheduling priority into the schedule-if-idle
> policy, while already holding the master mutex.
>
> Move that code into a static helper that expects the caller to hold
> the master mutex, and let the public function take that mutex. As a
> side effect, the schedule-if-idle policy is now updated on all GTs
> under a single lock, instead of taking the lock separately for each
> GT.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
> ---
> drivers/gpu/drm/xe/xe_sriov_pf_provision.c | 35 ++++++++++++++--------
> 1 file changed, 22 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
> index c37e422b5a5c..91670063f706 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
> @@ -376,18 +376,7 @@ int xe_sriov_pf_provision_query_vf_pt(struct xe_device *xe, unsigned int vfid, u
> return !count ? -ENODATA : 0;
> }
>
> -/**
> - * xe_sriov_pf_provision_bulk_apply_priority() - Change scheduling priority of all VFs and PF.
> - * @xe: the PF &xe_device
> - * @prio: scheduling priority to set
> - *
> - * Change the scheduling priority provisioning on all tiles/GTs.
> - *
> - * This function can only be called on PF.
> - *
> - * Return: 0 on success or a negative error code on failure.
> - */
> -int xe_sriov_pf_provision_bulk_apply_priority(struct xe_device *xe, u32 prio)
> +static int pf_bulk_apply_priority(struct xe_device *xe, u32 prio)
> {
> bool sched_if_idle;
> struct xe_gt *gt;
> @@ -395,6 +384,8 @@ int xe_sriov_pf_provision_bulk_apply_priority(struct xe_device *xe, u32 prio)
> int result = 0;
> int err;
>
> + lockdep_assert_held(xe_sriov_pf_master_mutex(xe));
> +
> /*
> * Currently, priority changes that involves VFs are only allowed using
> * the 'sched_if_idle' policy KLV, so only LOW and NORMAL are supported.
> @@ -403,13 +394,31 @@ int xe_sriov_pf_provision_bulk_apply_priority(struct xe_device *xe, u32 prio)
> sched_if_idle = prio == GUC_SCHED_PRIORITY_NORMAL;
>
> for_each_gt(gt, xe, id) {
> - err = xe_gt_sriov_pf_policy_set_sched_if_idle(gt, sched_if_idle);
> + err = xe_gt_sriov_pf_policy_set_sched_if_idle_locked(gt, sched_if_idle);
> result = result ?: err;
> }
>
> return result;
> }
>
> +/**
> + * xe_sriov_pf_provision_bulk_apply_priority() - Change scheduling priority of all VFs and PF.
> + * @xe: the PF &xe_device
> + * @prio: scheduling priority to set
> + *
> + * Change the scheduling priority provisioning on all tiles/GTs.
> + *
> + * This function can only be called on PF.
> + *
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int xe_sriov_pf_provision_bulk_apply_priority(struct xe_device *xe, u32 prio)
> +{
> + guard(mutex)(xe_sriov_pf_master_mutex(xe));
> +
> + return pf_bulk_apply_priority(xe, prio);
> +}
> +
> /**
> * xe_sriov_pf_provision_apply_vf_priority() - Change VF's scheduling priority.
> * @xe: the PF &xe_device
next prev parent reply other threads:[~2026-11-10 10:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 10:30 [PATCH v1 0/5] Prepare SR-IOV provisioning for VGPU profiles Piórkowski, Piotr
2026-10-27 10:30 ` [PATCH v1 1/5] drm/xe/pf: Split the bulk priority provisioning function Piórkowski, Piotr
2026-11-10 10:44 ` Bernatowicz, Marcin [this message]
2026-10-27 10:30 ` [PATCH v1 2/5] drm/xe/pf: Change provisioning mode under mutex Piórkowski, Piotr
2026-11-10 10:46 ` Bernatowicz, Marcin
2026-10-27 10:30 ` [PATCH v1 3/5] drm/xe/pf: Add locked variant of the fair VFs provisioning Piórkowski, Piotr
2026-11-10 10:47 ` Bernatowicz, Marcin
2026-10-27 10:30 ` [PATCH v1 4/5] drm/xe/pf: Provision VFs under mutex Piórkowski, Piotr
2026-11-10 10:48 ` Bernatowicz, Marcin
2026-10-27 10:30 ` [PATCH v1 5/5] drm/xe/pf: Split the provisioning mode change function Piórkowski, Piotr
2026-11-10 10:49 ` Bernatowicz, Marcin
2026-10-27 10:39 ` ✓ CI.KUnit: success for Prepare SR-IOV provisioning for VGPU profiles Patchwork
2026-10-27 11:15 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-27 13:07 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-11-10 12:36 ` Piotr Piórkowski
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=7e9b4208-ec8f-45fa-8ed7-bafc8b447e89@linux.intel.com \
--to=marcin.bernatowicz@linux.intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=piotr.piorkowski@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