Re: [RFC PATCH v5 03/12] __wr_after_init: Core and default arch

From
Peter Zijlstra <peterz@infradead.org>
Date
2019-02-15 08:58:01
Also in
linux-mm, lkml
Reply to
Igor Stoppa, 2019-02-14
On Fri, Feb 15, 2019 at 01:10:33AM +0200, Igor Stoppa wrote:

On 14/02/2019 13:28, Peter Zijlstra wrote:
quoted
On Thu, Feb 14, 2019 at 12:41:32AM +0200, Igor Stoppa wrote:
[...]
quoted
quoted
+#define wr_rcu_assign_pointer(p, v) ({	\
+	smp_mb();			\
+	wr_assign(p, v);		\
+	p;				\
+})
This requires that wr_memcpy() (through wr_assign) is single-copy-atomic
for native types. There is not a comment in sight that states this.
Right, I kinda expected native-aligned <-> atomic, but it's not necessarily
true. It should be confirmed when enabling write rare on a new architecture.
I'll add the comment.
quoted
Also, is this true of x86/arm64 memcpy ?

For x86_64:
https://elixir.bootlin.com/linux/v5.0-rc6/source/arch/x86/include/asm/uaccess.h#L462
the mov"itype"  part should deal with atomic copy of native, aligned types.


For arm64:
https://elixir.bootlin.com/linux/v5.0-rc6/source/arch/arm64/lib/copy_template.S#L110
.Ltiny15 deals with copying less than 16 bytes, which includes pointers.
When the data is aligned, the copy of a pointer should be atomic.
Where are the comments and Changelog notes ? How is an arch maintainer
to be aware of this requirement when adding support for his/her arch?
Thread (16 messages) 16 messages, 2 authors, last reply 2019-02-16
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help