summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/gvt/gtt.h
diff options
context:
space:
mode:
authorChangbin Du <changbin.du@intel.com>2018-01-30 19:19:53 +0800
committerZhenyu Wang <zhenyuw@linux.intel.com>2018-03-06 13:19:20 +0800
commite502a2af4c358d14ecf8fce51bf4988ebb4d10b4 (patch)
tree4007370f9bd6f748e58331a3c18d28fb5b91f3f8 /drivers/gpu/drm/i915/gvt/gtt.h
parent0947572849cb3ca7028d9daa3958158639ae4d69 (diff)
drm/i915/gvt: Provide generic page_track infrastructure for write-protected page
This patch provide generic page_track infrastructure for write-protected guest page. The old page_track logic gets rewrote and now stays in a new standalone page_track.c. This page track infrastructure can be both used by vGUC and GTT shadowing. The important change is that it uses radix tree instead of hash table. We don't have a predictable number of pages that will be tracked. Here is some performance data (duration in us) of looking up a element: Before: (aka. intel_vgpu_find_tracked_page) 0.091 0.089 0.090 ... 0.093 0.091 0.087 ... 0.292 0.285 0.292 0.291 After: (aka. intel_vgpu_find_page_track) 0.104 0.105 0.100 0.102 0.102 0.100 ... 0.101 0.101 0.105 0.105 The hash table has good performance at beginning, but turns bad with more pages being tracked even no 3D applications are running. As expected, radix tree has stable duration and very quick. The overall benchmark (tested with Heaven Benchmark) marginally improved since this is not the bottleneck. What we benefit more from this change is scalability. Signed-off-by: Changbin Du <changbin.du@intel.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/gvt/gtt.h')
-rw-r--r--drivers/gpu/drm/i915/gvt/gtt.h14
1 files changed, 0 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/gvt/gtt.h b/drivers/gpu/drm/i915/gvt/gtt.h
index e4ff3f823c7b..695ab3bd4a69 100644
--- a/drivers/gpu/drm/i915/gvt/gtt.h
+++ b/drivers/gpu/drm/i915/gvt/gtt.h
@@ -187,8 +187,6 @@ struct intel_vgpu_gtt {
unsigned long active_ppgtt_mm_bitmap;
struct list_head ppgtt_mm_list_head;
DECLARE_HASHTABLE(spt_hash_table, INTEL_GVT_GTT_HASH_BITS);
- DECLARE_HASHTABLE(tracked_guest_page_hash_table, INTEL_GVT_GTT_HASH_BITS);
- atomic_t n_tracked_guest_page;
struct list_head oos_page_list_head;
struct list_head post_shadow_list_head;
struct intel_vgpu_scratch_pt scratch_pt[GTT_TYPE_MAX];
@@ -205,14 +203,6 @@ extern void intel_gvt_clean_gtt(struct intel_gvt *gvt);
extern struct intel_vgpu_mm *intel_gvt_find_ppgtt_mm(struct intel_vgpu *vgpu,
int page_table_level, void *root_entry);
-struct intel_vgpu_page_track {
- struct hlist_node node;
- bool tracked;
- unsigned long gfn;
- int (*handler)(void *, u64, void *, int);
- void *data;
-};
-
struct intel_vgpu_oos_page {
struct intel_vgpu_ppgtt_spt *spt;
struct list_head list;
@@ -240,7 +230,6 @@ struct intel_vgpu_ppgtt_spt {
intel_gvt_gtt_type_t type;
unsigned long gfn;
unsigned long write_cnt;
- struct intel_vgpu_page_track track;
struct intel_vgpu_oos_page *oos_page;
} guest_page;
@@ -273,7 +262,4 @@ int intel_vgpu_emulate_ggtt_mmio_read(struct intel_vgpu *vgpu,
int intel_vgpu_emulate_ggtt_mmio_write(struct intel_vgpu *vgpu,
unsigned int off, void *p_data, unsigned int bytes);
-int intel_vgpu_write_protect_handler(struct intel_vgpu *vgpu, u64 pa,
- void *p_data, unsigned int bytes);
-
#endif /* _GVT_GTT_H_ */