[Intel-gfx] [PATCH 13/13] drm/i915/gt: Limit C-states while waiting for requests
Chris Wilson
chris at chris-wilson.co.uk
Tue Jan 14 15:18:01 UTC 2020
Quoting Mika Kuoppala (2020-01-14 15:12:03)
> Chris Wilson <chris at chris-wilson.co.uk> writes:
>
> > Allow the sysadmin to specify whether we should prevent the CPU from
> > entering higher C-states while waiting for the CPU, in order to reduce
>
> s/higher/deeper
> s/CPU/GPU
>
> > the latency of request completions and so speed up client continuations.
> >
> > The target dma latency can be adjusted per-engine using,
> >
> > /sys/class/drm/card?/engine/*/dma_latency_ns
> >
> > (For waiting on a virtual engine, the underlying physical engine is used
> > for the wait once the request is active, so set all the physical engines
> > in the virtual set to the same target dma latency.)
> >
> > Note that in most cases, the ratelimiting step does not appear to the
> > interrupt latency per se, but secondary effects of avoiding additional
> > memory latencies while active.
> >
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin at linux.intel.com>
> > Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> > Cc: Eero Tamminen <eero.t.tamminen at intel.com>
> > Cc: Francisco Jerez <currojerez at riseup.net>
> > Cc: Mika Kuoppala <mika.kuoppala at linux.intel.com>
> > Cc: Dmitry Rogozhkin <dmitry.v.rogozhkin at intel.com>
> > ---
> > drivers/gpu/drm/i915/Kconfig.profile | 14 ++++++
> > drivers/gpu/drm/i915/gt/intel_breadcrumbs.c | 48 ++++++++++++++++++++
> > drivers/gpu/drm/i915/gt/intel_engine_cs.c | 2 +
> > drivers/gpu/drm/i915/gt/intel_engine_sysfs.c | 31 +++++++++++++
> > drivers/gpu/drm/i915/gt/intel_engine_types.h | 9 ++++
> > 5 files changed, 104 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/Kconfig.profile b/drivers/gpu/drm/i915/Kconfig.profile
> > index ba8767fc0d6e..a956f1bb9caf 100644
> > --- a/drivers/gpu/drm/i915/Kconfig.profile
> > +++ b/drivers/gpu/drm/i915/Kconfig.profile
> > @@ -12,6 +12,20 @@ config DRM_I915_USERFAULT_AUTOSUSPEND
> > May be 0 to disable the extra delay and solely use the device level
> > runtime pm autosuspend delay tunable.
> >
> > +config DRM_I915_DMA_LATENCY
> > + int "Target CPU-DMA latency while waiting on active requests (ns)"
> > + default -1 # nanoseconds
> > + help
> > + Specify a target latency for DMA wakeup, see /dev/cpu_dma_latency,
> > + used while the CPU is waiting for GPU results.
> > +
> > + This is adjustable via
> > + /sys/class/drm/card?/engine/*/dma_latency_ns
> > +
> > + May be -1 to prevent specifying a target wakeup and let the CPU
> > + enter powersaving while waiting. Conversely, 0 may be used to
> > + prevent the CPU from entering any C-states while waiting.
>
> Who will be the target group to touch this tunable if it is default off?
It dramatically improves our fake transcode benchmarks, so I think there
will be those who find it useful and willing to pay the joules.
-Chris
More information about the Intel-gfx
mailing list