Thread (19 messages) 19 messages, 6 authors, 2021-03-24

Re: [Patch v3 1/2] cgroup: sev: Add misc cgroup controller

From: Michal Koutný <hidden>
Date: 2021-03-15 18:35:05
Also in: kvm, linux-doc, lkml

On Fri, Mar 12, 2021 at 11:07:14AM -0800, Vipin Sharma [off-list ref] wrote:
We should be fine without atomic64_t because we are using unsigned
long and not 64 bit explicitly. This will work on both 32 and 64 bit
machines.
I see.
But I will add READ_ONCE and WRITE_ONCE because of potential chances of
load tearing and store tearing.

Do you agree?
Yes.
This was only here to avoid multiple reads of capacity and making sure
if condition and seq_print will see the same value.
Aha.
Also, I was not aware of load and store tearing of properly aligned
and machine word size variables. I will add READ_ONCE and WRITE_ONCE
at other places.
Yeah, although it's theoretical, I think it also serves well to annotate
such unsychronized accesses.

Thanks,
Michal

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help