From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: Jonathan Cavitt <jonathan.cavitt@intel.com>,
<intel-xe@lists.freedesktop.org>
Cc: <saurabhg.gupta@intel.com>, <alex.zuo@intel.com>
Subject: Re: [PATCH] drm/xe/pf: Streamline fair scheduling error reporting
Date: Wed, 15 Apr 2026 12:19:19 +0200 [thread overview]
Message-ID: <66230450-64f5-440a-bc5e-f09a449733df@intel.com> (raw)
In-Reply-To: <20260414220409.119614-2-jonathan.cavitt@intel.com>
On 4/15/2026 12:04 AM, Jonathan Cavitt wrote:
> The function xe_gt_sriov_pf_config_set_fair_sched returns the first
> error result it encounters, or zero if the function succeeds. The way
> the function accomplishes this is by only overwriting the result value
> if it is already zero.
>
> The function checks this three times, but the first time it does this is
> unnecessary because the result value defaults to zero, meaning the
> result is always overwritten. We can streamline this by just directly
> assigning result to the return value of pf_bulk_set_exec_quantum instead
> of assinging it to err, eliminating the superfluous check. This also
> means we don't need to initialize result separately from err.
>
but the final effect of this patch is ... nothing?
$ scripts/bloat-o-meter .build/drivers/gpu/drm/xe/xe.ko1 .build/drivers/gpu/drm/xe/xe.ko2
add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0 (0)
Function old new delta
Total: Before=1720641, After=1720641, chg +0.00%
and it was written that way to focus on the actual steps, not their
order, as order can potentially change when new steps will have to
be added (and maybe some must be done before setting up the EQ)
and since the same simple pattern is used in other places (where you
may still argue the same 'optimization' could be applied) I would
prefer to leave all code as is, to be consistent and safe
> Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
btw, instead of Cc: managers, in the future please try to include in Cc:
here the author and/or the owner of the code you are trying to modify
> ---
> drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> index e112aa148dab..bb9811bc64d4 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> @@ -2725,8 +2725,7 @@ static bool pf_needs_provision_sched(struct xe_gt *gt, unsigned int num_vfs)
> */
> int xe_gt_sriov_pf_config_set_fair_sched(struct xe_gt *gt, unsigned int num_vfs)
> {
> - int result = 0;
> - int err;
> + int result, err;
>
> xe_gt_assert(gt, num_vfs);
> xe_gt_assert(gt, XE_FAIR_EXEC_QUANTUM_MS);
> @@ -2737,8 +2736,7 @@ int xe_gt_sriov_pf_config_set_fair_sched(struct xe_gt *gt, unsigned int num_vfs)
> if (!pf_needs_provision_sched(gt, num_vfs))
> return 0;
>
> - err = pf_bulk_set_exec_quantum(gt, XE_FAIR_EXEC_QUANTUM_MS, PFID, 1 + num_vfs);
> - result = result ?: err;
> + result = pf_bulk_set_exec_quantum(gt, XE_FAIR_EXEC_QUANTUM_MS, PFID, 1 + num_vfs);
> err = pf_bulk_set_preempt_timeout(gt, XE_FAIR_PREEMPT_TIMEOUT_US, PFID, 1 + num_vfs);
> result = result ?: err;
>
next prev parent reply other threads:[~2026-04-15 10:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-14 22:04 [PATCH] drm/xe/pf: Streamline fair scheduling error reporting Jonathan Cavitt
2026-04-14 23:18 ` ✓ CI.KUnit: success for " Patchwork
2026-04-15 0:58 ` ✓ Xe.CI.FULL: " Patchwork
2026-04-15 10:19 ` Michal Wajdeczko [this message]
2026-04-15 14:24 ` [PATCH] " Cavitt, Jonathan
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=66230450-64f5-440a-bc5e-f09a449733df@intel.com \
--to=michal.wajdeczko@intel.com \
--cc=alex.zuo@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=jonathan.cavitt@intel.com \
--cc=saurabhg.gupta@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