All of lore.kernel.org
 help / color / mirror / Atom feed
From: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
To: "Bai, Zongyao" <zongyao.bai@intel.com>
Cc: <intel-xe@lists.freedesktop.org>, <jia.yao@intel.com>,
	<matthew.brost@intel.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH v5 0/4] drm/xe/forcewake: add delayed-release optimization
Date: Thu, 3 Sep 2026 16:56:26 -0700	[thread overview]
Message-ID: <apoJKi0SKWk2MzBY@soc-5CG1426VCC.clients.intel.com> (raw)
In-Reply-To: <14d20a60-29f1-40f3-83f5-e8b6eaec81db@intel.com>

On Thu, Sep 03, 2026 at 04:19:01PM -0700, Bai, Zongyao wrote:
>
>On 9/3/2026 11:59 AM, Umesh Nerlige Ramappa wrote:
>>Hi Zongyao,
>>
>>On Thu, Aug 13, 2026 at 12:06:50AM +0000, Zongyao Bai wrote:
>>>Engine-cycle queries used by tools such as VTune and PTI can arrive in
>>>bursts. Releasing forcewake immediately after every query makes the next
>>>query issue another wake request and wait for its ACK.
>>>
>>>Add an opt-in delayed-release path that keeps an idle forcewake domain
>>>awake for a configurable interval, allowing a subsequent engine-cycle
>>>query to reuse it. Other forcewake users retain the existing immediate
>>>release behavior. The default hold interval is 100 us and can be changed
>>>through configfs before binding the device.
>>>
>>>The series also synchronizes engine-cycle queries with unplug and 
>>>flushes
>>>pending delayed releases before suspend, shutdown, remove, and probe
>>>unwind, ensuring timer callbacks cannot access MMIO after power-off or
>>>teardown.
>>>
>>>On BMG, this reduced the Level Zero timestamp median from approximately
>>>48.5 us to 9.4 us.
>>
>>Can you please add some more info here on what this measurement is 
>>and how this is affecting the VTune/PTI use cases? In other words, 
>>what breaks if we don't have these changes?
>>
>>The purpose of engine_cycles query is just to capture CPU and GPU 
>>timestamps as close to each other as possible and then the user 
>>would use that to map the two timelines in whatever they are trying 
>>to correlate, so I am interested in understanding the use case that 
>>this is improving.
>>
>>Thanks,
>>Umesh
>Hi Umesh,
>
>The main issue without this patch is the latency introduced when the 
>XE forcewake domain goes to sleep immediately after a query completes.
>
>In VTune/PTI workloads, APIs such as zeDeviceGetGlobalTimestamps() may 
>be called at a very high frequency to correlate CPU and GPU timelines. 
>It's not a one time query.
>Since the forcewake domain is released right after the MMIO read, the 
>next query often arrives after only a very short interval and must go 
>through the full forcewake acquisition and MMIO read sequence again.
>On bmg, we measured that this additional forcewake overhead can be 
>around 48.5 µs, even with RC6 disabled.
>

If you could just somehow mention that the numbers are overheads in the 
line below, that would be great.

"On BMG, this reduced the Level Zero timestamp median from approximately
48.5 us to 9.4 us"

Thanks for the details.
Umesh

...

  reply	other threads:[~2026-09-03 23:56 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-01 21:38 [PATCH] drm/xe/forcewake: add delayed-release optimization Zongyao Bai
2026-06-01 22:37 ` ✓ CI.KUnit: success for " Patchwork
2026-06-01 23:15 ` ✓ Xe.CI.BAT: " Patchwork
2026-06-02  8:13 ` ✓ Xe.CI.FULL: " Patchwork
2026-06-11  1:03 ` [PATCH v2] " Zongyao Bai
2026-06-11 11:59   ` Maarten Lankhorst
2026-06-18 21:18     ` Bai, Zongyao
2026-06-11  1:13 ` ✓ CI.KUnit: success for drm/xe/forcewake: add delayed-release optimization (rev2) Patchwork
2026-06-11  1:58 ` ✓ Xe.CI.BAT: " Patchwork
2026-06-11  3:09 ` [PATCH] drm/xe/forcewake: add delayed-release optimization Matthew Brost
2026-06-11  3:15   ` Matthew Brost
2026-06-25  1:37     ` Bai, Zongyao
2026-06-11 11:29 ` ✓ Xe.CI.FULL: success for drm/xe/forcewake: add delayed-release optimization (rev2) Patchwork
2026-06-25  8:19 ` [PATCH v3] drm/xe/forcewake: add delayed-release optimization Zongyao Bai
2026-06-25  8:51 ` ✓ CI.KUnit: success for drm/xe/forcewake: add delayed-release optimization (rev3) Patchwork
2026-06-25  9:26 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-06-25 10:55 ` ✗ Xe.CI.FULL: " Patchwork
2026-07-20 22:13 ` [PATCH v4] drm/xe/forcewake: add delayed-release optimization Zongyao Bai
2026-07-21 22:43   ` Matthew Brost
2026-07-20 22:18 ` ✗ CI.checkpatch: warning for drm/xe/forcewake: add delayed-release optimization (rev4) Patchwork
2026-07-20 22:20 ` ✓ CI.KUnit: success " Patchwork
2026-07-20 22:54 ` ✓ Xe.CI.BAT: " Patchwork
2026-07-21  5:00 ` ✓ Xe.CI.FULL: " Patchwork
2026-08-13  0:06 ` [PATCH v5 0/4] drm/xe/forcewake: add delayed-release optimization Zongyao Bai
2026-08-13  0:06   ` [PATCH v5 1/4] drm/xe/forcewake: synchronize engine-cycle access with unplug Zongyao Bai
2026-08-13  0:21     ` sashiko-bot
2026-08-13 20:48       ` Bai, Zongyao
2026-08-19 18:29     ` Yao, Jia
2026-09-03 16:20     ` Rodrigo Vivi
2026-09-03 18:29       ` Bai, Zongyao
2026-08-13  0:06   ` [PATCH v5 2/4] drm/xe/forcewake: add delayed-release state machine Zongyao Bai
2026-08-13  0:23     ` sashiko-bot
2026-08-13 21:28       ` Bai, Zongyao
2026-09-03 16:12         ` Rodrigo Vivi
2026-09-04  0:25           ` Bai, Zongyao
2026-08-20 23:07     ` Yao, Jia
2026-08-13  0:06   ` [PATCH v5 3/4] drm/xe/forcewake: flush delayed release at power boundaries Zongyao Bai
2026-08-13  0:23     ` sashiko-bot
2026-08-13 22:06       ` Bai, Zongyao
2026-08-20 23:07     ` Yao, Jia
2026-08-13  0:06   ` [PATCH v5 4/4] drm/xe/forcewake: enable configurable delayed forcewake release Zongyao Bai
2026-08-13  0:18     ` sashiko-bot
2026-08-13 23:14       ` Bai, Zongyao
2026-08-19 18:05     ` Yao, Jia
2026-09-03 18:59   ` [PATCH v5 0/4] drm/xe/forcewake: add delayed-release optimization Umesh Nerlige Ramappa
2026-09-03 23:19     ` Bai, Zongyao
2026-09-03 23:56       ` Umesh Nerlige Ramappa [this message]
2026-08-13  0:13 ` ✗ CI.checkpatch: warning for drm/xe/forcewake: add delayed-release optimization (rev5) Patchwork
2026-08-13  0:15 ` ✓ CI.KUnit: success " 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=apoJKi0SKWk2MzBY@soc-5CG1426VCC.clients.intel.com \
    --to=umesh.nerlige.ramappa@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jia.yao@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=zongyao.bai@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.