summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAingara Paramakuru <aparamakuru@nvidia.com>2016-02-22 12:35:49 -0500
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-03-15 19:23:44 -0400
commit2a58d3c27b45ca9d0d9dc2136377b7a41b9ed82d (patch)
tree9d7464bfd0eea8e4b65f591996db59a98f4070e2 /include
parentf07a046a52e7a8074bd1572a12ac65747d3f827d (diff)
gpu: nvgpu: improve channel interleave support
Previously, only "high" priority bare channels were interleaved between all other bare channels and TSGs. This patch decouples priority from interleaving and introduces 3 levels for interleaving a bare channel or TSG: high, medium, and low. The levels define the number of times a channel or TSG will appear on a runlist (see nvgpu.h for details). By default, all bare channels and TSGs are set to interleave level low. Userspace can then request the interleave level to be increased via the CHANNEL_SET_RUNLIST_INTERLEAVE ioctl (TSG-specific ioctl will be added later). As timeslice settings will soon be coming from userspace, the default timeslice for "high" priority channels has been restored. JIRA VFND-1302 Bug 1729664 Change-Id: I178bc1cecda23f5002fec6d791e6dcaedfa05c0c Signed-off-by: Aingara Paramakuru <aparamakuru@nvidia.com> Reviewed-on: http://git-master/r/1014962 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/nvgpu.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h
index 442a84ac..0787d4e4 100644
--- a/include/uapi/linux/nvgpu.h
+++ b/include/uapi/linux/nvgpu.h
@@ -834,6 +834,28 @@ struct nvgpu_channel_wdt_args {
834#define NVGPU_IOCTL_CHANNEL_DISABLE_WDT 1 834#define NVGPU_IOCTL_CHANNEL_DISABLE_WDT 1
835#define NVGPU_IOCTL_CHANNEL_ENABLE_WDT 2 835#define NVGPU_IOCTL_CHANNEL_ENABLE_WDT 2
836 836
837/*
838 * Interleaving channels in a runlist is an approach to improve
839 * GPU scheduling by allowing certain channels to appear multiple
840 * times on the runlist. The number of times a channel appears is
841 * governed by the following levels:
842 *
843 * low (L) : appears once
844 * medium (M): if L, appears L times
845 * else, appears once
846 * high (H) : if L, appears (M + 1) x L times
847 * else if M, appears M times
848 * else, appears once
849 */
850struct nvgpu_runlist_interleave_args {
851 __u32 level;
852 __u32 reserved;
853};
854#define NVGPU_RUNLIST_INTERLEAVE_LEVEL_LOW 0
855#define NVGPU_RUNLIST_INTERLEAVE_LEVEL_MEDIUM 1
856#define NVGPU_RUNLIST_INTERLEAVE_LEVEL_HIGH 2
857#define NVGPU_RUNLIST_INTERLEAVE_NUM_LEVELS 3
858
837#define NVGPU_IOCTL_CHANNEL_SET_NVMAP_FD \ 859#define NVGPU_IOCTL_CHANNEL_SET_NVMAP_FD \
838 _IOW(NVGPU_IOCTL_MAGIC, 5, struct nvgpu_set_nvmap_fd_args) 860 _IOW(NVGPU_IOCTL_MAGIC, 5, struct nvgpu_set_nvmap_fd_args)
839#define NVGPU_IOCTL_CHANNEL_SET_TIMEOUT \ 861#define NVGPU_IOCTL_CHANNEL_SET_TIMEOUT \
@@ -876,9 +898,11 @@ struct nvgpu_channel_wdt_args {
876 _IOWR(NVGPU_IOCTL_MAGIC, 118, struct nvgpu_cycle_stats_snapshot_args) 898 _IOWR(NVGPU_IOCTL_MAGIC, 118, struct nvgpu_cycle_stats_snapshot_args)
877#define NVGPU_IOCTL_CHANNEL_WDT \ 899#define NVGPU_IOCTL_CHANNEL_WDT \
878 _IOW(NVGPU_IOCTL_MAGIC, 119, struct nvgpu_channel_wdt_args) 900 _IOW(NVGPU_IOCTL_MAGIC, 119, struct nvgpu_channel_wdt_args)
901#define NVGPU_IOCTL_CHANNEL_SET_RUNLIST_INTERLEAVE \
902 _IOW(NVGPU_IOCTL_MAGIC, 120, struct nvgpu_runlist_interleave_args)
879 903
880#define NVGPU_IOCTL_CHANNEL_LAST \ 904#define NVGPU_IOCTL_CHANNEL_LAST \
881 _IOC_NR(NVGPU_IOCTL_CHANNEL_WDT) 905 _IOC_NR(NVGPU_IOCTL_CHANNEL_SET_RUNLIST_INTERLEAVE)
882#define NVGPU_IOCTL_CHANNEL_MAX_ARG_SIZE sizeof(struct nvgpu_submit_gpfifo_args) 906#define NVGPU_IOCTL_CHANNEL_MAX_ARG_SIZE sizeof(struct nvgpu_submit_gpfifo_args)
883 907
884/* 908/*