From a807cf20419af737a79a3d0c7fcc1068ac6b724a Mon Sep 17 00:00:00 2001 From: David Li Date: Thu, 26 Apr 2018 02:00:01 -0700 Subject: gpu: nvgpu: add NVGPU_IOCTL_CHANNEL_RESCHEDULE_RUNLIST Add NVGPU_IOCTL_CHANNEL_RESCHEDULE_RUNLIST ioctl to reschedule runlist, and optionally check host and FECS status to preempt pending load of context not belonging to the calling channel on GR engine during context switch. This should be called immediately after a submit to decrease worst case submit to start latency for high interleave channel. There is less than 0.002% chance that the ioctl blocks up to couple miliseconds due to race condition of FECS status changing while being read. For GV11B it will always preempt pending load of unwanted context since there is no chance that ioctl blocks due to race condition. Also fix bug with host reschedule for multiple runlists which needs to write both runlist registers. Bug 1987640 Bug 1924808 Change-Id: I0b7e2f91bd18b0b20928e5a3311b9426b1bf1848 Signed-off-by: David Li Reviewed-on: https://git-master.nvidia.com/r/1549050 Reviewed-by: mobile promotions Tested-by: mobile promotions --- include/trace/events/gk20a.h | 47 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) (limited to 'include/trace/events') diff --git a/include/trace/events/gk20a.h b/include/trace/events/gk20a.h index 99726e4c..ef51451a 100644 --- a/include/trace/events/gk20a.h +++ b/include/trace/events/gk20a.h @@ -1,7 +1,7 @@ /* * gk20a event logging to ftrace. * - * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -346,6 +346,51 @@ TRACE_EVENT(gk20a_channel_submitted_gpfifo, __entry->flags, __entry->incr_id, __entry->incr_value) ); +TRACE_EVENT(gk20a_reschedule_preempt_next, + TP_PROTO(u32 chid, u32 fecs0, u32 engstat, u32 fecs1, u32 fecs2, + u32 preempt), + + TP_ARGS(chid, fecs0, engstat, fecs1, fecs2, preempt), + + TP_STRUCT__entry( + __field(u32, chid) + __field(u32, fecs0) + __field(u32, engstat) + __field(u32, fecs1) + __field(u32, fecs2) + __field(u32, preempt) + ), + + TP_fast_assign( + __entry->chid = chid; + __entry->fecs0 = fecs0; + __entry->engstat = engstat; + __entry->fecs1 = fecs1; + __entry->fecs2 = fecs2; + __entry->preempt = preempt; + ), + + TP_printk("chid=%d, fecs0=%#x, engstat=%#x, fecs1=%#x, fecs2=%#x," + " preempt=%#x", __entry->chid, __entry->fecs0, __entry->engstat, + __entry->fecs1, __entry->fecs2, __entry->preempt) +); + +TRACE_EVENT(gk20a_reschedule_preempted_next, + TP_PROTO(u32 chid), + + TP_ARGS(chid), + + TP_STRUCT__entry( + __field(u32, chid) + ), + + TP_fast_assign( + __entry->chid = chid; + ), + + TP_printk("chid=%d", __entry->chid) +); + TRACE_EVENT(gk20a_channel_reset, TP_PROTO(u32 chid, u32 tsgid), -- cgit v1.2.2