From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 18/21] drm/i915: Remove the GEM idle worker
Date: Tue, 24 Sep 2019 16:26:34 +0100 [thread overview]
Message-ID: <d40a865b-b72e-c8b7-d2a6-49c968d05197@linux.intel.com> (raw)
In-Reply-To: <20190902040303.14195-18-chris@chris-wilson.co.uk>
On 02/09/2019 05:03, Chris Wilson wrote:
> Nothing inside the idle worker now requires struct_mutex, so we can
> remove the indirection of using our own worker.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/gem/i915_gem_pm.c | 28 ++-----------------
> .../drm/i915/gem/selftests/i915_gem_mman.c | 3 --
> drivers/gpu/drm/i915/i915_debugfs.c | 5 ----
> drivers/gpu/drm/i915/i915_drv.h | 9 ------
> .../gpu/drm/i915/selftests/mock_gem_device.c | 6 ----
> 5 files changed, 2 insertions(+), 49 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_pm.c b/drivers/gpu/drm/i915/gem/i915_gem_pm.c
> index fec0b410d1d9..e83eed8fa452 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_pm.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_pm.c
> @@ -13,36 +13,13 @@
>
> static void i915_gem_park(struct drm_i915_private *i915)
> {
> - lockdep_assert_held(&i915->drm.struct_mutex);
> + cancel_delayed_work(&i915->gem.retire_work);
>
> i915_vma_parked(i915);
>
> i915_globals_park();
> }
>
> -static void idle_work_handler(struct work_struct *work)
> -{
> - struct drm_i915_private *i915 =
> - container_of(work, typeof(*i915), gem.idle_work);
> - bool park;
> -
> - cancel_delayed_work_sync(&i915->gem.retire_work);
> - mutex_lock(&i915->drm.struct_mutex);
> -
> - intel_wakeref_lock(&i915->gt.wakeref);
> - park = (!intel_wakeref_is_active(&i915->gt.wakeref) &&
> - !work_pending(work));
> - intel_wakeref_unlock(&i915->gt.wakeref);
> - if (park)
> - i915_gem_park(i915);
> - else
> - queue_delayed_work(i915->wq,
> - &i915->gem.retire_work,
> - round_jiffies_up_relative(HZ));
> -
> - mutex_unlock(&i915->drm.struct_mutex);
> -}
> -
> static void retire_work_handler(struct work_struct *work)
> {
> struct drm_i915_private *i915 =
> @@ -71,7 +48,7 @@ static int pm_notifier(struct notifier_block *nb,
> break;
>
> case INTEL_GT_PARK:
> - queue_work(i915->wq, &i915->gem.idle_work);
> + i915_gem_park(i915);
> break;
> }
>
> @@ -244,7 +221,6 @@ void i915_gem_resume(struct drm_i915_private *i915)
>
> void i915_gem_init__pm(struct drm_i915_private *i915)
> {
> - INIT_WORK(&i915->gem.idle_work, idle_work_handler);
> INIT_DELAYED_WORK(&i915->gem.retire_work, retire_work_handler);
>
> i915->gem.pm_notifier.notifier_call = pm_notifier;
> diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
> index 39c01bc4eb51..8563af1819c4 100644
> --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
> +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
> @@ -384,11 +384,8 @@ static bool assert_mmap_offset(struct drm_i915_private *i915,
> static void disable_retire_worker(struct drm_i915_private *i915)
> {
> i915_gem_driver_unregister__shrinker(i915);
> -
> intel_gt_pm_get(&i915->gt);
> -
> cancel_delayed_work_sync(&i915->gem.retire_work);
> - flush_work(&i915->gem.idle_work);
> }
>
> static void restore_retire_worker(struct drm_i915_private *i915)
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 55f0fc03aa3e..09c6c485a732 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -3642,11 +3642,6 @@ i915_drop_caches_set(void *data, u64 val)
> i915_gem_shrink_all(i915);
> fs_reclaim_release(GFP_KERNEL);
>
> - if (val & DROP_IDLE) {
> - flush_delayed_work(&i915->gem.retire_work);
> - flush_work(&i915->gem.idle_work);
> - }
> -
> if (val & DROP_FREED)
> i915_gem_drain_freed_objects(i915);
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index db7480831e52..b33fc7972e6b 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1718,15 +1718,6 @@ struct drm_i915_private {
> * fires, go retire requests.
> */
> struct delayed_work retire_work;
> -
> - /**
> - * When we detect an idle GPU, we want to turn on
> - * powersaving features. So once we see that there
> - * are no more requests outstanding and no more
> - * arrive within a small period of time, we fire
> - * off the idle_work.
> - */
> - struct work_struct idle_work;
> } gem;
>
> /* For i945gm vblank irq vs. C3 workaround */
> diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> index 1956006a0d5b..f3e9b5d7d098 100644
> --- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> +++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> @@ -55,7 +55,6 @@ static void mock_device_release(struct drm_device *dev)
>
> mock_device_flush(i915);
>
> - flush_work(&i915->gem.idle_work);
> i915_gem_drain_workqueue(i915);
>
> mutex_lock(&i915->drm.struct_mutex);
> @@ -103,10 +102,6 @@ static void mock_retire_work_handler(struct work_struct *work)
> {
> }
>
> -static void mock_idle_work_handler(struct work_struct *work)
> -{
> -}
> -
> static int pm_domain_resume(struct device *dev)
> {
> return pm_generic_runtime_resume(dev);
> @@ -186,7 +181,6 @@ struct drm_i915_private *mock_gem_device(void)
> mock_init_contexts(i915);
>
> INIT_DELAYED_WORK(&i915->gem.retire_work, mock_retire_work_handler);
> - INIT_WORK(&i915->gem.idle_work, mock_idle_work_handler);
>
> i915->gt.awake = true;
>
>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-09-24 15:26 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-02 4:02 [PATCH 01/21] drm/i915: Restrict the aliasing-ppgtt to the size of the ggtt Chris Wilson
2019-09-02 4:02 ` [PATCH 02/21] drm/i915: Report aliasing ppgtt size as ggtt size Chris Wilson
2019-09-02 8:55 ` Matthew Auld
2019-09-02 4:02 ` [PATCH 03/21] drm/i915/execlists: Ignore lost completion events Chris Wilson
2019-09-02 4:02 ` [PATCH 04/21] drm/i915: Refresh the errno to vmf_fault translations Chris Wilson
2019-09-03 15:34 ` Abdiel Janulgue
2019-09-02 4:02 ` [PATCH 05/21] drm/i915: Replace obj->pin_global with obj->frontbuffer Chris Wilson
2019-09-02 4:02 ` [PATCH 06/21] dma-fence: Serialise signal enabling (dma_fence_enable_sw_signaling) Chris Wilson
2019-09-02 4:02 ` [PATCH 07/21] drm/mm: Pack allocated/scanned boolean into a bitfield Chris Wilson
2019-09-02 4:02 ` [PATCH 08/21] drm/i915: Make shrink/unshrink be atomic Chris Wilson
2019-09-10 19:54 ` Matthew Auld
2019-09-02 4:02 ` [PATCH 09/21] drm/i915: Only track bound elements of the GTT Chris Wilson
2019-09-02 4:02 ` [PATCH 10/21] drm/i915: Make i915_vma.flags atomic_t for mutex reduction Chris Wilson
2019-09-10 20:06 ` Matthew Auld
2019-09-02 4:02 ` [PATCH 11/21] drm/i915/gtt: Make sure the gen6 ppgtt is bound before first use Chris Wilson
2019-09-10 20:17 ` Matthew Auld
2019-09-02 4:02 ` [PATCH 12/21] drm/i915: Mark up address spaces that may need to allocate Chris Wilson
2019-09-20 16:22 ` Tvrtko Ursulin
2019-09-20 16:35 ` Chris Wilson
2019-09-23 8:10 ` Tvrtko Ursulin
2019-09-25 8:23 ` Chris Wilson
2019-09-25 15:59 ` Tvrtko Ursulin
2019-09-27 17:03 ` Chris Wilson
2019-09-02 4:02 ` [PATCH 13/21] drm/i915: Pull i915_vma_pin under the vm->mutex Chris Wilson
2019-09-16 10:13 ` Tvrtko Ursulin
2019-09-16 11:10 ` Chris Wilson
2019-09-17 12:37 ` Tvrtko Ursulin
2019-09-17 18:56 ` Chris Wilson
2019-09-19 13:37 ` Tvrtko Ursulin
2019-09-19 14:05 ` Chris Wilson
2019-09-02 4:02 ` [PATCH 14/21] drm/i915: Push the i915_active.retire into a worker Chris Wilson
2019-09-02 4:02 ` [PATCH 15/21] drm/i915: Coordinate i915_active with its own mutex Chris Wilson
2019-09-20 16:14 ` Tvrtko Ursulin
2019-09-20 16:32 ` Chris Wilson
2019-09-02 4:02 ` [PATCH 16/21] drm/i915: Move idle barrier cleanup into engine-pm Chris Wilson
2019-09-20 16:18 ` Tvrtko Ursulin
2019-09-02 4:02 ` [PATCH 17/21] drm/i915: Drop struct_mutex from around i915_retire_requests() Chris Wilson
2019-09-24 15:25 ` Tvrtko Ursulin
2019-09-25 8:43 ` Chris Wilson
2019-09-25 8:49 ` Tvrtko Ursulin
2019-09-02 4:03 ` [PATCH 18/21] drm/i915: Remove the GEM idle worker Chris Wilson
2019-09-24 15:26 ` Tvrtko Ursulin [this message]
2019-09-02 4:03 ` [PATCH 19/21] drm/i915: Merge wait_for_timelines with retire_request Chris Wilson
2019-09-24 15:57 ` Tvrtko Ursulin
2019-09-25 8:54 ` Chris Wilson
2019-09-02 4:03 ` [PATCH 20/21] drm/i915: Move request runtime management onto gt Chris Wilson
2019-09-02 4:03 ` [PATCH 21/21] drm/i915: Move global activity tracking from GEM to GT Chris Wilson
2019-09-25 9:55 ` Tvrtko Ursulin
2019-09-02 4:54 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/21] drm/i915: Restrict the aliasing-ppgtt to the size of the ggtt Patchwork
2019-09-02 5:20 ` ✓ Fi.CI.BAT: success " Patchwork
2019-09-02 8:00 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-09-02 8:52 ` [PATCH 01/21] " Matthew Auld
-- strict thread matches above, loose matches on Subject: below --
2019-08-30 6:11 [PATCH 01/21] drm/i915/gtt: Downgrade Baytrail back to aliasing-ppgtt Chris Wilson
2019-08-30 6:12 ` [PATCH 18/21] drm/i915: Remove the GEM idle worker Chris Wilson
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=d40a865b-b72e-c8b7-d2a6-49c968d05197@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/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