public inbox for linux-perf-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
	Vinay Belgaumkar <vinay.belgaumkar@intel.com>,
	Riana Tauro <riana.tauro@intel.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	<linux-perf-users@vger.kernel.org>
Subject: Re: [PATCH v14 6/7] drm/xe/pmu: Get/put runtime pm on event init
Date: Wed, 22 Jan 2025 05:26:41 -0500	[thread overview]
Message-ID: <Z5DH4dVikf7nbJft@intel.com> (raw)
In-Reply-To: <20250122062341.1100173-7-lucas.demarchi@intel.com>

On Tue, Jan 21, 2025 at 10:23:40PM -0800, Lucas De Marchi wrote:
> When the event is created, make sure runtime pm is taken and later put:
> in order to read an event counter the GPU needs to remain accessible and
> doing a get/put during perf's read is not possible it's holding a
> raw_spinlock.
> 
> Suggested-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/xe/xe_pmu.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_pmu.c b/drivers/gpu/drm/xe/xe_pmu.c
> index 68ebec1746a53..8d938d67c1f2c 100644
> --- a/drivers/gpu/drm/xe/xe_pmu.c
> +++ b/drivers/gpu/drm/xe/xe_pmu.c
> @@ -79,6 +79,7 @@ static void xe_pmu_event_destroy(struct perf_event *event)
>  	struct xe_device *xe = container_of(event->pmu, typeof(*xe), pmu.base);
>  
>  	drm_WARN_ON(&xe->drm, event->parent);
> +	xe_pm_runtime_put(xe);
>  	drm_dev_put(&xe->drm);
>  }
>  
> @@ -111,6 +112,7 @@ static int xe_pmu_event_init(struct perf_event *event)
>  
>  	if (!event->parent) {
>  		drm_dev_get(&xe->drm);
> +		xe_pm_runtime_get(xe);
>  		event->destroy = xe_pmu_event_destroy;
>  	}
>  
> -- 
> 2.48.0
> 

  reply	other threads:[~2025-01-22 10:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-22  6:23 [PATCH v14 0/7] drm/xe/pmu: PMU interface for Xe Lucas De Marchi
2025-01-22  6:23 ` [PATCH v14 1/7] perf/core: Add PMU_EVENT_ATTR_ID_STRING Lucas De Marchi
2025-02-22 12:42   ` Ingo Molnar
2025-01-22  6:23 ` [PATCH v14 2/7] drm/xe/pmu: Enable PMU interface Lucas De Marchi
2025-01-22 10:51   ` Riana Tauro
2025-01-22 15:31     ` Lucas De Marchi
2025-01-22  6:23 ` [PATCH v14 3/7] drm/xe/pmu: Assert max gt Lucas De Marchi
2025-01-22  6:23 ` [PATCH v14 4/7] drm/xe/pmu: Extract xe_pmu_event_update() Lucas De Marchi
2025-01-22  6:23 ` [PATCH v14 5/7] drm/xe/pmu: Add attribute skeleton Lucas De Marchi
2025-01-22  6:23 ` [PATCH v14 6/7] drm/xe/pmu: Get/put runtime pm on event init Lucas De Marchi
2025-01-22 10:26   ` Rodrigo Vivi [this message]
2025-01-22  6:23 ` [PATCH v14 7/7] drm/xe/pmu: Add GT C6 events Lucas De Marchi
2025-01-22 10:23   ` Riana Tauro
2025-01-22 10:32   ` Rodrigo Vivi
2025-01-23  0:11     ` Lucas De Marchi

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=Z5DH4dVikf7nbJft@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=lucas.demarchi@intel.com \
    --cc=peterz@infradead.org \
    --cc=riana.tauro@intel.com \
    --cc=vinay.belgaumkar@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