[PATCH v2 1/2] drm/i915/gvt: Support event based scheduling
Zhenyu Wang
zhenyuw at linux.intel.com
Wed May 24 04:40:37 UTC 2017
On 2017.05.24 12:41:54 +0800, Gao, Ping A wrote:
>
> On 2017/5/24 10:31, Zhenyu Wang wrote:
> > On 2017.05.24 09:14:10 +0800, Ping Gao wrote:
> >> This patch decouple the time slice caculation and scheduler, let
> > ^^^^^^^^^^typo
> >> other event be able to trigger scheduling without impact the
> >> calcuation for QoS.
> > ^^^^^^^^^^again
>
> Could you please help correct it or need a v3 version. :)
>
Usually I'm not supposed to change other's patch, so v3 pls
> >> v2: add only one new enum definition.
> >>
> >> Signed-off-by: Ping Gao <ping.a.gao at intel.com>
> >> ---
> >> drivers/gpu/drm/i915/gvt/gvt.c | 4 +++-
> >> drivers/gpu/drm/i915/gvt/gvt.h | 5 +++++
> >> drivers/gpu/drm/i915/gvt/sched_policy.c | 15 ++++++++++-----
> >> 3 files changed, 18 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/gvt/gvt.c b/drivers/gpu/drm/i915/gvt/gvt.c
> >> index 7dea5e5..5fcfee2 100644
> >> --- a/drivers/gpu/drm/i915/gvt/gvt.c
> >> +++ b/drivers/gpu/drm/i915/gvt/gvt.c
> >> @@ -147,7 +147,9 @@ static int gvt_service_thread(void *data)
> >> mutex_unlock(&gvt->lock);
> >> }
> >>
> >> - if (test_and_clear_bit(INTEL_GVT_REQUEST_SCHED,
> >> + if (test_bit(INTEL_GVT_REQUEST_SCHED,
> >> + (void *)&gvt->service_request) ||
> >> + test_bit(INTEL_GVT_REQUEST_EVENT_SCHED,
> >> (void *)&gvt->service_request)) {
> >> intel_gvt_schedule(gvt);
> >> }
> >> diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b/drivers/gpu/drm/i915/gvt/gvt.h
> >> index 930732e..07ecd73 100644
> >> --- a/drivers/gpu/drm/i915/gvt/gvt.h
> >> +++ b/drivers/gpu/drm/i915/gvt/gvt.h
> >> @@ -257,7 +257,12 @@ static inline struct intel_gvt *to_gvt(struct drm_i915_private *i915)
> >>
> >> enum {
> >> INTEL_GVT_REQUEST_EMULATE_VBLANK = 0,
> >> +
> >> + /* Scheduling trigger by timer */
> >> INTEL_GVT_REQUEST_SCHED = 1,
> >> +
> >> + /* Scheduling trigger by event */
> >> + INTEL_GVT_REQUEST_EVENT_SCHED = 2,
> >> };
> >>
> >> static inline void intel_gvt_request_service(struct intel_gvt *gvt,
> >> diff --git a/drivers/gpu/drm/i915/gvt/sched_policy.c b/drivers/gpu/drm/i915/gvt/sched_policy.c
> >> index f25ff13..e8af608 100644
> >> --- a/drivers/gpu/drm/i915/gvt/sched_policy.c
> >> +++ b/drivers/gpu/drm/i915/gvt/sched_policy.c
> >> @@ -202,11 +202,6 @@ static void tbs_sched_func(struct gvt_sched_data *sched_data)
> >> struct intel_gvt_workload_scheduler *scheduler = &gvt->scheduler;
> >> struct vgpu_sched_data *vgpu_data;
> >> struct intel_vgpu *vgpu = NULL;
> >> - static uint64_t timer_check;
> >> -
> >> - if (!(timer_check++ % GVT_TS_BALANCE_PERIOD_MS))
> >> - gvt_balance_timeslice(sched_data);
> >> -
> >> /* no active vgpu or has already had a target */
> >> if (list_empty(&sched_data->lru_runq_head) || scheduler->next_vgpu)
> >> goto out;
> >> @@ -231,9 +226,19 @@ static void tbs_sched_func(struct gvt_sched_data *sched_data)
> >> void intel_gvt_schedule(struct intel_gvt *gvt)
> >> {
> >> struct gvt_sched_data *sched_data = gvt->scheduler.sched_data;
> >> + static uint64_t timer_check;
> >>
> >> mutex_lock(&gvt->lock);
> >> +
> >> + if (test_and_clear_bit(INTEL_GVT_REQUEST_SCHED,
> >> + (void *)&gvt->service_request)) {
> >> + if (!(timer_check++ % GVT_TS_BALANCE_PERIOD_MS))
> >> + gvt_balance_timeslice(sched_data);
> >> + }
> >> + clear_bit(INTEL_GVT_REQUEST_EVENT_SCHED, (void *)&gvt->service_request);
> >> +
> >> tbs_sched_func(sched_data);
> >> +
> >> mutex_unlock(&gvt->lock);
> >> }
> >>
> >> --
> >> 2.7.4
> >>
> >> _______________________________________________
> >> intel-gvt-dev mailing list
> >> intel-gvt-dev at lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev
>
--
Open Source Technology Center, Intel ltd.
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20170524/9692e306/attachment.sig>
More information about the intel-gvt-dev
mailing list