[PATCH v2] sched/psi: fix memory barrier without comment warnings

Pintu Kumar posted 1 patch 1 month, 3 weeks ago
There is a newer version of this series
kernel/sched/psi.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH v2] sched/psi: fix memory barrier without comment warnings
Posted by Pintu Kumar 1 month, 3 weeks ago
These warnings were reported by checkpatch.
Fix them with minor changes.
No functional changes.

WARNING: memory barrier without comment
+       t = smp_load_acquire(trigger_ptr);

WARNING: memory barrier without comment
+       smp_store_release(&seq->private, new);

Signed-off-by: Pintu Kumar <quic_pintu@quicinc.com>
Reviewed-by: Joe Perches <joe@perches.com>

---
Changes in V2:
Retain printk_deferred warnings as suggested by Joe Perches.
V1: https://lore.kernel.org/all/a848671f803ba2b4ab14b0f7b09f0f53a8dd1c4b.camel@perches.com/
---
 kernel/sched/psi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
index 020d58967d4e..4e4ff12fdeae 100644
--- a/kernel/sched/psi.c
+++ b/kernel/sched/psi.c
@@ -1474,6 +1474,7 @@ __poll_t psi_trigger_poll(void **trigger_ptr,
 	if (static_branch_likely(&psi_disabled))
 		return DEFAULT_POLLMASK | EPOLLERR | EPOLLPRI;
 
+	/* Pairs with the smp_store_release in psi_write */
 	t = smp_load_acquire(trigger_ptr);
 	if (!t)
 		return DEFAULT_POLLMASK | EPOLLERR | EPOLLPRI;
@@ -1557,6 +1558,7 @@ static ssize_t psi_write(struct file *file, const char __user *user_buf,
 		return PTR_ERR(new);
 	}
 
+	/* Pairs with the smp_store_acquire in psi_trigger_poll */
 	smp_store_release(&seq->private, new);
 	mutex_unlock(&seq->lock);
 
-- 
2.17.1
Re: [PATCH v2] sched/psi: fix memory barrier without comment warnings
Posted by Joe Perches 1 month, 3 weeks ago
On Sat, 2024-10-05 at 18:46 +0530, Pintu Kumar wrote:
> These warnings were reported by checkpatch.
> Fix them with minor changes.
> No functional changes.
> 
> WARNING: memory barrier without comment
> +       t = smp_load_acquire(trigger_ptr);
> 
> WARNING: memory barrier without comment
> +       smp_store_release(&seq->private, new);
> 
> Signed-off-by: Pintu Kumar <quic_pintu@quicinc.com>
> Reviewed-by: Joe Perches <joe@perches.com>

Please do not add signatures not given to you.
Re: [PATCH v2] sched/psi: fix memory barrier without comment warnings
Posted by Pintu Agarwal 1 month, 3 weeks ago
On Sat, 5 Oct 2024 at 18:59, Joe Perches <joe@perches.com> wrote:
>
> On Sat, 2024-10-05 at 18:46 +0530, Pintu Kumar wrote:
> > These warnings were reported by checkpatch.
> > Fix them with minor changes.
> > No functional changes.
> >
> > WARNING: memory barrier without comment
> > +       t = smp_load_acquire(trigger_ptr);
> >
> > WARNING: memory barrier without comment
> > +       smp_store_release(&seq->private, new);
> >
> > Signed-off-by: Pintu Kumar <quic_pintu@quicinc.com>
> > Reviewed-by: Joe Perches <joe@perches.com>
>
> Please do not add signatures not given to you.
>
Ohk sorry, will remove it and send again.
Thank you.