diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-11-18 00:22:25 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-11-18 00:22:25 +0000 |
commit | 41ee54c1c8089202c2f892c12832a0a6071f18cd (patch) | |
tree | bde7160a5ee80e38e73f7d73c74d27be91264a6e /sys/dev/pci/drm/amd/amdkfd/kfd_process.c | |
parent | 8fb78b37ed8978d4ab896bafabbb4c0b9892c747 (diff) |
drm/amdkfd: Accounting pdd vram_usage for svm
From Philip Yang
4c332037fcbb9bb53c46ba4f156951429acc4d97 in linux-6.6.y/6.6.62
68d26c10ef503175df3142db6fcd75dd94860592 in mainline linux
Diffstat (limited to 'sys/dev/pci/drm/amd/amdkfd/kfd_process.c')
-rw-r--r-- | sys/dev/pci/drm/amd/amdkfd/kfd_process.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/drm/amd/amdkfd/kfd_process.c b/sys/dev/pci/drm/amd/amdkfd/kfd_process.c index 43f520b3796..6c90231e0ae 100644 --- a/sys/dev/pci/drm/amd/amdkfd/kfd_process.c +++ b/sys/dev/pci/drm/amd/amdkfd/kfd_process.c @@ -306,7 +306,7 @@ static ssize_t kfd_procfs_show(struct kobject *kobj, struct attribute *attr, } else if (strncmp(attr->name, "vram_", 5) == 0) { struct kfd_process_device *pdd = container_of(attr, struct kfd_process_device, attr_vram); - return snprintf(buffer, PAGE_SIZE, "%llu\n", READ_ONCE(pdd->vram_usage)); + return snprintf(buffer, PAGE_SIZE, "%llu\n", atomic64_read(&pdd->vram_usage)); } else if (strncmp(attr->name, "sdma_", 5) == 0) { struct kfd_process_device *pdd = container_of(attr, struct kfd_process_device, attr_sdma); @@ -1589,7 +1589,7 @@ struct kfd_process_device *kfd_create_process_device_data(struct kfd_node *dev, pdd->bound = PDD_UNBOUND; pdd->already_dequeued = false; pdd->runtime_inuse = false; - pdd->vram_usage = 0; + atomic64_set(&pdd->vram_usage, 0); pdd->sdma_past_activity_counter = 0; pdd->user_gpu_id = dev->id; atomic64_set(&pdd->evict_duration_counter, 0); |