On Wed, 30 Jul 2025 12:18:38 +0800, Tiwei Bie wrote: > On Tue, 29 Jul 2025 17:37:24 +0200, Johannes Berg wrote: [...] > > > > IOW, I think you've stumbled across an inconsistency in the generic > > files, and hence we should fix that, rather than having each > > architecture paper over it. > > That does make sense. I will prepare a patch for that. Thanks!
Hmm, this issue might be a bit tricky to resolve.. The root cause is that smp_cond_load_relaxed() provided by asm/barrier.h relies on cpu_relax() [1][2], but the corresponding header isn't included. The reason why it's not included might be that asm/processor.h includes too many dependencies, which prevents barrier.h from including it. I haven't come up with an ideal way to address it yet. Fortunately, smp_cond_load_relaxed() is a macro, so cpu_relax() is needed only when smp_cond_load_relaxed() is invoked inside a function (i.e., when it's expanded during preprocessing). As for this series, I realized that I should implement spinlock in $SUBARCH (i.e., in a $SUBARCH native way, which won't require the above workaround anymore), similar to how atomic and barrier are implemented. I'll take that approach in the next version. Thanks again for the review! [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/asm-generic/barrier.h?h=v6.16#n253 [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/um/asm/barrier.h?h=v6.16#n27 Regards, Tiwei