Linux cgroups development
 help / color / mirror / Atom feed
* [PATCH] cgroup/rdma: drop unnecessary READ_ONCE() on event counters
@ 2026-05-16  5:25 Tao Cui
  2026-05-18 19:31 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Tao Cui @ 2026-05-16  5:25 UTC (permalink / raw)
  To: tj, hannes, mkoutny, cgroups; +Cc: Tao Cui

All accesses to the event counters are serialized by rdmacg_mutex,
making the READ_ONCE() annotations unnecessary. Remove them.

Signed-off-by: Tao Cui <cuitao@kylinos.cn>
---
 kernel/cgroup/rdma.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/kernel/cgroup/rdma.c b/kernel/cgroup/rdma.c
index 7c238a9d64d4..5e82a03b3270 100644
--- a/kernel/cgroup/rdma.c
+++ b/kernel/cgroup/rdma.c
@@ -145,10 +145,10 @@ static bool rpool_has_persistent_state(struct rdmacg_resource_pool *rpool)
 	 */
 	for (i = 0; i < RDMACG_RESOURCE_MAX; i++) {
 		if (rpool->resources[i].peak ||
-		    READ_ONCE(rpool->events_max[i]) ||
-		    READ_ONCE(rpool->events_local_max[i]) ||
-		    READ_ONCE(rpool->events_alloc_fail[i]) ||
-		    READ_ONCE(rpool->events_local_alloc_fail[i]))
+		    rpool->events_max[i] ||
+		    rpool->events_local_max[i] ||
+		    rpool->events_alloc_fail[i] ||
+		    rpool->events_local_alloc_fail[i])
 			return true;
 	}
 	return false;
@@ -654,9 +654,9 @@ static int rdmacg_events_show(struct seq_file *sf, void *v)
 		for (i = 0; i < RDMACG_RESOURCE_MAX; i++) {
 			seq_printf(sf, "%s.max=%llu %s.alloc_fail=%llu",
 				   rdmacg_resource_names[i],
-				   rpool ? READ_ONCE(rpool->events_max[i]) : 0ULL,
+				   rpool ? rpool->events_max[i] : 0ULL,
 				   rdmacg_resource_names[i],
-				   rpool ? READ_ONCE(rpool->events_alloc_fail[i]) : 0ULL);
+				   rpool ? rpool->events_alloc_fail[i] : 0ULL);
 			if (i < RDMACG_RESOURCE_MAX - 1)
 				seq_putc(sf, ' ');
 		}
@@ -683,9 +683,9 @@ static int rdmacg_events_local_show(struct seq_file *sf, void *v)
 		for (i = 0; i < RDMACG_RESOURCE_MAX; i++) {
 			seq_printf(sf, "%s.max=%llu %s.alloc_fail=%llu",
 				   rdmacg_resource_names[i],
-				   rpool ? READ_ONCE(rpool->events_local_max[i]) : 0ULL,
+				   rpool ? rpool->events_local_max[i] : 0ULL,
 				   rdmacg_resource_names[i],
-				   rpool ? READ_ONCE(rpool->events_local_alloc_fail[i]) : 0ULL);
+				   rpool ? rpool->events_local_alloc_fail[i] : 0ULL);
 			if (i < RDMACG_RESOURCE_MAX - 1)
 				seq_putc(sf, ' ');
 		}
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-18 19:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-16  5:25 [PATCH] cgroup/rdma: drop unnecessary READ_ONCE() on event counters Tao Cui
2026-05-18 19:31 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox