summaryrefslogtreecommitdiff
path: root/drivers/misc/sgi-gru/grulib.h
diff options
context:
space:
mode:
authorJack Steiner <steiner@sgi.com>2009-06-18 03:28:30 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-19 00:04:03 +0400
commit7e796a72a2691d7094fd62da61097294d0d59ce4 (patch)
tree9e8d4e1eae9a2d23f604f0af5d101979dc7afec7 /drivers/misc/sgi-gru/grulib.h
parentd6e2fbce0d70c2072a1c478dbd37b34d27129d74 (diff)
downloadlinux-7e796a72a2691d7094fd62da61097294d0d59ce4.tar.xz
gru: collect per-context user statistics
Collect GRU statistics for each user GRU context. Statistics are kept for TLB misses & content resource contention. Add user request for retrieving the statistics. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/sgi-gru/grulib.h')
-rw-r--r--drivers/misc/sgi-gru/grulib.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/misc/sgi-gru/grulib.h b/drivers/misc/sgi-gru/grulib.h
index 87586551d16f..c5865dd19eec 100644
--- a/drivers/misc/sgi-gru/grulib.h
+++ b/drivers/misc/sgi-gru/grulib.h
@@ -50,6 +50,9 @@
/* For dumpping GRU chiplet state */
#define GRU_DUMP_CHIPLET_STATE _IOWR(GRU_IOCTL_NUM, 11, void *)
+/* For getting gseg statistics */
+#define GRU_GET_GSEG_STATISTICS _IOWR(GRU_IOCTL_NUM, 12, void *)
+
/* For user TLB flushing (primarily for tests) */
#define GRU_USER_FLUSH_TLB _IOWR(GRU_IOCTL_NUM, 50, void *)
@@ -61,6 +64,21 @@
#define CONTEXT_WINDOW_BYTES(th) (GRU_GSEG_PAGESIZE * (th))
#define THREAD_POINTER(p, th) (p + GRU_GSEG_PAGESIZE * (th))
+#define GSEG_START(cb) ((void *)((unsigned long)(cb) & ~(GRU_GSEG_PAGESIZE - 1)))
+
+/*
+ * Statictics kept on a per-GTS basis.
+ */
+struct gts_statistics {
+ unsigned long fmm_tlbdropin;
+ unsigned long upm_tlbdropin;
+ unsigned long context_stolen;
+};
+
+struct gru_get_gseg_statistics_req {
+ unsigned long gseg;
+ struct gts_statistics stats;
+};
/*
* Structure used to pass TLB flush parameters to the driver