From 2a58d3c27b45ca9d0d9dc2136377b7a41b9ed82d Mon Sep 17 00:00:00 2001 From: Aingara Paramakuru Date: Mon, 22 Feb 2016 12:35:49 -0500 Subject: 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 Reviewed-on: http://git-master/r/1014962 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- include/uapi/linux/nvgpu.h | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'include') 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 { #define NVGPU_IOCTL_CHANNEL_DISABLE_WDT 1 #define NVGPU_IOCTL_CHANNEL_ENABLE_WDT 2 +/* + * Interleaving channels in a runlist is an approach to improve + * GPU scheduling by allowing certain channels to appear multiple + * times on the runlist. The number of times a channel appears is + * governed by the following levels: + * + * low (L) : appears once + * medium (M): if L, appears L times + * else, appears once + * high (H) : if L, appears (M + 1) x L times + * else if M, appears M times + * else, appears once + */ +struct nvgpu_runlist_interleave_args { + __u32 level; + __u32 reserved; +}; +#define NVGPU_RUNLIST_INTERLEAVE_LEVEL_LOW 0 +#define NVGPU_RUNLIST_INTERLEAVE_LEVEL_MEDIUM 1 +#define NVGPU_RUNLIST_INTERLEAVE_LEVEL_HIGH 2 +#define NVGPU_RUNLIST_INTERLEAVE_NUM_LEVELS 3 + #define NVGPU_IOCTL_CHANNEL_SET_NVMAP_FD \ _IOW(NVGPU_IOCTL_MAGIC, 5, struct nvgpu_set_nvmap_fd_args) #define NVGPU_IOCTL_CHANNEL_SET_TIMEOUT \ @@ -876,9 +898,11 @@ struct nvgpu_channel_wdt_args { _IOWR(NVGPU_IOCTL_MAGIC, 118, struct nvgpu_cycle_stats_snapshot_args) #define NVGPU_IOCTL_CHANNEL_WDT \ _IOW(NVGPU_IOCTL_MAGIC, 119, struct nvgpu_channel_wdt_args) +#define NVGPU_IOCTL_CHANNEL_SET_RUNLIST_INTERLEAVE \ + _IOW(NVGPU_IOCTL_MAGIC, 120, struct nvgpu_runlist_interleave_args) #define NVGPU_IOCTL_CHANNEL_LAST \ - _IOC_NR(NVGPU_IOCTL_CHANNEL_WDT) + _IOC_NR(NVGPU_IOCTL_CHANNEL_SET_RUNLIST_INTERLEAVE) #define NVGPU_IOCTL_CHANNEL_MAX_ARG_SIZE sizeof(struct nvgpu_submit_gpfifo_args) /* -- cgit v1.2.2