Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Tejas Upadhyay <tejas.upadhyay@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [Intel-xe] [PATCH V9 5/6] drm/xe: Add sysfs for preempt reset timeout
Date: Thu, 27 Jul 2023 14:54:13 +0000	[thread overview]
Message-ID: <ZMKFFcKLZJKrSyCp@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20230727082235.905240-6-tejas.upadhyay@intel.com>

On Thu, Jul 27, 2023 at 01:52:34PM +0530, Tejas Upadhyay wrote:
> The preemption request and timeout is used for
> higher priority context or kill hung context and reset
> gpu.

NIT, reset hardware engine, not GPU.

With the NIT fixed:
Reviewed-by: Matthew Brost <matthew.brost@intel.com>

> 
> The preempt timeout can be adjusted per-engine class using,
> 
> /sys/class/drm/cardX/device/tileN/gtN/engines/ccs/preempt_timeout_us
> 
> and can be disabled by setting it to 0.
> 
> V6:
>   - Rebase to use s/xe_engine/xe_hw_engine/ - Matt
> V5:
>   - Remove timeout validation, not relevant - Niranjana
> V4:
>   - Rebase to replace hw engine with eclass interface
> V3:
>   - Rebase to per class engine props interface
> V2:
>   - Rebase
>   - Update commit message to add tile
> 
> Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c | 29 +++++++++++++++++++
>  1 file changed, 29 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c
> index b1c13d27bcf4..990bb675d1e0 100644
> --- a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c
> @@ -118,6 +118,34 @@ static ssize_t timeslice_default(struct kobject *kobj,
>  static struct kobj_attribute timeslice_duration_def =
>  __ATTR(timeslice_duration_us, 0444, timeslice_default, NULL);
>  
> +static ssize_t preempt_timeout_store(struct kobject *kobj,
> +				     struct kobj_attribute *attr,
> +				     const char *buf, size_t count)
> +{
> +	struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj);
> +	u32 timeout;
> +	int err;
> +
> +	err = kstrtou32(buf, 0, &timeout);
> +	if (err)
> +		return err;
> +
> +	WRITE_ONCE(eclass->sched_props.preempt_timeout_us, timeout);
> +
> +	return count;
> +}
> +
> +static ssize_t preempt_timeout_show(struct kobject *kobj,
> +				    struct kobj_attribute *attr, char *buf)
> +{
> +	struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj);
> +
> +	return sprintf(buf, "%u\n", eclass->sched_props.preempt_timeout_us);
> +}
> +
> +static struct kobj_attribute preempt_timeout_attr =
> +__ATTR(preempt_timeout_us, 0644, preempt_timeout_show, preempt_timeout_store);
> +
>  static ssize_t preempt_timeout_default(struct kobject *kobj,
>  				       struct kobj_attribute *attr,
>  				       char *buf)
> @@ -140,6 +168,7 @@ static const struct attribute *defaults[] = {
>  static const struct attribute *files[] = {
>  	&job_timeout_attr.attr,
>  	&timeslice_duration_attr.attr,
> +	&preempt_timeout_attr.attr,
>  	NULL
>  };
>  
> -- 
> 2.25.1
> 

  reply	other threads:[~2023-07-27 14:55 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27  8:22 [Intel-xe] [PATCH V9 0/6] drm/xe: Add engine scheduler control interface Tejas Upadhyay
2023-07-27  8:22 ` [Intel-xe] [PATCH V9 1/6] drm/xe: Add sysfs entries for engines under its GT Tejas Upadhyay
2023-07-27 14:41   ` Matthew Brost
2023-07-28 13:22     ` Upadhyay, Tejas
2023-07-27  8:22 ` [Intel-xe] [PATCH V9 2/6] drm/xe: Add sysfs for default engine scheduler properties Tejas Upadhyay
2023-07-27 14:47   ` Matthew Brost
2023-07-27  8:22 ` [Intel-xe] [PATCH V9 3/6] drm/xe: Add job timeout engine property to sysfs Tejas Upadhyay
2023-07-27 14:51   ` Matthew Brost
2023-07-27  8:22 ` [Intel-xe] [PATCH V9 4/6] drm/xe: Add timeslice duration " Tejas Upadhyay
2023-07-27 14:52   ` Matthew Brost
2023-07-27  8:22 ` [Intel-xe] [PATCH V9 5/6] drm/xe: Add sysfs for preempt reset timeout Tejas Upadhyay
2023-07-27 14:54   ` Matthew Brost [this message]
2023-07-27  8:22 ` [Intel-xe] [PATCH V9 6/6] drm/xe: Add min/max cap for engine scheduler properties Tejas Upadhyay
2023-07-27 15:26   ` Matthew Brost
2023-07-28  4:44     ` Niranjana Vishwanathapura
2023-07-28  5:04       ` Matthew Brost
2023-07-28  5:54         ` Upadhyay, Tejas
2023-07-28  6:25           ` Niranjana Vishwanathapura
2023-07-28  7:36             ` Upadhyay, Tejas
2023-07-28 14:24               ` Matthew Brost
2023-07-28 14:27                 ` Upadhyay, Tejas
2023-07-28 14:53                   ` Niranjana Vishwanathapura
2023-07-28 14:20             ` Matthew Brost
2023-07-27  8:59 ` [Intel-xe] ✓ CI.Patch_applied: success for drm/xe: Add engine scheduler control interface (rev9) Patchwork
2023-07-27  9:00 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-07-27  9:01 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-07-27  9:05 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-07-27  9:05 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-07-27  9:06 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-07-27  9:40 ` [Intel-xe] ○ CI.BAT: info " 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=ZMKFFcKLZJKrSyCp@DUT025-TGLU.fm.intel.com \
    --to=matthew.brost@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=tejas.upadhyay@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