[v2] drm/i915/gvt: Make MI_USER_INTERRUPT nop in cmd parser

Submitted by Zhipeng Gong on March 26, 2018, 7:18 a.m.

Details

Message ID 1522048736-16377-1-git-send-email-zhipeng.gong@intel.com
State New
Headers show
Series "drm/i915/gvt: Make MI_USER_INTERRUPT nop in cmd parser" ( rev: 2 ) in Intel GVT devel

Not browsing as part of any series.

Commit Message

Zhipeng Gong March 26, 2018, 7:18 a.m.
GVT-g dispatches request to host i915 and depends on i915 notify
ring interrupt mechanism to check completion of request.
For now MI_USER_INTERRUPT in guest requests is passed through
in GVT-g cmd parser and i915 does not use it, which causes
unnecessary interrupt handling in i915.
On the other hand, if several requests from guest are combined into
one request in and contain MI_USER_INTERRUPT in the middle of
combined request. GVT-g still has to wait on the whole request to
complete to inject user interrupts to guest.

This patch makes all the MI_USER_INTERRUPT nop to save some interrupt
handling.

Here is test result to run glmark2 on guest for 10 seconds:
host master interrupts number is reduced from 16021 to 11162
host user interrupts number is reduced from 7936 to 3536

v2:
- revise commit message. (Kevin)

Signed-off-by: Zhipeng Gong <zhipeng.gong@intel.com>
---
 drivers/gpu/drm/i915/gvt/cmd_parser.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c
index febb814..ab4a670 100644
--- a/drivers/gpu/drm/i915/gvt/cmd_parser.c
+++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c
@@ -1064,6 +1064,7 @@  static int cmd_handler_mi_user_interrupt(struct parser_exec_state *s)
 {
 	set_bit(cmd_interrupt_events[s->ring_id].mi_user_interrupt,
 			s->workload->pending_events);
+	patch_value(s, cmd_ptr(s, 0), MI_NOOP);
 	return 0;
 }
 

Comments

> From: Zhipeng Gong

> Sent: Monday, March 26, 2018 3:19 PM

> 

> GVT-g dispatches request to host i915 and depends on i915 notify

> ring interrupt mechanism to check completion of request.

> For now MI_USER_INTERRUPT in guest requests is passed through

> in GVT-g cmd parser and i915 does not use it, which causes

> unnecessary interrupt handling in i915.

> On the other hand, if several requests from guest are combined into

> one request in and contain MI_USER_INTERRUPT in the middle of

> combined request. GVT-g still has to wait on the whole request to

> complete to inject user interrupts to guest.

> 

> This patch makes all the MI_USER_INTERRUPT nop to save some interrupt

> handling.

> 

> Here is test result to run glmark2 on guest for 10 seconds:

> host master interrupts number is reduced from 16021 to 11162

> host user interrupts number is reduced from 7936 to 3536

> 

> v2:

> - revise commit message. (Kevin)

> 

> Signed-off-by: Zhipeng Gong <zhipeng.gong@intel.com>


Reviewed-by: Kevin Tian <kevin.tian@intel.com>
On 2018.03.26 07:37:20 +0000, Tian, Kevin wrote:
> > From: Zhipeng Gong
> > Sent: Monday, March 26, 2018 3:19 PM
> > 
> > GVT-g dispatches request to host i915 and depends on i915 notify
> > ring interrupt mechanism to check completion of request.
> > For now MI_USER_INTERRUPT in guest requests is passed through
> > in GVT-g cmd parser and i915 does not use it, which causes
> > unnecessary interrupt handling in i915.
> > On the other hand, if several requests from guest are combined into
> > one request in and contain MI_USER_INTERRUPT in the middle of
> > combined request. GVT-g still has to wait on the whole request to
> > complete to inject user interrupts to guest.
> > 
> > This patch makes all the MI_USER_INTERRUPT nop to save some interrupt
> > handling.
> > 
> > Here is test result to run glmark2 on guest for 10 seconds:
> > host master interrupts number is reduced from 16021 to 11162
> > host user interrupts number is reduced from 7936 to 3536
> > 
> > v2:
> > - revise commit message. (Kevin)
> > 
> > Signed-off-by: Zhipeng Gong <zhipeng.gong@intel.com>
> 
> Reviewed-by: Kevin Tian <kevin.tian@intel.com>

applied, thanks!