aboutsummaryrefslogtreecommitdiffstats
path: root/runlist_procfs.c
diff options
context:
space:
mode:
authorJoshua Bakita <bakitajoshua@gmail.com>2024-04-21 20:30:08 -0400
committerJoshua Bakita <bakitajoshua@gmail.com>2024-04-21 20:30:08 -0400
commit091c242c9ef7cbd8d88d3beae936b14f5b907286 (patch)
tree85f76f37209abc3888045ff2db8576ad3c6370d7 /runlist_procfs.c
parent684c20c0afbfc2c2075a00881fbb3f9d3e68e023 (diff)
Add /proc/gpu#/resubmit_runlist API
Resubmits the runlist in an identical configuration. Causes the runlist scheduler to: 1. Reload and cache timeslice and scale values from TSGs. 2. Restart scheduling from the head of the runlist [may cause a preempt to be scheduled for the currently-running task (?)]. 3. Address (?) an errata on Turing where re-enabled channels are not always detected. Above behavior tested on GV100 and partially tested on TU102.
Diffstat (limited to 'runlist_procfs.c')
-rw-r--r--runlist_procfs.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/runlist_procfs.c b/runlist_procfs.c
index 0087d90..f569c77 100644
--- a/runlist_procfs.c
+++ b/runlist_procfs.c
@@ -207,6 +207,33 @@ struct file_operations preempt_tsg_file_ops = {
207 .llseek = default_llseek, 207 .llseek = default_llseek,
208}; 208};
209 209
210
211ssize_t resubmit_runlist_file_write(struct file *f, const char __user *buffer,
212 size_t count, loff_t *off) {
213 uint32_t target_runlist;
214 // Passing 0 as the base to kstrtou32 indicates autodetect hex/octal/dec
215 int err = kstrtou32_from_user(buffer, count, 0, &target_runlist);
216 struct nvdebug_state *g = &g_nvdebug_state[file2gpuidx(f)];
217 if (err)
218 return err;
219
220 // Verify valid runlist (in terms of absolute maximums)
221 if (g->chip_id < NV_CHIP_ID_TURING && target_runlist > MAX_RUNLISTS_GF100)
222 return -ERANGE;
223 else if (g->chip_id < NV_CHIP_ID_AMPERE && target_runlist > MAX_RUNLISTS_TU102)
224 return -ERANGE;
225
226 if ((err = resubmit_runlist(g, target_runlist)))
227 return err;
228
229 return count;
230}
231
232struct file_operations resubmit_runlist_file_ops = {
233 .write = resubmit_runlist_file_write,
234 .llseek = default_llseek,
235};
236
210ssize_t disable_channel_file_write(struct file *f, const char __user *buffer, 237ssize_t disable_channel_file_write(struct file *f, const char __user *buffer,
211 size_t count, loff_t *off) { 238 size_t count, loff_t *off) {
212 uint32_t target_channel; 239 uint32_t target_channel;