From: Andrzej Hajda <andrzej.hajda@intel.com>
To: Andi Shyti <andi.shyti@linux.intel.com>
Cc: Chris Wilson <chris.p.wilson@intel.com>,
netdev@vger.kernel.org, intel-gfx@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
Chris Wilson <chris@chris-wilson.co.uk>,
Eric Dumazet <edumazet@google.com>,
dri-devel@lists.freedesktop.org, Daniel Vetter <daniel@ffwll.ch>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Jakub Kicinski <kuba@kernel.org>,
David Airlie <airlied@gmail.com>,
Dmitry Vyukov <dvyukov@google.com>
Subject: Re: [Intel-gfx] [PATCH v4 06/10] drm/i915: Separate wakeref tracking
Date: Mon, 20 Mar 2023 19:39:23 +0100 [thread overview]
Message-ID: <e0481f32-1245-f429-cebe-b6c55c613f80@intel.com> (raw)
In-Reply-To: <ZBehYC0npr4nv4mw@ashyti-mobl2.lan>
On 20.03.2023 00:57, Andi Shyti wrote:
> Hi Andrzej,
>
> On Mon, Mar 06, 2023 at 05:32:02PM +0100, Andrzej Hajda wrote:
>> From: Chris Wilson <chris@chris-wilson.co.uk>
>>
>> Extract the callstack tracking of intel_runtime_pm.c into its own
>> utility so that that we can reuse it for other online debugging of
>> scoped wakerefs.
>>
>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>> Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
>> ---
>> drivers/gpu/drm/i915/Kconfig.debug | 9 ++
>> drivers/gpu/drm/i915/Makefile | 4 +
>> drivers/gpu/drm/i915/intel_runtime_pm.c | 222 +++----------------------
>> drivers/gpu/drm/i915/intel_wakeref.h | 2 +-
>> drivers/gpu/drm/i915/intel_wakeref_tracker.c | 234 +++++++++++++++++++++++++++
>> drivers/gpu/drm/i915/intel_wakeref_tracker.h | 52 ++++++
>> 6 files changed, 319 insertions(+), 204 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/Kconfig.debug b/drivers/gpu/drm/i915/Kconfig.debug
>> index 93dfb7ed970547..5fde52107e3b44 100644
>> --- a/drivers/gpu/drm/i915/Kconfig.debug
>> +++ b/drivers/gpu/drm/i915/Kconfig.debug
>> @@ -25,6 +25,7 @@ config DRM_I915_DEBUG
>> select PREEMPT_COUNT
>> select I2C_CHARDEV
>> select STACKDEPOT
>> + select STACKTRACE
>> select DRM_DP_AUX_CHARDEV
>> select X86_MSR # used by igt/pm_rpm
>> select DRM_VGEM # used by igt/prime_vgem (dmabuf interop checks)
>> @@ -37,6 +38,7 @@ config DRM_I915_DEBUG
>> select DRM_I915_DEBUG_GEM
>> select DRM_I915_DEBUG_GEM_ONCE
>> select DRM_I915_DEBUG_MMIO
>> + select DRM_I915_TRACK_WAKEREF
>> select DRM_I915_DEBUG_RUNTIME_PM
>> select DRM_I915_SW_FENCE_DEBUG_OBJECTS
>> select DRM_I915_SELFTEST
>> @@ -227,11 +229,18 @@ config DRM_I915_DEBUG_VBLANK_EVADE
>>
>> If in doubt, say "N".
>>
>> +config DRM_I915_TRACK_WAKEREF
>> + depends on STACKDEPOT
>> + depends on STACKTRACE
>> + bool
>> +
>> config DRM_I915_DEBUG_RUNTIME_PM
>> bool "Enable extra state checking for runtime PM"
>> depends on DRM_I915
>> default n
>> select STACKDEPOT
>> + select STACKTRACE
>> + select DRM_I915_TRACK_WAKEREF
>> help
>> Choose this option to turn on extra state checking for the
>> runtime PM functionality. This may introduce overhead during
>> diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
>> index b2f91a1f826858..42daff6d575a82 100644
>> --- a/drivers/gpu/drm/i915/Makefile
>> +++ b/drivers/gpu/drm/i915/Makefile
>> @@ -81,6 +81,10 @@ i915-$(CONFIG_DEBUG_FS) += \
>> i915_debugfs_params.o \
>> display/intel_display_debugfs.o \
>> display/intel_pipe_crc.o
>> +
>> +i915-$(CONFIG_DRM_I915_TRACK_WAKEREF) += \
>> + intel_wakeref_tracker.o
>> +
>
> This patch, along with the previous one and two following it, is
> a bit confusing. We add this file only to remove it later and
> the code hops from file to file. There seem to be some extra
> steps that could be avoided.
>
> Is there room for simplification?
The reason behind this was that i915 had it's own tracker integrated
with i915_runtime_pm, then it was abstracted out (05,06) to allow track
gt->wakerefs (07) and then I proposed replacement of internal tracker
with ref_tracker (09). I wanted to keep original history of development.
I can squash all/some of this work, but I am afraid it will generate
less readable patches - now we have separated abstract-out and replace
steps.
Probably sending patches 05-08 1st, then proposing conversion to
ref_tracker in another patchset would make it more clear.
Regards
Andrzej
>
> Thanks,
> Andi
next prev parent reply other threads:[~2023-03-20 18:47 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-06 16:31 [PATCH v4 00/10] drm/i915: use ref_tracker library for tracking wakerefs Andrzej Hajda
2023-03-06 16:31 ` [PATCH v4 01/10] lib/ref_tracker: add unlocked leak print helper Andrzej Hajda
2023-03-19 22:59 ` [Intel-gfx] " Andi Shyti
2023-03-20 15:30 ` Andrzej Hajda
2023-03-06 16:31 ` [PATCH v4 02/10] lib/ref_tracker: __ref_tracker_dir_print improve printing Andrzej Hajda
2023-03-19 23:11 ` [Intel-gfx] " Andi Shyti
2023-03-20 15:39 ` Andrzej Hajda
2023-03-06 16:31 ` [PATCH v4 03/10] lib/ref_tracker: add printing to memory buffer Andrzej Hajda
2023-03-19 23:18 ` [Intel-gfx] " Andi Shyti
2023-03-20 18:24 ` Andrzej Hajda
2023-03-06 16:32 ` [PATCH v4 04/10] lib/ref_tracker: remove warnings in case of allocation failure Andrzej Hajda
2023-03-19 23:19 ` [Intel-gfx] " Andi Shyti
2023-03-06 16:32 ` [PATCH v4 05/10] drm/i915: Separate wakeref tracking types from rpm Andrzej Hajda
2023-03-06 16:32 ` [PATCH v4 06/10] drm/i915: Separate wakeref tracking Andrzej Hajda
2023-03-19 23:57 ` [Intel-gfx] " Andi Shyti
2023-03-20 18:39 ` Andrzej Hajda [this message]
2023-03-06 16:32 ` [PATCH v4 07/10] drm/i915: Track leaked gt->wakerefs Andrzej Hajda
2023-03-06 16:32 ` [PATCH v4 08/10] drm/i915: Correct type of wakeref variable Andrzej Hajda
2023-03-19 23:58 ` [Intel-gfx] " Andi Shyti
2023-03-06 16:32 ` [PATCH v4 09/10] drm/i915: replace Intel internal tracker with kernel core ref_tracker Andrzej Hajda
2023-03-06 16:32 ` [PATCH v4 10/10] drm/i915/gt: Hold a wakeref for the active VM Andrzej Hajda
2023-03-17 11:58 ` [Intel-gfx] [PATCH v4 00/10] drm/i915: use ref_tracker library for tracking wakerefs Andrzej Hajda
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=e0481f32-1245-f429-cebe-b6c55c613f80@intel.com \
--to=andrzej.hajda@intel.com \
--cc=airlied@gmail.com \
--cc=andi.shyti@linux.intel.com \
--cc=chris.p.wilson@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=dvyukov@google.com \
--cc=edumazet@google.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rodrigo.vivi@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;
as well as URLs for NNTP newsgroup(s).