Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: reduce queue timeout to 2 seconds v2

There has been multiple complains that 10 seconds are usually to long.

The original requirement for longer timeout came from compute tests on
AMDVLK, since that is no longer a topic reduce the timeout back to 2
seconds for all queues.

While at it also remove any special handling for compute queues under
SRIOV or pass through.

v2: fix checkpatch warning.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Christian König and committed by
Alex Deucher
1bea57ea 861fc60b

+47 -58
+40 -45
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
··· 4285 4285 long timeout; 4286 4286 int ret = 0; 4287 4287 4288 - /* 4289 - * By default timeout for jobs is 10 sec 4290 - */ 4291 - adev->compute_timeout = adev->gfx_timeout = msecs_to_jiffies(10000); 4292 - adev->sdma_timeout = adev->video_timeout = adev->gfx_timeout; 4288 + /* By default timeout for all queues is 2 sec */ 4289 + adev->gfx_timeout = adev->compute_timeout = adev->sdma_timeout = 4290 + adev->video_timeout = msecs_to_jiffies(2000); 4293 4291 4294 - if (strnlen(input, AMDGPU_MAX_TIMEOUT_PARAM_LENGTH)) { 4295 - while ((timeout_setting = strsep(&input, ",")) && 4296 - strnlen(timeout_setting, AMDGPU_MAX_TIMEOUT_PARAM_LENGTH)) { 4297 - ret = kstrtol(timeout_setting, 0, &timeout); 4298 - if (ret) 4299 - return ret; 4292 + if (!strnlen(input, AMDGPU_MAX_TIMEOUT_PARAM_LENGTH)) 4293 + return 0; 4300 4294 4301 - if (timeout == 0) { 4302 - index++; 4303 - continue; 4304 - } else if (timeout < 0) { 4305 - timeout = MAX_SCHEDULE_TIMEOUT; 4306 - dev_warn(adev->dev, "lockup timeout disabled"); 4307 - add_taint(TAINT_SOFTLOCKUP, LOCKDEP_STILL_OK); 4308 - } else { 4309 - timeout = msecs_to_jiffies(timeout); 4310 - } 4295 + while ((timeout_setting = strsep(&input, ",")) && 4296 + strnlen(timeout_setting, AMDGPU_MAX_TIMEOUT_PARAM_LENGTH)) { 4297 + ret = kstrtol(timeout_setting, 0, &timeout); 4298 + if (ret) 4299 + return ret; 4311 4300 4312 - switch (index++) { 4313 - case 0: 4314 - adev->gfx_timeout = timeout; 4315 - break; 4316 - case 1: 4317 - adev->compute_timeout = timeout; 4318 - break; 4319 - case 2: 4320 - adev->sdma_timeout = timeout; 4321 - break; 4322 - case 3: 4323 - adev->video_timeout = timeout; 4324 - break; 4325 - default: 4326 - break; 4327 - } 4301 + if (timeout == 0) { 4302 + index++; 4303 + continue; 4304 + } else if (timeout < 0) { 4305 + timeout = MAX_SCHEDULE_TIMEOUT; 4306 + dev_warn(adev->dev, "lockup timeout disabled"); 4307 + add_taint(TAINT_SOFTLOCKUP, LOCKDEP_STILL_OK); 4308 + } else { 4309 + timeout = msecs_to_jiffies(timeout); 4328 4310 } 4329 - /* 4330 - * There is only one value specified and 4331 - * it should apply to all non-compute jobs. 4332 - */ 4333 - if (index == 1) { 4334 - adev->sdma_timeout = adev->video_timeout = adev->gfx_timeout; 4335 - if (amdgpu_sriov_vf(adev) || amdgpu_passthrough(adev)) 4336 - adev->compute_timeout = adev->gfx_timeout; 4311 + 4312 + switch (index++) { 4313 + case 0: 4314 + adev->gfx_timeout = timeout; 4315 + break; 4316 + case 1: 4317 + adev->compute_timeout = timeout; 4318 + break; 4319 + case 2: 4320 + adev->sdma_timeout = timeout; 4321 + break; 4322 + case 3: 4323 + adev->video_timeout = timeout; 4324 + break; 4325 + default: 4326 + break; 4337 4327 } 4338 4328 } 4329 + 4330 + /* When only one value specified apply it to all queues. */ 4331 + if (index == 1) 4332 + adev->gfx_timeout = adev->compute_timeout = adev->sdma_timeout = 4333 + adev->video_timeout = timeout; 4339 4334 4340 4335 return ret; 4341 4336 }
+7 -13
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
··· 354 354 * DOC: lockup_timeout (string) 355 355 * Set GPU scheduler timeout value in ms. 356 356 * 357 - * The format can be [Non-Compute] or [GFX,Compute,SDMA,Video]. That is there can be one or 358 - * multiple values specified. 0 and negative values are invalidated. They will be adjusted 359 - * to the default timeout. 357 + * The format can be [single value] for setting all timeouts at once or 358 + * [GFX,Compute,SDMA,Video] to set individual timeouts. 359 + * Negative values mean infinity. 360 360 * 361 - * - With one value specified, the setting will apply to all non-compute jobs. 362 - * - With multiple values specified, the first one will be for GFX. 363 - * The second one is for Compute. The third and fourth ones are 364 - * for SDMA and Video. 365 - * 366 - * By default(with no lockup_timeout settings), the timeout for all jobs is 10000. 361 + * By default(with no lockup_timeout settings), the timeout for all queues is 2000. 367 362 */ 368 363 MODULE_PARM_DESC(lockup_timeout, 369 - "GPU lockup timeout in ms (default: 10000 for all jobs. " 370 - "0: keep default value. negative: infinity timeout), format: for bare metal [Non-Compute] or [GFX,Compute,SDMA,Video]; " 371 - "for passthrough or sriov [all jobs] or [GFX,Compute,SDMA,Video]."); 372 - module_param_string(lockup_timeout, amdgpu_lockup_timeout, sizeof(amdgpu_lockup_timeout), 0444); 364 + "GPU lockup timeout in ms (default: 2000. 0: keep default value. negative: infinity timeout), format: [single value for all] or [GFX,Compute,SDMA,Video]."); 365 + module_param_string(lockup_timeout, amdgpu_lockup_timeout, 366 + sizeof(amdgpu_lockup_timeout), 0444); 373 367 374 368 /** 375 369 * DOC: dpm (int)