[PATCH 3/3] drm/xe/guc: Bump the G2H queue size to account for page faults

Matthew Brost matthew.brost at intel.com
Fri Jul 19 18:10:27 UTC 2024


On Fri, Jul 19, 2024 at 05:58:28PM +0000, Stuart Summers wrote:
> With the increase in the size of the recoverable page fault
> queue, we want to ensure the initial messages from GuC in
> the G2H buffer have space while we transfer those out to the
> actual pf_queue. Bump the G2H queue size to account for this
> increase in the pf_queue size.
> 
> Signed-off-by: Stuart Summers <stuart.summers at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_guc_ct.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c
> index 7d2e937da1d8..3135f5812827 100644
> --- a/drivers/gpu/drm/xe/xe_guc_ct.c
> +++ b/drivers/gpu/drm/xe/xe_guc_ct.c
> @@ -105,11 +105,19 @@ ct_to_xe(struct xe_guc_ct *ct)
>   * enough space to avoid backpressure on the driver. We increase the size
>   * of the receive buffer (relative to the send) to ensure a G2H response
>   * CTB has a landing spot.
> + *
> + * In addition to submissions, the G2H buffer needs to be able to hold
> + * enough space for recoverable page fault notifications. The number of
> + * page faults is interrupt driven and can be as much as the number of
> + * compute resources available. However, most of the actual work for these
> + * is in a separate page fault worker thread. Therefore we only need to
> + * make sure the queue has enough space to handle all of the submissions
> + * and responses and an extra buffer for incoming page faults.
>   */
>  
>  #define CTB_DESC_SIZE		ALIGN(sizeof(struct guc_ct_buffer_desc), SZ_2K)
>  #define CTB_H2G_BUFFER_SIZE	(SZ_4K)
> -#define CTB_G2H_BUFFER_SIZE	(4 * CTB_H2G_BUFFER_SIZE)
> +#define CTB_G2H_BUFFER_SIZE	(16 * CTB_H2G_BUFFER_SIZE)
>  #define G2H_ROOM_BUFFER_SIZE	(CTB_G2H_BUFFER_SIZE / 4)

So I think G2H_ROOM_BUFFER_SIZE needs to be roughly 64k as this is the
part of the CTB to sink unsolicated G2H. So how about...

#define CTB_G2H_BUFFER_SIZE	SZ_128K
#define G2H_ROOM_BUFFER_SIZE	(CTB_G2H_BUFFER_SIZE / 2)

The cost of the larger buffers like this is a little more cache
footprint but I think we have live with that until this properly fixed
in the GuC.

Matt

>  
>  /**
> -- 
> 2.34.1
> 


More information about the Intel-xe mailing list