mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	cgroup: rstat: Mark benign data race to silence KCSAN
There is a race between updaters and flushers (flush can possibly miss the latest update(s)). This is expected as explained in cgroup_rstat_updated() comment, add also machine readable annotation so that KCSAN results aren't noisy. Reported-by: Hao Sun <sunhao.th@gmail.com> Link: https://lore.kernel.org/r/CACkBjsbPVdkub=e-E-p1WBOLxS515ith-53SFdmFHWV_QMo40w@mail.gmail.com Suggested-by: Hao Sun <sunhao.th@gmail.com> Signed-off-by: Michal Koutný <mkoutny@suse.com> Reviewed-by: Shakeel Butt <shakeelb@google.com> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
		
							parent
							
								
									8ab7745879
								
							
						
					
					
						commit
						eda09706b2
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -35,7 +35,7 @@ void cgroup_rstat_updated(struct cgroup *cgrp, int cpu)
 | 
				
			||||||
	 * instead of NULL, we can tell whether @cgrp is on the list by
 | 
						 * instead of NULL, we can tell whether @cgrp is on the list by
 | 
				
			||||||
	 * testing the next pointer for NULL.
 | 
						 * testing the next pointer for NULL.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	if (cgroup_rstat_cpu(cgrp, cpu)->updated_next)
 | 
						if (data_race(cgroup_rstat_cpu(cgrp, cpu)->updated_next))
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	raw_spin_lock_irqsave(cpu_lock, flags);
 | 
						raw_spin_lock_irqsave(cpu_lock, flags);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue