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 memory usage for umc_lookup_bad_pages_in_a_row

The function handles one page in one time, allocating umc.retire_unit
bad page records is enough.

Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Tao Zhou and committed by
Alex Deucher
76723fbc 4e7812e2

+2 -3
+2 -3
drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c
··· 452 452 struct ta_ras_query_address_output addr_out; 453 453 struct ras_err_data err_data; 454 454 455 - err_data.err_addr = 456 - kcalloc(adev->umc.max_ras_err_cnt_per_query, 455 + err_data.err_addr = kcalloc(adev->umc.retire_unit, 457 456 sizeof(struct eeprom_table_record), GFP_KERNEL); 458 457 if (!err_data.err_addr) { 459 458 dev_warn(adev->dev, "Failed to alloc memory in bad page lookup!\n"); ··· 467 468 else 468 469 goto out; 469 470 470 - for (i = 0; i < adev->umc.max_ras_err_cnt_per_query; i++) { 471 + for (i = 0; i < adev->umc.retire_unit; i++) { 471 472 if (pos >= len) 472 473 goto out; 473 474