# Re: \[PATCH 03/12\] powerpc: qspinlock: Enforce qnode writes prior to publishing to queue

- From: Nicholas Piggin \<npiggin@gmail.com\>
- Date: 2023-05-09 06:46:28 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2023/05/9530863
- Thread: https://ratatoskr.run/linuxppc-dev/2023/05/9530811/t.md

```text
On Tue May 9, 2023 at 3:26 PM AEST, Rohan McLure wrote:
> > On 9 May 2023, at 12:04 pm, Nicholas Piggin [ref] wrote:
> > 
> > On Mon May 8, 2023 at 12:01 PM AEST, Rohan McLure wrote:
> >> Use a compiler barrier to enforce that all fields of a new struct qnode
> >> be written to (especially the lock value) before publishing the qnode to
> >> the waitqueue.
> > 
> > publish_tail_cpu is the release barrier for this and includes the memory
> > clobber there. Can we annotate that instead?
>
> Got it, I see that one now.
>
> On another note though, it looks like the memory clobber doesn’t serve
> to squash KCSAN warnings here.

Aha, publish_tail_cpu() needs a kcsan_release().

Thanks,
Nick
```
