From: Nirmoy Das <nirmoy.das@intel.com>
To: Jonathan Cavitt <jonathan.cavitt@intel.com>,
<intel-gfx@lists.freedesktop.org>
Cc: janusz.krzysztofik@intel.com, andi.shyti@intel.com,
matthew.d.roper@intel.com, saurabhg.gupta@intel.com,
chris.p.wilson@linux.intel.com
Subject: Re: [Intel-gfx] [PATCH v11 2/7] drm/i915/guc: Add CT size delay helper
Date: Wed, 11 Oct 2023 11:00:51 +0200 [thread overview]
Message-ID: <fd941b82-4dc7-429d-bd47-9a28c6580688@intel.com> (raw)
In-Reply-To: <20231011000248.2181018-3-jonathan.cavitt@intel.com>
On 10/11/2023 2:02 AM, Jonathan Cavitt wrote:
> Add a helper function to the GuC CT buffer that reports the expected
> time to process all outstanding requests. As of now, there is no
> functionality to check number of requests in the buffer, so the helper
> function just reports 2 seconds, or 1ms per request up to the maximum
> number of requests the CT buffer can store.
>
> Suggested-by: John Harrison <john.c.harrison@intel.com>
> Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
> drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 27 +++++++++++++++++++++++
> drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h | 2 ++
> 2 files changed, 29 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
> index c33210ead1ef7..03b616ba4ebb7 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
> @@ -103,6 +103,33 @@ enum { CTB_SEND = 0, CTB_RECV = 1 };
>
> enum { CTB_OWNER_HOST = 0 };
>
> +/*
> + * Some H2G commands involve a synchronous response that the driver needs
> + * to wait for. In such cases, a timeout is required to prevent the driver
> + * from waiting forever in the case of an error (either no error response
> + * is defined in the protocol or something has died and requires a reset).
> + * The specific command may be defined as having a time bound response but
> + * the CT is a queue and that time guarantee only starts from the point
> + * when the command reaches the head of the queue and is processed by GuC.
> + *
> + * Ideally there would be a helper to report the progress of a given
> + * command through the CT. However, that would require a significant
> + * amount of work in the CT layer. In the meantime, provide a reasonable
> + * estimation of the worst case latency it should take for the entire
> + * queue to drain. And therefore, how long a caller should wait before
> + * giving up on their request. The current estimate is based on empirical
> + * measurement of a test that fills the buffer with context creation and
> + * destruction requests as they seem to be the slowest operation.
> + */
> +long intel_guc_ct_max_queue_time_jiffies(void)
> +{
> + /*
> + * A 4KB buffer full of context destroy commands takes a little
> + * over a second to process so bump that to 2s to be super safe.
> + */
> + return (CTB_H2G_BUFFER_SIZE * HZ) / SZ_2K;
> +}
> +
> static void ct_receive_tasklet_func(struct tasklet_struct *t);
> static void ct_incoming_request_worker_func(struct work_struct *w);
>
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h
> index 58e42901ff498..2c4bb9a941be6 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h
> @@ -104,6 +104,8 @@ struct intel_guc_ct {
> #endif
> };
>
> +long intel_guc_ct_max_queue_time_jiffies(void);
> +
> void intel_guc_ct_init_early(struct intel_guc_ct *ct);
> int intel_guc_ct_init(struct intel_guc_ct *ct);
> void intel_guc_ct_fini(struct intel_guc_ct *ct);
next prev parent reply other threads:[~2023-10-11 9:01 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-11 0:02 [Intel-gfx] [PATCH v11 0/7] drm/i915: Define and use GuC and CTB TLB invalidation routines Jonathan Cavitt
2023-10-11 0:02 ` [Intel-gfx] [PATCH v11 1/7] drm/i915: Add GuC TLB Invalidation device info flags Jonathan Cavitt
2023-10-11 9:00 ` Nirmoy Das
2023-10-11 0:02 ` [Intel-gfx] [PATCH v11 2/7] drm/i915/guc: Add CT size delay helper Jonathan Cavitt
2023-10-11 9:00 ` Nirmoy Das [this message]
2023-10-11 17:44 ` John Harrison
2023-10-11 0:02 ` [Intel-gfx] [PATCH v11 3/7] drm/i915: Define and use GuC and CTB TLB invalidation routines Jonathan Cavitt
2023-10-11 9:01 ` Nirmoy Das
2023-10-11 17:52 ` John Harrison
2023-10-11 0:02 ` [Intel-gfx] [PATCH v11 4/7] drm/i915: No TLB invalidation on suspended GT Jonathan Cavitt
2023-10-11 11:09 ` Nirmoy Das
2023-10-11 0:02 ` [Intel-gfx] [PATCH v11 5/7] drm/i915: No TLB invalidation on wedged GT Jonathan Cavitt
2023-10-11 9:03 ` Nirmoy Das
2023-10-11 0:02 ` [Intel-gfx] [PATCH v11 6/7] drm/i915/gt: Increase sleep in gt_tlb selftest sanitycheck Jonathan Cavitt
2023-10-11 9:04 ` Nirmoy Das
2023-10-11 0:02 ` [Intel-gfx] [PATCH v11 7/7] drm/i915: Enable GuC TLB invalidations for MTL Jonathan Cavitt
2023-10-11 9:05 ` Nirmoy Das
2023-10-11 4:17 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Define and use GuC and CTB TLB invalidation routines Patchwork
2023-10-11 4:17 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-10-11 4:30 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-10-11 8:24 ` [Intel-gfx] [PATCH v11 0/7] " Tvrtko Ursulin
2023-10-11 18:55 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for " Patchwork
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=fd941b82-4dc7-429d-bd47-9a28c6580688@intel.com \
--to=nirmoy.das@intel.com \
--cc=andi.shyti@intel.com \
--cc=chris.p.wilson@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=janusz.krzysztofik@intel.com \
--cc=jonathan.cavitt@intel.com \
--cc=matthew.d.roper@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