Re: [PATCH v3 2/8] lib/vsprintf: Use acquire/release for ptr_key publication
From: Petr Mladek <pmladek@suse.com>
Date: 2026-09-04 13:13:33
Also in:
linux-fsdevel, lkml
On Wed 2026-09-02 15:47:59, Jinjie Ruan wrote:
Replace the smp_wmb() + WRITE_ONCE() and READ_ONCE() + smp_rmb() barrier pair with smp_store_release()/smp_load_acquire() on filled_random_ptr_key. This expresses the publish/subscribe pattern more clearly and allows architectures with native acquire/release instructions (e.g. arm64's STLR/LDAR) to avoid the cost of full one-way barriers (DMB ISHST/ISHLD). No functional change intended. Cc: Petr Mladek <pmladek@suse.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk> Cc: Sergey Senozhatsky <senozhatsky@chromium.org> Cc: Andrew Morton <akpm@linux-foundation.org> Assisted-by: DeepSeek:DeepSeek-V3 Signed-off-by: Jinjie Ruan <redacted>
Just for record. The conversion looks correct from the barrier guarantees POV. I am just not 100% sure about that the performance on different architectures. I asked this question as a reply on the cover letter, see https://lore.kernel.org/all/apq5iLOF8lAQ_ZVU@pathway.suse.cz/ (local) Anyway, vsprintf() is not a hot path. So, we do not need to take care of the performance effect here. Feel free to use: Reviewed-by: Petr Mladek <pmladek@suse.com> I am going wait how the discussion about the performance goes. If it does not block this patchset then I could queue this particular patch via printk tree. Best Regards, Petr