@@ -280,7 +280,7 @@ size_t get_gpu_memory_usage(const int dev) {
280280 // Lock-free read with acquire semantics for proc_num
281281 int proc_num = atomic_load_explicit (& region_info .shared_region -> proc_num , memory_order_acquire );
282282
283- for (i = 0 ;i < proc_num ;i ++ ){
283+ for (i = 0 ; i < proc_num ; i ++ ) {
284284 shrreg_proc_slot_t * slot = & region_info .shared_region -> procs [i ];
285285 uint64_t proc_usage ;
286286 uint64_t seq1 , seq2 ;
@@ -442,8 +442,8 @@ uint64_t nvml_get_device_memory_usage(const int dev) {
442442}
443443
444444// Lock-free memory add using atomics with seqlock for consistent reads
445- int add_gpu_device_memory_usage (int32_t pid ,int cudadev ,size_t usage ,int type ){
446- LOG_INFO ("add_gpu_device_memory_lockfree:%d %d->%d %lu" ,pid ,cudadev ,cuda_to_nvml_map (cudadev ),usage );
445+ int add_gpu_device_memory_usage (int32_t pid , int cudadev , size_t usage , int type ) {
446+ LOG_INFO ("add_gpu_device_memory_lockfree:%d %d->%d %lu" , pid , cudadev , cuda_to_nvml_map (cudadev ), usage );
447447
448448 int dev = cuda_to_nvml_map (cudadev );
449449 ensure_initialized ();
@@ -472,7 +472,7 @@ int add_gpu_device_memory_usage(int32_t pid,int cudadev,size_t usage,int type){
472472 // Seqlock protocol: increment to even (write complete)
473473 atomic_fetch_add_explicit (& slot -> seqlock , 1 , memory_order_release );
474474
475- LOG_INFO ("gpu_device_memory_added_lockfree:%d %d %lu" ,pid ,dev ,usage );
475+ LOG_INFO ("gpu_device_memory_added_lockfree:%d %d %lu" , pid , dev , usage );
476476 return 0 ;
477477 }
478478
@@ -481,7 +481,7 @@ int add_gpu_device_memory_usage(int32_t pid,int cudadev,size_t usage,int type){
481481 int i ;
482482 for (i = 0 ; i < proc_num ; i ++ ) {
483483 int32_t slot_pid = atomic_load_explicit (& region_info .shared_region -> procs [i ].pid , memory_order_acquire );
484- if (slot_pid == pid ){
484+ if (slot_pid == pid ) {
485485 shrreg_proc_slot_t * slot = & region_info .shared_region -> procs [i ];
486486
487487 // Seqlock protocol: increment to odd (write in progress)
@@ -504,7 +504,7 @@ int add_gpu_device_memory_usage(int32_t pid,int cudadev,size_t usage,int type){
504504 // Seqlock protocol: increment to even (write complete)
505505 atomic_fetch_add_explicit (& slot -> seqlock , 1 , memory_order_release );
506506
507- LOG_INFO ("gpu_device_memory_added_lockfree:%d %d %lu" ,pid ,dev ,usage );
507+ LOG_INFO ("gpu_device_memory_added_lockfree:%d %d %lu" , pid , dev , usage );
508508 return 0 ;
509509 }
510510 }
@@ -514,8 +514,8 @@ int add_gpu_device_memory_usage(int32_t pid,int cudadev,size_t usage,int type){
514514}
515515
516516// Lock-free memory remove using atomics with seqlock for consistent reads
517- int rm_gpu_device_memory_usage (int32_t pid ,int cudadev ,size_t usage ,int type ){
518- LOG_INFO ("rm_gpu_device_memory_lockfree:%d %d->%d %d:%lu" ,pid ,cudadev ,cuda_to_nvml_map (cudadev ),type ,usage );
517+ int rm_gpu_device_memory_usage (int32_t pid , int cudadev , size_t usage , int type ) {
518+ LOG_INFO ("rm_gpu_device_memory_lockfree:%d %d->%d %d:%lu" , pid , cudadev , cuda_to_nvml_map (cudadev ), type , usage );
519519 int dev = cuda_to_nvml_map (cudadev );
520520 ensure_initialized ();
521521
@@ -544,7 +544,7 @@ int rm_gpu_device_memory_usage(int32_t pid,int cudadev,size_t usage,int type){
544544 atomic_fetch_add_explicit (& slot -> seqlock , 1 , memory_order_release );
545545
546546 uint64_t new_total = atomic_load_explicit (& slot -> used [dev ].total , memory_order_acquire );
547- LOG_INFO ("after delete_lockfree:%lu" ,new_total );
547+ LOG_INFO ("after delete_lockfree:%lu" , new_total );
548548 return 0 ;
549549 }
550550
@@ -553,7 +553,7 @@ int rm_gpu_device_memory_usage(int32_t pid,int cudadev,size_t usage,int type){
553553 int i ;
554554 for (i = 0 ; i < proc_num ; i ++ ) {
555555 int32_t slot_pid = atomic_load_explicit (& region_info .shared_region -> procs [i ].pid , memory_order_acquire );
556- if (slot_pid == pid ){
556+ if (slot_pid == pid ) {
557557 shrreg_proc_slot_t * slot = & region_info .shared_region -> procs [i ];
558558
559559 // Seqlock protocol: increment to odd (write in progress)
@@ -577,7 +577,7 @@ int rm_gpu_device_memory_usage(int32_t pid,int cudadev,size_t usage,int type){
577577 atomic_fetch_add_explicit (& slot -> seqlock , 1 , memory_order_release );
578578
579579 uint64_t new_total = atomic_load_explicit (& slot -> used [dev ].total , memory_order_acquire );
580- LOG_INFO ("after delete_lockfree:%lu" ,new_total );
580+ LOG_INFO ("after delete_lockfree:%lu" , new_total );
581581 return 0 ;
582582 }
583583 }
@@ -841,7 +841,7 @@ int clear_proc_slot_nolock(int do_clear) {
841841 if (do_clear > 0 && cleaned_dead < 10 && proc_alive (pid ) == PROC_STATE_NONALIVE ) {
842842 LOG_WARN ("Kick dead proc %d (proc_alive check)" , pid );
843843 cleaned_dead ++ ;
844- res = 1 ;
844+ res = 1 ;
845845 region -> proc_num -- ;
846846 region -> procs [slot ] = region -> procs [region -> proc_num ];
847847 __sync_synchronize ();
0 commit comments